Package org.hippoecm.frontend.util
Class DocumentReferenceUtils
java.lang.Object
org.hippoecm.frontend.util.DocumentReferenceUtils
Utility class for document reference related operations.
-
Method Summary
Modifier and TypeMethodDescriptiongetComponentVariants
(ComponentReference reference, String locale) Returns the set of variants for the givenComponentReference
.getReferencingXPageComponents
(Node handle, String channelRootPath, boolean preview) getReferencingXPageComponents
(Node handle, String channelRootPath, boolean preview, String projectId) getReferredDocuments
(Node variant) Returns the list of 1st level referred documents by the given documentvariant
.getReferredDocuments
(Node variant, ReferenceSearchFilter searchFilter) Returns the list of 1st level referred documents by the given documentvariant
.getReferringDocuments
(Node handle, ReferenceSearchFilter searchFilter) Returns the list of 1st level referring documents by the given documenthandle
.static List<SiteReference>
getSiteReferences
(Node handle, String hostGroup, boolean preview) Returns the list ofSiteReference
s for the given documenthandle
.static List<SiteReference>
getSiteReferences
(Node handle, String hostGroup, boolean preview, String projectId) Returns the list ofSiteReference
s for the given documenthandle
.
-
Method Details
-
getReferencingXPageComponents
public static List<Node> getReferencingXPageComponents(Node handle, String channelRootPath, boolean preview) throws RepositoryException - Parameters:
handle
- document handlechannelRootPath
- the path of the channel rootpreview
- whether to find preview components- Returns:
- list of xpage component nodes
- Throws:
RepositoryException
-
getReferencingXPageComponents
public static List<Node> getReferencingXPageComponents(Node handle, String channelRootPath, boolean preview, String projectId) throws RepositoryException - Parameters:
handle
- document handlechannelRootPath
- the path of the channel rootpreview
- whether to find preview componentsprojectId
- id of the project- Returns:
- list of xpage component nodes
- Throws:
RepositoryException
-
getReferringDocuments
public static List<Node> getReferringDocuments(Node handle, ReferenceSearchFilter searchFilter) throws RepositoryException Returns the list of 1st level referring documents by the given documenthandle
.- Parameters:
variant
- document handle nodesearchFilter
- reference search filter- Returns:
- list of referred document nodes
- Throws:
RepositoryException
-
getReferredDocuments
Returns the list of 1st level referred documents by the given documentvariant
.- Parameters:
variant
- document variant node- Returns:
- list of referred document nodes
- Throws:
RepositoryException
-
getReferredDocuments
public static List<Node> getReferredDocuments(Node variant, ReferenceSearchFilter searchFilter) throws RepositoryException Returns the list of 1st level referred documents by the given documentvariant
.- Parameters:
variant
- document variant nodesearchFilter
- reference search filter- Returns:
- list of referred document nodes
- Throws:
RepositoryException
-
getSiteReferences
public static List<SiteReference> getSiteReferences(Node handle, String hostGroup, boolean preview) throws RepositoryException Returns the list ofSiteReference
s for the given documenthandle
.- Parameters:
handle
- document handlehostGroup
- host group of the callerpreview
- whether to find preview references- Returns:
- list of site references
- Throws:
RepositoryException
-
getSiteReferences
public static List<SiteReference> getSiteReferences(Node handle, String hostGroup, boolean preview, String projectId) throws RepositoryException Returns the list ofSiteReference
s for the given documenthandle
.- Parameters:
handle
- document handlehostGroup
- host group of the callerpreview
- whether to get preview referencesprojectId
- id of the project- Returns:
- list of site references
- Throws:
RepositoryException
-
getComponentVariants
Returns the set of variants for the givenComponentReference
.- Parameters:
reference
- the component referencelocale
- the locale- Returns:
- set of component variants
-