Compiere 3.1

org.compiere.api
Interface ModelValidator

All Known Implementing Classes:
MyValidator

public interface ModelValidator

Model Validator

Version:
$Id: ModelValidator.java,v 1.2 2006/07/30 00:58:18 jjanke Exp $
Author:
Jorg Janke

Field Summary
static int CHANGETYPE_CHANGE
          Model Change Type Change
static int CHANGETYPE_DELETE
          Model Change Type Delete
static int CHANGETYPE_NEW
          Model Change Type New
static int DOCTIMING_AFTER_COMPLETE
          Called after document is processed
static int DOCTIMING_BEFORE_PREPARE
          Called before document is prepared
 
Method Summary
 String docValidate(PO po, int docTiming)
          Validate Document.
 int getAD_Client_ID()
          Get Client to be monitored
 void initialize(int AD_Client_ID, ModelValidationEngine engine)
          Initialize Validation
 String login(int AD_Org_ID, int AD_Role_ID, int AD_User_ID)
          User logged in Called before preferences are set
 String modelChange(PO po, int changeType)
          Model Change of a monitored Table.
 boolean updateInfoColumns(ArrayList<Info_Column> columns, StringBuffer sqlFrom, StringBuffer sqlOrder)
          Update Info Window Columns
 

Field Detail

CHANGETYPE_NEW

static final int CHANGETYPE_NEW
Model Change Type New

See Also:
Constant Field Values

CHANGETYPE_CHANGE

static final int CHANGETYPE_CHANGE
Model Change Type Change

See Also:
Constant Field Values

CHANGETYPE_DELETE

static final int CHANGETYPE_DELETE
Model Change Type Delete

See Also:
Constant Field Values

DOCTIMING_BEFORE_PREPARE

static final int DOCTIMING_BEFORE_PREPARE
Called before document is prepared

See Also:
Constant Field Values

DOCTIMING_AFTER_COMPLETE

static final int DOCTIMING_AFTER_COMPLETE
Called after document is processed

See Also:
Constant Field Values
Method Detail

initialize

void initialize(int AD_Client_ID,
                ModelValidationEngine engine)
Initialize Validation

Parameters:
specific - AD_Client_ID or 0 for ALL
engine - validation engine

getAD_Client_ID

int getAD_Client_ID()
Get Client to be monitored

Returns:
AD_Client_ID or 0 for ALL

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 - org
AD_Role_ID - role
AD_User_ID - user
Returns:
error message or null

modelChange

String modelChange(PO po,
                   int changeType)
                   throws Exception
Model Change of a monitored Table. Called after PO.beforeSave/PO.beforeDelete when you called addModelChange for the table

Parameters:
po - persistent object
changeType - CHANGETYPE_
Returns:
error message or null
Throws:
Exception - if the recipient wishes the change to be not accept.

docValidate

String docValidate(PO po,
                   int docTiming)
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 object
docTiming - see DOCTIMING_ constants
Returns:
error message or null - if not null, the document will be marked as Invalid.

updateInfoColumns

boolean updateInfoColumns(ArrayList<Info_Column> columns,
                          StringBuffer sqlFrom,
                          StringBuffer sqlOrder)
Update Info Window Columns. - add new Columns - remove columns - change display sequence

Parameters:
columns - array of columns
sqlFrom - from clause, can be modified
sqlOrder - order by clause, can me modified
Returns:
true if you updated columns, sequence or sql From clause

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.