public class LinkManagerImpl extends Object implements LinkManager
| Constructor and Description |
|---|
LinkManagerImpl(org.exoplatform.services.jcr.ext.app.SessionProviderService providerService) |
| Modifier and Type | Method and Description |
|---|---|
javax.jcr.Node |
createLink(javax.jcr.Node parent,
javax.jcr.Node target)
Creates a new link with "exo:symlink" type.
|
javax.jcr.Node |
createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target)
Creates a new link with a given type.
|
javax.jcr.Node |
createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target,
String linkName)
Creates a new link with given type and name.
|
javax.jcr.Node |
createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target,
String linkName,
String linkTitle)
Creates a new link with given type, name and title.
|
List<javax.jcr.Node> |
getAllLinks(javax.jcr.Node targetNode,
String linkType)
Gets all links of a target node by a given link type.
|
List<javax.jcr.Node> |
getAllLinks(javax.jcr.Node targetNode,
String linkType,
org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
Gets all links of a target node by a given link type.
|
javax.jcr.Node |
getTarget(javax.jcr.Node link)
Gets the target node of a given link using the user session.
|
javax.jcr.Node |
getTarget(javax.jcr.Node link,
boolean system)
Gets the target node of a given link.
|
String |
getTargetPrimaryNodeType(javax.jcr.Node link)
Gets the primary nodetype of a target node by a given link.
|
boolean |
isLink(javax.jcr.Item item)
Checks if a given item is link.
|
boolean |
isTargetReachable(javax.jcr.Node link)
Checks if the target node of a given link can be reached using the user session.
|
boolean |
isTargetReachable(javax.jcr.Node link,
boolean system)
Checks if the target node of a given link can be reached using the user session.
|
javax.jcr.Node |
updateLink(javax.jcr.Node linkNode,
javax.jcr.Node targetNode)
Updates a link node.
|
void |
updateSymlink(javax.jcr.Node node)
Updates information for a symlink, including "exo:title", "exo:dateCreated", "exo:dateModified", "publication:liveDate" and "exo:index".
|
public javax.jcr.Node createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target)
throws javax.jcr.RepositoryException
createLink in interface LinkManagerparent - The parent node that contains the new link.linkType - The primary nodetype of the link that must be sub-type of
"exo:symlink". Its default value is "exo:symlink".target - Target of the link.javax.jcr.RepositoryException - if the link cannot be created for any reason.public javax.jcr.Node createLink(javax.jcr.Node parent,
javax.jcr.Node target)
throws javax.jcr.RepositoryException
createLink in interface LinkManagerparent - The parent node that contains the new link.target - Target of the link.javax.jcr.RepositoryException - if the link cannot be created for any reason.public javax.jcr.Node createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target,
String linkName)
throws javax.jcr.RepositoryException
createLink in interface LinkManagerparent - The parent node that contains the new link.linkType - The primary nodetype of the link that must be sub-type of
"exo:symlink". Its default value is "exo:symlink".target - Target of the link.linkName - Name of the link.javax.jcr.RepositoryException - if the link cannot be created for any reason.public javax.jcr.Node createLink(javax.jcr.Node parent,
String linkType,
javax.jcr.Node target,
String linkName,
String linkTitle)
throws javax.jcr.RepositoryException
createLink in interface LinkManagerparent - The parent node that contains the new link.linkType - The primary nodetype of the link that must be sub-type of
"exo:symlink". Its default value is "exo:symlink".target - Target of the link.linkName - Name of the link.linkTitle - Title of the link.javax.jcr.RepositoryException - if the link cannot be created for any reason.public javax.jcr.Node getTarget(javax.jcr.Node link,
boolean system)
throws javax.jcr.ItemNotFoundException,
javax.jcr.RepositoryException
getTarget in interface LinkManagerlink - The node of "exo:symlink" type.system - Indicates whether the target node must be retrieved using a
system or user session. In case the target and the
link are not in the same workspace, the system session will be used.javax.jcr.ItemNotFoundException - if the target node cannot be found.javax.jcr.RepositoryException - if an unexpected error occurs while retrieving
the target node.public javax.jcr.Node getTarget(javax.jcr.Node link)
throws javax.jcr.ItemNotFoundException,
javax.jcr.RepositoryException
getTarget in interface LinkManagerlink - The node of "exo:symlink" type.javax.jcr.ItemNotFoundException - if the target node cannot be found.javax.jcr.RepositoryException - if an unexpected error occurs while retrieving
the target nodepublic boolean isTargetReachable(javax.jcr.Node link)
throws javax.jcr.RepositoryException
isTargetReachable in interface LinkManagerlink - The node of "exo:symlink" type.javax.jcr.RepositoryException - if an unexpected error occurs.public boolean isTargetReachable(javax.jcr.Node link,
boolean system)
throws javax.jcr.RepositoryException
isTargetReachable in interface LinkManagerlink - The node of "exo:symlink" type.system - The boolean value which indicates if the system session is needed.javax.jcr.RepositoryException - if an unexpected error occurs.public javax.jcr.Node updateLink(javax.jcr.Node linkNode,
javax.jcr.Node targetNode)
throws javax.jcr.RepositoryException
updateLink in interface LinkManagerlinkNode - The link node to be updated.targetNode - Target of the link node.javax.jcr.RepositoryException - if the link cannot be updated for any reason.public boolean isLink(javax.jcr.Item item)
throws javax.jcr.RepositoryException
isLink in interface LinkManageritem - The item to be checked.javax.jcr.RepositoryException - if an unexpected error occurspublic String getTargetPrimaryNodeType(javax.jcr.Node link) throws javax.jcr.RepositoryException
getTargetPrimaryNodeType in interface LinkManagerlink - The given link.javax.jcr.RepositoryException - if an unexpected error occurs.public List<javax.jcr.Node> getAllLinks(javax.jcr.Node targetNode, String linkType, org.exoplatform.services.jcr.ext.common.SessionProvider sessionProvider)
getAllLinks in interface LinkManagertargetNode - The target node.linkType - The given link type.sessionProvider - The session provider.public List<javax.jcr.Node> getAllLinks(javax.jcr.Node targetNode, String linkType)
getAllLinks in interface LinkManagertargetNode - The target node.linkType - The given link type.public void updateSymlink(javax.jcr.Node node)
throws javax.jcr.RepositoryException
updateSymlink in interface LinkManagernode - The link node.javax.jcr.RepositoryExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.