180 lines
5.8 KiB
Java
180 lines
5.8 KiB
Java
package it.acxent.pg;
|
|
|
|
import com.lowagie.text.Document;
|
|
import com.lowagie.text.Font;
|
|
import com.lowagie.text.Table;
|
|
import com.lowagie.text.pdf.PdfPCell;
|
|
import com.lowagie.text.pdf.PdfPTable;
|
|
import com.lowagie.text.pdf.PdfWriter;
|
|
import it.acxent.db.ApplParm;
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.DBAdapter;
|
|
import it.acxent.db.ResParm;
|
|
import java.awt.Color;
|
|
|
|
public class _PgAdapter extends DBAdapter {
|
|
private static final long serialVersionUID = -8378506495945276989L;
|
|
|
|
public static final boolean DEBUG_LOCALE = false;
|
|
|
|
public static final String P_PATHFOTO = "PATHFOTO";
|
|
|
|
public static final String P_PATHFOTO_RIDOTTE = "PATHFOTO_RIDOTTE";
|
|
|
|
public static final String P_MAX_CONCURRENT_THREAD = "MAX_CONCURRENT_THREAD";
|
|
|
|
public static final String P_MAX_CONCURRENT_UPLOAD_THREAD = "MAX_CONCURRENT_UPLOAD_THREAD";
|
|
|
|
public static final String P_MAIL_MSG_RINNOVO = "MAIL_MSG_RINNOVO";
|
|
|
|
public static final String P_MAIL_MSG_STA_PER_SCADERE = "MAIL_MSG_STA_PER_SCADERE";
|
|
|
|
public static final String P_MAIL_MSG_COUPON_OMAGGIO = "MAIL_MSG_COUPON_OMAGGIO";
|
|
|
|
public static final String P_OCR_COMANDO_SHELL_PRODUZIONE = "OCR_COMANDO_SHELL_PRODUZIONE";
|
|
|
|
public static final String P_OCR_COMANDO_SHELL_TEST = "OCR_COMANDO_SHELL_TEST";
|
|
|
|
public static final String P_OCR_LINEE_FILE_PRODUZIONE = "OCR_LINEE_FILE_PRODUZIONE";
|
|
|
|
public static final String P_OCR_LINEE_FILE_TEST = "OCR_LINEE_FILE_TEST";
|
|
|
|
public static final String P_NUM_GG_PRIMA_DELLA_SCADENZA_RINNOVO = "NUM_GG_PRIMA_DELLA_SCADENZA_RINNOVO";
|
|
|
|
public static final String PATH_RIDOTTA = "RIDOTTA/";
|
|
|
|
protected PdfPCell blankCell = new PdfPCell();
|
|
|
|
protected Document document;
|
|
|
|
protected Table pdfcorpo;
|
|
|
|
protected PdfPTable pdfPcorpo;
|
|
|
|
protected PdfWriter writer;
|
|
|
|
protected static ApplParmFull apRemoto;
|
|
|
|
public static final String P_WWW_ADDRESS = "P_WWW_ADDRESS";
|
|
|
|
public static final String P_WWW_DBDRIVE = "WWW_DBDRIVE";
|
|
|
|
public static final String P_WWW_DBNAME = "WWW_DBNAME";
|
|
|
|
public static final String P_WWW_PASSWORD = "WWW_PASSWORD";
|
|
|
|
public static final String P_WWW_USER = "WWW_USER";
|
|
|
|
public static final String P_WWW_CATALOG = "WWW_CATALOG";
|
|
|
|
public static final Font PDF_fGrande = new Font(2, 12.0F, 0);
|
|
|
|
public static final Font PDF_fGrandeB = new Font(2, 12.0F, 1);
|
|
|
|
public static final Font PDF_fGrandeBianco = new Font(2, 14.0F, 1, Color.white);
|
|
|
|
public static final Font PDF_fGrandeBlu = new Font(2, 12.0F, 1, Color.blue);
|
|
|
|
public static final Font PDF_fGrandeRouge = new Font(2, 12.0F, 1, Color.magenta);
|
|
|
|
public static final Font PDF_fGrandissimo = new Font(2, 14.0F, 0);
|
|
|
|
public static final Font PDF_fGrandissimoB = new Font(2, 14.0F, 1);
|
|
|
|
public static final Font PDF_fGrandissimoBianco = new Font(2, 14.0F, 1, Color.white);
|
|
|
|
public static final Font PDF_fGrandissimoBlu = new Font(2, 14.0F, 1, Color.blue);
|
|
|
|
public static final Font PDF_fGrandissimoRouge = new Font(2, 14.0F, 1, Color.magenta);
|
|
|
|
public static final Font PDF_fIntestazione = new Font(2, 14.0F, 1);
|
|
|
|
public static final Font PDF_fMedio = new Font(2, 10.0F, 0);
|
|
|
|
public static final Font PDF_fMedioB = new Font(2, 10.0F, 1);
|
|
|
|
public static final Font PDF_fMedioBianco = new Font(2, 10.0F, 1, Color.white);
|
|
|
|
public static final Font PDF_fMedioBlu = new Font(2, 10.0F, 0, Color.blue);
|
|
|
|
public static final Font PDF_fMedioGrigio = new Font(2, 10.0F, 1, Color.GRAY);
|
|
|
|
public static final Font PDF_fMedioRosso = new Font(2, 10.0F, 0, Color.red);
|
|
|
|
public static final Font PDF_fMedioRouge = new Font(2, 10.0F, 0, Color.magenta);
|
|
|
|
public static final Font PDF_fPiccolissimo = new Font(2, 7.0F, 0);
|
|
|
|
public static final Font PDF_fPiccolissimo4 = new Font(2, 4.0F, 0);
|
|
|
|
public static final Font PDF_fPiccolissimo4B = new Font(2, 4.0F, 1);
|
|
|
|
public static final Font PDF_fPiccolissimo5 = new Font(2, 5.0F, 0);
|
|
|
|
public static final Font PDF_fPiccolissimo5B = new Font(2, 5.0F, 1);
|
|
|
|
public static final Font PDF_fPiccolissimo6 = new Font(2, 6.0F, 0);
|
|
|
|
public static final Font PDF_fPiccolissimo6B = new Font(2, 6.0F, 1);
|
|
|
|
public static final Font PDF_fPiccolissimoB = new Font(2, 7.0F, 1);
|
|
|
|
public static final Font PDF_fPiccolo = new Font(2, 8.0F, 0);
|
|
|
|
public static final Font PDF_fPiccoloB = new Font(2, 8.0F, 1);
|
|
|
|
public static final Font PDF_fPiccoloBianco = new Font(2, 8.0F, 1, Color.white);
|
|
|
|
public static final Font PDF_fPiccoloBlu = new Font(2, 8.0F, 0, Color.blue);
|
|
|
|
public static final Font PDF_fPiccoloRosso = new Font(2, 8.0F, 0, Color.red);
|
|
|
|
public _PgAdapter() {}
|
|
|
|
public _PgAdapter(ApplParmFull newApplParmFull) {
|
|
super(newApplParmFull);
|
|
}
|
|
|
|
protected ResParm checkDeleteCascade() {
|
|
return new ResParm(true);
|
|
}
|
|
|
|
protected void deleteCascade() {}
|
|
|
|
public String getPathBaseFoto() {
|
|
if (getApFull() == null)
|
|
return DBAdapter.SEPARATOR;
|
|
return getParm("PATHFOTO").getTesto();
|
|
}
|
|
|
|
public String getPathBaseFotoRidotte() {
|
|
if (getApFull() == null)
|
|
return "/";
|
|
return getParm("PATHFOTO_RIDOTTE").getTesto();
|
|
}
|
|
|
|
public boolean isModGara() {
|
|
long mg = getParm("MODGARA").getNumeroLong();
|
|
if (mg > 0L)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
public boolean isModGara(long l_id_gara) {
|
|
long mg = getParm("MODGARA").getNumeroLong();
|
|
if (mg == l_id_gara)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
public ApplParmFull getApRemoto() {
|
|
apRemoto = null;
|
|
if (apRemoto == null)
|
|
apRemoto = new ApplParmFull(new ApplParm(getApFull().getParm("WWW_DBDRIVE").getNumeroInt(), getApFull().getParm("WWW_DBNAME").getTesto(), getApFull().getParm("WWW_CATALOG").getTesto(), getApFull().getParm("WWW_USER").getTesto(), getApFull().getParm("WWW_PASSWORD").getTesto()));
|
|
return apRemoto;
|
|
}
|
|
|
|
public String getImgLogoFileName() {
|
|
return getDocBase() + "_img/_logo/watermark.png";
|
|
}
|
|
}
|