Class DefaultClassifiedService

java.lang.Object
org.silverpeas.components.classifieds.service.DefaultClassifiedService
All Implemented Interfaces:
ClassifiedService, org.silverpeas.core.ApplicationService

@Service @Named("classifiedsService") public class DefaultClassifiedService extends Object implements ClassifiedService
Services provided by the Classified Silverpeas component.
  • Field Details

  • Constructor Details

    • DefaultClassifiedService

      public DefaultClassifiedService()
  • Method Details

    • 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.kernel.bundle.SettingBundle getComponentSettings()
      Specified by:
      getComponentSettings in interface org.silverpeas.core.ApplicationService
    • getComponentMessages

      public org.silverpeas.kernel.bundle.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
    • createClassified

      public String createClassified(ClassifiedDetail classified)
      Description copied from interface: ClassifiedService
      create a classified
      Specified by:
      createClassified in interface ClassifiedService
      Parameters:
      classified - : ClassifiedDetail
      Returns:
      classifiedId : String
    • 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
    • getAllClassifieds

      public Collection<ClassifiedDetail> getAllClassifieds(String instanceId)
      Description copied from interface: ClassifiedService
      get all classifieds for an instance corresponding to instanceId
      Specified by:
      getAllClassifieds in interface ClassifiedService
      Parameters:
      instanceId - : String
      Returns:
      a collection of ClassifiedDetail
    • 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
    • getClassifiedsByUser

      public List<ClassifiedDetail> getClassifiedsByUser(String instanceId, String userId)
      Description copied from interface: ClassifiedService
      get all classifieds for user and instance corresponding to userId and instanceId
      Specified by:
      getClassifiedsByUser in interface ClassifiedService
      Parameters:
      instanceId - : String
      userId - : String
      Returns:
      a collection of ClassifiedDetail
    • getClassifiedsToValidate

      public List<ClassifiedDetail> getClassifiedsToValidate(String instanceId)
      Description copied from interface: ClassifiedService
      get all classifieds to validate for an instance corresponding to instanceId
      Specified by:
      getClassifiedsToValidate in interface ClassifiedService
      Parameters:
      instanceId - : String
      Returns:
      a Collection of ClassifiedDetail
    • 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
    • sendSubscriptionsNotification

      public void sendSubscriptionsNotification(String field1, String field2, ClassifiedDetail classified)
      Description copied from interface: ClassifiedService
      send a notification for subscribers to field1 and field2 when classified modified
      Specified by:
      sendSubscriptionsNotification in interface ClassifiedService
      Parameters:
      field1 - the first classified field
      field2 - the second classified field
    • getAllClassifiedsToUnpublish

      public Collection<ClassifiedDetail> getAllClassifiedsToUnpublish(int nbDays, String instanceId)
      Description copied from interface: ClassifiedService
      get all expiring classifieds (corresponding of a number of day nbDays)
      Specified by:
      getAllClassifiedsToUnpublish in interface ClassifiedService
      Parameters:
      nbDays - : int
      instanceId - : classified component instance id
      Returns:
      a collection of ClassifiedDetail
    • 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
    • deleteIndex

      public void deleteIndex(ClassifiedDetail classified)
    • 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
    • createSubscribe

      public void createSubscribe(Subscribe subscribe)
      Description copied from interface: ClassifiedService
      create a subscription
      Specified by:
      createSubscribe in interface ClassifiedService
      Parameters:
      subscribe - : Subscribe
    • deleteSubscribe

      public void deleteSubscribe(String subscribeId)
      Description copied from interface: ClassifiedService
      delete a subscription corresponding to subscribeId
      Specified by:
      deleteSubscribe in interface ClassifiedService
      Parameters:
      subscribeId - : String
    • checkSubscription

      public boolean checkSubscription(Subscribe subscribe)
    • getSubscribesByUser

      public Collection<Subscribe> getSubscribesByUser(String instanceId, String userId)
      Description copied from interface: ClassifiedService
      get all subscriptions for user and instance corresponding to userId and instanceId
      Specified by:
      getSubscribesByUser in interface ClassifiedService
      Parameters:
      instanceId - : String
      userId - : String
      Returns:
      a collection of Subscribe
    • getUsersBySubscribe

      public Collection<String> getUsersBySubscribe(String instanceId, String field1, String field2)
      Description copied from interface: ClassifiedService
      get all subscribing users to a search corresponding to fields field1 and field2
      Specified by:
      getUsersBySubscribe in interface ClassifiedService
      field1 - : String
      field2 - : String
      Returns:
      a collection of userId (String)
    • getAllSubscribes

      public Collection<Subscribe> getAllSubscribes(String instanceId)
    • 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)
      Specified by:
      getAllValidClassifieds in interface ClassifiedService
    • getAllValidClassifieds

      public List<ClassifiedDetail> getAllValidClassifieds(String instanceId, 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
      searchField1 - : name of the search field 1
      searchField2 - : name of the search field 2
      firstItemIndex - : index of first item to display
      elementsPerPage - : the number of items to render per page
      Returns:
      a collection of ClassifiedDetail
    • setClassification

      public void setClassification(ClassifiedDetail classified, String searchField1, String searchField2, String xmlFormName)
      Specified by:
      setClassification in interface ClassifiedService