Search in sources :

Example 1 with List

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List in project kie-wb-common by kiegroup.

the class ListPropertyConverter method wbFromDMN.

public static List wbFromDMN(final org.kie.dmn.model.v1_1.List dmn) {
    Id id = new Id(dmn.getId());
    Description description = new Description(dmn.getDescription());
    QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
    java.util.List<Expression> expression = new ArrayList<>();
    for (org.kie.dmn.model.v1_1.Expression e : dmn.getExpression()) {
        Expression eConverted = ExpressionPropertyConverter.wbFromDMN(e);
        expression.add(eConverted);
    }
    List result = new List(id, description, typeRef, expression);
    return result;
}
Also used : Description(org.kie.workbench.common.dmn.api.property.dmn.Description) Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ArrayList(java.util.ArrayList) List(org.kie.workbench.common.dmn.api.definition.v1_1.List) ArrayList(java.util.ArrayList) Id(org.kie.workbench.common.dmn.api.property.dmn.Id)

Example 2 with List

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List in project kie-wb-common by kiegroup.

the class ListPropertyConverter method dmnFromWB.

public static org.kie.dmn.model.v1_1.List dmnFromWB(final List wb) {
    org.kie.dmn.model.v1_1.List result = new org.kie.dmn.model.v1_1.List();
    result.setId(wb.getId().getValue());
    result.setDescription(wb.getDescription().getValue());
    QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
    for (Expression e : wb.getExpression()) {
        org.kie.dmn.model.v1_1.Expression eConverted = ExpressionPropertyConverter.dmnFromWB(e);
        result.getExpression().add(eConverted);
    }
    return result;
}
Also used : Expression(org.kie.workbench.common.dmn.api.definition.v1_1.Expression) List(org.kie.workbench.common.dmn.api.definition.v1_1.List) ArrayList(java.util.ArrayList)

Example 3 with List

use of com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ListIT method setup.

protected void setup() throws ClientException {
    // add 2 tags
    tag1Path = Commons.addTag(adminClient, tag1);
    tag2Path = Commons.addTag(adminClient, tag2);
    // create a separate parent page
    parentPath = authorClient.createPage("parent_page", "parent_page", rootPage, defaultPageTemplate).getSlingPath();
    // add page 1
    page1Path = authorClient.createPage("page_1", "page_1", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    String[] tags = new String[] { tag1 };
    Commons.setTagsToPage(adminClient, page1Path, tags, 200);
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("jcr:description", description);
    Commons.editNodeProperties(adminClient, page1Path + "/jcr:content", data);
    // add page 2
    page2Path = authorClient.createPage("page_2", "page_2", parentPath, defaultPageTemplate).getSlingPath();
    // add a text component
    String text1Path = Commons.addComponent(adminClient, Commons.rtText_v1, page2Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text1Path, data);
    // create subpage for page 2
    page21Path = authorClient.createPage("sub_2_1", "sub_2_1", page2Path, defaultPageTemplate).getSlingPath();
    // create second sub page for page 2
    page22Path = authorClient.createPage("sub_2_2", "sub_2_2", page2Path, defaultPageTemplate).getSlingPath();
    // add page 3
    page3Path = authorClient.createPage("page_3", "page_3", parentPath, defaultPageTemplate).getSlingPath();
    // set 2 tags on the page
    tags = new String[] { tag1, tag2 };
    Commons.setTagsToPage(adminClient, page3Path, tags, 200);
    // create page 4
    page4Path = authorClient.createPage("page_4", "page_4", parentPath, defaultPageTemplate).getSlingPath();
    // create a sub page for page 4
    String page41Path = authorClient.createPage("sub_4_1", "sub_4_1", page4Path, defaultPageTemplate).getSlingPath();
    // add a text component
    String text2Path = Commons.addComponent(adminClient, Commons.rtText_v1, page41Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text2Path, data);
    // create page 5
    page5Path = authorClient.createPage("page_5", "page_5", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    tags = new String[] { tag2 };
    Commons.setTagsToPage(adminClient, page5Path, tags, 200);
    // create the test page containing the list component, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, listRT, Commons.proxyPath, null, null);
    // add the component to test page
    compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "list", null);
    // open test page in page editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    list = new List();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) List(com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List)

Aggregations

ArrayList (java.util.ArrayList)2 Expression (org.kie.workbench.common.dmn.api.definition.v1_1.Expression)2 List (org.kie.workbench.common.dmn.api.definition.v1_1.List)2 PageEditorPage (com.adobe.cq.testing.selenium.pageobject.PageEditorPage)1 List (com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List)1 HashMap (java.util.HashMap)1 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)1 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)1 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)1