www in docker support

This commit is contained in:
MaddoScientisto 2026-04-22 18:41:37 +02:00
commit c227fce036
2145 changed files with 399596 additions and 58 deletions

View file

@ -0,0 +1,94 @@
package it.acxent.pg.servlet.admin;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.pg.Coupon;
import it.acxent.pg.CouponCR;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class CouponSvlt extends _PgAdminSvlt {
private static final long serialVersionUID = -3103317969344235586L;
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Coupon(getApFull());
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new CouponCR(getApFull());
}
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
return super.afterSave(beanA, req, res);
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
super.prepareNewRecord(req, res);
}
protected String[] getFileNameTypesForLoadAttachServlet(HttpServletRequest req) {
return super.getFileNameTypesForLoadAttachServlet(req);
}
public void _resetCoupon(HttpServletRequest req, HttpServletResponse res) {
long l_id_coupon = getRequestLongParameter(req, "id_coupon");
System.out.println(l_id_coupon);
Coupon bean = new Coupon(getApFull());
bean.findByPrimaryKey(l_id_coupon);
if (bean.getId_coupon() > 0L) {
bean.save();
sendMessage(req, "Coupon " + bean.getCodice() + " disattivato");
}
search(req, res);
}
public void _attivaCoupon(HttpServletRequest req, HttpServletResponse res) {
long l_id_coupon = getRequestLongParameter(req, "id_coupon");
System.out.println(l_id_coupon);
Coupon bean = new Coupon(getApFull());
bean.findByPrimaryKey(l_id_coupon);
if (bean.getId_coupon() > 0L) {
bean.save();
sendMessage(req, "Coupon " + bean.getCodice() + " ATTIVATO!!");
}
search(req, res);
}
public void _generaCoupon(HttpServletRequest req, HttpServletResponse res) {
Coupon bean = new Coupon(getApFull(req));
long nCoupon = getRequestLongParameter(req, "numCoupon");
long nFoto = getRequestLongParameter(req, "nFoto1");
String serie = getRequestParameter(req, "serie1");
ResParm rp = bean.creaCoupon(serie, nFoto, nCoupon);
if (rp.getStatus()) {
sendMessage(req, "Creazione di " + nCoupon + " Coupon effettuata correttamente");
} else {
sendMessage(req, rp.getMsg());
}
search(req, res);
}
public void _stampaCoupon(HttpServletRequest req, HttpServletResponse res) {
long l_blankLabels = getRequestLongParameter(req, "numLabel");
String serie = getRequestParameter(req, "serie");
Coupon c = new Coupon(getApFull());
sendPdf(res, c.stampaCouponA4Pdf(serie, l_blankLabels), "stampaCoupon.pdf");
}
public void _couponCsv(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
CouponCR CR = new CouponCR(apFull);
fillObject(req, CR);
Coupon bean = new Coupon(apFull);
bean.creaFileCvs(CR);
sendHtmlMsgResponse(req, res, "<a href='../../" + CR.getFileName() + "' target='_blank'>File export in formato cvs (Excel)</a>");
}
}

View file

