com.jalios.jcms
Interface DataController

All Superinterfaces:
Comparable
All Known Implementing Classes:
BasicDataController, PortletQueryForeachDataController, PublicationFollowerController, UnzipDataController

public interface DataController
extends Comparable

A DataController is notified whenever data integrity must be checked, write (create, update, delete, ...) must be accepted, before and after the write is performed.

Since:
jcms-5.0.0
Version:
$Revision: 28799 $
Author:
Olivier Dedieu

Field Summary
static String CTXT_DBMEMBER_CONVERT_TO_MEMBER
          DataController's context map key used to indicate that the operation is convertion from DBMember to Member.
static String CTXT_DOC_DIRECTORY
          DataController's context map key used to indicate that the operation is an being performed on all files of a directory.
static String CTXT_DOC_PSTATUS_CONTROL
          DataController's context map key used to indicate that the operation is an being performed on control the pstatus of the FileDocument from its referer.
static String CTXT_DOC_UNZIP
          DataController's context map key used to indicate that the operation is an being performed by unzipping a document.
static String CTXT_DOC_UPLOAD
          DataController's context map key used to indicate that the operation is an upload operation (from the web interface).
static String CTXT_FORCE_DELETE
          DataController's context map key to use in order to force delete operations (used by member, publication or workspace).
static String CTXT_IGNORE_DBDATA_MODIFICATION_CHECK
          DataController's context map key to use in order to disable the DBData modification check during update operations.
static String CTXT_IGNORE_INTEGRITY_CHECK
          DataController's context map key to use in order to disable integrity check during operations.
static String CTXT_IS_BATCH_OPERATION
          DataController's context map key used to indicate that the operation is batch operation requiring high performance processing (e.g caddy).
static String CTXT_MAIL_FETCHER
          DataController's context map key used to indicate that the operation is performed in the scope of a Mail Fetching.
static String CTXT_ORIGINAL_DATA
          DataController's context map key used to indicate that the operation is a duplication of an existing data.
static String CTXT_PREVIOUS_DATA
          DataController's context map key available in afterWrite() to provide a clone of the modified data (only if op == OP_UPDATE).
static String CTXT_REST
          DataController's context map key used to indicate that the operation is a rest operation.
static String CTXT_WEBDAV
          DataController's context map key used to indicate that the operation is a webdav operation.
static String CTXT_WIZARD
          DataController's context map key used to link the WizardContext in the DataControler Map.
static String DO_NOT_STORE
          DataController's context map key to use in order to cancel write operation.
Must be used in beforeWrite(Data, int, Member, Map).
static String REVISION
           
 
Method Summary
 void afterWrite(Data data, int op, Member mbr, Map context)
          This method is called once the write operation has been performed.
 void beforeWrite(Data data, int op, Member mbr, Map context)
          This method is called before the write operation is performed.
 ControllerStatus checkIntegrity(Data data)
          Checks if the given data respects constraints integrity
 ControllerStatus checkWrite(Data data, int op, Member mbr, boolean checkIntegrity, Map context)
          Checks if the given write operation can be performed
 void processFieldStatusMap(Data data, Member mbr, Map<String,FieldStatus> map)
          This method is called to fill the map of FieldStatus for the given data.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

REVISION

static final String REVISION
See Also:
Constant Field Values

DO_NOT_STORE

static final String DO_NOT_STORE
DataController's context map key to use in order to cancel write operation.
Must be used in beforeWrite(Data, int, Member, Map).

Since:
jcms-5.0.4
See Also:
Constant Field Values

CTXT_IGNORE_INTEGRITY_CHECK

static final String CTXT_IGNORE_INTEGRITY_CHECK
DataController's context map key to use in order to disable integrity check during operations.
Warning: This is potentially very dangerous !!! Be sure of what you do if you use it.

Since:
jcms-5.0.4
See Also:
Constant Field Values

CTXT_FORCE_DELETE

static final String CTXT_FORCE_DELETE
DataController's context map key to use in order to force delete operations (used by member, publication or workspace).
Warning: This is potentially very dangerous !!! Be sure of what you do if you use it.

Since:
jcms-5.5.0
See Also:
Constant Field Values

CTXT_WEBDAV

static final String CTXT_WEBDAV
DataController's context map key used to indicate that the operation is a webdav operation.

Since:
jcms-5.5.0
See Also:
Constant Field Values

CTXT_REST

static final String CTXT_REST
DataController's context map key used to indicate that the operation is a rest operation.

Since:
jcms-6.0
See Also:
Constant Field Values

CTXT_DOC_UPLOAD

static final String CTXT_DOC_UPLOAD
DataController's context map key used to indicate that the operation is an upload operation (from the web interface).

Since:
jcms-5.5.0
See Also:
Constant Field Values

CTXT_DOC_UNZIP

