Package org.compiere.model
Class ModelValidationEngine
java.lang.Object
org.compiere.model.ModelValidationEngine
Model Validation Engine
- Version:
- $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $
- Author:
- Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
- FR [ 1670025 ] ModelValidator.afterLoadPreferences will be useful
- BF [ 1679692 ] fireDocValidate doesn't treat exceptions as errors
- FR [ 1724662 ] Support Email should contain model validators info
- FR [ 2788276 ] Data Import Validator https://sourceforge.net/p/adempiere/feature-requests/712/
- BF [ 2804135 ] Global FactsValidator are not invoked https://sourceforge.net/p/adempiere/bugs/1936/
- BF [ 2819617 ] NPE if script validator rule returns null https://sourceforge.net/p/adempiere/bugs/1976/, victor.perez@e-evolution.com, www.e-evolution.com
- BF [ 2947607 ] Model Validator Engine duplicate listeners
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocValidate
(String tableName, ModelValidator listener) Add Document Validation Listener for a tablevoid
addFactsValidate
(String tableName, FactsValidator listener) Add Accounting Facts Validation Listenervoid
addImportValidate
(String importTableName, ImportValidator listener) Add Import Validation Listener of an import tablevoid
addModelChange
(String tableName, ModelValidator listener) Add Model Change Listener for a tablevoid
After Load Preferences into Context for selected client.void
Deprecated.for deprecated swing client onlyfireDocValidate
(PO po, int docTiming) Fire Document Validation event of a table.
- CallModelValidator.docValidate(PO, int)
on register validators.
- Call script validator (AD_Table_ScriptValidator)
- Fire IEventTopics.DOC_* OSGi event.fireFactsValidate
(MAcctSchema schema, List<Fact> facts, PO po) Fire Accounting Facts Validation event of a table.
- CallFactsValidator.factsValidate(MAcctSchema, List, PO)
on register validators.
- FireIEventTopics.ACCT_FACTS_VALIDATE
OSGi event.void
fireImportValidate
(ImportProcess process, PO importModel, PO targetModel, int timing) Fire Import Validation event.
- CallImportValidator.validate(ImportProcess, Object, Object, int)
on registered validators.
- Fire IEventTopics.IMPORT_* OSGi event.fireModelChange
(PO po, int changeType) Fire Model Change event of a tablestatic ModelValidationEngine
get()
Get Singleton instancegetInfoDetail
(StringBuffer sb, Properties ctx) Get Model Validation Engine InfologinComplete
(int AD_Client_ID, int AD_Org_ID, int AD_Role_ID, int AD_User_ID) Called when login is complete.
- CallModelValidator.login(int, int, int)
on register validatorsvoid
removeDocValidate
(String tableName, ModelValidator listener) Remove Document Validation Listener of a tablevoid
removeFactsValidate
(String tableName, FactsValidator listener) Remove Accounting Facts Validation Listener of a tablevoid
removeModelChange
(String tableName, ModelValidator listener) Remove Model Change Listener for a tabletoString()
String Representation
-
Method Details
-
get
Get Singleton instance- Returns:
- singleton engine instance
-
loginComplete
Called when login is complete.
- CallModelValidator.login(int, int, int)
on register validators. - Call script validator (AD_Table_ScriptValidator)
- FireIEventTopics.AFTER_LOGIN
OSGi event.- Parameters:
AD_Client_ID
- clientAD_Org_ID
- orgAD_Role_ID
- roleAD_User_ID
- user- Returns:
- error message or null
-
addModelChange
Add Model Change Listener for a table- Parameters:
tableName
- table namelistener
- listener (global or tenant specific)
-
removeModelChange
Remove Model Change Listener for a table- Parameters:
tableName
- table namelistener
- listener (global or tenant specific)
-
fireModelChange
Fire Model Change event of a table. - CallModelValidator.modelChange(PO, int)
on register validators.
- Call script validator (AD_Table_ScriptValidator)
- Fire IEventTopics.PO_* OSGi event.- Parameters:
po
- PO instance for the eventchangeType
- ModelValidator.TYPE_*- Returns:
- error message or NULL for no veto
-
addDocValidate
Add Document Validation Listener for a table- Parameters:
tableName
- table namelistener
- listener (global or tenant specific)
-
removeDocValidate
Remove Document Validation Listener of a table- Parameters:
tableName
- table namelistener
- listener (global or tenant specific)
-
fireDocValidate
Fire Document Validation event of a table.
- CallModelValidator.docValidate(PO, int)
on register validators.
- Call script validator (AD_Table_ScriptValidator)
- Fire IEventTopics.DOC_* OSGi event.- Parameters:
po
- PO instance for the eventdocTiming
- see ModelValidator.TIMING_ constants- Returns:
- error message or null
-
addFactsValidate
Add Accounting Facts Validation Listener- Parameters:
tableName
- table namelistener
- listener (global or tenant specific)
-
addImportValidate
Add Import Validation Listener of an import table- Parameters:
importTableName
- table namelistener
- listener
-
removeFactsValidate
Remove Accounting Facts Validation Listener of a table- Parameters:
tableName
- table namelistener
- listener
-
fireFactsValidate
Fire Accounting Facts Validation event of a table.
- CallFactsValidator.factsValidate(MAcctSchema, List, PO)
on register validators.
- FireIEventTopics.ACCT_FACTS_VALIDATE
OSGi event.- Parameters:
schema
-facts
-po
- PO instance of event- Returns:
- error message or null
-
fireImportValidate
Fire Import Validation event.
- CallImportValidator.validate(ImportProcess, Object, Object, int)
on registered validators.
- Fire IEventTopics.IMPORT_* OSGi event.- Parameters:
process
- import processimportModel
- import record (e.g. X_I_BPartner)targetModel
- target model (e.g. MBPartner, MBPartnerLocation, MUser)timing
- see ImportValidator.TIMING_* constants
-
toString
String Representation -
getInfoDetail
Get Model Validation Engine Info- Parameters:
sb
- optional string bufferctx
- context- Returns:
- Model Validation Engine Info author Teo Sarca, FR [ 1724662 ]
-
afterLoadPreferences
After Load Preferences into Context for selected client.
Fire afterLoadPreferences model validator event andIEventTopics.PREF_AFTER_LOAD
OSGi event.- Parameters:
ctx
- context- See Also:
-
beforeSaveProperties
Deprecated.for deprecated swing client onlyBefore Save Properties for selected client.
-