48 lines
1.7 KiB
Java
48 lines
1.7 KiB
Java
package it.acxent.cc;
|
|
|
|
import it.acxent.art.Articolo;
|
|
import it.acxent.art.ArticoloCR;
|
|
import it.acxent.common.CrontabInterface;
|
|
import it.acxent.db.ApplParm;
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.db.ResParm;
|
|
|
|
public class CCCronCreaIdealoXml implements CrontabInterface {
|
|
public ResParm crontabJob(ApplParmFull ap) {
|
|
ResParm rp = new ResParm(true);
|
|
System.out.println("CCCronCreaTrovaprezziXml start...");
|
|
StringBuffer msg = new StringBuffer("\n################# Inizio crontab IDEALO XML OFFERTE CC (" +
|
|
DBAdapter.getNow().toString() + ")\n#################");
|
|
msg.append("\n\n");
|
|
msg.append(ap.getMsg());
|
|
msg.append("\n\n");
|
|
long t0 = System.currentTimeMillis();
|
|
ArticoloCR CR = new ArticoloCR(ap);
|
|
CR.setFlgQta(1L);
|
|
CR.setFlgIdealo(1L);
|
|
CR.setFileNameIdealo("idealo_f3.xml");
|
|
CR.setFlgReadyForWeb(1L);
|
|
CR.setFlgEscludiWeb(0L);
|
|
CR.setLangReadyForWeb("it");
|
|
Articolo art = new Articolo(ap);
|
|
if (art.isLocalhost());
|
|
rp = art.creaFileXmlIdealo(CR);
|
|
msg.append(rp.getMsg());
|
|
msg.append("\n################# Fine crontab IDEALO XML OFFERTE CC (" + DBAdapter.getNow().toString() + ")\n#################");
|
|
long tn = System.currentTimeMillis();
|
|
long duration = (tn - t0) / 60000L;
|
|
msg.append("Durata aggiornamento: " + duration + " minuti.\n");
|
|
rp.setMsg(msg.toString());
|
|
System.out.println(msg.toString());
|
|
return rp;
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
String hostname = "localhost";
|
|
String db = "cc";
|
|
ApplParmFull apTarget = new ApplParmFull(new ApplParm(3, "//" + hostname + "/" + db, "root", "root", 1, 10, 300));
|
|
CCCronCreaIdealoXml bean = new CCCronCreaIdealoXml();
|
|
bean.crontabJob(apTarget);
|
|
}
|
|
}
|