@ -0,0 +1,120 @@
package it.acxent.pg.servlet.admin;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.pg.Foto;
import it.acxent.pg.FotoCR;
import it.acxent.pg.GaraCR;
import it.acxent.pg.PuntoFoto;
import it.acxent.pg.PuntoFotoCR;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class FotoSvlt extends _PgAdminSvlt {
private static final long serialVersionUID = -7583627968141093970L;
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
if (getCmd(req).equals("foto")) {
Foto bean = null;
long l_id = getRequestLongParameter(req, "id_foto");
bean = new Foto(getApFull());
bean.findByPrimaryKey(l_id);
req.setAttribute("bean", bean);
setJspPageRelative("fotoImg.jsp", req);
callJsp(req, res);
} else {
search(req, res);
}
}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
Foto bean = (Foto)beanA;
PuntoFotoCR CR = new PuntoFotoCR();
CR.setId_gara(getId_garaLte(req));
CR.setTipoPuntoFoto(getRequestParameter(req, "tipoPuntoFoto"));
req.setAttribute("listaPuntiFoto", new PuntoFoto(getApFull()).findByCR(CR, 0, 0));
if (CR.getId_gara() > 0L)
req.setAttribute("listaTipiPuntoFoto", new PuntoFoto(getApFull()).findTipiPuntoFoto(CR.getId_gara()));
}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {
GaraCR CRgara = new GaraCR();
PuntoFotoCR CR = new PuntoFotoCR();
if (getId_garaLte(req) == 0L) {
CR.setId_gara(getRequestLongParameter(req, "id_gara"));
} else {
CRgara.setId_gara(getId_garaLte(req));
CR.setId_gara(getId_garaLte(req));
}
CR.setTipoPuntoFoto(getRequestParameter(req, "tipoPuntoFoto"));
if (CR.getId_gara() > 0L) {
req.setAttribute("listaPuntiFoto", new PuntoFoto(getApFull()).findByCR(CR, 0, 0));
req.setAttribute("listaTipiPuntoFoto", new PuntoFoto(getApFull()).findTipiPuntoFoto(CR.getId_gara()));
}
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Foto(getApFull());
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new FotoCR(getApFull());
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
super.prepareNewRecord(req, res);
}
public void _trasferisciCoupon(HttpServletRequest req, HttpServletResponse res) {}
protected void sqlActions(HttpServletRequest req, HttpServletResponse res) {
super.sqlActions(req, res);
}
protected void search(HttpServletRequest req, HttpServletResponse res) {
FotoCR CR = new FotoCR(getApFull());
if (!getAct(req).equals("del") || !getAct(req).equals("back"))
fillObject(req, CR);
if (getAct(req).equals("back") &&
req.getSession().getAttribute(getATTR_CRBEAN(req)) != null) {
CR = (FotoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
req.setAttribute("id_gara", Long.valueOf(CR.getId_gara()));
}
if (getId_garaLte(req) == 0L) {
CR.setId_gara(getRequestLongParameter(req, "id_gara"));
} else {
CR.setId_gara(getId_garaLte(req));
}
req.setAttribute("CR", CR);
req.getSession().setAttribute(getATTR_CRBEAN(req), CR);
if (CR.getId_gara() > 0L || CR.getId_fotoS() > 0L || !CR.getFile().isEmpty())
if (CR.getFlgReport().equals("")) {
req.setAttribute("list", new Foto(getApFull()).findByCR(CR, getPageNumber(req), getPageRow(req)));
} else {
req.setAttribute("list", new Foto(getApFull()).findByCR(CR, 0, 0));
}
fillComboAfterSearch(CR, req, res);
callJsp(req, res);
}
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
Foto bean = (Foto)beanA;
long l_id = bean.getId_foto();
if (!getAct2(req).isEmpty()) {
FotoCR CR = new FotoCR(getApFull());
CR = (FotoCR)req.getSession().getAttribute(getATTR_CRBEAN(req));
if (CR == null)
CR = new FotoCR(getApFull());
if (getAct2(req).equals("next")) {
l_id = bean.getNextId_foto(CR);
} else if (getAct2(req).equals("prev")) {
l_id = bean.getPrevId_foto(CR);
}
bean.findByPrimaryKey(l_id);
req.setAttribute("id_foto", Long.valueOf(l_id));
req.setAttribute("bean", bean);
}
return super.afterSave(beanA, req, res);
}
}

View file

