Interface DataController

All Superinterfaces:
Comparable
All Known Implementing Classes:
AlertController, BasicDataController, ContentController, JPortalPortletFieldStatusController, JPortalStructureDataController, MailMessageDataController, MediaProgressionDataController, MentionController, PortletJspDataController, PortletQueryForeachDataController, PublicationFollowerController, QuotaDataController, RecentHistoryDataController, RecommendationController, SecurityAlertMemberDataController, UnzipDataController, VoteDataController, WFDataController

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
Author:
Olivier Dedieu
  • Field Details

    • 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:
    • 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:
    • CTXT_SKIP_CSRF_CHECK

      static final String CTXT_SKIP_CSRF_CHECK
      DataController's context map key to use in order to skip CSRF check during operations performed through HTTP request.
      Warning: This is potentially very dangerous !!! Be sure of what you do if you use it.
      See Also:
    • 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:
    • 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:
    • 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:
    • CTXT_DOC_UPLOAD_NEW_FILE

      static final String CTXT_DOC_UPLOAD_NEW_FILE
      DataController's context map key used to indicate that the operation is an upload operation (from the web interface) and will generate a new file of file system (creation or orlder version are kept).
      Since:
      jcms-7.1.1
      See Also:
    • CTXT_DOC_UPLOAD_PREVIOUS_FILE

      static final String CTXT_DOC_UPLOAD_PREVIOUS_FILE
      DataController's context map key used to indicate that the previous File that will be replaced or updated by upload. This may be null.
      Since:
      jcms-10.0.6
      See Also:
    • CTXT_DOC_UPLOAD_ATTACHMENT

      static final String CTXT_DOC_UPLOAD_ATTACHMENT
      DataController's context map key used to indicate that the operation is an upload operation associated to another publication.
      Since:
      jcms-9.0.2
      See Also:
    • CTXT_DOC_UPLOAD_WYSIWYG_IMAGE_UPLOAD

      static final String CTXT_DOC_UPLOAD_WYSIWYG_IMAGE_UPLOAD
      DataController's context map key used to indicate that the operation is an upload operation performed from wysiwyg editor.
      Since:
      jcms-10.0.2 / JCMS-6769
      See Also:
    • CTXT_DOC_UPLOAD_UNIFIED_INSERT_UPLOAD

      static final String CTXT_DOC_UPLOAD_UNIFIED_INSERT_UPLOAD
      DataController's context map key used to indicate that the operation is an upload operation performed from wysiwyg editor.
      Since:
      jcms-10.0.2 / JCMS-6769
      See Also:
    • 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:
    • 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:
    • CTXT_DOC_DOCUMENTS_COLLECTION

      static final String CTXT_DOC_DOCUMENTS_COLLECTION
      DataController's context map key used to retrieve the collection of documents that were created by using the same context.

      This key is filled for batch operation such as Unzipping or filedocument creation from Directory.

      If this key is present in the context map, the value is a Collection of FileDocument.

      Since:
      jcms-10.0.3
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • CTXT_IS_SILENT_WRITE

      static final String CTXT_IS_SILENT_WRITE
      DataController's context map key used to indicate that the operation is a silent write and it must not been notified to the members (eg Publication Follower, ESN Activity, ...)
      Since:
      jcms-10.0.0
      See Also:
    • 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:
    • 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:
    • 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:
    • 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:
    • CTXT_CREATE_COPY

      static final Object CTXT_CREATE_COPY
      DataController's context map key to use in order to detect wether a publication is created from a copy or from a real create
      Since:
      jcms-9.0.2
    • CTXT_WORK_COPY_MERGE

      static final Object CTXT_WORK_COPY_MERGE
      DataController's context map key to use in order to detect wether a publication is the result of a merge of a workcopy
      Since:
      jcms-9.0.3
    • CTXT_SAVE_ACTION_TO_ANALYTICS

      static final Object CTXT_SAVE_ACTION_TO_ANALYTICS
      DataController's context map key to use in order to save or not the current action in analytics
      Since:
      jcms-10.0.3
    • CTXT_SYNC_LDAP

      static final String CTXT_SYNC_LDAP
      DataController's context map key to use in order to indicate this is an LDAP synchronization operation.
      Since:
      jcms-10.0.5
      See Also:
    • CTXT_BYPASS_GIVE_UP_RIGHTS_CHECKING

      static final String CTXT_BYPASS_GIVE_UP_RIGHTS_CHECKING
      DataController's context map key to bypass give up of read rights on Publication
      Since:
      jcms-10.0.6
      See Also:
    • CTXT_IS_LOCK_OPERATION

      static final String CTXT_IS_LOCK_OPERATION
      DataController's context map key to use in order to indicate this is an Unlock publication operation.
      Since:
      jcms-10.0.9 / JCMS-11173
      See Also:
    • CTXT_IS_UNLOCK_OPERATION

      static final String CTXT_IS_UNLOCK_OPERATION
      DataController's context map key to use in order to indicate this is an Unlock publication operation.
      Since:
      jcms-10.0.8 / JCMS-9978
      See Also:
    • CTXT_FORBID_UPDATESRIGHT_WITHOUT_READRIGHTS

      static final String CTXT_FORBID_UPDATESRIGHT_WITHOUT_READRIGHTS
      DataController's context map key to use in order to bypass, in Publication.checkWrite(int, Member, boolean, Map), the control forbidding a writer to set update right with member(s) not authorized to read the Publication (JCMS-8940).
      Since:
      JCMS-12120
      See Also:
    • CTXT_CHECK_BAD_ROLE_ASSIGNMENT

      static final String CTXT_CHECK_BAD_ROLE_ASSIGNMENT
      DataController's context map key to use in order to bypass, in Publication.checkWrite(int, Member, boolean, Map), the control checking that member(s) newly added in the Publication's role map are authorized to read the Publication.
      Since:
      JCMS-12120
      See Also:
  • Method Details

    • 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 that was written
      op - the operation (OP_CREATE, OP_UPDATE, ...)
      mbr - the member who requested the write operation
      context - a map which contains context parameters (may be null)
      Since:
      jcms-5.0.0