Class BasicDataController

    • Field Detail

      • order

        protected int order
      • channel

        protected Channel channel
    • Constructor Detail

      • BasicDataController

        public BasicDataController()
        Constructs a BasicDataController with order = 0
        Since:
        jcms-5.0.0
      • BasicDataController

        public BasicDataController​(int order)
        Constructs a BasicDataController with the given order
        Parameters:
        order - the order
        Since:
        jcms-5.5.0
    • Method Detail

      • init

        public boolean init​(Plugin plugin)
        Description copied from interface: PluginComponent
        Initialize the component with the given plugin configuration
        Specified by:
        init in interface PluginComponent
        Parameters:
        plugin - the calling plugin
        Returns:
        true if the component has been correctly initialized.
        Since:
        jcms-5.7.1
        See Also:
        PluginComponent.init(Plugin)
      • checkIntegrity

        public ControllerStatus checkIntegrity​(Data data)
        Checks if the given data respects constraints integrity
        Specified by:
        checkIntegrity in interface DataController
        Parameters:
        data - the data to be checked
        Returns:
        a ControllerStatus
        Since:
        jcms-5.0.0
      • checkWrite

        public ControllerStatus checkWrite​(Data data,
                                           int op,
                                           Member mbr,
                                           boolean checkIntegrity,
                                           java.util.Map context)
        Checks if the given write operation can be performed
        Specified by:
        checkWrite in interface DataController
        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

        public void processFieldStatusMap​(Data data,
                                          Member mbr,
                                          java.util.Map<java.lang.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.
        Specified by:
        processFieldStatusMap in interface DataController
        Parameters:
        data - the data
        mbr - the member which requests the data
        map - the map of FieldStatus
        Since:
        jcms-6.0.1
      • beforeWrite

        public void beforeWrite​(Data data,
                                int op,
                                Member mbr,
                                java.util.Map context)
        This method is called before the write operation is performed.
        Specified by:
        beforeWrite in interface DataController
        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

        public void afterWrite​(Data data,
                               int op,
                               Member mbr,
                               java.util.Map context)
        This method is called once the write operation has been performed.
        Specified by:
        afterWrite in interface DataController
        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
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Compare this object with the specified object for order.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        obj - the Object to be compared.
        See Also:
        Comparable.compareTo(java.lang.Object)
      • equals

        public boolean equals​(java.lang.Object obj)
        Indicates wheter some other object is "equal to" this one. The comparison is performed with compareTo() method.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the Object to be compared.
      • checkFieldMLRequired

        protected ControllerStatus checkFieldMLRequired​(Publication pub,
                                                        java.lang.String fieldName,
                                                        java.lang.String value,
                                                        java.util.HashMap valueML)
        This convenient method checks if the given multilingual field is required.
        Parameters:
        pub - the publication
        fieldName - the name of the field
        value - the value of the field
        valueML - the ML value of the field
        Returns:
        a ControllerStatus
        Since:
        jcms-6.0.1
      • checkFieldRequired

        protected ControllerStatus checkFieldRequired​(Publication pub,
                                                      java.lang.String fieldName,
                                                      java.lang.String value)
        This convenient method checks if the given field is required.
        Parameters:
        pub - the publication
        fieldName - the name of the field
        value - the value of the field
        Returns:
        a ControllerStatus
        Since:
        jcms-6.0.1
      • updateFieldStatusMap

        protected void updateFieldStatusMap​(java.util.Map<java.lang.String,​FieldStatus> map,
                                            java.lang.String fieldName,
                                            FieldStatus status)
        This convenient methods update a FieldStatus map with the given status
        Parameters:
        map - the FieldStatus map
        fieldName - the name of the field (i.e. the key of the map)
        status - the FieldStatus to be added
        Since:
        jcms-6.0.1
      • getOrder

        public int getOrder()
        Retrieve the order value used to sort BasicDataController.
        Returns:
        an integer value, default is 0
        Since:
        jcms-7.1