Class DefaultClassifiedService

  • All Implemented Interfaces:
    ClassifiedService, org.silverpeas.core.ApplicationService

    @Service
    @Named("classifiedService")
    public class DefaultClassifiedService
    extends Object
    implements ClassifiedService
    Services provided by the Classified Silverpeas component.
    • Constructor Detail

      • DefaultClassifiedService

        public DefaultClassifiedService()
    • Method Detail

      • getContributionById

        public Optional<ClassifiedDetail> getContributionById​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId)
        Specified by:
        getContributionById in interface org.silverpeas.core.ApplicationService
        Specified by:
        getContributionById in interface ClassifiedService
      • getComponentSettings

        public org.silverpeas.core.util.SettingBundle getComponentSettings()
        Specified by:
        getComponentSettings in interface org.silverpeas.core.ApplicationService
      • getComponentMessages

        public org.silverpeas.core.util.LocalizationBundle getComponentMessages​(String language)
        Specified by:
        getComponentMessages in interface org.silverpeas.core.ApplicationService
      • isRelatedTo

        public boolean isRelatedTo​(String instanceId)
        Specified by:
        isRelatedTo in interface org.silverpeas.core.ApplicationService
      • deleteClassified

        public void deleteClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId)
        Description copied from interface: ClassifiedService
        delete the classified corresponding to classifiedId
        Specified by:
        deleteClassified in interface ClassifiedService
        Parameters:
        classifiedId - the unique identifier of the classified.
      • unpublishClassified

        public void unpublishClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId)
        Description copied from interface: ClassifiedService
        Unpublish a subscription corresponding to classifiedId
        Specified by:
        unpublishClassified in interface ClassifiedService
        Parameters:
        classifiedId - the unique identifier of a classified
      • deleteAllClassifieds

        public void deleteAllClassifieds​(String instanceId)
        Description copied from interface: ClassifiedService
        delete all classifieds for the instance corresponding to instanceId
        Specified by:
        deleteAllClassifieds in interface ClassifiedService
        Parameters:
        instanceId - : String
      • updateClassified

        public void updateClassified​(ClassifiedDetail classified,
                                     boolean notify)
        Description copied from interface: ClassifiedService
        update the classified and send notification if notify is true
        Specified by:
        updateClassified in interface ClassifiedService
        Parameters:
        classified - : ClassifiedDetail
        notify - : boolean
      • getNbTotalClassifieds

        public String getNbTotalClassifieds​(String instanceId)
        Description copied from interface: ClassifiedService
        get the number of classifieds for an instance corresponding to instanceId
        Specified by:
        getNbTotalClassifieds in interface ClassifiedService
        Parameters:
        instanceId - : String
        Returns:
        the number of classified : String
      • validateClassified

        public void validateClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId,
                                       String userId)
        Description copied from interface: ClassifiedService
        pass to status validate because the user corresponding to userId validated the classified corresponding to classifiedId
        Specified by:
        validateClassified in interface ClassifiedService
        Parameters:
        classifiedId - the unique identifier of a classified.
        userId - the unique identifier of the user validating the classified.
      • refusedClassified

        public void refusedClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId,
                                      String userId,
                                      String refusalMotive)
        Description copied from interface: ClassifiedService
        pass to status refused because the user corresponding to userId refused the classified corresponding to classifiedId for the given motive.
        Specified by:
        refusedClassified in interface ClassifiedService
        Parameters:
        classifiedId - unique identifier of a classified
        userId - unique identifier of the user refusing the classified
        refusalMotive - the text about the motive of the refusal
      • search

        public List<ClassifiedDetail> search​(org.silverpeas.core.index.search.model.QueryDescription query)
        Description copied from interface: ClassifiedService
        search all classifieds corresponding to the query
        Specified by:
        search in interface ClassifiedService
        Parameters:
        query - the query from which the search will be performed.
        Returns:
        a collection of ClassifiedDetail
      • indexClassifieds

        public void indexClassifieds​(String instanceId)
        Description copied from interface: ClassifiedService
        index all the classifieds for the instance corresponding to instanceId
        Specified by:
        indexClassifieds in interface ClassifiedService
        Parameters:
        instanceId - : String
      • draftOutClassified

        public void draftOutClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId,
                                       String profile,
                                       boolean isValidationEnabled)
        Description copied from interface: ClassifiedService
        take out draft mode the classified corresponding to classified
        Specified by:
        draftOutClassified in interface ClassifiedService
        Parameters:
        classifiedId - the unique identifier of the classified
        profile - a role profile of the user performing the action.
        isValidationEnabled - is the validation enabled?
      • draftInClassified

        public void draftInClassified​(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId)
        Description copied from interface: ClassifiedService
        pass the classified corresponding to classifiedId in draft mode
        Specified by:
        draftInClassified in interface ClassifiedService
        Parameters:
        classifiedId - the unique identifier of the classified
      • checkSubscription

        public boolean checkSubscription​(Subscribe subscribe)
      • deleteAllSubscribes

        public void deleteAllSubscribes​(String instanceId)
        Description copied from interface: ClassifiedService
        delete all subscriptions for the instance corresponding to instanceId
        Specified by:
        deleteAllSubscribes in interface ClassifiedService
        Parameters:
        instanceId - unique identifier of a component instance.
      • getAllValidClassifieds

        public List<ClassifiedDetail> getAllValidClassifieds​(String instanceId,
                                                             Map<String,​String> mapFields1,
                                                             Map<String,​String> mapFields2,
                                                             String searchField1,
                                                             String searchField2,
                                                             int firstItemIndex,
                                                             int elementsPerPage)
        Description copied from interface: ClassifiedService
        get all valid classifieds
        Specified by:
        getAllValidClassifieds in interface ClassifiedService
        Parameters:
        instanceId - : String
        mapFields1 - : HashMap des champs de recherche 1
        mapFields2 - : HashMap des champs de recherche 1
        searchField1 - : champ de recherche 1
        searchField2 - : champ de recherche 2
        firstItemIndex - : index of first item to display
        elementsPerPage - : nombre d'éléments à afficher par page
        Returns:
        a collection of ClassifiedDetail