Class ModelValidationEngine


  • public class ModelValidationEngine
    extends Object
    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 Detail

      • loginComplete

        public String loginComplete​(int AD_Client_ID,
                                    int AD_Org_ID,
                                    int AD_Role_ID,
                                    int AD_User_ID)
        Called when login is complete
        Parameters:
        AD_Client_ID - client
        AD_Org_ID - org
        AD_Role_ID - role
        AD_User_ID - user
        Returns:
        error message or null
      • addModelChange

        public void addModelChange​(String tableName,
                                   ModelValidator listener)
        Add Model Change Listener
        Parameters:
        tableName - table name
        listener - listener
      • removeModelChange

        public void removeModelChange​(String tableName,
                                      ModelValidator listener)
        Remove Model Change Listener
        Parameters:
        tableName - table name
        listener - listener
      • fireModelChange

        public String fireModelChange​(PO po,
                                      int changeType)
        Fire Model Change. Call modelChange method of added validators
        Parameters:
        po - persistent objects
        changeType - ModelValidator.TYPE_*
        Returns:
        error message or NULL for no veto
      • addDocValidate

        public void addDocValidate​(String tableName,
                                   ModelValidator listener)
        Add Document Validation Listener
        Parameters:
        tableName - table name
        listener - listener
      • removeDocValidate

        public void removeDocValidate​(String tableName,
                                      ModelValidator listener)
        Remove Document Validation Listener
        Parameters:
        tableName - table name
        listener - listener
      • fireDocValidate

        public String fireDocValidate​(PO po,
                                      int docTiming)
        Fire Document Validation. Call docValidate method of added validators
        Parameters:
        po - persistent objects
        docTiming - see ModelValidator.TIMING_ constants
        Returns:
        error message or null
      • addFactsValidate

        public void addFactsValidate​(String tableName,
                                     FactsValidator listener)
        Add Accounting Facts Validation Listener
        Parameters:
        tableName - table name
        listener - listener
      • addImportValidate

        public void addImportValidate​(String importTableName,
                                      ImportValidator listener)
        Add Date Import Validation Listener
        Parameters:
        importTableName - table name
        listener - listener
      • removeFactsValidate

        public void removeFactsValidate​(String tableName,
                                        FactsValidator listener)
        Remove Accounting Facts Validation Listener
        Parameters:
        tableName - table name
        listener - listener
      • fireFactsValidate

        public String fireFactsValidate​(MAcctSchema schema,
                                        List<Fact> facts,
                                        PO po)
        Fire Accounting Facts Validation. Call factsValidate method of added validators
        Parameters:
        schema -
        facts -
        po -
        Returns:
        error message or null
      • fireImportValidate

        public void fireImportValidate​(ImportProcess process,
                                       PO importModel,
                                       PO targetModel,
                                       int timing)
        Fire Import Validation. Call ImportValidator.validate(ImportProcess, Object, Object, int) or registered validators.
        Parameters:
        process - import process
        importModel - import record (e.g. X_I_BPartner)
        targetModel - target model (e.g. MBPartner, MBPartnerLocation, MUser)
        timing - see ImportValidator.TIMING_* constants
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class Object
        Returns:
        info
      • getInfoDetail

        public StringBuffer getInfoDetail​(StringBuffer sb,
                                          Properties ctx)
        Create Model Validators Info
        Parameters:
        sb - optional string buffer
        ctx - context
        Returns:
        Model Validators Info author Teo Sarca, FR [ 1724662 ]
      • beforeSaveProperties

        public void beforeSaveProperties()
        Before Save Properties for selected client.