Class DefaultKmeliaService
- java.lang.Object
-
- org.silverpeas.components.kmelia.service.DefaultKmeliaService
-
- All Implemented Interfaces:
KmeliaService
,org.silverpeas.core.ApplicationService
@Service @Singleton @Named("kmeliaService") public class DefaultKmeliaService extends Object implements KmeliaService
This is the Kmelia Service controller of the MVC. It controls all the activities that happen in a client session. It also provides mechanisms to access other services. Service which manage kmelia and kmax application.- Author:
- Nicolas Eysseric
-
-
Constructor Summary
Constructors Constructor Description DefaultKmeliaService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAttachmentToPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, String filename, String description, byte[] contents)
org.silverpeas.core.node.model.NodePK
addAxis(org.silverpeas.core.node.model.NodeDetail axis, String componentId)
Add the given axis into the specified component instance.void
addInfoLinks(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, List<org.silverpeas.core.ResourceReference> links)
Updates the publication linksorg.silverpeas.core.node.model.NodePK
addPosition(String fatherId, org.silverpeas.core.node.model.NodeDetail position, String componentId, String userId)
Add position to an axis in the given component instance and for the specified user.void
addPublicationToCombination(String pubId, List<String> combination, String componentId)
Add for the given publication a combination of position on the axis of the component instance.void
addPublicationToTopic(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK fatherPK, boolean isACreation)
Add a publication to a topic and send email alerts to topic subscribersvoid
addPublicationToTopicWithoutNotifications(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK fatherPK, boolean isACreation)
org.silverpeas.core.node.model.NodePK
addSubTopic(org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.node.model.NodeDetail subTopic, String alertType)
Add a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePKorg.silverpeas.core.node.model.NodePK
addToTopic(org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.node.model.NodeDetail subTopic)
Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePKvoid
changeTopicStatus(String newStatus, org.silverpeas.core.node.model.NodePK nodePK, boolean recursiveChanges)
protected boolean
checkCombination(Collection<org.silverpeas.core.node.coordinates.model.Coordinate> coordinates, List<String> combination)
protected boolean
checkPoint(org.silverpeas.core.node.coordinates.model.CoordinatePoint point, List<String> combination)
String
clonePublication(org.silverpeas.core.contribution.publication.model.CompletePublication refPubComplete, org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, String nextStatus)
Clone the given publication.void
copyNode(KmeliaCopyDetail copyDetail)
void
copyPublication(org.silverpeas.core.contribution.publication.model.PublicationDetail publiToCopy, KmeliaCopyDetail copyDetail)
void
copyPublications(KmeliaCopyDetail copyDetail)
String
createKmaxPublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail)
Create a new Publication (only the header - parameters)String
createPublicationIntoTopic(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, org.silverpeas.core.node.model.NodePK fatherPK)
Create a new Publication (only the header - parameters) to the current TopicString
createPublicationIntoTopic(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)
Creates a new publication into the specified topic and with the specified classification on the PdC.String
createTopic(String componentId, String topicId, String spaceId, String userId, String name, String description)
void
deleteAllReadingControlsByPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
delete reading controls to a publicationvoid
deleteAxis(String axisId, String componentId)
Delete the given axis in the specified component instance.void
deleteClone(org.silverpeas.core.contribution.publication.model.PublicationPK pk)
void
deletePosition(String positionId, String componentId)
Delete a position in an axisvoid
deletePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
HEAD Delete a publication If this publication is in the basket or in the DZ, it's deleted from the database Else it only send to the basket.void
deletePublicationFromCombination(String pubId, String combinationId, String componentId)
Remove for the given publication the specified combination of positions on the axis of the component instance.List<String>
deletePublications(List<String> ids, org.silverpeas.core.node.model.NodePK nodePK, String userId)
Removes publications according to given ids.void
deleteSilverContent(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
void
deleteTopic(org.silverpeas.core.node.model.NodePK pkToDelete)
Delete a topic and all descendants.void
draftInPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Change publication status from any state to draftvoid
draftInPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
void
draftOutPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile)
Change publication status from draft to valid (for publisher) or toValidate (for redactor)void
draftOutPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile, boolean forceUpdateDate)
org.silverpeas.core.contribution.publication.model.PublicationDetail
draftOutPublicationWithoutNotifications(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile)
void
externalElementsOfPublicationHaveChanged(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
alert that an external elements of publication (wysiwyg, attachment, versioning) has been created, updated or removedList<KmeliaPublication>
filterPublications(List<KmeliaPublication> publications, String instanceId, org.silverpeas.core.admin.user.model.SilverpeasRole profile, String userId)
List<String>
getActiveValidatorIds(org.silverpeas.core.contribution.publication.model.PublicationPK pk)
Collection<org.silverpeas.core.contribution.publication.model.Location>
getAliases(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Gets all the aliases of the specified publication, whatever the component instance and without taking into account the publication is a clone or not.List<org.silverpeas.core.node.model.NodeDetail>
getAllowedSubfolders(org.silverpeas.core.node.model.NodeDetail folder, String userId)
ValidatorsList
getAllValidators(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
List<KmeliaPublication>
getAuthorizedPublicationsOfFolder(org.silverpeas.core.node.model.NodePK pk, String userProfile, String userId, boolean isTreeStructureUsed)
Gets the publications linked to the folder represented by givenNodePK
reference.List<org.silverpeas.core.node.model.NodeDetail>
getAxis(String componentId)
Get the axis on which publications are categorized in the specified component instance.List<org.silverpeas.core.node.model.NodeDetail>
getAxisHeaders(String componentId)
Get the header of the axis on which publications are categorized in the specified component instance.org.silverpeas.core.node.model.NodePK
getBestLocationOfPublicationForUser(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
Gets the father of the specified publication according to the rights of the user.TopicDetail
getBestTopicDetailOfPublicationForUser(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, boolean isTreeStructureUsed, String userId)
Gets the details about the father from which the specified publication is accessible to the given user.org.silverpeas.core.contribution.publication.model.CompletePublication
getCompletePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Gets the complete details about the publication referred by the specified unique identifier.org.silverpeas.core.util.LocalizationBundle
getComponentMessages(String language)
org.silverpeas.core.util.SettingBundle
getComponentSettings()
Optional<KmeliaPublication>
getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)
org.silverpeas.core.node.model.NodeDetail
getExpandedPathToNode(org.silverpeas.core.node.model.NodePK pk, String userId)
org.silverpeas.core.node.model.NodeDetail
getFolder(org.silverpeas.core.node.model.NodePK nodePK, String userId)
Gets the details about the specified folder.Collection<org.silverpeas.core.node.model.NodeDetail>
getFolderChildren(org.silverpeas.core.node.model.NodePK nodePK, String userId)
KmeliaPublication
getKmaxPublication(String pubId, String currentUserId)
Get the given publication for the given user.List<org.silverpeas.core.silverstatistics.access.model.HistoryObjectDetail>
getLastAccess(org.silverpeas.core.contribution.publication.model.PublicationPK pk, org.silverpeas.core.node.model.NodePK nodePK, String excludedUserId, int maxResult)
List<KmeliaPublication>
getLatestAuthorizedPublications(String instanceId, String userId, int limit)
Checks rights on publications order by descending begin visibility date of publication.List<KmeliaPublication>
getLinkedPublications(KmeliaPublication publication, String userId)
Gets the publications linked with the specified one and for which the specified user is authorized to access.Collection<org.silverpeas.core.contribution.publication.model.Location>
getLocations(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Gets all the locations of the specified publication; whatever the component instance.Collection<String>
getModelUsed(String instanceId, String nodeId)
org.silverpeas.core.node.model.NodeDetail
getNodeHeader(String id, String componentId)
Get the header of the specified node.List<KmeliaPublication>
getNonVisiblePublications(String componentId, String userId)
Collection<org.silverpeas.core.node.model.NodeDetail>
getPath(String id, String componentId)
Get path of a position in an axis.Collection<Collection<org.silverpeas.core.node.model.NodeDetail>>
getPathList(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Return list of all path to this publication - it's a Collection of NodeDetail collectionKmeliaPublication
getPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK)
Gets the Kmelia publication identified by the specified identifying key and that is located into the specified topic.Collection<org.silverpeas.core.node.coordinates.model.Coordinate>
getPublicationCoordinates(String pubId, String componentId)
Get the coordinates for the given publication on the axis of the specified component instance.org.silverpeas.core.contribution.publication.model.PublicationDetail
getPublicationDetail(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Return the detail of a publication (only the Header)<T extends org.silverpeas.core.ResourceReference>
List<org.silverpeas.core.contribution.publication.model.PublicationDetail>getPublicationDetails(List<T> references)
gets a list of PublicationDetail corresponding to the links parameterorg.silverpeas.core.node.model.NodePK
getPublicationFatherPK(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Gets the father of the specified publication.<T extends org.silverpeas.core.ResourceReference>
List<KmeliaPublication>getPublications(List<T> references, String userId, org.silverpeas.core.node.model.NodePK contextFolder, boolean accessControlFiltering)
Gets a list of publications with optional control access filtering.<T extends org.silverpeas.core.ResourceReference>
List<org.silverpeas.core.util.Pair<KmeliaPublication,KmeliaPublication>>getPublicationsForModification(List<T> references, String userId)
Gets a list ofPair
ofKmeliaPublication
instances into context of modification by a user represented by the given user id.List<KmeliaPublication>
getPublicationsToValidate(String componentId, String userId)
org.silverpeas.core.node.model.NodeDetail
getRoot(String componentId, String userId)
int
getSilverObjectId(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
org.silverpeas.core.node.model.NodeDetail
getSubTopicDetail(org.silverpeas.core.node.model.NodePK pk)
Return a subtopic to currentTopicList<org.silverpeas.core.node.model.NodeDetail>
getTreeview(org.silverpeas.core.node.model.NodePK nodePK, String profile, boolean coWritingEnable, boolean draftVisibleWithCoWriting, String userId, boolean displayNb, boolean isRightsOnTopicsUsed)
Collection<KmeliaPublication>
getUnbalancedPublications(String componentId)
Get publications that aren't categorized on any axis.List<String>
getUserIdsOfFolder(org.silverpeas.core.node.model.NodePK pk)
org.silverpeas.core.notification.user.UserNotification
getUserNotification(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.contribution.attachment.model.SimpleDocumentPK documentPk, org.silverpeas.core.node.model.NodePK topicPK)
Send an email to alert users of a attachmentorg.silverpeas.core.notification.user.UserNotification
getUserNotification(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK)
Send an email to alert users of a publication creationorg.silverpeas.core.notification.user.UserNotification
getUserNotification(org.silverpeas.core.node.model.NodePK pk)
Send a notification to alert users about a folderString
getUserTopicProfile(org.silverpeas.core.node.model.NodePK pk, String userId)
TopicDetail
goTo(org.silverpeas.core.node.model.NodePK pk, String userId, boolean isTreeStructureUsed, String userProfile, boolean mustUserRightsBeChecked)
void
indexKmax(String componentId)
void
indexKmelia(String componentId)
boolean
isRelatedTo(String instanceId)
boolean
isUserCanPublish(String componentId, String userId)
boolean
isUserCanValidate(String componentId, String userId)
boolean
isUserCanValidatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
This method verifies if the user behind the given user identifier can validate the publication represented by the given primary key.boolean
isUserCanWrite(String componentId, String userId)
void
moveNode(org.silverpeas.core.node.model.NodePK nodePK, org.silverpeas.core.node.model.NodePK to, KmeliaPasteDetail pasteContext)
void
movePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK to, KmeliaPasteDetail pasteContext)
void
movePublicationInSameApplication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK from, KmeliaPasteDetail pasteContext)
protected void
onDocumentDeletion(org.silverpeas.core.contribution.attachment.notification.AttachmentRef attachment)
void
performReminder(org.silverpeas.core.reminder.Reminder reminder)
Performs processes about kmelia linked to given reminder.
If kmelia is not concerned, nothing is performed.void
removeContentOfPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
List<KmeliaPublication>
search(List<String> combination, int nbDays, String componentId)
Get publications categorized in a combination of positions and that are visible or created the given number of days ago.List<KmeliaPublication>
search(List<String> combination, String componentId)
Get publications categorized in a combination of positions.void
sendModificationAlert(int modificationScope, org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
void
sendPublicationToBasket(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
void
sendPublicationToBasket(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, boolean kmaxMode)
Send the publication in the basket topic.void
setAliases(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, List<org.silverpeas.core.contribution.publication.model.Location> locations)
void
setModelUsed(String[] models, String instanceId, String nodeId)
void
setValidators(org.silverpeas.core.contribution.publication.model.PublicationPK pubOrClonePK, String userIds)
void
sortSubTopics(org.silverpeas.core.node.model.NodePK fatherPK, boolean recursive, String[] criteria)
void
suspendPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String defermentMotive, String userId)
void
unvalidatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, String refusalMotive, int validationType)
void
updateAxis(org.silverpeas.core.node.model.NodeDetail axis, String componentId)
Update the given axis in the specified component instance.void
updatePosition(org.silverpeas.core.node.model.NodeDetail position, String componentId)
Update a position in an axisvoid
updatePublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail)
Update a publication (only the header - parameters)void
updatePublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, boolean forceUpdateDate)
org.silverpeas.core.node.model.NodePK
updateTopic(org.silverpeas.core.node.model.NodeDetail topic, String alertType)
Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePKvoid
userHaveBeenDeleted(String userId)
boolean
validatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, boolean force, boolean hasUserNoMoreValidationRight)
-
-
-
Method Detail
-
goTo
public TopicDetail goTo(org.silverpeas.core.node.model.NodePK pk, String userId, boolean isTreeStructureUsed, String userProfile, boolean mustUserRightsBeChecked)
- Specified by:
goTo
in interfaceKmeliaService
-
getAuthorizedPublicationsOfFolder
public List<KmeliaPublication> getAuthorizedPublicationsOfFolder(org.silverpeas.core.node.model.NodePK pk, String userProfile, String userId, boolean isTreeStructureUsed)
Description copied from interface:KmeliaService
Gets the publications linked to the folder represented by givenNodePK
reference.In any case, user right access to a publication is verified so that only accessible ones are included into returned list.
- Specified by:
getAuthorizedPublicationsOfFolder
in interfaceKmeliaService
- Parameters:
pk
- the reference to a folder.userProfile
- a user profileuserId
- the identifier of the user for which access controls MUST be verified.isTreeStructureUsed
- true if publications are represented into tree structure, false otherwise.- Returns:
- a list of
KmeliaPublication
instances.
-
getLatestAuthorizedPublications
public List<KmeliaPublication> getLatestAuthorizedPublications(String instanceId, String userId, int limit)
Description copied from interface:KmeliaService
Checks rights on publications order by descending begin visibility date of publication.Due to the nature of this service, it is not designed to by used by update processes and the result is so cached at request scope in order to avoid to perform several times the same request.
- Specified by:
getLatestAuthorizedPublications
in interfaceKmeliaService
- Parameters:
instanceId
- the identifier of the instance.userId
- the identifier of the user for which access controls MUST be verified.limit
- the maximum number of publications to return (0 = no limit).- Returns:
- a list of
KmeliaPublication
instances.
-
getAllowedSubfolders
public List<org.silverpeas.core.node.model.NodeDetail> getAllowedSubfolders(org.silverpeas.core.node.model.NodeDetail folder, String userId)
- Specified by:
getAllowedSubfolders
in interfaceKmeliaService
-
addToTopic
public org.silverpeas.core.node.model.NodePK addToTopic(org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.node.model.NodeDetail subTopic)
Add a subtopic to a topic - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK- Specified by:
addToTopic
in interfaceKmeliaService
- Parameters:
fatherPK
- the topic Id of the future fathersubTopic
- the NodeDetail of the new sub topic- Returns:
- If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
- See Also:
NodeDetail
,NodePK
-
addSubTopic
public org.silverpeas.core.node.model.NodePK addSubTopic(org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.node.model.NodeDetail subTopic, String alertType)
Description copied from interface:KmeliaService
Add a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK- Specified by:
addSubTopic
in interfaceKmeliaService
subTopic
- the NodeDetail of the new sub topicalertType
- Alert all users, only publishers or nobody of the topic creation alertType = "All"|"Publisher"|"None"- Returns:
- If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
- See Also:
NodeDetail
,NodePK
-
updateTopic
public org.silverpeas.core.node.model.NodePK updateTopic(org.silverpeas.core.node.model.NodeDetail topic, String alertType)
Update a subtopic to currentTopic and alert users - If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK- Specified by:
updateTopic
in interfaceKmeliaService
- Parameters:
topic
- the NodeDetail of the updated sub topicalertType
- Alert all users, only publishers or nobody of the topic creation alertType = "All"|"Publisher"|"None"- Returns:
- If a subtopic of same name already exists a NodePK with id=-1 is returned else the new topic NodePK
- Since:
- 1.0
- See Also:
NodeDetail
,NodePK
-
getSubTopicDetail
public org.silverpeas.core.node.model.NodeDetail getSubTopicDetail(org.silverpeas.core.node.model.NodePK pk)
Description copied from interface:KmeliaService
Return a subtopic to currentTopic- Specified by:
getSubTopicDetail
in interfaceKmeliaService
- Parameters:
pk
- the id of the researched topic- Returns:
- the detail of the specified topic
- See Also:
NodeDetail
-
deleteTopic
public void deleteTopic(org.silverpeas.core.node.model.NodePK pkToDelete)
Delete a topic and all descendants. Delete all links between descendants and publications. This publications will be visible in the Declassified zone. Delete All subscriptions and favorites on this topics and all descendants- Specified by:
deleteTopic
in interfaceKmeliaService
- Parameters:
pkToDelete
- the id of the topic to delete- Since:
- 1.0
-
changeTopicStatus
public void changeTopicStatus(String newStatus, org.silverpeas.core.node.model.NodePK nodePK, boolean recursiveChanges)
- Specified by:
changeTopicStatus
in interfaceKmeliaService
-
sortSubTopics
public void sortSubTopics(org.silverpeas.core.node.model.NodePK fatherPK, boolean recursive, String[] criteria)
- Specified by:
sortSubTopics
in interfaceKmeliaService
-
getTreeview
public List<org.silverpeas.core.node.model.NodeDetail> getTreeview(org.silverpeas.core.node.model.NodePK nodePK, String profile, boolean coWritingEnable, boolean draftVisibleWithCoWriting, String userId, boolean displayNb, boolean isRightsOnTopicsUsed)
- Specified by:
getTreeview
in interfaceKmeliaService
-
getPublicationDetail
public org.silverpeas.core.contribution.publication.model.PublicationDetail getPublicationDetail(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Return the detail of a publication (only the Header)- Specified by:
getPublicationDetail
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publication- Returns:
- a PublicationDetail
- Since:
- 1.0
- See Also:
PublicationDetail
-
getPathList
public Collection<Collection<org.silverpeas.core.node.model.NodeDetail>> getPathList(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Return list of all path to this publication - it's a Collection of NodeDetail collection- Specified by:
getPathList
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publication- Returns:
- a Collection of NodeDetail collection
- Since:
- 1.0
- See Also:
NodeDetail
-
createPublicationIntoTopic
public String createPublicationIntoTopic(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, org.silverpeas.core.node.model.NodePK fatherPK)
Create a new Publication (only the header - parameters) to the current Topic- Specified by:
createPublicationIntoTopic
in interfaceKmeliaService
- Parameters:
pubDetail
- a PublicationDetail- Returns:
- the id of the new publication
- Since:
- 1.0
- See Also:
PublicationDetail
-
createPublicationIntoTopic
public String createPublicationIntoTopic(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, org.silverpeas.core.node.model.NodePK fatherPK, org.silverpeas.core.pdc.pdc.model.PdcClassification classification)
Description copied from interface:KmeliaService
Creates a new publication into the specified topic and with the specified classification on the PdC.- Specified by:
createPublicationIntoTopic
in interfaceKmeliaService
- Parameters:
pubDetail
- the detail about the publication to create.fatherPK
- the unique identifier of the topic into which the publication is published.classification
- the classification on the PdC of the publication content.- Returns:
- the unique identifier of the created publication.
-
updatePublication
public void updatePublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail)
Update a publication (only the header - parameters)- Specified by:
updatePublication
in interfaceKmeliaService
- Parameters:
pubDetail
- a PublicationDetail- Since:
- 1.0
- See Also:
PublicationDetail
-
updatePublication
public void updatePublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, boolean forceUpdateDate)
- Specified by:
updatePublication
in interfaceKmeliaService
-
movePublication
@SimulationActionProcess(elementLister=KmeliaPublicationSimulationElementLister.class) @Action(MOVE) public void movePublication(@SourcePK org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, @TargetPK org.silverpeas.core.node.model.NodePK to, KmeliaPasteDetail pasteContext)
- Specified by:
movePublication
in interfaceKmeliaService
-
movePublicationInSameApplication
@SimulationActionProcess(elementLister=KmeliaPublicationSimulationElementLister.class) @Action(MOVE) public void movePublicationInSameApplication(@SourcePK org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, @TargetPK org.silverpeas.core.node.model.NodePK from, KmeliaPasteDetail pasteContext)
- Specified by:
movePublicationInSameApplication
in interfaceKmeliaService
-
externalElementsOfPublicationHaveChanged
public void externalElementsOfPublicationHaveChanged(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
Description copied from interface:KmeliaService
alert that an external elements of publication (wysiwyg, attachment, versioning) has been created, updated or removed- Specified by:
externalElementsOfPublicationHaveChanged
in interfaceKmeliaService
- Parameters:
pubPK
- - id of the publication which contains this external elements
-
deletePublication
public void deletePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
HEAD Delete a publication If this publication is in the basket or in the DZ, it's deleted from the database Else it only send to the basket.- Specified by:
deletePublication
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publication to delete- See Also:
TopicDetail
-
sendPublicationToBasket
public void sendPublicationToBasket(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, boolean kmaxMode)
Send the publication in the basket topic.All aliases of the publication are deleted if exist.
- Specified by:
sendPublicationToBasket
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publicationkmaxMode
- true to indicate a use from kmax application- Since:
- 1.0
- See Also:
TopicDetail
-
sendPublicationToBasket
public void sendPublicationToBasket(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
sendPublicationToBasket
in interfaceKmeliaService
-
addPublicationToTopic
public void addPublicationToTopic(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK fatherPK, boolean isACreation)
Description copied from interface:KmeliaService
Add a publication to a topic and send email alerts to topic subscribers- Specified by:
addPublicationToTopic
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publicationfatherPK
- the id of the topic
-
addPublicationToTopicWithoutNotifications
public void addPublicationToTopicWithoutNotifications(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK fatherPK, boolean isACreation)
- Specified by:
addPublicationToTopicWithoutNotifications
in interfaceKmeliaService
-
addInfoLinks
public void addInfoLinks(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, List<org.silverpeas.core.ResourceReference> links)
Updates the publication links- Specified by:
addInfoLinks
in interfaceKmeliaService
- Parameters:
pubPK
- publication identifier which you want to update linkslinks
- list of publication to link with current.
-
getCompletePublication
public org.silverpeas.core.contribution.publication.model.CompletePublication getCompletePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Description copied from interface:KmeliaService
Gets the complete details about the publication referred by the specified unique identifier.- Specified by:
getCompletePublication
in interfaceKmeliaService
- Parameters:
pubPK
- the unique identifier of a Kmelia publication.- Returns:
- a
CompletePublication
object.
-
getPublication
public KmeliaPublication getPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK)
Description copied from interface:KmeliaService
Gets the Kmelia publication identified by the specified identifying key and that is located into the specified topic. As a Kmelia publication can be in different locations, all publications other than the original father of the publication are considered as an alias of that original publication. This is why it is required to know the father of the asked publication.- Specified by:
getPublication
in interfaceKmeliaService
- Parameters:
pubPK
- identifier of the publication to get.topicPK
- identifier of the topic in which the publication is located.- Returns:
- the asked
KmeliaPublication
instance.
-
getBestTopicDetailOfPublicationForUser
public TopicDetail getBestTopicDetailOfPublicationForUser(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, boolean isTreeStructureUsed, String userId)
Description copied from interface:KmeliaService
Gets the details about the father from which the specified publication is accessible to the given user. If the main location of the publication isn't accessible by the user, then the first accessible alias of the publication is returned. If no aliases are accessible or defined, the the details of the root topic is returned.The component instance set to given
PublicationPK
gives the priority of the resultingTopicDetail
. For example, into case of a main publication on instance A with aliases on instance B, if component instance id set to givenPublicationPK
is the B one, thenTopicDetail
result is about the best father PK (the best location) on instance B (so an alias in that case).- Specified by:
getBestTopicDetailOfPublicationForUser
in interfaceKmeliaService
- Parameters:
pubPK
- the unique identifier of the publication.isTreeStructureUsed
- is the tree view of the topics enabled?userId
- the unique identifier of a user.- Returns:
- the details of the topic in which the publication is accessible by the given user.
-
getBestLocationOfPublicationForUser
public org.silverpeas.core.node.model.NodePK getBestLocationOfPublicationForUser(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
Description copied from interface:KmeliaService
Gets the father of the specified publication according to the rights of the user. If the main location of the publication isn't accessible by the user, then the first accessible alias of the publication is returned. If no aliases are accessible or defined, the the root topic is returned.The component instance set to given
PublicationPK
gives the priority of the resultingNodePK
. For example, into case of a main publication on instance A with aliases on instance B, if component instance id set to givenPublicationPK
is the B one, then the best father PK (the best location) on instance B is returned (so an alias in that case).- Specified by:
getBestLocationOfPublicationForUser
in interfaceKmeliaService
- Parameters:
pubPK
- the unique identifier of the publicationuserId
- the unique identifier of a user.- Returns:
- a topic in which the publication is accessible by the given user.
-
getPublicationFatherPK
public org.silverpeas.core.node.model.NodePK getPublicationFatherPK(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Description copied from interface:KmeliaService
Gets the father of the specified publication. If the publication is a clone of a main one, then gets the father of the cloned publication. The father returned should be the main location of the publication. It the publication is an orphaned one, null is returned.- Specified by:
getPublicationFatherPK
in interfaceKmeliaService
- Parameters:
pubPK
- the identifying key of the publication.- Returns:
- the father of the publication or null if the publication is an orphaned one.
-
getPublicationDetails
public <T extends org.silverpeas.core.ResourceReference> List<org.silverpeas.core.contribution.publication.model.PublicationDetail> getPublicationDetails(List<T> references)
Description copied from interface:KmeliaService
gets a list of PublicationDetail corresponding to the links parameter- Specified by:
getPublicationDetails
in interfaceKmeliaService
- Parameters:
references
- list of publication (componentID + publicationId)- Returns:
- a list of PublicationDetail
-
getPublications
public <T extends org.silverpeas.core.ResourceReference> List<KmeliaPublication> getPublications(List<T> references, String userId, org.silverpeas.core.node.model.NodePK contextFolder, boolean accessControlFiltering)
Description copied from interface:KmeliaService
Gets a list of publications with optional control access filtering.When a folder is given as context, then the ALIAS information is computed on each publication.
- Specified by:
getPublications
in interfaceKmeliaService
- Parameters:
references
- list of publication represented asResourceReference
instances.userId
- identifier User. allow to check if the publication is accessible for current usercontextFolder
- optional folder that represents if specified the folder into which the given references are retrieved. It is MANDATORY to determinate alias status.accessControlFiltering
- true to filter the publication according user rights.- Returns:
- a collection of Kmelia publications
-
getPublicationsForModification
public <T extends org.silverpeas.core.ResourceReference> List<org.silverpeas.core.util.Pair<KmeliaPublication,KmeliaPublication>> getPublicationsForModification(List<T> references, String userId)
Description copied from interface:KmeliaService
Gets a list ofPair
ofKmeliaPublication
instances into context of modification by a user represented by the given user id. On the left of aPair
instance, there is a publication that can not be a null value. On the right, there is the clone of the publication if any, and so, it can be null if the publication has got no clone.The main location is computed for each publication (and clone) by taking care about performances.
This service guarantees that the returned
KmeliaPublication
instances each aims the main location.- Specified by:
getPublicationsForModification
in interfaceKmeliaService
- Parameters:
references
- list of publication represented asResourceReference
instances.userId
- identifier User. allow to check if the publication is accessible for current user- Returns:
- a list of
Pair
ofKmeliaPublication
instances. A pair represents on the left the publication and the eventual corresponding clone on the right if it exists.
-
getLinkedPublications
public List<KmeliaPublication> getLinkedPublications(KmeliaPublication publication, String userId)
Gets the publications linked with the specified one and for which the specified user is authorized to access.- Specified by:
getLinkedPublications
in interfaceKmeliaService
- Parameters:
publication
- the publication from which linked publications are get.userId
- the unique identifier of a user. It allows to check if a linked publication is accessible for the specified user.- Returns:
- a list of Kmelia publications.
-
getPublicationsToValidate
public List<KmeliaPublication> getPublicationsToValidate(String componentId, String userId)
- Specified by:
getPublicationsToValidate
in interfaceKmeliaService
-
getAllValidators
public ValidatorsList getAllValidators(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
getAllValidators
in interfaceKmeliaService
-
setValidators
public void setValidators(org.silverpeas.core.contribution.publication.model.PublicationPK pubOrClonePK, String userIds)
- Specified by:
setValidators
in interfaceKmeliaService
-
validatePublication
public boolean validatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, boolean force, boolean hasUserNoMoreValidationRight)
- Specified by:
validatePublication
in interfaceKmeliaService
- Parameters:
pubPK
- id of the publication to validate. If publication is always visible, clone is processed.userId
- id of the user who validateforce
- if true, force to validate publication (bypass pending validations)hasUserNoMoreValidationRight
- true if the given id represents a user which has no more validation right (deleted user for example)- Returns:
- true if the validation process is complete (ie all validators have validate)
-
unvalidatePublication
public void unvalidatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, String refusalMotive, int validationType)
- Specified by:
unvalidatePublication
in interfaceKmeliaService
-
suspendPublication
public void suspendPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String defermentMotive, String userId)
- Specified by:
suspendPublication
in interfaceKmeliaService
-
draftOutPublication
public void draftOutPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile)
Description copied from interface:KmeliaService
Change publication status from draft to valid (for publisher) or toValidate (for redactor)- Specified by:
draftOutPublication
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publication
-
draftOutPublicationWithoutNotifications
public org.silverpeas.core.contribution.publication.model.PublicationDetail draftOutPublicationWithoutNotifications(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile)
- Specified by:
draftOutPublicationWithoutNotifications
in interfaceKmeliaService
-
draftOutPublication
public void draftOutPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK, String userProfile, boolean forceUpdateDate)
- Specified by:
draftOutPublication
in interfaceKmeliaService
-
draftInPublication
public void draftInPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Description copied from interface:KmeliaService
Change publication status from any state to draft- Specified by:
draftInPublication
in interfaceKmeliaService
- Parameters:
pubPK
- the id of the publication
-
draftInPublication
public void draftInPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
- Specified by:
draftInPublication
in interfaceKmeliaService
-
getUserNotification
public org.silverpeas.core.notification.user.UserNotification getUserNotification(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.node.model.NodePK topicPK)
Description copied from interface:KmeliaService
Send an email to alert users of a publication creation- Specified by:
getUserNotification
in interfaceKmeliaService
- Parameters:
pubPK
- the publication Id
-
getUserNotification
public org.silverpeas.core.notification.user.UserNotification getUserNotification(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, org.silverpeas.core.contribution.attachment.model.SimpleDocumentPK documentPk, org.silverpeas.core.node.model.NodePK topicPK)
Description copied from interface:KmeliaService
Send an email to alert users of a attachment- Specified by:
getUserNotification
in interfaceKmeliaService
- Parameters:
pubPK
- the publication Id
-
deleteAllReadingControlsByPublication
public void deleteAllReadingControlsByPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
delete reading controls to a publication- Specified by:
deleteAllReadingControlsByPublication
in interfaceKmeliaService
- Parameters:
pubPK
- the id of a publication- Since:
- 1.0
-
getLastAccess
public List<org.silverpeas.core.silverstatistics.access.model.HistoryObjectDetail> getLastAccess(org.silverpeas.core.contribution.publication.model.PublicationPK pk, org.silverpeas.core.node.model.NodePK nodePK, String excludedUserId, int maxResult)
- Specified by:
getLastAccess
in interfaceKmeliaService
-
getUserIdsOfFolder
public List<String> getUserIdsOfFolder(org.silverpeas.core.node.model.NodePK pk)
- Specified by:
getUserIdsOfFolder
in interfaceKmeliaService
-
indexKmelia
public void indexKmelia(String componentId)
- Specified by:
indexKmelia
in interfaceKmeliaService
-
sendModificationAlert
public void sendModificationAlert(int modificationScope, org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
sendModificationAlert
in interfaceKmeliaService
-
getSilverObjectId
public int getSilverObjectId(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
getSilverObjectId
in interfaceKmeliaService
-
deleteSilverContent
public void deleteSilverContent(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
deleteSilverContent
in interfaceKmeliaService
-
removeContentOfPublication
public void removeContentOfPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
- Specified by:
removeContentOfPublication
in interfaceKmeliaService
-
setModelUsed
public void setModelUsed(String[] models, String instanceId, String nodeId)
- Specified by:
setModelUsed
in interfaceKmeliaService
-
getModelUsed
public Collection<String> getModelUsed(String instanceId, String nodeId)
- Specified by:
getModelUsed
in interfaceKmeliaService
-
getAxis
public List<org.silverpeas.core.node.model.NodeDetail> getAxis(String componentId)
Description copied from interface:KmeliaService
Get the axis on which publications are categorized in the specified component instance.- Specified by:
getAxis
in interfaceKmeliaService
- Parameters:
componentId
- the unique identifier of a component instance.- Returns:
- a list of axis as
NodeDetail
instances.
-
getAxisHeaders
public List<org.silverpeas.core.node.model.NodeDetail> getAxisHeaders(String componentId)
Description copied from interface:KmeliaService
Get the header of the axis on which publications are categorized in the specified component instance.- Specified by:
getAxisHeaders
in interfaceKmeliaService
- Parameters:
componentId
- the unique identifier of a component instance.- Returns:
- a list of axis headers as
NodeDetail
instances.
-
addAxis
public org.silverpeas.core.node.model.NodePK addAxis(org.silverpeas.core.node.model.NodeDetail axis, String componentId)
Description copied from interface:KmeliaService
Add the given axis into the specified component instance.- Specified by:
addAxis
in interfaceKmeliaService
- Parameters:
axis
- the axis to add.componentId
- the unique identifier of the component instance.- Returns:
- the identifier of the new added axis.
-
updateAxis
public void updateAxis(org.silverpeas.core.node.model.NodeDetail axis, String componentId)
Description copied from interface:KmeliaService
Update the given axis in the specified component instance.- Specified by:
updateAxis
in interfaceKmeliaService
- Parameters:
axis
- the axis from which its counterpart in the data source will be updated.componentId
- the unique identifier of a component instance.
-
deleteAxis
public void deleteAxis(String axisId, String componentId)
Description copied from interface:KmeliaService
Delete the given axis in the specified component instance.- Specified by:
deleteAxis
in interfaceKmeliaService
- Parameters:
axisId
- the unique identifier of the axis to delete.componentId
- the unique identifier of a component instance.
-
getNodeHeader
public org.silverpeas.core.node.model.NodeDetail getNodeHeader(String id, String componentId)
Description copied from interface:KmeliaService
Get the header of the specified node.- Specified by:
getNodeHeader
in interfaceKmeliaService
- Parameters:
id
- the unique identifier of a nodecomponentId
- the unique identifier of the component instance in which the node is.- Returns:
- a
NodeDetail
instance.
-
addPosition
public org.silverpeas.core.node.model.NodePK addPosition(String fatherId, org.silverpeas.core.node.model.NodeDetail position, String componentId, String userId)
Description copied from interface:KmeliaService
Add position to an axis in the given component instance and for the specified user.- Specified by:
addPosition
in interfaceKmeliaService
- Parameters:
fatherId
- the identifier of the position that will be the father of the new one.position
- the position to add.componentId
- the unique identifier of the component instance.userId
- the unique identifier of a user.- Returns:
- the identifier of the new position.
-
updatePosition
public void updatePosition(org.silverpeas.core.node.model.NodeDetail position, String componentId)
Description copied from interface:KmeliaService
Update a position in an axis- Specified by:
updatePosition
in interfaceKmeliaService
- Parameters:
position
- the position from which its counterpart in the data source will be updated.componentId
- the unique identifier of the component instance in which belongs the axis.
-
deletePosition
public void deletePosition(String positionId, String componentId)
Description copied from interface:KmeliaService
Delete a position in an axis- Specified by:
deletePosition
in interfaceKmeliaService
- Parameters:
positionId
- the unique identifier of the position to delete.componentId
- the unique identifier of the component instance in which belongs the axis.
-
getPath
public Collection<org.silverpeas.core.node.model.NodeDetail> getPath(String id, String componentId)
Description copied from interface:KmeliaService
Get path of a position in an axis.- Specified by:
getPath
in interfaceKmeliaService
- Parameters:
id
- the unique identifier of a position.componentId
- the unique identifier of the component instance in which belongs the axis.- Returns:
- the path of the position with a
NodeDetail
instance for each path's node.
-
search
public List<KmeliaPublication> search(List<String> combination, String componentId)
Description copied from interface:KmeliaService
Get publications categorized in a combination of positions.- Specified by:
search
in interfaceKmeliaService
- Parameters:
combination
- a list of positions composing the combination.componentId
- the unique identifier of the component instance in which belongs the combination.- Returns:
- the publications that satisfy the combination of positions.
-
search
public List<KmeliaPublication> search(List<String> combination, int nbDays, String componentId)
Description copied from interface:KmeliaService
Get publications categorized in a combination of positions and that are visible or created the given number of days ago.- Specified by:
search
in interfaceKmeliaService
- Parameters:
combination
- a list of positions composing the combination.nbDays
- the number of days before today.componentId
- the unique identifier of the component instance in which belongs the combination.- Returns:
- the publications that satisfy the combination of positions and the time criteria.
-
getUnbalancedPublications
public Collection<KmeliaPublication> getUnbalancedPublications(String componentId)
Description copied from interface:KmeliaService
Get publications that aren't categorized on any axis.- Specified by:
getUnbalancedPublications
in interfaceKmeliaService
- Parameters:
componentId
- the unique identifier of a component instance.- Returns:
- the uncategorized publications.
-
indexKmax
public void indexKmax(String componentId)
- Specified by:
indexKmax
in interfaceKmeliaService
-
getKmaxPublication
public KmeliaPublication getKmaxPublication(String pubId, String currentUserId)
Description copied from interface:KmeliaService
Get the given publication for the given user.- Specified by:
getKmaxPublication
in interfaceKmeliaService
- Parameters:
pubId
- the unique identifier of a publication.currentUserId
- the unique identifier of the user for whom the publications are asked.- Returns:
- the publication as a
KmeliaPublication
instance.
-
getPublicationCoordinates
public Collection<org.silverpeas.core.node.coordinates.model.Coordinate> getPublicationCoordinates(String pubId, String componentId)
Description copied from interface:KmeliaService
Get the coordinates for the given publication on the axis of the specified component instance.- Specified by:
getPublicationCoordinates
in interfaceKmeliaService
- Parameters:
pubId
- the unique identifier of a publication.componentId
- the unique identifier of the component instance.- Returns:
- a collection of coordinates
-
addPublicationToCombination
public void addPublicationToCombination(String pubId, List<String> combination, String componentId)
Description copied from interface:KmeliaService
Add for the given publication a combination of position on the axis of the component instance.- Specified by:
addPublicationToCombination
in interfaceKmeliaService
- Parameters:
pubId
- the unique identifier of a publication.combination
- a list of coordinate identifiers.componentId
- the unique identifier of the component instance.
-
checkCombination
protected boolean checkCombination(Collection<org.silverpeas.core.node.coordinates.model.Coordinate> coordinates, List<String> combination)
-
checkPoint
protected boolean checkPoint(org.silverpeas.core.node.coordinates.model.CoordinatePoint point, List<String> combination)
-
deletePublicationFromCombination
public void deletePublicationFromCombination(String pubId, String combinationId, String componentId)
Description copied from interface:KmeliaService
Remove for the given publication the specified combination of positions on the axis of the component instance.- Specified by:
deletePublicationFromCombination
in interfaceKmeliaService
- Parameters:
pubId
- the unique identifier of a publication.combinationId
- the unique identifier of a combination of positions.componentId
- the unique identifier of the component instance.
-
createKmaxPublication
public String createKmaxPublication(org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail)
Create a new Publication (only the header - parameters)- Specified by:
createKmaxPublication
in interfaceKmeliaService
- Parameters:
pubDetail
- a PublicationDetail- Returns:
- the id of the new publication
- Since:
- 1.0
- See Also:
PublicationDetail
-
getAliases
public Collection<org.silverpeas.core.contribution.publication.model.Location> getAliases(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Description copied from interface:KmeliaService
Gets all the aliases of the specified publication, whatever the component instance and without taking into account the publication is a clone or not. If the publication is a clone, then nothing will be returned.- Specified by:
getAliases
in interfaceKmeliaService
- Parameters:
pubPK
- the unique identifier of the publication.- Returns:
- a collection of locations that are all the aliases for the given publication.
-
getLocations
public Collection<org.silverpeas.core.contribution.publication.model.Location> getLocations(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK)
Description copied from interface:KmeliaService
Gets all the locations of the specified publication; whatever the component instance. If the given publication is a clone, then gets all the locations of the main publication.- Specified by:
getLocations
in interfaceKmeliaService
- Parameters:
pubPK
- the unique identifier of the publication.- Returns:
- a collection of the locations of the given publication.
-
setAliases
public void setAliases(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, List<org.silverpeas.core.contribution.publication.model.Location> locations)
- Specified by:
setAliases
in interfaceKmeliaService
-
addAttachmentToPublication
public void addAttachmentToPublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId, String filename, String description, byte[] contents)
- Specified by:
addAttachmentToPublication
in interfaceKmeliaService
-
createTopic
public String createTopic(String componentId, String topicId, String spaceId, String userId, String name, String description)
- Specified by:
createTopic
in interfaceKmeliaService
-
clonePublication
public String clonePublication(org.silverpeas.core.contribution.publication.model.CompletePublication refPubComplete, org.silverpeas.core.contribution.publication.model.PublicationDetail pubDetail, String nextStatus)
Description copied from interface:KmeliaService
Clone the given publication. Create new publication based on pubDetail object if not null or CompletePublication otherwise. Original publication will not be modified (except references to clone: cloneId and cloneStatus).- Specified by:
clonePublication
in interfaceKmeliaService
pubDetail
- If not null, attribute values are set to the clonenextStatus
- Draft or Clone- Returns:
- the identifier of the cloned publication.
-
getRoot
public org.silverpeas.core.node.model.NodeDetail getRoot(String componentId, String userId)
- Specified by:
getRoot
in interfaceKmeliaService
-
getFolder
public org.silverpeas.core.node.model.NodeDetail getFolder(org.silverpeas.core.node.model.NodePK nodePK, String userId)
Description copied from interface:KmeliaService
Gets the details about the specified folder. The difference withKmeliaService.getNodeHeader(String, String)
is that the children are also set as well as other information like the number of publications.- Specified by:
getFolder
in interfaceKmeliaService
- Parameters:
nodePK
- the unique identifier of the folder.userId
- the unique identifier of the user for which the folder is asked.- Returns:
- the
NodeDetail
instance corresponding to the folder.
-
getFolderChildren
public Collection<org.silverpeas.core.node.model.NodeDetail> getFolderChildren(org.silverpeas.core.node.model.NodePK nodePK, String userId)
- Specified by:
getFolderChildren
in interfaceKmeliaService
-
getUserTopicProfile
public String getUserTopicProfile(org.silverpeas.core.node.model.NodePK pk, String userId)
- Specified by:
getUserTopicProfile
in interfaceKmeliaService
-
isUserCanValidatePublication
public boolean isUserCanValidatePublication(org.silverpeas.core.contribution.publication.model.PublicationPK pubPK, String userId)
This method verifies if the user behind the given user identifier can validate the publication represented by the given primary key. The verification is strictly applied on the given primary key, that is to say that no publication clone information are retrieved. To perform a verification on a publication clone, the primary key of the clone must be given.- Specified by:
isUserCanValidatePublication
in interfaceKmeliaService
- Parameters:
pubPK
- the primary key of the publication or of the clone of a publication.userId
- the identifier of the user fo which rights must be verified.- Returns:
- true if the user can validate, false otherwise.
-
isUserCanValidate
public boolean isUserCanValidate(String componentId, String userId)
- Specified by:
isUserCanValidate
in interfaceKmeliaService
-
isUserCanWrite
public boolean isUserCanWrite(String componentId, String userId)
- Specified by:
isUserCanWrite
in interfaceKmeliaService
-
isUserCanPublish
public boolean isUserCanPublish(String componentId, String userId)
- Specified by:
isUserCanPublish
in interfaceKmeliaService
-
getExpandedPathToNode
public org.silverpeas.core.node.model.NodeDetail getExpandedPathToNode(org.silverpeas.core.node.model.NodePK pk, String userId)
- Specified by:
getExpandedPathToNode
in interfaceKmeliaService
-
deletePublications
public List<String> deletePublications(List<String> ids, org.silverpeas.core.node.model.NodePK nodePK, String userId)
Removes publications according to given ids. Before a publication is removed, user priviledges are controlled. If node defines the trash, publications are definitively deleted. Otherwise, publications move into trash.- Specified by:
deletePublications
in interfaceKmeliaService
- Parameters:
ids
- the ids of publications to deletenodePK
- the node where the publications areuserId
- the user who wants to perform deletion- Returns:
- the list of publication ids which has been really deleted
-
getContributionById
public Optional<KmeliaPublication> getContributionById(org.silverpeas.core.contribution.model.ContributionIdentifier contributionId)
- Specified by:
getContributionById
in interfaceorg.silverpeas.core.ApplicationService
- Specified by:
getContributionById
in interfaceKmeliaService
-
getComponentSettings
public org.silverpeas.core.util.SettingBundle getComponentSettings()
- Specified by:
getComponentSettings
in interfaceorg.silverpeas.core.ApplicationService
-
getComponentMessages
public org.silverpeas.core.util.LocalizationBundle getComponentMessages(String language)
- Specified by:
getComponentMessages
in interfaceorg.silverpeas.core.ApplicationService
-
isRelatedTo
public boolean isRelatedTo(String instanceId)
- Specified by:
isRelatedTo
in interfaceorg.silverpeas.core.ApplicationService
-
moveNode
@SimulationActionProcess(elementLister=KmeliaNodeSimulationElementLister.class) @Action(MOVE) public void moveNode(@SourcePK org.silverpeas.core.node.model.NodePK nodePK, @TargetPK org.silverpeas.core.node.model.NodePK to, KmeliaPasteDetail pasteContext)
- Specified by:
moveNode
in interfaceKmeliaService
-
copyNode
@SimulationActionProcess(elementLister=KmeliaNodeSimulationElementLister.class) @Action(COPY) public void copyNode(@SourcePK @TargetPK KmeliaCopyDetail copyDetail)
- Specified by:
copyNode
in interfaceKmeliaService
-
copyPublications
@SimulationActionProcess(elementLister=KmeliaPublicationSimulationElementLister.class) @Action(COPY) public void copyPublications(@SourcePK @TargetPK KmeliaCopyDetail copyDetail)
- Specified by:
copyPublications
in interfaceKmeliaService
-
copyPublication
@SimulationActionProcess(elementLister=KmeliaPublicationSimulationElementLister.class) @Action(COPY) public void copyPublication(@SourcePK org.silverpeas.core.contribution.publication.model.PublicationDetail publiToCopy, @TargetPK KmeliaCopyDetail copyDetail)
- Specified by:
copyPublication
in interfaceKmeliaService
-
filterPublications
public List<KmeliaPublication> filterPublications(List<KmeliaPublication> publications, String instanceId, org.silverpeas.core.admin.user.model.SilverpeasRole profile, String userId)
- Specified by:
filterPublications
in interfaceKmeliaService
-
userHaveBeenDeleted
public void userHaveBeenDeleted(String userId)
- Specified by:
userHaveBeenDeleted
in interfaceKmeliaService
-
onDocumentDeletion
protected void onDocumentDeletion(org.silverpeas.core.contribution.attachment.notification.AttachmentRef attachment)
-
getUserNotification
public org.silverpeas.core.notification.user.UserNotification getUserNotification(org.silverpeas.core.node.model.NodePK pk)
Description copied from interface:KmeliaService
Send a notification to alert users about a folder- Specified by:
getUserNotification
in interfaceKmeliaService
- Parameters:
pk
- the folder id
-
getActiveValidatorIds
public List<String> getActiveValidatorIds(org.silverpeas.core.contribution.publication.model.PublicationPK pk)
- Specified by:
getActiveValidatorIds
in interfaceKmeliaService
-
performReminder
public void performReminder(org.silverpeas.core.reminder.Reminder reminder)
Description copied from interface:KmeliaService
Performs processes about kmelia linked to given reminder.
If kmelia is not concerned, nothing is performed.- Specified by:
performReminder
in interfaceKmeliaService
- Parameters:
reminder
- aReminder
instance.
-
deleteClone
public void deleteClone(org.silverpeas.core.contribution.publication.model.PublicationPK pk)
- Specified by:
deleteClone
in interfaceKmeliaService
-
getNonVisiblePublications
public List<KmeliaPublication> getNonVisiblePublications(String componentId, String userId)
- Specified by:
getNonVisiblePublications
in interfaceKmeliaService
-
-