Interface PublicationService
-
- All Known Implementing Classes:
DefaultPublicationService
,TagCloudPublicationService
public interface PublicationService
Service to manage the publications in Silverpeas.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addAliases(PublicationPK pubPK, List<Location> aliases)
Adds the specified aliases of the specified publication.void
addFather(PublicationPK pubPK, NodePK fatherPK)
Adds the specified father to the given publication.void
addLinks(PublicationPK pubPK, List<ResourceReference> links)
Updates the publication linksvoid
addValidationStep(ValidationStep step)
void
changePublicationOrder(PublicationPK pubPK, NodePK fatherPK, int direction)
Change the order of the given publication among the others one for the specified father.void
changePublicationsOrder(List<String> ids, NodePK nodePK)
void
createIndex(PublicationDetail pubDetail)
void
createIndex(PublicationPK pubPK)
PublicationPK
createPublication(PublicationDetail detail)
Creates in Silverpeas the specified publication.void
deleteIndex(PublicationPK pubPK)
void
deleteLink(String id)
Deletes the specified link between two publications.static PublicationService
get()
Gets an instance of thePublicationService
interface.List<Location>
getAllAliases(PublicationPK pubPK)
Gets all the aliases of the specified publication.Collection<NodePK>
getAllFatherPK(PublicationPK pubPK)
Deprecated.use instead the renamedgetAllFatherPKInSamePublicationComponentInstance(PublicationPK)
.List<NodePK>
getAllFatherPKInSamePublicationComponentInstance(PublicationPK pubPK)
Gets the unique identifying key of all of the fathers of the specified publication and in the same component instance.List<Location>
getAllLocations(PublicationPK pubPK)
Gets all the locations of the specified publication whatever the component instance in which they are.Map<String,List<Location>>
getAllLocationsByPublicationIds(Collection<String> ids)
Selects massively simple data about all locations (main or aliases).Collection<PublicationDetail>
getAllPublications(String instanceId)
Collection<PublicationDetail>
getAllPublications(String instanceId, String sorting)
List<SocialInformation>
getAllPublicationsWithStatusbyUserid(String userId, Date begin, Date end)
SilverpeasList<PublicationDetail>
getAuthorizedPublicationsForUserByCriteria(String userId, PublicationCriteria criteria)
Gets a list of authorized publications by applying given criteria.List<PublicationDetail>
getByIds(Collection<String> publicationIds)
Gets publications from given identifiers.CompletePublication
getCompletePublication(PublicationPK pubPK)
Gets the complete detail about the specified publication.Collection<Coordinate>
getCoordinates(String pubId, String componentId)
PublicationDetail
getDetail(PublicationPK pubPK)
Gets the publication with the specified identifying key.Collection<PublicationDetail>
getDetailBetweenDate(String beginDate, String endDate, String instanceId)
PublicationDetail
getDetailByName(PublicationPK pubPK, String pubName)
Looking for, in the instance identified by pubPK, a publication named pubName.PublicationDetail
getDetailByNameAndNodeId(PublicationPK pubPK, String pubName, int nodeId)
Collection<PublicationDetail>
getDetailsByFatherIds(List<String> fatherIds, String instanceId, boolean filterOnVisibilityPeriod)
Collection<PublicationDetail>
getDetailsByFatherIdsAndStatus(List<String> fatherIds, String instanceId, String sorting, String status)
Collection<PublicationDetail>
getDetailsByFatherIdsAndStatusList(List<String> fatherIds, String instanceId, String sorting, List<String> status)
Collection<PublicationDetail>
getDetailsByFatherIdsAndStatusList(List<String> fatherIds, String instanceId, String sorting, List<String> status, boolean filterOnVisibilityPeriod)
Collection<PublicationDetail>
getDetailsByFatherPK(NodePK fatherPK)
Gets all the publications attached to the specified father.Collection<PublicationDetail>
getDetailsByFatherPK(NodePK fatherPK, String sorting)
Gets all the publications attached to the specified father ordered as indicated by the sorting directive.Collection<PublicationDetail>
getDetailsByFatherPK(NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod)
Gets all the publications attached to the specified father, ordered as indicated by the sorting directive, according to the visibility.Collection<PublicationDetail>
getDetailsByFatherPK(NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod, String userId)
Gets all the publications attached to the specified father, ordered as indicated by the sorting directive, according to the visibility, and that was authored or updated by the specified user.Collection<PublicationDetail>
getDetailsNotInFatherPK(NodePK fatherPK)
Gets all the publications that aren't attached to the specified father.Collection<PublicationDetail>
getDetailsNotInFatherPK(NodePK fatherPK, String sorting)
Gets all the publications that aren't attached to the specified father and ordered by the specified sorting directive.Map<String,Integer>
getDistributionTree(DistributionTreeCriteria criteria)
Gets the tree of nodes with the number of publication per node.Collection<PublicationDetail>
getDraftsByUser(String userId)
get all publications of given user in state 'Draft'.List<Location>
getLocationsInComponentInstance(PublicationPK pubPK, String instanceId)
Gets the locations of the specified publication in the given component instance.Optional<Location>
getMainLocation(PublicationPK pubPK)
Gets the main location of the specified publication.List<PublicationDetail>
getMinimalDataByIds(Collection<PublicationPK> ids)
Selects massively simple data about publications.int
getNbPubByFatherPath(NodePK fatherPK, String fatherPath)
Collection<PublicationDetail>
getOrphanPublications(String componentId)
Gets all the publications that aren't attached to any father in the specified component instance.List<PublicationDetail>
getPublications(Collection<PublicationPK> publicationPKs)
Gets all the asked publications.SilverpeasList<PublicationDetail>
getPublicationsByCriteria(PublicationCriteria criteria)
Gets all the publications according to given criteria.Collection<PublicationPK>
getPubPKsInFatherPK(NodePK fatherPK)
List<SocialInformationPublication>
getSocialInformationsListOfMyContacts(List<String> myContactsIds, List<String> options, Date begin, Date end)
get list of socialInformation of my contacts according to options and number of Item and the first IndexValidationStep
getValidationStepByUser(PublicationPK pubPK, String userId)
List<ValidationStep>
getValidationSteps(PublicationPK pubPK)
void
movePublication(PublicationPK pubPK, NodePK toFatherPK, boolean indexIt)
Moves the specified publication to the specified father and indexes or not it.void
removeAliases(PublicationPK pubPK, Collection<Location> aliases)
Removes the specified aliases of the specified publication.void
removeAllFathers(PublicationPK pubPK)
Removes the specified publication from all fathers.void
removeFather(PublicationPK pubPK, NodePK fatherPK)
Removes the specified publication from the specified father.void
removeFathers(PublicationPK pubPK, Collection<String> fatherIds)
Removes the specified publication from all the specified father.void
removePublication(PublicationPK pubPK)
Removes the specified publication.List<PublicationDetail>
removeUserFromTargetValidators(String userId)
Remove given userId from publication validators where it appears.void
removeValidationSteps(PublicationPK pubPK)
void
resetPublicationsOrder(NodePK nodePK)
Pair<Collection<Location>,Collection<Location>>
setAliases(PublicationPK pubPK, List<Location> aliases)
Sets the aliases of the specified publication.void
setDetail(PublicationDetail detail)
Updates the specified publication.void
setDetail(PublicationDetail detail, boolean forceUpdateDate)
Updates the specified publication and specify if the update date property of the publication detail has to be used as update date.void
setDetail(PublicationDetail detail, boolean forceUpdateDate, ResourceEvent.Type eventType)
Updates the specified publication and specify if the update date property of the publication detail has to be used as update date.
-
-
-
Method Detail
-
get
static PublicationService get()
Gets an instance of thePublicationService
interface.- Returns:
- a
PublicationService
object.
-
getDetail
PublicationDetail getDetail(PublicationPK pubPK)
Gets the publication with the specified identifying key.- Parameters:
pubPK
- the identifying key of the publication to get.- Returns:
- the publication corresponding to the given key. If no such publication exists with the specified key, then null is returned.
-
createPublication
PublicationPK createPublication(PublicationDetail detail)
Creates in Silverpeas the specified publication. It persists it into the Silverpeas data source and a new identifier is set for this publication. AResourceEvent.Type.CREATION
event is sent once the publication is created.- Parameters:
detail
- the detail on the publication to persist.- Returns:
- the identifying key of the publication so that it can be retrieved later in the data source by this key.
-
movePublication
void movePublication(PublicationPK pubPK, NodePK toFatherPK, boolean indexIt)
Moves the specified publication to the specified father and indexes or not it. The father can be either a node in the same component instance or a node in another component instance. NoResourceEvent.Type.MOVE
event is sent; for doing please use one the move done thesetDetail(PublicationDetail, boolean, ResourceEvent.Type)
method by specifying theResourceEvent.Type.MOVE
event as last parameter.- Parameters:
pubPK
- the identifying key of the publication to move.toFatherPK
- the new father of the publication.indexIt
- a boolean indicating if the publication must be indexed.
-
changePublicationOrder
void changePublicationOrder(PublicationPK pubPK, NodePK fatherPK, int direction)
Change the order of the given publication among the others one for the specified father. Direction less than 0 means "up", otherwise it means "down".- Parameters:
pubPK
- the identifying key of the publication to reorder.fatherPK
- a father of the publication.direction
- a direction of the reordering: a value less than 0 means "up", otherwise it means "down". Cannot be 0.
-
removePublication
void removePublication(PublicationPK pubPK)
Removes the specified publication. TheResourceEvent.Type.DELETION
event is sent once the publication is removed.- Parameters:
pubPK
- the identifying key of the publication to remove.
-
setDetail
void setDetail(PublicationDetail detail)
Updates the specified publication. The update date isn't updated in given the publication detail. TheResourceEvent.Type.UPDATE
event is sent once the publication is updated.- Parameters:
detail
- the detail of the publication from which it has to be updated.
-
setDetail
void setDetail(PublicationDetail detail, boolean forceUpdateDate)
Updates the specified publication and specify if the update date property of the publication detail has to be used as update date. TheResourceEvent.Type.UPDATE
event is sent once the publication is updated.- Parameters:
detail
- the detail of the publication from which it has to be updated.forceUpdateDate
- a boolean indicating if the update date has to be set with date of this update.
-
setDetail
void setDetail(PublicationDetail detail, boolean forceUpdateDate, ResourceEvent.Type eventType)
Updates the specified publication and specify if the update date property of the publication detail has to be used as update date. The kind of update is specified by the given event type: it is either a simple publication update or an update issuing from a publication move (some publication properties can require to be updated after a move but they aren't related to a publication modification).- Parameters:
detail
- the detail of the publication from which it has to be updated.forceUpdateDate
- a boolean indicating if the update date has to be set with date of this update.eventType
- permit to precise to listener of publication modification the type of the update.
-
addFather
void addFather(PublicationPK pubPK, NodePK fatherPK)
Adds the specified father to the given publication. The publication will be then visible from this new father.- Parameters:
pubPK
- the identifying key of the publication.fatherPK
- the the identifying key of the new father.
-
removeFather
void removeFather(PublicationPK pubPK, NodePK fatherPK)
Removes the specified publication from the specified father. The publication won't be any more attached to the given father and hence it won't be visible any more from this father.- Parameters:
pubPK
- the identifying key of the publicationfatherPK
- the identifying key of the father to detach.
-
removeFathers
void removeFathers(PublicationPK pubPK, Collection<String> fatherIds)
Removes the specified publication from all the specified father. The publication won't be any more attached to the given fathers and hence it won't be visible any more from these fathers.- Parameters:
pubPK
- the identifying key of the publicationfatherIds
- a collection of identifying key of the fathers to detach.
-
removeAllFathers
void removeAllFathers(PublicationPK pubPK)
Removes the specified publication from all fathers. This means the publication will become an orphan and it won't be visible from any fathers.- Parameters:
pubPK
- the identifying key of the publication
-
getOrphanPublications
Collection<PublicationDetail> getOrphanPublications(String componentId)
Gets all the publications that aren't attached to any father in the specified component instance.- Parameters:
componentId
- the unique identifier of a component instance/- Returns:
- a collection of orphan publications.
-
getAllFatherPK
@Deprecated Collection<NodePK> getAllFatherPK(PublicationPK pubPK)
Deprecated.use instead the renamedgetAllFatherPKInSamePublicationComponentInstance(PublicationPK)
. This signature has been kept in case of external uses.Gets the unique identifying key of all of the fathers of the specified publication and in the same component instance.- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- a collection of
NodePK
instances, each of them identifying a node.
-
getAllFatherPKInSamePublicationComponentInstance
List<NodePK> getAllFatherPKInSamePublicationComponentInstance(PublicationPK pubPK)
Gets the unique identifying key of all of the fathers of the specified publication and in the same component instance.- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- a collection of
NodePK
instances, each of them identifying a node.
-
getAllLocationsByPublicationIds
Map<String,List<Location>> getAllLocationsByPublicationIds(Collection<String> ids)
Selects massively simple data about all locations (main or aliases).This method is designed for process performance needs.
- Parameters:
ids
- the instance ids aimed.- Returns:
- a list of
Location
instances.
-
getAllLocations
List<Location> getAllLocations(PublicationPK pubPK)
Gets all the locations of the specified publication whatever the component instance in which they are. By default, the original location of the publication is returned along with all of its aliases.- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- a collection of the locations of the publication.
- See Also:
Location
-
getLocationsInComponentInstance
List<Location> getLocationsInComponentInstance(PublicationPK pubPK, String instanceId)
Gets the locations of the specified publication in the given component instance.
-
getMainLocation
Optional<Location> getMainLocation(PublicationPK pubPK)
Gets the main location of the specified publication. A publication has always one original location and any other locations should be an alias.- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- the main location of the specified publication or nothing is the publication is orphaned (not attached to a father).
- See Also:
Location
-
getAllAliases
List<Location> getAllAliases(PublicationPK pubPK)
Gets all the aliases of the specified publication. The original location isn't returned among the aliases; to get also the original location, please look at thegetAllLocations(PublicationPK)
method.- Parameters:
pubPK
- the identifying key of the publication.- See Also:
Location
-
setAliases
Pair<Collection<Location>,Collection<Location>> setAliases(PublicationPK pubPK, List<Location> aliases)
Sets the aliases of the specified publication. They replace the existing aliases of the publication. TheIllegalArgumentException
is throw if one of the location isn't an alias.- Parameters:
pubPK
- the identifying key of the publication.aliases
- the new aliases.- Returns:
- a pair made up of firstly the added aliases and of secondly the removed aliases.
- See Also:
Location
-
addAliases
void addAliases(PublicationPK pubPK, List<Location> aliases)
Adds the specified aliases of the specified publication. TheIllegalArgumentException
is throw if one of the location isn't an alias.- Parameters:
pubPK
- the identifying key of the publication.aliases
- the aliases to add to the existing ones.- See Also:
Location
-
removeAliases
void removeAliases(PublicationPK pubPK, Collection<Location> aliases)
Removes the specified aliases of the specified publication. TheIllegalArgumentException
is throw if one of the location isn't an alias. Prefer in this case theremoveFather(PublicationPK, NodePK)
method.- Parameters:
pubPK
- the identifying key of the publication.aliases
- the aliases to remove.- See Also:
Location
-
getDetailsByFatherPK
Collection<PublicationDetail> getDetailsByFatherPK(NodePK fatherPK)
Gets all the publications attached to the specified father.- Parameters:
fatherPK
- the identifying key of the father.- Returns:
- a collection of
PublicationDetail
instances.
-
getDetailsByFatherPK
Collection<PublicationDetail> getDetailsByFatherPK(NodePK fatherPK, String sorting)
Gets all the publications attached to the specified father ordered as indicated by the sorting directive.- Parameters:
fatherPK
- the identifying key of the father.sorting
- a sorting directive. Must be in the form of "P.[publication detail attribute] (DESC|ASC)"- Returns:
- a collection of
PublicationDetail
instances.
-
getDetailsByFatherPK
Collection<PublicationDetail> getDetailsByFatherPK(NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod)
Gets all the publications attached to the specified father, ordered as indicated by the sorting directive, according to the visibility.- Parameters:
fatherPK
- the identifying key of the father.sorting
- a sorting directive. Must be in the form of "P.[publication detail attribute] (DESC|ASC)"filterOnVisibilityPeriod
- is the publications to get must be today visible.- Returns:
- a collection of
PublicationDetail
instances.
-
getDetailsByFatherPK
Collection<PublicationDetail> getDetailsByFatherPK(NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod, String userId)
Gets all the publications attached to the specified father, ordered as indicated by the sorting directive, according to the visibility, and that was authored or updated by the specified user.- Parameters:
fatherPK
- the identifying key of the father.sorting
- a sorting directive. Must be in the form of "P.[publication detail attribute] (DESC|ASC)"filterOnVisibilityPeriod
- is the publications to get must be today visible.userId
- the unique identifier of the author or of an updater.- Returns:
- a collection of
PublicationDetail
instances.
-
getDetailsNotInFatherPK
Collection<PublicationDetail> getDetailsNotInFatherPK(NodePK fatherPK)
Gets all the publications that aren't attached to the specified father.- Parameters:
fatherPK
- the identifying key of the father.- Returns:
- a collection of
PublicationDetail
instances.
-
getDetailsNotInFatherPK
Collection<PublicationDetail> getDetailsNotInFatherPK(NodePK fatherPK, String sorting)
Gets all the publications that aren't attached to the specified father and ordered by the specified sorting directive.- Parameters:
fatherPK
- the identifying key of the father.sorting
- a sorting directive. Must be in the form of "P.[publication detail attribute] (DESC|ASC)"- Returns:
- a collection of
PublicationDetail
instances.
-
deleteLink
void deleteLink(String id)
Deletes the specified link between two publications.- Parameters:
id
- the unique identifier of a link between two publications.
-
getCompletePublication
CompletePublication getCompletePublication(PublicationPK pubPK)
Gets the complete detail about the specified publication.- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- a
CompletePublication
instance.
-
getPublications
List<PublicationDetail> getPublications(Collection<PublicationPK> publicationPKs)
Gets all the asked publications.- Parameters:
publicationPKs
- a collection of identifying key of the publications to get.- Returns:
- a list of
PublicationDetail
instances.
-
getByIds
List<PublicationDetail> getByIds(Collection<String> publicationIds)
Gets publications from given identifiers.- Parameters:
publicationIds
- list of identifiers of publications- Returns:
- a list of
PublicationDetail
.
-
getPublicationsByCriteria
SilverpeasList<PublicationDetail> getPublicationsByCriteria(PublicationCriteria criteria)
Gets all the publications according to given criteria.- Parameters:
criteria
- the criteria to process.- Returns:
- a list of
PublicationDetail
instances
-
getAuthorizedPublicationsForUserByCriteria
SilverpeasList<PublicationDetail> getAuthorizedPublicationsForUserByCriteria(String userId, PublicationCriteria criteria)
Gets a list of authorized publications by applying given criteria.- Parameters:
userId
- the identifier of the user for which access control MUST be verified.criteria
- the criteria.- Returns:
- a list of publications
-
getDistributionTree
Map<String,Integer> getDistributionTree(DistributionTreeCriteria criteria)
Gets the tree of nodes with the number of publication per node.- Parameters:
criteria
- criteria for delimiting the scope of the request.- Returns:
- the tree of nodes with the number of publication per node
-
getDetailsByFatherIds
Collection<PublicationDetail> getDetailsByFatherIds(List<String> fatherIds, String instanceId, boolean filterOnVisibilityPeriod)
-
getDetailsByFatherIdsAndStatus
Collection<PublicationDetail> getDetailsByFatherIdsAndStatus(List<String> fatherIds, String instanceId, String sorting, String status)
-
getDetailsByFatherIdsAndStatusList
Collection<PublicationDetail> getDetailsByFatherIdsAndStatusList(List<String> fatherIds, String instanceId, String sorting, List<String> status)
-
getDetailsByFatherIdsAndStatusList
Collection<PublicationDetail> getDetailsByFatherIdsAndStatusList(List<String> fatherIds, String instanceId, String sorting, List<String> status, boolean filterOnVisibilityPeriod)
-
getPubPKsInFatherPK
Collection<PublicationPK> getPubPKsInFatherPK(NodePK fatherPK)
-
createIndex
void createIndex(PublicationPK pubPK)
-
createIndex
void createIndex(PublicationDetail pubDetail)
-
deleteIndex
void deleteIndex(PublicationPK pubPK)
-
getMinimalDataByIds
List<PublicationDetail> getMinimalDataByIds(Collection<PublicationPK> ids)
Selects massively simple data about publications.For now, only the following data are retrieved:
- pubId
- pubStatus
- pubCloneId
- pubCloneStatus
- instanceId
- pubBeginDate
- pubEndDate
- pubBeginHour
- pubEndHour
- pubcreatorid
- pubupdaterid
The result is not necessarily into same ordering as the one of given parameter.- Parameters:
ids
- the instance ids aimed.- Returns:
- a list of
PublicationDetail
instances.
-
getAllPublications
Collection<PublicationDetail> getAllPublications(String instanceId)
-
getAllPublications
Collection<PublicationDetail> getAllPublications(String instanceId, String sorting)
-
getDetailByName
PublicationDetail getDetailByName(PublicationPK pubPK, String pubName)
Looking for, in the instance identified by pubPK, a publication named pubName.- Parameters:
pubPK
- the identifier of the instancepubName
- the publication's name we are looking for- Returns:
- the pubId if a publication already exists in this component's instance. null otherwise.
-
getDetailByNameAndNodeId
PublicationDetail getDetailByNameAndNodeId(PublicationPK pubPK, String pubName, int nodeId)
-
getDetailBetweenDate
Collection<PublicationDetail> getDetailBetweenDate(String beginDate, String endDate, String instanceId)
-
getValidationSteps
List<ValidationStep> getValidationSteps(PublicationPK pubPK)
-
getValidationStepByUser
ValidationStep getValidationStepByUser(PublicationPK pubPK, String userId)
-
addValidationStep
void addValidationStep(ValidationStep step)
-
removeValidationSteps
void removeValidationSteps(PublicationPK pubPK)
-
resetPublicationsOrder
void resetPublicationsOrder(NodePK nodePK)
-
getCoordinates
Collection<Coordinate> getCoordinates(String pubId, String componentId)
-
addLinks
void addLinks(PublicationPK pubPK, List<ResourceReference> links)
Updates the publication links- Parameters:
pubPK
- publication identifier which you want to update linkslinks
- list of publication to link with current.
-
getAllPublicationsWithStatusbyUserid
List<SocialInformation> getAllPublicationsWithStatusbyUserid(String userId, Date begin, Date end)
-
getSocialInformationsListOfMyContacts
List<SocialInformationPublication> getSocialInformationsListOfMyContacts(List<String> myContactsIds, List<String> options, Date begin, Date end)
get list of socialInformation of my contacts according to options and number of Item and the first Index- Parameters:
myContactsIds
-options
-begin
-end
-- Returns:
-
getDraftsByUser
Collection<PublicationDetail> getDraftsByUser(String userId)
get all publications of given user in state 'Draft'. It returns simple publications in state 'Draft' and cloned publications with a clone in state 'Draft'.- Parameters:
userId
-- Returns:
- all PublicationDetail in state 'Draft' according to given userId
-
removeUserFromTargetValidators
List<PublicationDetail> removeUserFromTargetValidators(String userId)
Remove given userId from publication validators where it appears.- Parameters:
userId
- id of the user to remove- Returns:
- a List of PublicationPK on which userId have been removed to.
-
-