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,223 @@
package it.acxent.dm;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import org.json.JSONArray;
import org.json.JSONObject;
public class FaceDetectionMethod extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1705937095434L;
private long id_faceDetectionMethod;
private long codice;
private String descrizione;
private long flgDetectionType;
private String descrizioneLunga;
private String pathModello;
private long flgBtn;
public static final long FACE_DETECTION_TYPE_OCV = 0L;
public static final long FACE_DETECTION_TYPE_GOOGLE = 1L;
public static final long FACE_DETECTION_TYPE_YUNET = 2L;
public static final long FACE_DETECT_METHOD_H_DEFAULT = 0L;
public static final long FACE_DETECT_METHOD_H_ALT = 1L;
public static final long FACE_DETECT_METHOD_H_ALT2 = 2L;
public static final long FACE_DETECT_METHOD_H_ALT_TREE = 3L;
public static final long FACE_DETECT_METHOD_L_DEFAULT = 4L;
public static final long FACE_DETECT_METHOD_L_IMPROVED = 5L;
public static final long FACE_DETECT_METHOD_YUNET = 20L;
public static final long FACE_DETECT_METHOD_GOOGLE_VISION = 99L;
public static final String getDetectionType(long l_flgDetectionType) {
if (l_flgDetectionType == 0L)
return "Open CV";
if (l_flgDetectionType == 1L)
return "Google Vision";
if (l_flgDetectionType == 2L)
return "Yunet zoo";
return "";
}
public final String getDetectionType() {
return getDetectionType(getFlgDetectionType());
}
public FaceDetectionMethod(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public FaceDetectionMethod() {}
public void setId_faceDetectionMethod(long newId_faceDetectionMethod) {
this.id_faceDetectionMethod = newId_faceDetectionMethod;
}
public void setCodice(long newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setFlgDetectionType(long newFlgDectectionType) {
this.flgDetectionType = newFlgDectectionType;
}
public void setDescrizioneLunga(String newDescrizioneLunga) {
this.descrizioneLunga = newDescrizioneLunga;
}
public void setPathModello(String newPathModello) {
this.pathModello = newPathModello;
}
public long getId_faceDetectionMethod() {
return this.id_faceDetectionMethod;
}
public long getCodice() {
return this.codice;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public long getFlgDetectionType() {
return this.flgDetectionType;
}
public String getDescrizioneLunga() {
return (this.descrizioneLunga == null) ? "" : this.descrizioneLunga.trim();
}
public String getPathModello() {
return (this.pathModello == null) ? "" : this.pathModello.trim();
}
public String getApiKey() {
return getPathModello();
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<FaceDetectionMethod> findByBtn() {
String s_Sql_Find = "select A.* from FACE_DETECTION_METHOD AS A";
String s_Sql_Order = " order by A.codice";
WcString wc = new WcString();
wc.addWc("A.flgBtn=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByCodice(long l_codice) {
String s_Sql_Find = "select A.* from FACE_DETECTION_METHOD AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (l_codice == 0L) {
wc.addWc("(A.codice=0 or A.codice is null)");
} else {
wc.addWc("A.codice=" + l_codice);
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public ResParm syncJson(JSONArray jaFdm) {
ResParm rp = new ResParm();
boolean debug = false;
if (debug)
System.out.println("syncJson:\n" + jaFdm.toString());
FaceDetectionMethod row = new FaceDetectionMethod(getApFull());
for (int i = 0; i < jaFdm.length(); i++) {
JSONObject jRow = jaFdm.getJSONObject(i);
if (debug)
System.out.println("syncJson: codice " + jRow.getLong("codice") + " desc: " +
jRow.getString("descrizione"));
row.findByCodice(jRow.getLong("codice"));
row.setCodice(jRow.getLong("codice"));
row.setFlgDetectionType(jRow.getLong("flgDetectionType"));
row.setDescrizione(jRow.getString("descrizione"));
row.setDescrizioneLunga(jRow.getString("descrizioneLunga"));
row.save();
}
return rp;
}
protected String sqlStringfindAll() {
return "select A.* from FACE_DETECTION_METHOD AS A order by codice";
}
public long getFlgBtn() {
return this.flgBtn;
}
public void setFlgBtn(long flgBtn) {
this.flgBtn = flgBtn;
}
public Vectumerator<FaceDetectionMethod> findByCR(FaceDetectionMethodCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from FACE_DETECTION_METHOD AS A";
String s_Sql_Order = " order by codice";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,92 @@
package it.acxent.dm;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class FaceDetectionMethodCR extends CRAdapter {
private static final long serialVersionUID = -7539345269995197440L;
private long id_faceDetectionMethod;
private long codice;
private String descrizione;
private long flgDetectionType = -1L;
private String descrizioneLunga;
private String pathModello;
private long flgBtn = -1L;
public static final String getDetectionType(long l_flgDetectionTYpe) {
return FaceDetectionMethod.getDetectionType(l_flgDetectionTYpe);
}
public final String getDetectionType() {
return FaceDetectionMethod.getDetectionType(getFlgDetectionType());
}
public FaceDetectionMethodCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public FaceDetectionMethodCR() {}
public void setId_faceDetectionMethod(long newId_faceDetectionMethod) {
this.id_faceDetectionMethod = newId_faceDetectionMethod;
}
public void setCodice(long newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setFlgDetectionType(long newFlgDectectionType) {
this.flgDetectionType = newFlgDectectionType;
}
public void setDescrizioneLunga(String newDescrizioneLunga) {
this.descrizioneLunga = newDescrizioneLunga;
}
public void setPathModello(String newPathModello) {
this.pathModello = newPathModello;
}
public long getId_faceDetectionMethod() {
return this.id_faceDetectionMethod;
}
public long getCodice() {
return this.codice;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public long getFlgDetectionType() {
return this.flgDetectionType;
}
public String getDescrizioneLunga() {
return (this.descrizioneLunga == null) ? "" : this.descrizioneLunga.trim();
}
public String getPathModello() {
return (this.pathModello == null) ? "" : this.pathModello.trim();
}
public long getFlgBtn() {
return this.flgBtn;
}
public void setFlgBtn(long flgBtn) {
this.flgBtn = flgBtn;
}
}

View file

@ -0,0 +1,127 @@
package it.acxent.dm;
public class FaceJsonAttribute {
public static final String J_ATTRIBUTE_FILENAME = "fileName";
public static final String J_ATTRIBUTE_MD5 = "md5";
public static final String J_ATTRIBUTE_ID_FOTO = "id_foto";
public static final String J_ATTRIBUTE_ORIGINAL_PATH = "originalPath";
public static final String J_ATTRIBUTE_LABELS = "labels";
public static final String J_ATTRIBUTE_REQUEST_IMAGE = "reqImage";
public static final String J_ATTRIBUTE_VALUE = "value";
public static final String J_ATTRIBUTE_X_CENTER = "xCenter";
public static final String J_ATTRIBUTE_Y_CENTER = "yCenter";
public static final String J_ATTRIBUTE_RESPONSE = "response";
public static final String J_ATTRIBUTE_FACE_ANNOTATIONS = "faceAnnotations";
public static final String J_ATTRIBUTE_FD_BOUNDING_POLY = "fdBoundingPoly";
public static final String J_ATTRIBUTE_VERTICES = "vertices";
public static final String J_ATTRIBUTE_Y = "y";
public static final String J_ATTRIBUTE_X = "x";
public static final String J_ATTRIBUTE_NUMBERS = "numbers";
public static final String J_ATTRIBUTE_RESPONSES = "responses";
public static final String J_ATTRIBUTE_MSG = "msg";
public static final String J_ATTRIBUTE_STATUS = "status";
public static final String J_ATTRIBUTE_SUCCESS = "success";
public static final String J_ATTRIBUTE_FACE_DETECTION_TYPE = "faceDetectionType";
public static final String J_ATTRIBUTE_FACE_RECOGNIZER_TYPE = "recognizerType";
public static final String J_ATTRIBUTE_CONTENT = "content";
public static final String J_ATTRIBUTE_IMAGE = "image";
public static final String J_ATTRIBUTE_REQUESTS = "requests";
public static final String J_ATTRIBUTE_CODGARA = "id_gara";
public static final String J_ATTRIBUTE_CODE = "code";
public static final String J_ATTRIBUTE_DESCRIPTION = "description";
public static final String J_ATTRIBUTE_NOIMG = "noImg";
public static final String J_ATTRIBUTE_ID = "id";
public static final String J_ATTRIBUTE_LABEL = "label";
public static final String J_ATTRIBUTE_LABEL_MD5 = "labelMd5";
public static final String J_ATTRIBUTE_NUMBERTRAININGIMAGES = "numberTrainingImages";
public static final String J_ATTRIBUTE_CONFIDENCE = "confidence";
public static final String J_ATTRIBUTE_NUM_OF_FACES = "numOfFaces";
public static final String J_ATTRIBUTE_NUM_OF_NUMBERS = "numOfNumbers";
public static final String J_ATTRIBUTE_SEND_NOTIFICHE = "sendNotifiche";
public static final String J_ATTRIBUTE_SOURCE = "source";
public static final String J_ATTRIBUTE_IMAGEURI = "imageUri";
public static final String J_ATTRIBUTE_POSITION = "position";
public static final String J_ATTRIBUTE_LANDMARKS = "landmarks";
public static final String J_ATTRIBUTE_Z = "z";
public static final String J_ATTRIBUTE_RECOGNIZER_TYPE = "recognizerType";
public static final String J_ATTRIBUTE_ADD_LABEL = "addLabel";
public static final String J_ATTRIBUTE_FACE_DETECTION_METHODS = "faceDetectionMethods";
public static final String J_ATTRIBUTE_CODICE = "codice";
public static final String J_ATTRIBUTE_FLG_DETECTION_TYPE = "flgDetectionType";
public static final String J_ATTRIBUTE_DESCRIZIONE = "descrizione";
public static final String J_ATTRIBUTE_DESCRIZIONE_LUNGA = "descrizioneLunga";
public static final String J_ATTRIBUTE_JSON_DATA_PATH = "json_data_path";
public static final String J_ATTRIBUTE_JSON_RES_PATH = "json_res_path";
public static final String J_ATTRIBUTE_DIS_TYPE = "dis_type";
public static final String J_ATTRIBUTE_TARGET = "target";
public static final String J_ATTRIBUTE_QUERY = "query";
public static final String J_ATTRIBUTE_PATH = "path";
public static final String J_ATTRIBUTE_SCORE = "score";
public static final String J_ATTRIBUTE_DETECTION_CONFIDENCE_THRESOLD = "conf_threshold";
public static final String J_ATTRIBUTE_TYPE = "type";
public static final String J_ATTRIBUTE_DB = "db";
public static final String J_ATTRIBUTE_TYPE_VALUE_SELFIE = "selfie";
public static final String J_ATTRIBUTE_TYPE_VALUE_FACE = "face";
public static final String J_ATTRIBUTE_TYPE_VALUE_PHOTO = "photo";
}

View file

@ -0,0 +1,205 @@
package it.acxent.dm;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
public abstract class FaceRecognizer extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1701089773600L;
private long id_faceRecognizer;
private long flgTipo;
private String codice;
private String descrizione;
private String fileName;
private long nTrainingImages;
private Date dataTraining;
private Timestamp tsStart;
private Timestamp tsStop;
private long faceSize;
public static final long RECOGNIZER_LBPH = 0L;
public static final long RECOGNIZER_FISH = 1L;
public static final long RECOGNIZER_EIGEN = 2L;
public static final int TOPT_NUMB_RECOGNIZER = 1;
public FaceRecognizer(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public FaceRecognizer() {}
public void setId_faceRecognizer(long newId_faceRecognizer) {
this.id_faceRecognizer = newId_faceRecognizer;
}
public void setFlgTipo(long newFlgTipo) {
this.flgTipo = newFlgTipo;
}
public void setCodice(String newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setFileName(String newFileName) {
this.fileName = newFileName;
}
public void setNTrainingImages(long newNTrainingImages) {
this.nTrainingImages = newNTrainingImages;
}
public void setDataTraining(Date newDataTraining) {
this.dataTraining = newDataTraining;
}
public long getId_faceRecognizer() {
return this.id_faceRecognizer;
}
public long getFlgTipo() {
return this.flgTipo;
}
public String getCodice() {
return (this.codice == null) ? "" : this.codice.trim();
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public String getFileName() {
return (this.fileName == null) ? getCodice() : this.fileName.trim();
}
public long getNTrainingImages() {
return this.nTrainingImages;
}
public Date getDataTraining() {
return this.dataTraining;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<FaceRecognizer> findByCR(FaceRecognizerCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from FACE_RECOGNIZER AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByCode(String l_code) {
String s_Sql_Find = "select A.* from FACE_RECOGNIZER AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.code='" + l_code + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public void findBySessionId(String l_sessionId) {
String s_Sql_Find = "select A.* from FACE_RECOGNIZER AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.sessionId='" + l_sessionId + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public Timestamp getTsStart() {
return this.tsStart;
}
public void setTsStart(Timestamp tsStart) {
this.tsStart = tsStart;
}
public Timestamp getTsStop() {
return this.tsStop;
}
public void setTsStop(Timestamp tsStop) {
this.tsStop = tsStop;
}
public static final String getTipo(long l_flgTipo) {
if (l_flgTipo == 2L)
return "EIGEN";
if (l_flgTipo == 0L)
return "LBPH";
if (l_flgTipo == 1L)
return "FISH";
return "xx";
}
public final String getTipo() {
return getTipo(getFlgTipo());
}
public long getFaceSize() {
return (this.faceSize == 0L) ? 96L : this.faceSize;
}
public void setFaceSize(long faceSize) {
this.faceSize = faceSize;
}
}

View file

@ -0,0 +1,93 @@
package it.acxent.dm;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Date;
public class FaceRecognizerCR extends CRAdapter {
private long id_faceRecognizer;
private String flgTIpo;
private String codice;
private String descrizione;
private String sessionId;
private String fileName;
private long nTrainingImages;
private Date dataTraining;
public FaceRecognizerCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public FaceRecognizerCR() {}
public void setId_faceRecognizer(long newId_faceRecognizer) {
this.id_faceRecognizer = newId_faceRecognizer;
}
public void setFlgTIpo(String newFlgTIpo) {
this.flgTIpo = newFlgTIpo;
}
public void setCodice(String newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setSessionId(String newSessionId) {
this.sessionId = newSessionId;
}
public void setFileName(String newFileName) {
this.fileName = newFileName;
}
public void setNTrainingImages(long newNTrainingImages) {
this.nTrainingImages = newNTrainingImages;
}
public void setDataTraining(Date newDataTraining) {
this.dataTraining = newDataTraining;
}
public long getId_faceRecognizer() {
return this.id_faceRecognizer;
}
public String getFlgTIpo() {
return (this.flgTIpo == null) ? "" : this.flgTIpo.trim();
}
public String getCodice() {
return (this.codice == null) ? "" : this.codice.trim();
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public String getSessionId() {
return (this.sessionId == null) ? "" : this.sessionId.trim();
}
public String getFileName() {
return (this.fileName == null) ? "" : this.fileName.trim();
}
public long getNTrainingImages() {
return this.nTrainingImages;
}
public Date getDataTraining() {
return this.dataTraining;
}
}

View file

@ -0,0 +1 @@
package it.acxent.dm;