ilscipio/scipio-erp

View on GitHub
applications/content/widget/SurveyScreens.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <screen name="FindSurvey">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindSurvey"/>
                <set field="activeSubMenuItem" value="Survey"/>
                <set field="labelTitleProperty" value="PageTitleFindSurvey"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <!-- SCIPIO: Duplicate
                            <decorator-section name="menu-bar">
                                <container style="button-bar"><link text="${uiLabelMap.ContentSurveyCreate}" target="EditSurvey" style="${styles.link_nav} ${styles.action_add}"/></container>
                            </decorator-section>
                            -->
                            <decorator-section name="search-options">
                                <include-form name="FindSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListFindSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="CommonSurveyDecorator">
        <section>
            <actions>
                <set field="activeSubMenu" from-field="activeSubMenu" default-value="component://content/widget/SurveyMenus.xml#Survey" />
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="commonSideBarMenu.condList[]" type="Boolean" value="${not empty context.surveyId}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContentAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <container><link text="${uiLabelMap.ContentSurveyCreate}" target="EditSurvey" style="${styles.link_nav} ${styles.action_add}"/></container>
                        <decorator-section-include name="body"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditSurvey">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSurvey"/>
                <set field="activeSubMenuItem" value="Survey"/>
                <set field="labelTitleProperty" value="PageTitleEditSurvey"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-empty field="survey"/>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.PageTitleCreateSurvey}">
                                    <include-form name="EditSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <screenlet><!-- title="${uiLabelMap.PageTitleEditSurvey} ${uiLabelMap.ContentSurveySurveyId} ${surveyId}"  -->
                                    <include-form name="EditSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                                    <include-form name="BuildSurveyFromPdf" location="component://content/widget/survey/SurveyForms.xml"/>
                                </screenlet>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditSurveyMultiResps">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSurveyMultiResps"/>
                <set field="activeSubMenuItem" value="SurveyMultiResps"/>
                <set field="labelTitleProperty" value="PageTitleEditSurveyMultiResps"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>
                <entity-condition entity-name="SurveyMultiResp" list="surveyMultiRespList">
                    <condition-expr field-name="surveyId" from-field="surveyId"/>
                    <order-by field-name="surveyMultiRespId"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <label style="heading">${uiLabelMap.PageTitleEditSurveyMultiResps} ${uiLabelMap.ContentSurveySurveyId} ${surveyId}</label>
                        <iterate-section entry="surveyMultiResp" list="surveyMultiRespList">
                            <section>
                                <widgets>
                                    <screenlet title="${uiLabelMap.ContentSurveyEditSurveyMultiResp}">
                                        <include-form name="EditSurveyMultiResp" location="component://content/widget/survey/SurveyForms.xml"/>
                                        <include-form name="ListSurveyMultiRespColumns" location="component://content/widget/survey/SurveyForms.xml"/>
                                    </screenlet>
                                    <screenlet title="${uiLabelMap.ContentSurveyAddSurveyMultiRespColumn}">
                                        <include-form name="AddSurveyMultiRespColumn" location="component://content/widget/survey/SurveyForms.xml"/>
                                    </screenlet>
                                </widgets>
                            </section>
                        </iterate-section>
                        <screenlet title="${uiLabelMap.ContentSurveyAddSurveyMultiResp}">
                            <include-form name="AddSurveyMultiResp" location="component://content/widget/survey/SurveyForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditSurveyQuestions">
        <section>
            <actions>

                <set field="titleProperty" value="PageTitleEditSurveyQuestions"/>
                <set field="activeSubMenuItem" value="SurveyQuestions"/>
                <set field="labelTitleProperty" value="PageTitleEditSurveyQuestions"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>

                <script location="component://content/webapp/content/WEB-INF/actions/survey/EditSurveyQuestions.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <platform-specific><html><html-template location="component://content/webapp/content/survey/EditSurveyQuestions.ftl"/></html></platform-specific>

                        <!-- This page is a bit of a mess, so will cleanup/modernize later...
                        <include-form name="ListSurveyQuestions" location="component://content/widget/survey/SurveyForms.xml"/>
                        <include-form name="CreateSurveyQuestion" location="component://content/widget/survey/SurveyForms.xml"/>
                        -->

                        <screenlet id="SurveyPagePanel" title="${uiLabelMap.PageTitleEditSurveyPages} ${uiLabelMap.ContentSurveySurveyId} ${surveyId}" collapsible="true">
                            <include-form name="AddSurveyPage" location="component://content/widget/survey/SurveyForms.xml"/>
                        </screenlet>
                        <include-form name="ListSurveyPages" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindSurveyResponse">
        <section>
            <actions>
                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="titleProperty" value="PageTitleFindSurveyResponse"/>
                <set field="activeSubMenuItem" value="FindSurveyResponse"/>
                <set field="labelTitleProperty" value="PageTitleFindSurveyResponse"/>

                <set field="queryString" from-field="result.queryString"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleFindSurveyResponse} ${uiLabelMap.ContentSurveySurveyId} ${surveyId}">
                            <container>
                                <link text="${uiLabelMap.ContentSurveyCreateResponse}" target="EditSurveyResponse" style="${styles.link_nav} ${styles.action_add}">
                                    <parameter param-name="surveyId"/>
                                </link>
                            </container>
                            <include-form name="FindSurveyResponse" location="component://content/widget/survey/SurveyForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.ContentSurveyBuildRespondeFromPDF}">
                            <include-form name="BuildSurveyResponseFromPdf" location="component://content/widget/survey/SurveyForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.PageTitleListSurveyResponse}">
                            <include-form name="ListFindSurveyResponse" location="component://content/widget/survey/SurveyForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ViewSurveyResponses">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleViewSurveyResponses"/>
                <set field="activeSubMenuItem" value="SurveyResponses"/>
                <set field="labelTitleProperty" value="PageTitleViewSurveyResponses"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>

                <script location="component://content/webapp/content/WEB-INF/actions/survey/ViewSurveyResponses.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <container>
                            <link text="${uiLabelMap.ContentSurveyCreateResponse}" target="EditSurveyResponse" style="${styles.link_nav} ${styles.action_add}">
                                <parameter param-name="surveyId"/>
                            </link>
                        </container>
                        <screenlet title="${uiLabelMap.PageTitleViewSurveyResponses} ${uiLabelMap.ContentSurveySurveyId} ${surveyId}">
                            <section>
                                <condition><not><if-empty field="parameters.rootContentId"/></not></condition>
                                <widgets>
                                    <container>
                                        <link text="${uiLabelMap.ContentCompDocGoBack} [${parameters.rootContentId}]" target="ViewCompDocInstanceTree" style="${styles.link_nav_cancel_long}">
                                            <parameter param-name="rootContentId" from-field="parameters.rootContentId"/>
                                        </link>
                                    </container>
                                </widgets>
                            </section>
                            <platform-specific><html><html-template location="component://content/webapp/content/survey/ViewSurveyResponses.ftl"/></html></platform-specific>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditSurveyResponse">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditSurveyResponse"/>
                <set field="activeSubMenuItem" value="SurveyResponses"/>
                <set field="labelTitleProperty" value="PageTitleEditSurveyResponse"/>

                <set field="surveyId" from-field="parameters.surveyId"/>
                <entity-one entity-name="Survey" value-field="survey"/>

                <set field="surveyResponseId" from-field="parameters.surveyResponseId"/>
                <entity-one entity-name="SurveyResponse" value-field="surveyResponse"/>
                <script location="component://content/webapp/content/WEB-INF/actions/survey/EditSurveyResponse.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonSurveyDecorator">
                    <decorator-section name="body">
                        <label style="heading">${uiLabelMap.PageTitleEditSurveyResponse}, ${uiLabelMap.ContentSurveyResponse}: ${parameters.surveyResponseId}, ${uiLabelMap.ContentSurveySurveyId}: ${surveyId}</label>
                        <platform-specific><html><html-template location="component://content/webapp/content/survey/EditSurveyResponse.ftl"/></html></platform-specific>
                        <include-form name="BuildSurveyResponseFromPdf" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="LookupSurvey">
        <section>
            <condition>
                <if-has-permission permission="CONTENTMGR" action="_VIEW"/>
            </condition>
            <actions>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="title" from-field="uiLabelMap.PageTitleLookupSurvey"/>
                <set field="queryString" from-field="result.queryString"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
            </actions>
            <widgets>
                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-options">
                        <include-form name="lookupSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                    <decorator-section name="search-results">
                        <include-form name="listLookupSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="LookupSurveyResponse">
        <section>
            <condition>
                <if-has-permission permission="CONTENTMGR" action="_VIEW"/>
            </condition>
            <actions>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="title" from-field="uiLabelMap.PageTitleLookupSurveyResponse"/>
                <set field="queryString" from-field="result.queryString"/>
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
                <property-to-field resource="widget" property="widget.form.defaultViewSize" field="viewSizeDefaultValue"/>
                <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
            </actions>
            <widgets>
                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-options">
                        <include-form name="lookupSurveyResponse" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                    <decorator-section name="search-results">
                        <include-form name="listLookupSurveyResponse" location="component://content/widget/survey/SurveyForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ListFindSurveySearchResults">
        <section>
            <condition>
                <if-has-permission permission="CONTENTMGR" action="_VIEW"/>
            </condition>
            <actions>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
            </actions>
            <widgets>
                <include-form name="ListFindSurvey" location="component://content/widget/survey/SurveyForms.xml"/>
            </widgets>
        </section>
    </screen>

    <!-- SCIPIO: Widget: Simple survey response info. Input fields: surveyTmplLoc (optional; if empty, skips the template render) -->
    <screen name="RenderSurveyResponse">
        <section>
            <actions>
                <script location="component://content/webapp/content/WEB-INF/actions/survey/RenderSurveyResponse.groovy"/>
            </actions>
            <widgets>
                <section>
                    <condition><not><if-empty field="surveyString"/></not></condition>
                    <widgets>
                        <platform-specific><html><html-template><![CDATA[${raw(surveyString!)}]]></html-template></html></platform-specific>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: Widget: Simple non-interactive survey response info - see ordermgr showcartitems.ftl for reference usage -->
    <screen name="SurveyResponseQaList">
        <section>
            <actions>
                <set field="surveyTmplLoc" value="component://content/template/survey/qalistresult.ftl"/>
            </actions>
            <widgets>
                <include-screen name="RenderSurveyResponse"/>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: Widget: Simple non-interactive survey response info - see ordermgr showcartitems.ftl for reference usage -->
    <screen name="SurveyResponseDetail">
        <section>
            <actions>
                <set field="surveyTmplLoc" value="component://content/template/survey/genericresult.ftl"/>
            </actions>
            <widgets>
                <include-screen name="RenderSurveyResponse"/>
            </widgets>
        </section>
    </screen>
</screens>