Class PublicationListener

    • Field Detail

      • titleToPubSetMap

        protected java.util.HashMap<java.lang.String,​java.util.HashSet<Publication>> titleToPubSetMap
    • Constructor Detail

      • PublicationListener

        public PublicationListener()
    • Method Detail

      • handleCommitUpdate

        public void handleCommitUpdate​(Storable storable,
                                       Storable oldStorable,
                                       boolean firstTime)
        Description copied from interface: StoreListener
        This method gets called when after a storable has been updated.
        Specified by:
        handleCommitUpdate in interface StoreListener
        Overrides:
        handleCommitUpdate in class BasicStoreListener
        Parameters:
        storable - the storable, this instance is the object that was created at first and that will be stored in jcms until deletion of the storable with this ID. You should always manipulate this object if you maintain any index.
        oldStorable - the previous version of the storable, it is a clone, do not use in any index, it should only be used to access old values.
        firstTime - true if it is the first time this operation is processed
        See Also:
        StoreListener.handleCommitUpdate(Storable, Storable, boolean)
      • updateMemberIndex

        protected void updateMemberIndex​(Publication pub,
                                         boolean isContent,
                                         boolean add)
      • updateCategoryIndex

        protected void updateCategoryIndex​(Publication pub,
                                           boolean isContent,
                                           boolean add)
      • updateWorkspaceIndex

        public void updateWorkspaceIndex​(Publication pub,
                                         boolean add)
      • updateAuthGroupSet

        protected void updateAuthGroupSet​(Publication pub,
                                          boolean add)
      • updateFriendlyURLs

        protected void updateFriendlyURLs​(Publication pub)
      • removeFriendlyURLs

        protected void removeFriendlyURLs​(Publication pub)
      • updateWorkCopySet

        protected void updateWorkCopySet​(Publication pub)
      • removeWorkCopySet

        protected void removeWorkCopySet​(Publication pub)
      • updatePublicationTitlesIndex

        protected void updatePublicationTitlesIndex​(Publication pub,
                                                    Publication indexedPub,
                                                    boolean add)
        Method to update the title to publications index Map. To be called on handleCreate and handleDelete.
        Important Note: pub and indexedPub are always the same for create and delete operations. But when doing an update operation, first we want to remove the old version (which is a clone) and then we want to add the original but updated one, therefore: first: pub is the oldStorable (in which we look for the information to remove from index), indexedPub is the object to add or remove from the index, which is always the same object during the life of JCMS, that is the first created, storable. second: as for a create operation pub and indexedPub are the same (the storable).
        Parameters:
        pub - the publication in which to look for
        indexedPub - the publication to add or to remove to the index
        add - whether to add (create) or to remove (delete) the publication from the index
        Since:
        jcms-5.5.0
      • replacePublicationInTitlesIndex

        protected void replacePublicationInTitlesIndex​(Publication oldPub,
                                                       Publication newPub)
        Method to update the title to publications index Map. To be called on handleCreate and handleDelete.
        Parameters:
        oldPub - the publication as it was before the update (its title will be removed)
        newPub - the publication as it is now (its title will be added)
        Since:
        jcms-5.5.0
      • getPublicationSetFromTitle

        public java.util.HashSet<Publication> getPublicationSetFromTitle​(java.lang.String title)
        Return a set of Publications matching the given title.
        Parameters:
        title - the title of the publications to find.
        Returns:
        a new instance of HashSet containing Publication
        Since:
        jcms-5.5.0