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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckSubscription(Subscribe subscribe) createClassified(ClassifiedDetail classified) create a classifiedvoidcreateSubscribe(Subscribe subscribe) create a subscriptionvoiddeleteAllClassifieds(String instanceId) delete all classifieds for the instance corresponding to instanceIdvoiddeleteAllSubscribes(String instanceId) delete all subscriptions for the instance corresponding to instanceIdvoiddeleteClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) delete the classified corresponding to classifiedIdvoiddeleteIndex(ClassifiedDetail classified) voiddeleteSubscribe(String subscribeId) delete a subscription corresponding to subscribeIdvoiddraftInClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) pass the classified corresponding to classifiedId in draft modevoiddraftOutClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId, String profile, boolean isValidationEnabled) take out draft mode the classified corresponding to classifiedgetAllClassifieds(String instanceId) get all classifieds for an instance corresponding to instanceIdgetAllClassifiedsToUnpublish(int nbDays, String instanceId) get all expiring classifieds (corresponding of a number of day nbDays)getAllSubscribes(String instanceId) getAllValidClassifieds(String instanceId) getAllValidClassifieds(String instanceId, String searchField1, String searchField2, int firstItemIndex, int elementsPerPage) get all valid classifiedsgetClassifiedsByUser(String instanceId, String userId) get all classifieds for user and instance corresponding to userId and instanceIdgetClassifiedsToValidate(String instanceId) get all classifieds to validate for an instance corresponding to instanceIdorg.silverpeas.kernel.bundle.LocalizationBundlegetComponentMessages(String language) org.silverpeas.kernel.bundle.SettingBundlegetContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) getNbTotalClassifieds(String instanceId) get the number of classifieds for an instance corresponding to instanceIdgetSubscribesByUser(String instanceId, String userId) get all subscriptions for user and instance corresponding to userId and instanceIdgetUsersBySubscribe(String instanceId, String field1, String field2) get all subscribing users to a search corresponding to fields field1 and field2voidindexClassifieds(String instanceId) index all the classifieds for the instance corresponding to instanceIdbooleanisRelatedTo(String instanceId) voidrefusedClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId, String userId, String refusalMotive) pass to status refused because the user corresponding to userId refused the classified corresponding to classifiedId for the given motive.search(org.silverpeas.core.index.search.model.QueryDescription query) search all classifieds corresponding to the queryvoidsendSubscriptionsNotification(String field1, String field2, ClassifiedDetail classified) send a notification for subscribers to field1 and field2 when classified modifiedvoidsetClassification(ClassifiedDetail classified, String searchField1, String searchField2, String xmlFormName) voidunpublishClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) Unpublish a subscription corresponding to classifiedIdvoidupdateClassified(ClassifiedDetail classified, boolean notify) update the classified and send notification if notify is truevoidvalidateClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId, String userId) pass to status validate because the user corresponding to userId validated the classified corresponding to classifiedId
-
Field Details
-
CLASSIFIED
- See Also:
-
CLASSIFIEDS_IN_APPLICATION
- See Also:
-
CLASSIFIED_TYPE
- See Also:
-
-
Constructor Details
-
DefaultClassifiedService
public DefaultClassifiedService()
-
-
Method Details
-
getContributionById
public Optional<ClassifiedDetail> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) - Specified by:
getContributionByIdin interfaceorg.silverpeas.core.ApplicationService- Specified by:
getContributionByIdin interfaceClassifiedService
-
getComponentSettings
public org.silverpeas.kernel.bundle.SettingBundle getComponentSettings()- Specified by:
getComponentSettingsin interfaceorg.silverpeas.core.ApplicationService
-
getComponentMessages
- Specified by:
getComponentMessagesin interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
- Specified by:
isRelatedToin interfaceorg.silverpeas.core.ApplicationService
-
createClassified
Description copied from interface:ClassifiedServicecreate a classified- Specified by:
createClassifiedin interfaceClassifiedService- Parameters:
classified- : ClassifiedDetail- Returns:
- classifiedId : String
-
deleteClassified
public void deleteClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) Description copied from interface:ClassifiedServicedelete the classified corresponding to classifiedId- Specified by:
deleteClassifiedin interfaceClassifiedService- Parameters:
classifiedId- the unique identifier of the classified.
-
unpublishClassified
public void unpublishClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId) Description copied from interface:ClassifiedServiceUnpublish a subscription corresponding to classifiedId- Specified by:
unpublishClassifiedin interfaceClassifiedService- Parameters:
classifiedId- the unique identifier of a classified
-
deleteAllClassifieds
Description copied from interface:ClassifiedServicedelete all classifieds for the instance corresponding to instanceId- Specified by:
deleteAllClassifiedsin interfaceClassifiedService- Parameters:
instanceId- : String
-
updateClassified
Description copied from interface:ClassifiedServiceupdate the classified and send notification if notify is true- Specified by:
updateClassifiedin interfaceClassifiedService- Parameters:
classified- : ClassifiedDetailnotify- : boolean
-
getAllClassifieds
Description copied from interface:ClassifiedServiceget all classifieds for an instance corresponding to instanceId- Specified by:
getAllClassifiedsin interfaceClassifiedService- Parameters:
instanceId- : String- Returns:
- a collection of ClassifiedDetail
-
getNbTotalClassifieds
Description copied from interface:ClassifiedServiceget the number of classifieds for an instance corresponding to instanceId- Specified by:
getNbTotalClassifiedsin interfaceClassifiedService- Parameters:
instanceId- : String- Returns:
- the number of classified : String
-
getClassifiedsByUser
Description copied from interface:ClassifiedServiceget all classifieds for user and instance corresponding to userId and instanceId- Specified by:
getClassifiedsByUserin interfaceClassifiedService- Parameters:
instanceId- : StringuserId- : String- Returns:
- a collection of ClassifiedDetail
-
getClassifiedsToValidate
Description copied from interface:ClassifiedServiceget all classifieds to validate for an instance corresponding to instanceId- Specified by:
getClassifiedsToValidatein interfaceClassifiedService- 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:ClassifiedServicepass to status validate because the user corresponding to userId validated the classified corresponding to classifiedId- Specified by:
validateClassifiedin interfaceClassifiedService- 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:ClassifiedServicepass to status refused because the user corresponding to userId refused the classified corresponding to classifiedId for the given motive.- Specified by:
refusedClassifiedin interfaceClassifiedService- Parameters:
classifiedId- unique identifier of a classifieduserId- unique identifier of the user refusing the classifiedrefusalMotive- the text about the motive of the refusal
-
sendSubscriptionsNotification
public void sendSubscriptionsNotification(String field1, String field2, ClassifiedDetail classified) Description copied from interface:ClassifiedServicesend a notification for subscribers to field1 and field2 when classified modified- Specified by:
sendSubscriptionsNotificationin interfaceClassifiedService- Parameters:
field1- the first classified fieldfield2- the second classified field
-
getAllClassifiedsToUnpublish
Description copied from interface:ClassifiedServiceget all expiring classifieds (corresponding of a number of day nbDays)- Specified by:
getAllClassifiedsToUnpublishin interfaceClassifiedService- Parameters:
nbDays- : intinstanceId- : classified component instance id- Returns:
- a collection of ClassifiedDetail
-
search
Description copied from interface:ClassifiedServicesearch all classifieds corresponding to the query- Specified by:
searchin interfaceClassifiedService- Parameters:
query- the query from which the search will be performed.- Returns:
- a collection of ClassifiedDetail
-
indexClassifieds
Description copied from interface:ClassifiedServiceindex all the classifieds for the instance corresponding to instanceId- Specified by:
indexClassifiedsin interfaceClassifiedService- Parameters:
instanceId- : String
-
deleteIndex
-
draftOutClassified
public void draftOutClassified(org.silverpeas.core.contribution.model.ContributionIdentifier classifiedId, String profile, boolean isValidationEnabled) Description copied from interface:ClassifiedServicetake out draft mode the classified corresponding to classified- Specified by:
draftOutClassifiedin interfaceClassifiedService- Parameters:
classifiedId- the unique identifier of the classifiedprofile- 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:ClassifiedServicepass the classified corresponding to classifiedId in draft mode- Specified by:
draftInClassifiedin interfaceClassifiedService- Parameters:
classifiedId- the unique identifier of the classified
-
createSubscribe
Description copied from interface:ClassifiedServicecreate a subscription- Specified by:
createSubscribein interfaceClassifiedService- Parameters:
subscribe- : Subscribe
-
deleteSubscribe
Description copied from interface:ClassifiedServicedelete a subscription corresponding to subscribeId- Specified by:
deleteSubscribein interfaceClassifiedService- Parameters:
subscribeId- : String
-
checkSubscription
-
getSubscribesByUser
Description copied from interface:ClassifiedServiceget all subscriptions for user and instance corresponding to userId and instanceId- Specified by:
getSubscribesByUserin interfaceClassifiedService- Parameters:
instanceId- : StringuserId- : String- Returns:
- a collection of Subscribe
-
getUsersBySubscribe
Description copied from interface:ClassifiedServiceget all subscribing users to a search corresponding to fields field1 and field2- Specified by:
getUsersBySubscribein interfaceClassifiedServicefield1- : Stringfield2- : String- Returns:
- a collection of userId (String)
-
getAllSubscribes
-
deleteAllSubscribes
Description copied from interface:ClassifiedServicedelete all subscriptions for the instance corresponding to instanceId- Specified by:
deleteAllSubscribesin interfaceClassifiedService- Parameters:
instanceId- unique identifier of a component instance.
-
getAllValidClassifieds
- Specified by:
getAllValidClassifiedsin interfaceClassifiedService
-
getAllValidClassifieds
public List<ClassifiedDetail> getAllValidClassifieds(String instanceId, String searchField1, String searchField2, int firstItemIndex, int elementsPerPage) Description copied from interface:ClassifiedServiceget all valid classifieds- Specified by:
getAllValidClassifiedsin interfaceClassifiedService- Parameters:
instanceId- : StringsearchField1- : name of the search field 1searchField2- : name of the search field 2firstItemIndex- : index of first item to displayelementsPerPage- : 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:
setClassificationin interfaceClassifiedService
-