static final String CTXT_DOC_UNZIP
DataController's context map key used to indicate that the operation is an being performed by unzipping a document.

If this key is present in the context map, the value in the Map will contains the original FileDocument (which may not have been created in the store and may not be).

Since:
jcms-5.7.3
See Also:
Constant Field Values

CTXT_DOC_DIRECTORY

static final String CTXT_DOC_DIRECTORY
DataController's context map key used to indicate that the operation is an being performed on all files of a directory.

If this key is present in the context map, the value in the Map will contains the File instance pointing to the directory being worked on.

Since:
jcms-5.7.3
See Also:
Constant Field Values

CTXT_DOC_PSTATUS_CONTROL

static final String CTXT_DOC_PSTATUS_CONTROL
DataController's context map key used to indicate that the operation is an being performed on control the pstatus of the FileDocument from its referer.

Since:
jcms-6.1.0
See Also:
Constant Field Values

CTXT_PREVIOUS_DATA

static final String CTXT_PREVIOUS_DATA
DataController's context map key available in afterWrite() to provide a clone of the modified data (only if op == OP_UPDATE).

Since:
jcms-6.1.0
See Also:
Constant Field Values

CTXT_ORIGINAL_DATA

static final String CTXT_ORIGINAL_DATA
DataController's context map key used to indicate that the operation is a duplication of an existing data. The bound value is the original data.

Since:
jcms-5.7.4
See Also:
Constant Field Values

CTXT_IS_BATCH_OPERATION

static final String CTXT_IS_BATCH_OPERATION
DataController's context map key used to indicate that the operation is batch operation requiring high performance processing (e.g caddy).

Since:
jcms-6.1.0
See Also:
Constant Field Values

CTXT_WIZARD

static final String CTXT_WIZARD
DataController's context map key used to link the WizardContext in the DataControler Map.

Since:
jcms-6.1.0
See Also:
Constant Field Values

CTXT_MAIL_FETCHER

static final String CTXT_MAIL_FETCHER
DataController's context map key used to indicate that the operation is performed in the scope of a Mail Fetching. The Map is shared between DataControllers and MailPolicyFilter.

Since:
jcms-6.1.0
See Also:
Constant Field Values

CTXT_DBMEMBER_CONVERT_TO_MEMBER

static final String CTXT_DBMEMBER_CONVERT_TO_MEMBER
DataController's context map key used to indicate that the operation is convertion from DBMember to Member.

Since:
jcms-6.1.
See Also:
Constant Field Values

CTXT_IGNORE_DBDATA_MODIFICATION_CHECK

static final String CTXT_IGNORE_DBDATA_MODIFICATION_CHECK
DataController's context map key to use in order to disable the DBData modification check during update operations. Without this check, DBData are always updated in database, even when no field has been detected as modified through signature comparison.

Since:
jcms-7.0.0
See Also:
Constant Field Values
Method Detail

checkIntegrity

ControllerStatus checkIntegrity(Data data)
Checks if the given data respects constraints integrity

Parameters:
data - the data to be checked
Returns:
a ControllerStatus
Since:
jcms-5.0.0

checkWrite

ControllerStatus checkWrite(Data data,
                            int op,
                            Member mbr,
                            boolean checkIntegrity,
                            Map context)
Checks if the given write operation can be performed

Parameters:
data - the data involved by this operation
op - the operation (OP_CREATE, OP_UPDATE, ...)
mbr - the member which requests the write operation
checkIntegrity - if true, requires the constraints integrity to be checked
context - a map which contains context parameters (may be null)
Returns:
a ControllerStatus
Since:
jcms-5.0.0

processFieldStatusMap

void processFieldStatusMap(Data data,
                           Member mbr,
                           Map<String,FieldStatus> map)
This method is called to fill the map of FieldStatus for the given data. The key of the map in the name of the field.

Parameters:
data - the data
mbr - the member which requests the data
map - the map of FieldStatus
Since:
jcms-6.0.1

beforeWrite

void beforeWrite(Data data,
                 int op,
                 Member mbr,
                 Map context)
This method is called before the write operation is performed. The DataController can prevent the objet to be write in the store by setting the attribute DataController.DO_NOT_STORE to Boolean.TRUE in the context.

Parameters:
data - the data which will be written
op - the operation (OP_CREATE, OP_UPDATE, ...)
mbr - the member which requests the write operation
context - a map which contains context parameters (may be null)
Since:
jcms-5.0.0

afterWrite

void afterWrite(Data data,
                int op,
                Member mbr,
                Map context)
This method is called once the write operation has been performed.

Parameters:
data - the data which will be written
op - the operation (OP_CREATE, OP_UPDATE, ...)
mbr - the member which requests the write operation
context - a map which contains context parameters (may be null)
Since:
jcms-5.0.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.