use of com.adobe.cq.wcm.core.components.it.seljup.util.components.commons.AssetFinder in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class TeaserIT method setup.
protected void setup(String imageResourceType) throws ClientException {
testPage = authorClient.createPage(pageName, pageTitle, rootPage, defaultPageTemplate).getSlingPath();
secondTestPage = authorClient.createPage(secondPageName, secondPageTitle, rootPage, defaultPageTemplate).getSlingPath();
thirdTestPage = authorClient.createPage(thirdPageName, thirdPageTitle, rootPage, defaultPageTemplate).getSlingPath();
// Update test page description
java.util.List<NameValuePair> props = new ArrayList();
props.add(new BasicNameValuePair("jcr:description", pageDescription));
Commons.setPageProperties(adminClient, testPage, props, 200, 201);
String policySuffix = "/structure/page/new_policy";
HashMap<String, String> data = new HashMap();
data.put("jcr:title", "New Policy");
data.put("sling:resourceType", "wcm/core/components/policy/policy");
data.put("clientlibs", clientlibs);
String policyPath1 = "/conf/" + label + "/settings/wcm/policies/core-component/components";
String policyPath = Commons.createPolicy(adminClient, policySuffix, data, policyPath1);
// 3.
String policyLocation = "core-component/components";
String policyAssignmentPath = defaultPageTemplate + "/policies/jcr:content";
data.clear();
data.put("cq:policy", policyLocation + policySuffix);
data.put("sling:resourceType", "wcm/core/components/policies/mappings");
Commons.assignPolicy(adminClient, "", data, policyAssignmentPath);
proxyPath = Commons.createProxyComponent(adminClient, teaserRT, Commons.proxyPath, null, null);
imageProxyPath = Commons.createProxyComponent(adminClient, imageResourceType, Commons.proxyPath, null, null);
data.clear();
data.put("imageDelegate", imageProxyPath);
Commons.editNodeProperties(adminClient, proxyPath, data);
cmpPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, componentName, null);
editorPage = new PageEditorPage(testPage);
editorPage.open();
assetFinder = new AssetFinder();
}
Aggregations