com.jalios.jcms
Interface DataController

All Superinterfaces:
Comparable
All Known Implementing Classes:
BasicDataController, BookmarkDataController, CSRequestController, CSSlaveDataController, CSWorkspaceController, DBCommentController, DesktopDataController, ForumMemberController, ODDataController, PollController, PollVoteController, TrackerDataController, UnzipDataController, WikiPageController

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: 21720 $
Author:
Olivier Dedieu

Field Summary
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_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_INTEGRITY_CHECK
          DataController's context map key to use in order to disable integrity check during operations.
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_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 DO_NOT_STORE
          DataController's context map key to use in order to cancel write operation.
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
 
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_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
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

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-2007 Jalios SA. All Rights Reserved.