Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Orion
-
Orion.Cycle7.Sprint, Orion.Cycle8.Sprint
-
Undetermined
-
Medium (3-5)
Description
XPage: XPage document can refer documents in 2 ways;
1) On /{xpage-document}/{variant}/hst:xpage/{container-name}/{component-name} node, hst:parametervalues property can store documents by their paths. For example;
XPage name: test
Container Item Component Path: /content-en/pages/test/test[3]/hst:xpage/cd56ee48-0ad2-4477-9e70-74572e7e70c2/referencespa-banner-collection-WHCBC
hst:parameternames: document1
hst:parametervalues: banners/brand-1
2) On /{xpage-document}/{variant}/hippostd:componentcontentgroup/{component-name} node, a child-node can have a hippo:docbase field that refers a document. For example;
XPage name: test
Component Content Group Path: /content-en/pages/test/test[3]/hippostd:componentcontentgroup/referencespa:bannergallery-ZtRuM/referencespa:banners/referencespa:link
hippo:docbase: 44871ee6-fc7e-44e5-82af-146c0c46219d
Hst: Hst page can refer documents in the following way;
HstSite has all component configurations (including container items) calculated and merged, so it can be used to get container items hence finding possible document references there.
Here is an example of how to find hst:containeritemcomponent nodes which store references and parameters for components;
hstSite.getComponentsConfiguration()
.getComponentConfigurations()
.entrySet()
.stream()
.filter(configuration -> HstComponentConfiguration.Type.CONTAINER_ITEM_COMPONENT
.equals(configuration.getValue().getComponentType()))
.forEach(conf -> {
// here configurations can be iterated in a loop to check for document references
});
To get the hstSite instance, following method in SaaS codebase can be used as an example;
hst-commons -> org.hippoecm.hst.core.experiencepage.HstUtils#getSite
There, to find the references of a document, 'hst:parametervalues' and 'hippo:mirror' fields should be checked for document paths and document uuid values respectively.