@ -0,0 +1,515 @@
package it.acxent.pg.servlet.admin;
import it.acxent.common.Parm;
import it.acxent.common.TtFont;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.pg.Foto;
import it.acxent.pg.Gara;
import it.acxent.pg.GaraCR;
import it.acxent.pg.PuntoFoto;
import it.acxent.util.AbMessages;
import it.acxent.util.StringTokenizer;
import java.io.File;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/pg_RUS/Gara.abl"})
public class GaraSvlt extends _PgAdminSvlt {
private static final long serialVersionUID = -3103317969344235586L;
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
search(req, res);
}
public void _creaRiduzioniTest(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
try {
bean.findByPrimaryKey(new Long(l_id));
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus() == true) {
String fileTest = "";
String dirRidotte = getPathTmpFull();
String fileSorgente = getDocBase() + getDocBase() + bean.getPathImg();
rp = Foto.creaRiduzioniPerWeb(bean, fileSorgente, dirRidotte, true);
if (rp.getStatus())
fileTest = rp.getInfoMsg();
fileSorgente = getDocBase() + getDocBase() + bean.getPathImg();
rp = Foto.creaRiduzioniPerWeb(bean, fileSorgente, dirRidotte, true);
if (rp.getStatus()) {
if (!fileTest.isEmpty())
fileTest = fileTest + ",";
fileTest = fileTest + fileTest;
}
if (fileTest.length() > 0) {
StringTokenizer st = new StringTokenizer(fileTest, ",");
StringBuilder sb = new StringBuilder();
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
sb.append("<a href='../../" + getPathTmp() + token + "' download>File " + token + "</a><br>");
}
sendHtmlMsgResponse(req, res, sb.toString());
} else {
sendHtmlMsgResponse(req, res, "ERRORE! " + rp.getMsg());
}
}
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
}
public void _noIndexFoto(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(getApFull());
bean.findByPrimaryKey(new Long(l_id));
if (bean.getDBState() == 1) {
ResParm rp = bean.noIndexFoto();
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Impossibile importare: codice gara =0");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
Gara bean = (Gara)beanA;
req.setAttribute("listaPuntoFoto", bean.getPuntiFoto(0, 0));
req.setAttribute("listaTtf", TtFont.getInstance(getApFull()).findAll());
req.setAttribute("listaTipiPuntoFoto", new PuntoFoto(getApFull()).findTipiPuntoFoto(bean.getId_gara()));
}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Gara(getApFull());
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new GaraCR(getApFull());
}
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
try {
bean.findByPrimaryKey(new Long(l_id));
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus() != true) {
req.setAttribute("bean", bean);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
req.setAttribute("msg", "Impossibile aggiornare i record");
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaTtf", TtFont.getInstance(getApFull()).findAll());
Gara bean = new Gara(getApFull());
req.setAttribute("bean", bean);
super.prepareNewRecord(req, res);
}
public void _preview(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
ApplParmFull apFull = getApFull(req);
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(apFull);
bean.findByPrimaryKey(l_id);
if (bean.getId_puntoFoto() > 0L) {
Foto foto = new Foto(apFull);
ResParm rp = foto.startCreaPreviewMT(bean);
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Errore! Punto foto non valido!");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
protected String[] getFileNameTypesForLoadAttachServlet(HttpServletRequest req) {
return super.getFileNameTypesForLoadAttachServlet(req);
}
public void _delPuntoFoto(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
try {
bean.findByPrimaryKey(new Long(l_id));
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus() == true) {
long l_id_puntoFoto = getRequestLongParameter(req, "id_puntoFoto");
if (l_id_puntoFoto != 0L) {
bean.delPuntoFoto(l_id_puntoFoto);
sendMessage(req, "Cancellazione punto foto Effettuata");
}
showBean(req, res);
}
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
}
public void _indexFoto(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(getApFull());
bean.findByPrimaryKey(new Long(l_id));
if (bean.getDBState() == 1) {
ResParm rp = bean.indexFoto(getLoginUserId(req).longValue());
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Impossibile importare: codice gara =0");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
public void _modPuntoFoto(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
try {
bean.findByPrimaryKey(new Long(l_id));
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus() == true) {
PuntoFoto beangr = new PuntoFoto(getApFull());
long l_id_gr = getRequestLongParameter(req, "id_puntoFoto");
beangr.findByPrimaryKey(l_id_gr);
req.setAttribute("puntoFoto", beangr);
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
showBean(req, res);
}
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
}
public void _creaPuntiFoto(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
bean.findByPrimaryKey(l_id);
if (bean.getId_gara() > 0L) {
rp = bean.startCreaPuntiFoto(bean, true, getLoginUserId(req).longValue());
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Errore! Gara non valida.");
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
showBean(req, res);
}
public void _indexCsvPisa(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
l_id = getRequestLongParameter(req, "id_gara");
Gara bean = new Gara(getApFull());
bean.findByPrimaryKey(new Long(l_id));
String filename = bean.getImpCsvFileName();
if (bean.getDBState() == 1) {
ResParm rp = bean.indexFotoPisa(filename, "IMPORT CSV PISA: ");
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Impossibile importare: codice gara =0");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
}
}
public void _salvaFileCsv(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Gara bean = new Gara(getApFull());
long l_id = getRequestLongParameter(req, "id_gara");
bean.findByPrimaryKey(l_id);
String targetDir = getPathTmpFull();
checkAndMakeDir(targetDir);
String l_fileName = targetDir + targetDir;
if (new File(l_fileName).exists()) {
String targetCsvDir = getDocBase() + "csv/";
checkAndMakeDir(targetCsvDir);
String targetFile = targetCsvDir + targetCsvDir + ".csv";
try {
DBAdapter.copyFile(l_fileName, targetFile);
} catch (Exception e) {
sendMessage(req, "ERRORE! File csv NON caricato");
}
new File(l_fileName).delete();
sendMessage(req, "File csv caricato");
} else {
sendMessage(req, "Errore! File csv non trovato!");
}
req.setAttribute("act", "refresh");
showBean(req, res);
}
public void _annullaModGara(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Parm parm = new Parm(apFull);
parm.findByCodice("MODGARA");
parm.setNumero(0.0D);
ResParm rp = parm.save();
apFull.resetCurrentApParms();
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _annullaModGaraCR(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Parm parm = new Parm(apFull);
parm.findByCodice("MODGARA");
parm.setNumero(0.0D);
ResParm rp = parm.save();
apFull.resetCurrentApParms();
sendMessage(req, rp.getMsg());
search(req, res);
}
public void _exportGaraSuWww(HttpServletRequest req, HttpServletResponse res) {
long l_id_gara = getRequestLongParameter(req, "id_gara");
final Gara bean = new Gara(getApFull());
bean.findByPrimaryKey(l_id_gara);
if (bean.getId_gara() > 0L) {
if (!Gara.threadInvioGaraWww) {
Gara.threadInvioGaraWww = true;
new Thread() {
public void run() {
bean.exportGaraDa3PianoAWWW(false);
Gara.threadInvioGaraWww = false;
}
}.start();
sendMessage(req, "Threand export gara su WWW avviato!");
} else {
sendMessage(req, "ATTENZIONE! Threand export gara su WWW gia' in esecuzione!");
}
} else {
sendMessage(req, "ERRORE! Codice gara errato");
}
showBean(req, res);
}
public void _exportGaraSuWwwEOcr(HttpServletRequest req, HttpServletResponse res) {
long l_id_gara = getRequestLongParameter(req, "id_gara");
Gara bean = new Gara(getApFull());
ResParm rp = new ResParm(true);
bean.findByPrimaryKey(l_id_gara);
if (bean.getId_gara() > 0L) {
rp = bean.startInvioEOcr(bean, getDebug());
if (rp.getStatus()) {
sendMessage(req, "Threand export gara + OCR su WWW avviato!");
} else {
sendMessage(req, "ERRORE! " + rp.getMsg());
}
} else {
sendMessage(req, "ERRORE! Codice gara errato");
}
showBean(req, res);
}
public void _exportGaraSuWwwSoloFoto(HttpServletRequest req, HttpServletResponse res) {
long l_id_gara = getRequestLongParameter(req, "id_gara");
final Gara bean = new Gara(getApFull());
bean.findByPrimaryKey(l_id_gara);
if (bean.getId_gara() > 0L) {
if (!Gara.threadInvioGaraWww) {
Gara.threadInvioGaraWww = true;
new Thread() {
public void run() {
bean.exportGaraDa3PianoAWWW(true);
Gara.threadInvioGaraWww = false;
}
}.start();
sendMessage(req, "Threand export gara su WWW SOLO FOTO avviato!");
} else {
sendMessage(req, "ATTENZIONE! Threand export gara su WWW gia' in esecuzione!");
}
} else {
sendMessage(req, "ERRORE! Codice gara errato");
}
showBean(req, res);
}
public void _impostaModGara(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
long l_id_gara = getRequestLongParameter(req, "id_gara");
Gara bean = new Gara(apFull);
bean.findByPrimaryKey(l_id_gara);
if (bean.getId_gara() > 0L) {
Parm parm = new Parm(apFull);
parm.findByCodice("MODGARA");
parm.setNumero((double)l_id_gara);
ResParm rp = parm.save();
apFull.resetCurrentApParms();
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "ERRORE! Codice gara errato");
}
showBean(req, res);
}
protected void search(HttpServletRequest req, HttpServletResponse res) {
long l_id_gara = getId_garaLte(req);
if (l_id_gara > 0L) {
req.setAttribute("id_gara", Long.valueOf(l_id_gara));
showBean(req, res);
} else {
super.search(req, res);
}
}
public void _addPuntoFoto(HttpServletRequest req, HttpServletResponse res) {
if (getLoginUserGrant(req, new Gara().getTableBeanName()) >= 3L) {
ResParm rp = new ResParm(true, "");
long l_id = 0L;
Gara bean = null;
l_id = getRequestLongParameter(req, "id_gara");
bean = new Gara(getApFull(req));
try {
bean.findByPrimaryKey(new Long(l_id));
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus() == true) {
PuntoFoto beangr = new PuntoFoto(getApFull());
fillObject(req, beangr);
rp = bean.addPuntoFoto(beangr);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
}
public void _callOcr(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(getApFull());
bean.findByPrimaryKey(new Long(l_id));
if (bean.getDBState() == 1) {
ResParm rp = bean.startOcrThread();
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Impossibile eseguire OCR: codice punto foto =0");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
public void _resetPreview(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
ApplParmFull apFull = getApFull(req);
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(apFull);
bean.findByPrimaryKey(l_id);
if (bean.getId_puntoFoto() > 0L) {
ResParm rp = bean.resetPreview();
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Errore! Punto foto non valido!");
}
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
public void _creaFileExportIdx(HttpServletRequest req, HttpServletResponse res) {
Gara bean = new Gara(getApFull());
long l_id = getRequestLongParameter(req, "id_gara");
bean.findByPrimaryKey(l_id);
String targetDir = getPathTmpFull();
bean.setFileNameExport("" + getLoginUserId(req) + "_export_" + getLoginUserId(req) + ".txt");
ResParm rp = bean.exportFileIdx(targetDir + targetDir);
req.setAttribute("fileExportOk", (rp.getStatus() == true) ? "true" : "false");
req.setAttribute("fileNameExport", String.valueOf(bean.getFileNameExport()));
req.setAttribute("act", "refresh");
sendMessage(req, rp.getMsg());
showBean(req, res);
}
}

View file

@ -0,0 +1,21 @@
package it.acxent.pg.servlet.admin;
public class InitUpdateDbSvlt extends it.acxent.servlet.InitUpdateDbSvlt {
private static final long serialVersionUID = 2009631091908732636L;
protected String getProjectVersionTag() {
return "cli-rus";
}
protected long getDatabaseVersionNumber() {
return 9L;
}
protected String getSubVersionNumber() {
return "250611";
}
protected boolean shouldInitCore() {
return false;
}
}

View file

@ -0,0 +1,78 @@
package it.acxent.pg.servlet.admin;
import it.acxent.common.TtFont;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.pg.Gara;
import it.acxent.pg.LogFoto;
import it.acxent.pg.LogFotoCR;
import it.acxent.pg.PuntoFoto;
import it.acxent.util.ScaleImages;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/pg_RUS/LogFoto.abl"})
public class LogFotoSvlt extends _PgAdminSvlt {
private static final long serialVersionUID = -3103317969344235586L;
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
search(req, res);
}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new LogFoto(getApFull());
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new LogFotoCR(getApFull());
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaTtf", TtFont.getInstance(getApFull()).findAll());
Gara bean = new Gara(getApFull());
req.setAttribute("bean", bean);
super.prepareNewRecord(req, res);
}
private void preview(HttpServletRequest req, HttpServletResponse res) {
try {
long l_id = 0L;
ApplParmFull apFull = getApFull(req);
l_id = getRequestLongParameter(req, "id_puntoFotoIdx");
PuntoFoto bean = new PuntoFoto(apFull);
bean.findByPrimaryKey(l_id);
String dirFoto = getParm("PATHFOTO").getTesto() + getParm("PATHFOTO").getTesto();
int scaledWidth = (int)getParm("PREVIEW").getNumero();
String rpath = bean.getPathRelativoFoto();
if (rpath.lastIndexOf("/") > 0)
rpath = rpath.substring(rpath.lastIndexOf("/") + 1);
new ScaleImages(apFull, dirFoto, rpath, 0L, scaledWidth, 0, true, false, null, getPathTmpFull(), 10);
sendMessage(req, "Thread avviato!");
showBean(req, res);
} catch (Exception e) {
handleDebug(e);
sendMessage(req, e.toString());
showBean(req, res);
}
}
protected String[] getFileNameTypesForLoadAttachServlet(HttpServletRequest req) {
return super.getFileNameTypesForLoadAttachServlet(req);
}
protected void search(HttpServletRequest req, HttpServletResponse res) {
LogFotoCR CR = new LogFotoCR();
fillObject(req, CR);
if (CR.isEmpty()) {
callJsp(req, res);
} else {
super.search(req, res);
}
}
}

View file

@ -0,0 +1,51 @@
package it.acxent.pg.servlet.admin;
import it.acxent.pg.Users;
import it.acxent.servlet.LogonSvlt;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class MenuSvlt extends LogonSvlt {
protected long checkLoginName(HttpServletRequest req, HttpServletResponse res) {
return super.checkLoginName(req, res);
}
protected boolean checkLoginProfile(HttpServletRequest req) {
try {
String msg = "";
Users bean = (Users)getLoginUser(req);
if (bean == null) {
forceJspPage(getLoginPage(null, null), req);
return false;
}
if (bean.getFlgValido().equals("N")) {
forceJspPage(getLoginPage(null, null), req);
req.getSession().removeAttribute("loginUser_id");
req.getSession().removeAttribute("utenteLogon");
sendMessage(req, "Utente non valido. Contattare l'amministratore del sito.");
return false;
}
if (bean.getId_userProfile() != 1L) {
sendMessage(req, "Utente non valido. Permessi mancanti.");
forceJspPage(getLoginPage(null, null), req);
req.getSession().removeAttribute("loginUser_id");
req.getSession().removeAttribute("utenteLogon");
return false;
}
forceJspPage(getLoginPage(null, null), req);
return true;
} catch (Exception e) {
handleDebug(e);
return false;
}
}
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
return getJspPage(req).isEmpty() ? "/admin/menu/menu.jsp" :
getJspPage(req);
}
protected it.acxent.common.Users getUser() {
return new Users(getApFull());
}
}

View file

@ -0,0 +1,80 @@
package it.acxent.pg.servlet.admin;
import it.acxent.anag.Listino;
import it.acxent.art.Reparto;
import it.acxent.art.TipoTaglia;
import it.acxent.art.TipologiaArticolo;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.pg.TipoGara;
import it.acxent.pg.TipoGaraCR;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/pg_RUS/TipoGara.abl"})
public class TipoGaraSvlt extends _PgAdminSvlt {
private static final long serialVersionUID = 7529084224728549359L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
TipoGara tipoPadre = null;
long l_id_lista = getRequestLongParameter(req, "id_tipoGaraPadre");
tipoPadre = new TipoGara(apFull);
tipoPadre.findByPrimaryKey(l_id_lista);
req.setAttribute("tipoGaraPadre", tipoPadre);
req.setAttribute("list", tipoPadre.findFigli(0, 0));
req.setAttribute("listaReparti", new Reparto(apFull).findAll());
req.setAttribute("listaPadri", tipoPadre.findPadri());
req.setAttribute("listaListini", new Listino(apFull).findAll());
req.setAttribute("listaTipiTaglie", new TipoTaglia(apFull).findAll());
req.setAttribute("listaTipologieArticoli", new TipologiaArticolo(apFull).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new TipoGara(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TipoGaraCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
if (getCmd(req).equals("ordinaAlfabetico")) {
TipoGara bean = new TipoGara(getApFull(req));
bean.ordinaAlfabeticoFigli(bean);
search(req, res);
} else {
super.otherCommands(req, res);
}
}
protected boolean isLoadImageServlet() {
return true;
}
public void _ordinaAlfabetico(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
TipoGara bean = new TipoGara(getApFull(req));
bean.ordinaAlfabeticoFigli(bean);
search(req, res);
}
public void _indici(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
TipoGara bean = new TipoGara(getApFull(req));
bean.risalvaTutto();
search(req, res);
}
}

View file

@ -0,0 +1,149 @@
package it.acxent.pg.servlet.admin;
import it.acxent.common.UserAccess;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.newsletter.CodaMessaggi;
import it.acxent.newsletter.TemplateMsg;
import it.acxent.pg.Users;
import it.acxent.pg.UsersCR;
import it.acxent.util.AbMessages;
import it.acxent.util.Vectumerator;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/config/Users.abl"})
public class UsersSvlt extends it.acxent.anag.servlet.UsersSvlt {
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
super.fillComboAfterDetail(bean, req, res);
}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
super.fillComboAfterSearch(CR, req, res);
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Users(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
UsersCR CR = new UsersCR();
CR.setPolicy(getLoginUser(req).getUserProfile().getPolicy());
return (CRAdapter)CR;
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
super.prepareNewRecord(req, res);
}
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
long l_id = 0L;
ResParm rp = new ResParm(true, "");
l_id = getRequestLongParameter(req, "id_users");
Users bean = new Users(getApFull(req));
try {
bean.findByPrimaryKey(l_id);
long l_id_incasso = 0L;
if (getAct(req).equals("addAccess")) {
UserAccess up = new UserAccess(getApFull(req));
fillObject(req, up);
rp = bean.addAccess(up);
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getAct(req).equals("delAccess")) {
UserAccess up = new UserAccess(getApFull(req));
fillObject(req, up);
rp = bean.delAccess(up);
sendMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_OK") + ": Permesso Cancellato");
showBean(req, res);
} else if (getAct(req).equals("delLog")) {
rp = bean.azzeraFotoPrelevate();
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK") + ": LogFoto Cancellati");
showBean(req, res);
}
} catch (Exception e) {
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
showBean(req, res);
}
}
public void _rinnovaAnnoCR(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
long l_id = getRequestLongParameter(req, "id_users");
bean.findByPrimaryKey(l_id);
ResParm rp = bean.rinnovaAnno(1000L, 1);
rp.append(bean.sendRinnovoMailMessage(1000L, 1));
sendMessage(req, rp.getMsg());
search(req, res);
}
public void _rinnovaAnno3CR(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
long l_id = getRequestLongParameter(req, "id_users");
bean.findByPrimaryKey(l_id);
ResParm rp = bean.rinnovaAnno(3000L, 3);
rp.append(bean.sendRinnovoMailMessage(3000L, 3));
sendMessage(req, rp.getMsg());
search(req, res);
}
public void _rinnovaAnno(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
long l_id = getRequestLongParameter(req, "id_users");
bean.findByPrimaryKey(l_id);
ResParm rp = bean.rinnovaAnno(1000L, 1);
rp.append(bean.sendRinnovoMailMessage(1000L, 1));
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _rinnova25(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
long l_id = getRequestLongParameter(req, "id_users");
bean.findByPrimaryKey(l_id);
ResParm rp = bean.rinnovaAnno(25L, 1);
rp.append(bean.sendRinnovoMailMessage(25L, 1));
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _creaCodaMsg(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
UsersCR CR = new UsersCR(apFull);
fillObject(req, CR);
CR.setFlgMl(1L);
Vectumerator<Users> vec = bean.findByCR(CR, 0, 0);
long l_id_templateMsg = getRequestLongParameter(req, "id_templateMsg");
TemplateMsg ts = new TemplateMsg(apFull);
ts.findByPrimaryKey(l_id_templateMsg);
CodaMessaggi cm = new CodaMessaggi(apFull);
int num = 0;
while (vec.hasMoreElements()) {
Users row = (Users)vec.nextElement();
ResParm rp = cm.addCodaMessaggioByTemplate(row.getEMail(), ts);
if (rp.getStatus())
num++;
}
sendMessage(req, "Creata coda messaggi con " + num + " indirizzi email.");
search(req, res);
}
public void _rinnovaAnno3(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Users bean = new Users(apFull);
long l_id = getRequestLongParameter(req, "id_users");
bean.findByPrimaryKey(l_id);
ResParm rp = bean.rinnovaAnno(3000L, 3);
rp.append(bean.sendRinnovoMailMessage(3000L, 3));
sendMessage(req, rp.getMsg());
showBean(req, res);
}
}

View file

@ -0,0 +1,70 @@
package it.acxent.pg.servlet.admin;
import it.acxent.common.Users;
import it.acxent.pg.Gara;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public abstract class _PgAdminSvlt extends AblServletSvlt {
protected boolean checkLoginProfile(HttpServletRequest req) {
try {
if (getLoginUser(req) == null) {
forceJspPage(getLoginPage(null, null), req);
return true;
}
if (getLoginUser(req).getFlgValido().equals("N")) {
forceJspPage(super.getLoginPage(null, null), req);
req.getSession().removeAttribute("loginUser_id");
req.getSession().removeAttribute("utenteLogon");
return false;
}
if (getLoginUser(req).getId_userProfile() > 0L)
return true;
forceJspPage(super.getLoginPage(null, null), req);
req.getSession().removeAttribute("loginUser_id");
req.getSession().removeAttribute("utenteLogon");
return true;
} catch (Exception e) {
handleDebug(e);
return false;
}
}
protected long getLoginUserGrant(HttpServletRequest req, String l_permesso) {
try {
return getLoginUser(req).getGrantType(l_permesso);
} catch (Exception e) {
handleDebug(e);
return 0L;
}
}
protected String getAct3(HttpServletRequest req) {
return getRequestParameter(req, "act3");
}
protected String getCmd3(HttpServletRequest req) {
return getRequestParameter(req, "cmd3");
}
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
return super.getLoginPage(req, res);
}
protected Users getUser() {
return new it.acxent.pg.Users(getApFull());
}
protected boolean useAlwaysSendRedirect() {
return true;
}
public void _aggiornaThreadMsg(HttpServletRequest req, HttpServletResponse res) {
sendHtmlMsgResponse(req, res, Gara.threadCreaPuntiFotoMsg.trim());
}
protected long getId_garaLte(HttpServletRequest req) {
return getParm("MODGARA").getNumeroLong();
}
}