705 lines
29 KiB
Java
705 lines
29 KiB
Java
import java.util.*;
|
|
|
|
public class spadministration_groupsBL extends spadministration_groupsWV implements CPLib.QueryFilterFromApplication {
|
|
// Variabile che indica se il record è stato caricato
|
|
public boolean m_bLoaded;
|
|
// Variabile che indica se il record è stato variato
|
|
public boolean m_bUpdated;
|
|
// Variabile che memorizza lo stato subito dopo una Load o una Save
|
|
public String m_cPreviousState;
|
|
// Variabile che mantiene il vecchio timestamp
|
|
public String m_cOldCPCCCHK;
|
|
public java.util.List<String> m_oParameters;
|
|
protected String m_cPassword;
|
|
protected String m_cOTP;
|
|
// Variabile che indica il tipo dell'ultimo
|
|
// errore, o messaggio da comunicare all'interfaccia,
|
|
// che si è verificato impostando una variabile di work.
|
|
// I valori ammessi sono:
|
|
// - 1 : errore di campo obbligatorio
|
|
// - 2 : errore di check
|
|
// - 3 : valore non ammesso nel link
|
|
// - 4 : richiesta password
|
|
// - 5 : richiesto otp
|
|
public int m_nLastError;
|
|
public String m_cLastMsgError;
|
|
public String m_cLastWorkVarError;
|
|
// m_bCalculating==true la Calculate e' in esecuzione
|
|
public boolean m_bCalculating = false;
|
|
public static final String i_EntityName = "spadministration_groups";
|
|
public static final String i_EntityType = "master";
|
|
public static final boolean i_IsSon = false;
|
|
public boolean m_bSkipCheckOTPSecurity = true;
|
|
// Variabile di collegamento con il database: passata nel costruttore
|
|
public CPSql m_Sql;
|
|
// Variabile di contesto (variabili globali): passata nel costruttore
|
|
public CPContext m_Ctx;
|
|
// Variabili che contengono il nome fisico e la connessione per la tabella collegata
|
|
public String m_cPhName_cpgroups;
|
|
public String m_cServer_cpgroups;
|
|
public CPPhTableWrInfo m_oWrInfo_cpgroups;
|
|
// Variabile che contiene il nome virtuale della tabella
|
|
public String m_cVirtName_cpgroups;
|
|
// gestori eventi esterni al business object sono collegati inserendoli nella coppia di strutture dati seguenti
|
|
// gestori associati a particolari eventi ('Blank')
|
|
public static volatile HashMap specificEventsHandlers;
|
|
// gestori associati a tutti gli eventi
|
|
public static volatile ArrayList allEventsHandlers;
|
|
// metadati resi disponibili ai gestori di eventi
|
|
public static String[] m_EntityTables = {"cpgroups"};
|
|
// codice secondo sintassi delle business rules per produrre i dati da usare in un ideale documento che li rappresenti
|
|
public static final String i_StateStructure = "{'idfolder':idfolder,'code':code,'name':name,'grptype':grptype,'datestart':datestart,'datestop':datestop,'spadministration_subgroups':spadministration_subgroups,'pwdcomplexity':pwdcomplexity,'pwddaysduration':pwddaysduration,'pwdciclicity':pwdciclicity,'captchalevel':captchalevel,'grpdescription':grpdescription"+FoundlingChildrenList("spadministration_groups",true)+"}";
|
|
public static final String i_CompleteStateStructure = "{'idfolder':idfolder,'code':code,'name':name,'grptype':grptype,'datestart':datestart,'datestop':datestop,'company':company,'spadministration_subgroups':spadministration_subgroups,'pwdcomplexity':pwdcomplexity,'pwddaysduration':pwddaysduration,'pwdciclicity':pwdciclicity,'captchalevel':captchalevel,'init_code':init_code,'grpdescription':grpdescription"+FoundlingChildrenList("spadministration_groups",true)+"}";
|
|
public static final String i_ItemSequence = "idfolder,code,name,grptype,datestart,datestop,spadministration_subgroups,pwdcomplexity,pwddaysduration,pwdciclicity,captchalevel,grpdescription"+FoundlingChildrenList("spadministration_groups",false)+"";
|
|
public static final com.zucchetti.sitepainter.EntityItem[] i_EditableEntityItems = com.zucchetti.sitepainter.EntityItem.buildEditableItemsForEntity(GetLinkDef(),FoundlingChildrenList("spadministration_groups"),new String[][]{new String[]{"idfolder","","N","6","0","variabile","nokey","false","false"},new String[]{"code","ADMIN_CODE","N","6","0","campo","key1","false","false"},new String[]{"name","ADMIN_NAME","C","50","0","campo","nokey","false","false"},new String[]{"grptype","ADMIN_TYPE","C","1","0","campo","nokey","false","false"},new String[]{"datestart","ADMIN_VALIDITY_START","D","8","0","campo","nokey","false","false"},new String[]{"datestop","ADMIN_VALIDITY_END","D","8","0","campo","nokey","false","false"},new String[]{"spadministration_subgroups","Subgroups","","","","link_PC","","false",""},new String[]{"pwdcomplexity","ADMIN_PWDCOMPLEXITY","N","3","0","campo","nokey","false","false"},new String[]{"pwddaysduration","ADMIN_PWDDAYSDURATION","N","4","0","campo","nokey","false","false"},new String[]{"pwdciclicity","ADMIN_PWDCICLICITY","N","4","0","campo","nokey","false","false"},new String[]{"captchalevel","ADMIN_CAPTCHA_LEVEL","N","4","0","campo","nokey","false","false"},new String[]{"grpdescription","ADMIN_GROUP_DESCRIPTION","M","10","0","campo","nokey","false","false"}});
|
|
// dati usati internamente dai metodi BRxxx di BRCallerImpl
|
|
private static boolean _involved=true;
|
|
protected void _setInvolvedInBR(boolean involved) {
|
|
_involved=involved;
|
|
}
|
|
protected boolean _involvedInBR() {
|
|
return _involved;
|
|
}
|
|
public spadministration_groupsBL (CPContext p_ContextObject) {
|
|
/* Impostazione dell'ambiente globale: il businness object si collega
|
|
all'oggetto globale (unico per più istanze di una stessa applicazione)
|
|
per recuperare informazioni sul:
|
|
1) nome fisico della tabella di gestione;
|
|
2) nome fisico delle tabelle collegate nei link;
|
|
3) stringa di connessione.
|
|
L'azienda è contenuta nel global object. */
|
|
// Assegnazione delle variabili che contengono il nome fisico, il nome virtuale, e la connessione per la tabella collegata
|
|
m_cPhName_cpgroups = p_ContextObject.GetPhName("cpgroups",p_ContextObject.GetCompany(),false);
|
|
m_cServer_cpgroups = p_ContextObject.GetServer("cpgroups");
|
|
m_oWrInfo_cpgroups = CPPhTableWrInfo.GetCPPhTableWrInfo(p_ContextObject,"cpgroups",p_ContextObject.GetCompany());
|
|
m_cVirtName_cpgroups = CPSql.ManipulateTablePhName("cpgroups",m_cServer_cpgroups);
|
|
// Assegnazione della variabile di collegamento con il database
|
|
m_Sql = p_ContextObject.GetSql();
|
|
m_Ctx = p_ContextObject;
|
|
// Istanziazione dei business object dei figli
|
|
spadministration_subgroups = new spadministration_subgroupsBO(p_ContextObject);
|
|
m_MNTs = CPLib.MNTChilds("spadministration_groups",p_ContextObject);
|
|
}
|
|
public void Blank() {
|
|
BlankStatusVariables();
|
|
// * --- Area Manuale = BO - Blank Record Init
|
|
// * --- Fine Area Manuale
|
|
w_idfolder = 0;
|
|
w_name = "";
|
|
w_grptype = "";
|
|
w_datestart = CPLib.NullDate();
|
|
w_datestop = CPLib.NullDate();
|
|
w_company = "";
|
|
w_pwdcomplexity = 0;
|
|
w_pwddaysduration = 0;
|
|
w_pwdciclicity = 0;
|
|
w_captchalevel = 0;
|
|
w_grpdescription = "";
|
|
w_code = UserAdmin.Make(m_Ctx).GetNextCode("groups");
|
|
w_init_code = w_code;
|
|
m_cWv_spadministration_subgroups = "";
|
|
CPExtenderLib.BlankExtendedFields(extendedFields);
|
|
SaveDependsOn();
|
|
NotifyEvent("Blank");
|
|
// * --- Area Manuale = BO - Blank Record End
|
|
// * --- Fine Area Manuale
|
|
}
|
|
public boolean IsUpdated() {
|
|
boolean l_bResult;
|
|
l_bResult = m_bUpdated;
|
|
l_bResult = l_bResult || spadministration_subgroups.IsUpdated() || CPLib.IsUpdated(m_cWv_spadministration_subgroups);
|
|
return l_bResult;
|
|
}
|
|
public boolean IsLoaded() {
|
|
return m_bLoaded;
|
|
}
|
|
public boolean IsNew() {
|
|
return IsUpdated() && ! (IsLoaded());
|
|
}
|
|
public void SaveDependsOn() {
|
|
spadministration_subgroups.SaveDependsOn();
|
|
}
|
|
public void NotifyEvent(String p_cEvent) {
|
|
if (CPLib.eq(p_cEvent,"Insert end")) {
|
|
Calculation_OBGXXZUBDW();
|
|
}
|
|
CPLib.NotifyEvent(p_cEvent,this,m_Ctx,specificEventsHandlers,allEventsHandlers);
|
|
}
|
|
// Funzioni di link legate alle variabili ed ai campi.
|
|
/* Gestione dei metodi per l'impostazione delle variabili di work.
|
|
I seguenti metodi sono pubblici perchè vengono chiamati dalla UI che
|
|
ha creato il business object o da batch.
|
|
*/
|
|
public boolean Set_idfolder(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_idfolder = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_code(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_code = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_name(String p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_name = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_grptype(String p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_grptype = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_datestart(java.sql.Date p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_datestart = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_datestop(java.sql.Date p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_datestop = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_pwdcomplexity(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_pwdcomplexity = p_workVariableValue;
|
|
//
|
|
l_bResult = CPLib.ge(w_pwdcomplexity,0) && CPLib.le(w_pwdcomplexity,UserAdmin.Make(m_Ctx).GetPasswordRatingMaxReachable());
|
|
if ( ! (l_bResult)) {
|
|
m_nLastError = 2;
|
|
m_cLastMsgError = "ADMIN_MSG_ERROR_RANGE";
|
|
}
|
|
if ( ! (l_bResult)) {
|
|
// Impostazione a blank della variabile di work
|
|
w_pwdcomplexity = 0;
|
|
}
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_pwddaysduration(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_pwddaysduration = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_pwdciclicity(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_pwdciclicity = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_captchalevel(double p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_captchalevel = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
public boolean Set_grpdescription(String p_workVariableValue) {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
// Variabile temporanea che conterrà il risultato della funzione di link se l'item corrente è parte di una chiave composta
|
|
boolean l_bTmpRes;
|
|
SetUpdated();
|
|
w_grpdescription = p_workVariableValue;
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
SaveDependsOn();
|
|
return l_bResult;
|
|
}
|
|
/* Gestione delle funzioni che rispondono lo stato delle variabili di work.
|
|
Vengono chiamate dalla UI per valutare la condizione di visibilità e di
|
|
abilitazione di un control.
|
|
*/
|
|
public boolean getVisible_idfolder() {
|
|
return true;
|
|
}
|
|
public boolean Set_Password(String p_pwd) {
|
|
m_cPassword = p_pwd;
|
|
return true;
|
|
}
|
|
public boolean Set_OTP(String p_otp) {
|
|
m_cOTP = p_otp;
|
|
return true;
|
|
}
|
|
public boolean Calculate() {
|
|
boolean l_bTmpRes;
|
|
l_bTmpRes = true;
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
m_bCalculating = true;
|
|
// * --- Area Manuale = BO - Calculate
|
|
// * --- Fine Area Manuale
|
|
for (int l_i = 0; CPLib.lt(l_i,m_MNTs.length); l_i = l_i + (1)) {
|
|
m_MNTs[l_i].m_child.FoundlingCopyWorkVar(this,true);
|
|
}
|
|
m_bCalculating = false;
|
|
return l_bResult;
|
|
}
|
|
void Calculation_OBGXXZUBDW() {
|
|
spadministration_insertgrpgrpR l_oRoutine_spadministration_insertgrpgrp;
|
|
l_oRoutine_spadministration_insertgrpgrp = spadministration_insertgrpgrpR.Make(m_Ctx,this);
|
|
l_oRoutine_spadministration_insertgrpgrp.code = w_code;
|
|
l_oRoutine_spadministration_insertgrpgrp.father = w_idfolder;
|
|
l_oRoutine_spadministration_insertgrpgrp.Run();
|
|
}
|
|
protected void BlankStatusVariables() {
|
|
m_bLoaded = false;
|
|
m_bUpdated = false;
|
|
m_cPreviousState = CPSecurity.UNKNOWN_STATE;
|
|
}
|
|
public void CalledBatchEnd() {
|
|
if ( ! (m_bCalculating)) {
|
|
// Esecuzione dei calcoli
|
|
Calculate();
|
|
}
|
|
}
|
|
public final static String[] m_KeyColumns = {"code"};
|
|
public static String QueryFilter(CPContext m_Ctx) {
|
|
String l_cFilter;
|
|
l_cFilter = CPLib.ApplicationQueryFilter("spadministration_groups","cpgroups",m_KeyColumns,m_Ctx);
|
|
return l_cFilter;
|
|
}
|
|
public void SetFromContext(String s) {
|
|
SetFromContext(s,null);
|
|
}
|
|
public void SetFromContext(java.util.Properties p) {
|
|
SetFromContext("_dummy_",p);
|
|
}
|
|
public void SetFromContext(String s,java.util.Properties p) {
|
|
BlankStatusVariables();
|
|
w_idfolder = 0;
|
|
w_code = 0;
|
|
w_name = "";
|
|
w_grptype = "";
|
|
w_datestart = CPLib.NullDate();
|
|
w_datestop = CPLib.NullDate();
|
|
w_company = "";
|
|
w_pwdcomplexity = 0;
|
|
w_pwddaysduration = 0;
|
|
w_pwdciclicity = 0;
|
|
w_captchalevel = 0;
|
|
w_init_code = 0;
|
|
w_grpdescription = "";
|
|
m_cWv_spadministration_subgroups = "";
|
|
CPExtenderLib.BlankExtendedFields(extendedFields);
|
|
SaveDependsOn();
|
|
if ( ! (CPLib.Empty(s))) {
|
|
if (CPLib.IsNull(p)) {
|
|
p = CPLib.GetProperties(s);
|
|
}
|
|
boolean l_bFromHyperlink = CPLib.ne("_not_found_",CPLib.GetProperty(p,"m_cParameterSequence","_not_found_"));
|
|
w_code = CPLib.GetProperty(p,"code",w_code,0);
|
|
w_name = CPLib.GetProperty(p,"name",w_name,0);
|
|
w_grptype = CPLib.GetProperty(p,"grptype",w_grptype,0);
|
|
w_datestart = CPLib.GetProperty(p,"datestart",w_datestart,0);
|
|
w_datestop = CPLib.GetProperty(p,"datestop",w_datestop,0);
|
|
w_company = CPLib.GetProperty(p,"company",w_company,0);
|
|
w_pwdcomplexity = CPLib.GetProperty(p,"pwdcomplexity",w_pwdcomplexity,0);
|
|
w_pwddaysduration = CPLib.GetProperty(p,"pwddaysduration",w_pwddaysduration,0);
|
|
w_pwdciclicity = CPLib.GetProperty(p,"pwdciclicity",w_pwdciclicity,0);
|
|
w_captchalevel = CPLib.GetProperty(p,"captchalevel",w_captchalevel,0);
|
|
w_grpdescription = CPLib.GetProperty(p,"grpdescription",w_grpdescription,0);
|
|
w_idfolder = CPLib.GetProperty(p,"idfolder",w_idfolder,0);
|
|
w_init_code = CPLib.GetProperty(p,"init_code",w_init_code,0);
|
|
m_cWv_spadministration_subgroups = CPLib.GetProperty(p,"m_cWv_spadministration_subgroups",m_cWv_spadministration_subgroups,0);
|
|
CPLib.SetFromContextMNTs(p,m_MNTs);
|
|
SPExtenderLib.SetExtendedFromContext(p,extendedFields);
|
|
m_bLoaded = CPLib.GetProperty(p,"m_bLoaded",false,0);
|
|
m_bUpdated = CPLib.GetProperty(p,"m_bUpdated",false,0);
|
|
m_cOldCPCCCHK = CPLib.GetProperty(p,"m_cOldCPCCCHK","",0);
|
|
m_cPreviousState = CPLib.GetProperty(p,"m_cPrvsStt","",0);
|
|
m_cPassword = CPLib.GetProperty(p,"m_cPwd","",0);
|
|
m_cOTP = CPLib.GetProperty(p,"m_cOTP","",0);
|
|
m_lCtxLoaded = true;
|
|
if ( ! (l_bFromHyperlink)) {
|
|
SaveDependsOn();
|
|
}
|
|
}
|
|
}
|
|
public void SetUpdated() {
|
|
m_bUpdated = true;
|
|
}
|
|
public String EntityStatus() {
|
|
return (m_bLoaded?"E":"N");
|
|
}
|
|
public String LastErrorMessage() {
|
|
return m_cLastMsgError;
|
|
}
|
|
static void GetLinkDef0(Map<String,List<Map<String,String[]>>> tables) {
|
|
java.util.regex.Pattern zeroSplit;
|
|
zeroSplit = java.util.regex.Pattern.compile("\\x00");
|
|
Map<String,String[]> map;
|
|
List<Map<String,String[]>> items;
|
|
map = new HashMap<String,String[]>();
|
|
items = tables.get("cpgrpgrp");
|
|
if (CPLib.IsNull(items)) {
|
|
items = new ArrayList<Map<String,String[]>>();
|
|
tables.put("cpgrpgrp",items);
|
|
}
|
|
items.add(map);
|
|
map.put("link_PC",new String[]{});
|
|
map.put("rd_kvar",new String[]{});
|
|
map.put("rd_kfield",new String[]{});
|
|
map.put("rd_field",new String[]{"groupcode"});
|
|
map.put("rd_var",new String[]{"w_code"});
|
|
map.put("wr_var",new String[]{"w_code"});
|
|
map.put("wr_field",new String[]{"groupcode"});
|
|
map.put("wr_op",new String[]{});
|
|
map.put("rd_var.obj_type",new String[]{});
|
|
map.put("rd_kvar.obj_type",new String[]{});
|
|
map.put("rd_var.len",new String[]{});
|
|
map.put("rd_kvar.len",new String[]{});
|
|
map.put("rd_var.dec",new String[]{});
|
|
map.put("rd_kvar.dec",new String[]{});
|
|
map.put("rd_var.comment",new String[]{});
|
|
map.put("rd_kvar.comment",new String[]{});
|
|
map.put("rd_var.key_num",new String[]{});
|
|
map.put("rd_kvar.key_num",new String[]{});
|
|
map.put("rd_var.repeated",new String[]{});
|
|
map.put("rd_kvar.repeated",new String[]{});
|
|
map.put("rd_var.frm_obbl",new String[]{});
|
|
map.put("rd_kvar.frm_obbl",new String[]{});
|
|
map.put("rd_var.obj",new String[]{});
|
|
map.put("rd_kvar.obj",new String[]{});
|
|
map.put("property.value",zeroSplit.split("cpgrpgrp\u0000false\u0000false\u00001\u00000\u0000spadministration_subgroups\u0000false\u0000false\u0000\u0000\u0000\u0000false",-1));
|
|
map.put("property.name",zeroSplit.split("arch\u0000fillemptykey\u0000looselylinked\u0000src_key\u0000hst_link_mode\u0000prg_zoom\u0000looselylinked\u0000sendkeystozoomonzoom\u0000zoom_title\u0000prg_link_search\u0000prg_link_defaults\u0000",-1));
|
|
}
|
|
public static Map<String,List<Map<String,String[]>>> GetLinkDef() {
|
|
java.util.regex.Pattern zeroSplit;
|
|
zeroSplit = java.util.regex.Pattern.compile("\\x00");
|
|
Map<String,List<Map<String,String[]>>> tables;
|
|
tables = new HashMap<String,List<Map<String,String[]>>>();
|
|
Map<String,String[]> map;
|
|
List<Map<String,String[]>> items;
|
|
GetLinkDef0(tables);
|
|
for(String child : CPLib.LoadableMNTs("spadministration_groups",false)) {
|
|
map = new HashMap<String,String[]>();
|
|
items = tables.get(com.zucchetti.sitepainter.Library.getEntityTables(child)[0]);
|
|
if (CPLib.IsNull(items)) {
|
|
items = new ArrayList<Map<String,String[]>>();
|
|
tables.put(com.zucchetti.sitepainter.Library.getEntityTables(child)[0],items);
|
|
}
|
|
map.put("link_PC",new String[]{});
|
|
map.put("rd_kvar",new String[]{});
|
|
map.put("rd_kfield",new String[]{});
|
|
map.put("rd_field",new String[]{});
|
|
map.put("rd_var",new String[]{});
|
|
String[][] definitions = CPMNTChild.GetM_Fkd("spadministration_groups",child);
|
|
// Informazione usata per risolvere la sintassi BO->tabella nelle VQR
|
|
map.put("rd_var",definitions[0]);
|
|
map.put("rd_field",definitions[1]);
|
|
// Definizione delle coppie padre/figlio
|
|
map.put("wr_var",definitions[0]);
|
|
map.put("wr_field",definitions[1]);
|
|
map.put("wr_op",new String[]{});
|
|
map.put("rd_var.obj_type",new String[]{});
|
|
map.put("rd_var.len",new String[]{});
|
|
map.put("rd_var.dec",new String[]{});
|
|
map.put("rd_var.comment",new String[]{});
|
|
map.put("property.name",new String[]{"arch","foundling","","","","prg_zoom"});
|
|
map.put("property.value",new String[]{com.zucchetti.sitepainter.Library.getEntityTables(child)[0],"true","","","",child});
|
|
items.add(map);
|
|
}
|
|
return tables;
|
|
}
|
|
public void Initialize() {
|
|
// Inizializzazione delle variabili di work
|
|
Blank();
|
|
// Inizializzazione delle variabili di progressivo e legate alle operazioni a saldo
|
|
BlankAutonumberAndTransactionVars();
|
|
spadministration_subgroups = new spadministration_subgroupsBO(m_Ctx);
|
|
m_MNTs = CPLib.MNTChilds("spadministration_groups",m_Ctx);
|
|
m_cPreviousState = GetCurrentState();
|
|
}
|
|
public boolean Check() {
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
boolean l_bNoCheck;
|
|
l_bNoCheck = true;
|
|
boolean l_bNoObligatory;
|
|
l_bNoObligatory = true;
|
|
ResetErrorMessage();
|
|
if ( ! (CPLib.ge(w_pwdcomplexity,0) && CPLib.le(w_pwdcomplexity,UserAdmin.Make(m_Ctx).GetPasswordRatingMaxReachable()))) {
|
|
m_cLastMsgError = m_Ctx.Translate("ADMIN_MSG_ERROR_RANGE");
|
|
l_bNoCheck = false;
|
|
l_bResult = false;
|
|
w_pwdcomplexity = 0;
|
|
if (CPLib.eq(m_cLastWorkVarError,"")) {
|
|
m_cLastWorkVarError = "pwdcomplexity";
|
|
}
|
|
}
|
|
if (l_bResult && (( ! (spadministration_subgroups.m_bLoaded) && CPLib.IsLoaded(m_cWv_spadministration_subgroups)) || ( ! (spadministration_subgroups.m_bUpdated) && CPLib.IsUpdated(m_cWv_spadministration_subgroups)))) {
|
|
spadministration_subgroups.SetFromContext(m_cWv_spadministration_subgroups);
|
|
m_cWv_spadministration_subgroups = "_not_empty_";
|
|
}
|
|
if (l_bResult && (spadministration_subgroups.m_bLoaded || spadministration_subgroups.m_bUpdated)) {
|
|
l_bResult = l_bResult && spadministration_subgroups.Check();
|
|
l_bNoCheck = l_bResult;
|
|
if ( ! (l_bNoCheck)) {
|
|
m_cLastMsgError = spadministration_subgroups.m_cLastMsgError;
|
|
}
|
|
}
|
|
// * --- Area Manuale = BO - Check Form
|
|
// * --- Fine Area Manuale
|
|
if ( ! (l_bNoObligatory)) {
|
|
m_nLastError = 1;
|
|
} else if ( ! (l_bNoCheck)) {
|
|
m_nLastError = 2;
|
|
}
|
|
return l_bResult;
|
|
}
|
|
void ResetErrorMessage() {
|
|
m_nLastError = 0;
|
|
m_cLastMsgError = "";
|
|
m_cLastWorkVarError = "";
|
|
}
|
|
public String GetCurrentState() {
|
|
String l_bResult;
|
|
l_bResult = CPSecurity.UNKNOWN_STATE;
|
|
return l_bResult;
|
|
}
|
|
/** @deprecated Will be removed in a future version **/
|
|
@Deprecated
|
|
public String GetStateSecurityKey(String p_cState) {
|
|
return GetStateSecurityKeyRoles(p_cState)[0];
|
|
}
|
|
public String[] GetStateSecurityKeyRoles(String p_cState) {
|
|
String[] l_Keys = {};
|
|
if (CPLib.eq(p_cState,CPSecurity.UNKNOWN_STATE)) {
|
|
l_Keys = new String[]{"spadministration_groups"};
|
|
}
|
|
if (CPLib.eq(l_Keys.length,0)) {
|
|
l_Keys = new String[]{"spadministration_groups\\"+p_cState};
|
|
}
|
|
return l_Keys;
|
|
}
|
|
public boolean CanView() {
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
ResetErrorMessage();
|
|
l_bResult = l_bResult && BRCanView();
|
|
if ( ! (l_bResult)) {
|
|
String o_cLastMsgError = m_cLastMsgError;
|
|
Blank();
|
|
// Evita che un errore segnalato alla Blank, ad esempio link fallito, sovrascriva l'errore di accesso bloccato
|
|
m_cLastMsgError = o_cLastMsgError;
|
|
}
|
|
return l_bResult;
|
|
}
|
|
public boolean CanEdit() {
|
|
return CanEdit(GetCurrentState());
|
|
}
|
|
public boolean CanEdit(String p_cState) {
|
|
boolean l_bResult = true;
|
|
ResetErrorMessage();
|
|
l_bResult = l_bResult && BRCanEdit();
|
|
return l_bResult;
|
|
}
|
|
public boolean CanDelete() {
|
|
boolean l_bResult;
|
|
l_bResult = true;
|
|
ResetErrorMessage();
|
|
l_bResult = l_bResult && BRCanDelete();
|
|
return l_bResult;
|
|
}
|
|
public boolean CanAdd() {
|
|
return CanAdd(GetCurrentState());
|
|
}
|
|
public boolean CanAdd(String p_cState) {
|
|
boolean l_bResult = true;
|
|
ResetErrorMessage();
|
|
l_bResult = l_bResult && BRCanAdd();
|
|
return l_bResult;
|
|
}
|
|
void BlankAutonumberAndTransactionVars() {
|
|
// Inizializzazione dei progressivi
|
|
// Inizializzazione delle variabili per DependsOn
|
|
// Inizializzazione delle variabili per la gestione dello storno delle operazioni di saldo
|
|
}
|
|
public String GetContext() {
|
|
return GetContext(true);
|
|
}
|
|
public String GetContext(boolean p_bGetChildren) {
|
|
Properties p;
|
|
p = new Properties();
|
|
GetContext(p_bGetChildren,p);
|
|
return CPLib.ToProperties(p);
|
|
}
|
|
public void GetContext(java.util.Properties p_oProperties) {
|
|
GetContext(true,p_oProperties);
|
|
}
|
|
public void GetContext(boolean p_bGetChildren,java.util.Properties p) {
|
|
CPLib.PutProperty(p,"code",w_code,0);
|
|
CPLib.PutProperty(p,"name",w_name,0);
|
|
CPLib.PutProperty(p,"grptype",w_grptype,0);
|
|
CPLib.PutProperty(p,"datestart",w_datestart,0);
|
|
CPLib.PutProperty(p,"datestop",w_datestop,0);
|
|
CPLib.PutProperty(p,"company",w_company,0);
|
|
CPLib.PutProperty(p,"pwdcomplexity",w_pwdcomplexity,0);
|
|
CPLib.PutProperty(p,"pwddaysduration",w_pwddaysduration,0);
|
|
CPLib.PutProperty(p,"pwdciclicity",w_pwdciclicity,0);
|
|
CPLib.PutProperty(p,"captchalevel",w_captchalevel,0);
|
|
CPLib.PutProperty(p,"grpdescription",w_grpdescription,0);
|
|
CPLib.PutProperty(p,"idfolder",w_idfolder,0);
|
|
CPLib.PutProperty(p,"init_code",w_init_code,0);
|
|
if (p_bGetChildren) {
|
|
if (spadministration_subgroups.IsUpdated()) {
|
|
m_cWv_spadministration_subgroups = spadministration_subgroups.GetContext();
|
|
}
|
|
CPLib.PutProperty(p,"m_cWv_spadministration_subgroups",m_cWv_spadministration_subgroups,0);
|
|
}
|
|
if (p_bGetChildren) {
|
|
CPLib.PutProperty(p,m_MNTs);
|
|
}
|
|
SPExtenderLib.PutExtendedProperies(p,extendedFields);
|
|
CPLib.PutProperty(p,"m_bLoaded",m_bLoaded);
|
|
CPLib.PutProperty(p,"m_bUpdated",m_bUpdated);
|
|
CPLib.PutProperty(p,"m_cOldCPCCCHK",m_cOldCPCCCHK);
|
|
CPLib.PutProperty(p,"m_cPrvsStt",m_cPreviousState);
|
|
}
|
|
public String i_PrimaryKey() {
|
|
return PrimaryKey(this);
|
|
}
|
|
public static String PrimaryKey(Caller p_Caller) {
|
|
return "cpgroups"+"\\"+CPLib.ToCPStr(p_Caller.GetNumber("code","N",6,0));
|
|
}
|
|
public List<List<String>> AutonumDefinition() {
|
|
return StaticAutonumDefinition();
|
|
}
|
|
public static List<List<String>> StaticAutonumDefinition() {
|
|
List<List<String>> autonums;
|
|
autonums = new ArrayList<List<String>>();
|
|
List<String> oneAutoNum;
|
|
return autonums;
|
|
}
|
|
public boolean ChildExists_spadministration_subgroups() {
|
|
if (spadministration_subgroups.IsUpdated() || (CPLib.IsUpdated(m_cWv_spadministration_subgroups) || CPLib.IsLoaded(m_cWv_spadministration_subgroups))) {
|
|
return true;
|
|
} else if (m_bLoaded && ! (spadministration_subgroups.m_bLoaded)) {
|
|
spadministration_subgroups.Blank();
|
|
spadministration_subgroups.w_groupcode = w_code;
|
|
spadministration_subgroups.Load();
|
|
}
|
|
return spadministration_subgroups.m_bLoaded;
|
|
}
|
|
public void CtxLoad_spadministration_subgroups() {
|
|
if ( ! (spadministration_subgroups.m_lCtxLoaded)) {
|
|
spadministration_subgroups.Blank();
|
|
}
|
|
spadministration_subgroups.m_lCtxLoaded = true;
|
|
if ( ! (spadministration_subgroups.IsUpdated())) {
|
|
if (CPLib.IsUpdated(m_cWv_spadministration_subgroups) || CPLib.IsLoaded(m_cWv_spadministration_subgroups)) {
|
|
spadministration_subgroups.SetFromContext(m_cWv_spadministration_subgroups);
|
|
m_cWv_spadministration_subgroups = "_not_empty_";
|
|
} else {
|
|
if (m_bLoaded && ! (spadministration_subgroups.m_bLoaded)) {
|
|
spadministration_subgroups.Blank();
|
|
spadministration_subgroups.w_groupcode = w_code;
|
|
spadministration_subgroups.Load();
|
|
if ( ! (spadministration_subgroups.m_bLoaded)) {
|
|
spadministration_subgroups.Initialize();
|
|
spadministration_subgroups.SetUpdated();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
CallerBRImpl GetChild(String p_cName) {
|
|
if (CPLib.eq(p_cName,"spadministration_subgroups")) {
|
|
CtxLoad_spadministration_subgroups();
|
|
return spadministration_subgroups;
|
|
}
|
|
return GetMNTChild(false,m_MNTs,p_cName);
|
|
}
|
|
// * --- Area Manuale = BL - Methods
|
|
// * --- Fine Area Manuale
|
|
}
|