Package org.compiere.model
Interface ModelValidator
-
- All Known Implementing Classes:
ExportModelValidator,ProductPriceValidator,PromotionValidator,SalesMgmtValidator
public interface ModelValidatorModel Validator- Version:
- $Id: ModelValidator.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $ 2007/02/26 laydasalasc - globalqss - Add new timings for all before/after events on documents
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static intCHANGETYPE_CHANGEstatic intCHANGETYPE_DELETEstatic intCHANGETYPE_NEWstatic intDOCTIMING_AFTER_COMPLETEstatic intDOCTIMING_BEFORE_PREPAREstatic String[]documentEventTopicsstatic String[]documentEventValidatorsstatic String[]tableEventTopicsstatic String[]tableEventValidatorsstatic intTIMING_AFTER_CLOSECalled after document is closedstatic intTIMING_AFTER_COMPLETECalled after document is completedstatic intTIMING_AFTER_POSTCalled after document is postedstatic intTIMING_AFTER_PREPARECalled after document is preparedstatic intTIMING_AFTER_REACTIVATECalled after document is reactivatedstatic intTIMING_AFTER_REVERSEACCRUALCalled after document is reverseaccrualstatic intTIMING_AFTER_REVERSECORRECTCalled after document is reversecorrectstatic intTIMING_AFTER_VOIDCalled after document is voidstatic intTIMING_BEFORE_CLOSECalled before document is closestatic intTIMING_BEFORE_COMPLETECalled before document is completedstatic intTIMING_BEFORE_POSTCalled before document is postedstatic intTIMING_BEFORE_PREPARECalled before document is preparedstatic intTIMING_BEFORE_REACTIVATECalled before document is reactivatestatic intTIMING_BEFORE_REVERSEACCRUALCalled before document is reverseaccrualstatic intTIMING_BEFORE_REVERSECORRECTCalled before document is reversecorrectstatic intTIMING_BEFORE_VOIDCalled before document is voidstatic intTYPE_AFTER_CHANGEstatic intTYPE_AFTER_CHANGE_REPLICATIONstatic intTYPE_AFTER_DELETEstatic intTYPE_AFTER_NEWstatic intTYPE_AFTER_NEW_REPLICATIONstatic intTYPE_BEFORE_CHANGEModel Change Type Changestatic intTYPE_BEFORE_DELETEModel Change Type Deletestatic intTYPE_BEFORE_DELETE_REPLICATIONstatic intTYPE_BEFORE_NEWModel Change Type Newstatic intTYPE_CHANGEstatic intTYPE_DELETEstatic intTYPE_NEW
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringdocValidate(PO po, int timing)Validate Document.intgetAD_Client_ID()Get Client to be monitoredvoidinitialize(ModelValidationEngine engine, MClient client)Initialize ValidationStringlogin(int AD_Org_ID, int AD_Role_ID, int AD_User_ID)User logged in Called before preferences are setStringmodelChange(PO po, int type)Model Change of a monitored Table.
-
-
-
Field Detail
-
TYPE_BEFORE_NEW
static final int TYPE_BEFORE_NEW
Model Change Type New- See Also:
- Constant Field Values
-
TYPE_NEW
static final int TYPE_NEW
- See Also:
- Constant Field Values
-
CHANGETYPE_NEW
static final int CHANGETYPE_NEW
- See Also:
- Constant Field Values
-
TYPE_AFTER_NEW
static final int TYPE_AFTER_NEW
- See Also:
- Constant Field Values
-
TYPE_AFTER_NEW_REPLICATION
static final int TYPE_AFTER_NEW_REPLICATION
- See Also:
- Constant Field Values
-
TYPE_BEFORE_CHANGE
static final int TYPE_BEFORE_CHANGE
Model Change Type Change- See Also:
- Constant Field Values
-
TYPE_CHANGE
static final int TYPE_CHANGE
- See Also:
- Constant Field Values
-
CHANGETYPE_CHANGE
static final int CHANGETYPE_CHANGE
- See Also:
- Constant Field Values
-
TYPE_AFTER_CHANGE
static final int TYPE_AFTER_CHANGE
- See Also:
- Constant Field Values
-
TYPE_AFTER_CHANGE_REPLICATION
static final int TYPE_AFTER_CHANGE_REPLICATION
- See Also:
- Constant Field Values
-
TYPE_BEFORE_DELETE
static final int TYPE_BEFORE_DELETE
Model Change Type Delete- See Also:
- Constant Field Values
-
TYPE_DELETE
static final int TYPE_DELETE
- See Also:
- Constant Field Values
-
CHANGETYPE_DELETE
static final int CHANGETYPE_DELETE
- See Also:
- Constant Field Values
-
TYPE_AFTER_DELETE
static final int TYPE_AFTER_DELETE
- See Also:
- Constant Field Values
-
TYPE_BEFORE_DELETE_REPLICATION
static final int TYPE_BEFORE_DELETE_REPLICATION
- See Also:
- Constant Field Values
-
tableEventValidators
static final String[] tableEventValidators
-
tableEventTopics
static final String[] tableEventTopics
-
TIMING_BEFORE_PREPARE
static final int TIMING_BEFORE_PREPARE
Called before document is prepared- See Also:
- Constant Field Values
-
DOCTIMING_BEFORE_PREPARE
static final int DOCTIMING_BEFORE_PREPARE
- See Also:
- Constant Field Values
-
TIMING_BEFORE_VOID
static final int TIMING_BEFORE_VOID
Called before document is void- See Also:
- Constant Field Values
-
TIMING_BEFORE_CLOSE
static final int TIMING_BEFORE_CLOSE
Called before document is close- See Also:
- Constant Field Values
-
TIMING_BEFORE_REACTIVATE
static final int TIMING_BEFORE_REACTIVATE
Called before document is reactivate- See Also:
- Constant Field Values
-
TIMING_BEFORE_REVERSECORRECT
static final int TIMING_BEFORE_REVERSECORRECT
Called before document is reversecorrect- See Also:
- Constant Field Values
-
TIMING_BEFORE_REVERSEACCRUAL
static final int TIMING_BEFORE_REVERSEACCRUAL
Called before document is reverseaccrual- See Also:
- Constant Field Values
-
TIMING_BEFORE_COMPLETE
static final int TIMING_BEFORE_COMPLETE
Called before document is completed- See Also:
- Constant Field Values
-
TIMING_AFTER_PREPARE
static final int TIMING_AFTER_PREPARE
Called after document is prepared- See Also:
- Constant Field Values
-
TIMING_AFTER_COMPLETE
static final int TIMING_AFTER_COMPLETE
Called after document is completed- See Also:
- Constant Field Values
-
DOCTIMING_AFTER_COMPLETE
static final int DOCTIMING_AFTER_COMPLETE
- See Also:
- Constant Field Values
-
TIMING_AFTER_VOID
static final int TIMING_AFTER_VOID
Called after document is void- See Also:
- Constant Field Values
-
TIMING_AFTER_CLOSE
static final int TIMING_AFTER_CLOSE
Called after document is closed- See Also:
- Constant Field Values
-
TIMING_AFTER_REACTIVATE
static final int TIMING_AFTER_REACTIVATE
Called after document is reactivated- See Also:
- Constant Field Values
-
TIMING_AFTER_REVERSECORRECT
static final int TIMING_AFTER_REVERSECORRECT
Called after document is reversecorrect- See Also:
- Constant Field Values
-
TIMING_AFTER_REVERSEACCRUAL
static final int TIMING_AFTER_REVERSEACCRUAL
Called after document is reverseaccrual- See Also:
- Constant Field Values
-
TIMING_BEFORE_POST
static final int TIMING_BEFORE_POST
Called before document is posted- See Also:
- Constant Field Values
-
TIMING_AFTER_POST
static final int TIMING_AFTER_POST
Called after document is posted- See Also:
- Constant Field Values
-
documentEventValidators
static final String[] documentEventValidators
-
documentEventTopics
static final String[] documentEventTopics
-
-
Method Detail
-
initialize
void initialize(ModelValidationEngine engine, MClient client)
Initialize Validation- Parameters:
engine- validation engineclient- client
-
getAD_Client_ID
int getAD_Client_ID()
Get Client to be monitored- Returns:
- AD_Client_ID
-
login
String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID)
User logged in Called before preferences are set- Parameters:
AD_Org_ID- orgAD_Role_ID- roleAD_User_ID- user- Returns:
- error message or null
-
modelChange
String modelChange(PO po, int type) throws Exception
Model Change of a monitored Table. Called after PO.beforeSave/PO.beforeDelete when you called addModelChange for the table- Parameters:
po- persistent objecttype- TYPE_- Returns:
- error message or null
- Throws:
Exception- if the recipient wishes the change to be not accept.
-
docValidate
String docValidate(PO po, int timing)
Validate Document. Called as first step of DocAction.prepareIt or at the end of DocAction.completeIt when you called addDocValidate for the table. Note that totals, etc. may not be correct before the prepare stage.- Parameters:
po- persistent objecttiming- see TIMING_ constants- Returns:
- error message or null - if not null, the document will be marked as Invalid.
-
-