ilscipio/scipio-erp

View on GitHub
applications/marketing/widget/ContactListScreens.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="FindContactLists">
       <section>
           <actions>
               <set field="titleProperty" value="MarketingContactListFindContactLists"/>
               <set field="activeSubMenuItem" value="ContactList"/>               
               <set field="activeContactListSubMenuItem" value="ContactList"/>
               <set field="labelTitleProperty" value="PageTitleFindContactLists"/>
               <set field="donePage" from-field="parameters.DONE_PAGE" default-value="/marketing/control/FindContactList"/>
           </actions>
           <widgets>
               <decorator-screen name="CommonMarketingAppDecorator" location="${parameters.mainDecoratorLocation}">
                   <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link text="${uiLabelMap.MarketingContactListCreate}" target="EditContactList" style="${styles.link_nav} ${styles.action_add}">
                                        <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                    </link>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindContactLists" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListContactLists" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                   </decorator-section>
               </decorator-screen>
           </widgets>
       </section>
   </screen>

   <screen name="EditContactList">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditContactList"/>
                <set field="activeContactListSubMenuItem" value="ContactList"/>
                <set field="labelTitleProperty" value="PageTitleEditContactList"/>

                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="/marketing/control/ListContactLists"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
                <entity-one entity-name="ContactList" value-field="contactList"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <not><if-empty field="contactList"/></not>
                            </condition>
                            <widgets>
                                <screenlet><!-- SCIPIO: removed: title="${uiLabelMap.PageTitleEditContactList}" -->
                                    <container style="button-bar">
                                        <link text="${uiLabelMap.MarketingContactListCreate}" target="EditContactList" style="${styles.link_nav} ${styles.action_add}">
                                            <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                        </link>
                                    </container>
                                    <include-form name="EditContactList" location="component://marketing/widget/ContactListForms.xml"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <screenlet title="${uiLabelMap.PageTitleAddContactList}">
                                    <include-form name="EditContactList" location="component://marketing/widget/ContactListForms.xml"/>
                                </screenlet>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

   <screen name="ListContactLists">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListContactList"/>
                <set field="activeContactListSubMenuItem" value="ContactList"/>
                <set field="labelTitleProperty" value="PageTitleListContactList"/>

                <!-- parameters for pagination -->
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <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="donePage" from-field="parameters.DONE_PAGE" default-value="/marketing/control/ListContactList"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
                <set field="entityName" value="ContactList"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <container>
                                <link text="${uiLabelMap.MarketingContactListCreate}" target="EditContactList" style="${styles.link_nav} ${styles.action_add}">
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="ListContactLists" location="component://marketing/widget/ContactListForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditContactListParty">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditContactListParty"/>
                <set field="activeContactListSubMenuItem" value="ContactListParty"/>
                <set field="labelTitleProperty" value="PageTitleEditContactListParty"/>
                
                <set field="contactListId" from-field="parameters.contactListId"/>
                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListParties?contactListId=${contactListId}"/>
                
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="fromDate" from-field="parameters.fromDate"/>
                <entity-one entity-name="ContactListParty" value-field="contactListParty"/>
                <entity-condition entity-name="ContactListPartyAndStatus" list="contactListPartyStatusList">
                    <condition-list combine="and">
                        <condition-expr field-name="contactListId" from-field="contactListId"/>
                        <condition-expr field-name="partyId" from-field="partyId"/>
                        <condition-expr field-name="fromDate" from-field="fromDate"/>
                    </condition-list>
                    <order-by field-name="-statusDate"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <container style="button-bar">
                                <link text="${uiLabelMap.MarketingContactListPartyCreate}" target="EditContactListParty" style="${styles.link_nav} ${styles.action_add}">
                                    <parameter param-name="contactListId"/>
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="EditContactListParty" location="component://marketing/widget/ContactListForms.xml"/>
                            <label style="heading" text="${uiLabelMap.CommonStatusHistory}"/>
                            <iterate-section entry="contactListPartyStatus" list="contactListPartyStatusList">
                                <section>
                                    <widgets>
                                        <container><label text="${contactListPartyStatus.statusDate} ${contactListPartyStatus.description} [by: ${contactListPartyStatus.setByUserLoginId}] [code: ${contactListPartyStatus.optInVerifyCode}]"/></container>
                                    </widgets>
                                </section>
                            </iterate-section>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="ListContactListParties">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListContactListParty"/>
                <set field="activeContactListSubMenuItem" value="ContactListParty"/>
                <set field="labelTitleProperty" value="PageTitleListContactListParty"/>

                <!-- parameters for pagination -->
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <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="contactListId" from-field="parameters.contactListId"/>
                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListParties?contactListId=${contactListId}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <container>
                                <link style="${styles.link_nav} ${styles.action_add}" text="${uiLabelMap.MarketingContactListPartyCreate}" target="EditContactListParty">
                                    <parameter param-name="contactListId"/>
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="ListContactListParties" location="component://marketing/widget/ContactListForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindContactListParties">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindContactListParty"/>
                <set field="activeContactListSubMenuItem" value="ContactListParty"/>
                <set field="labelTitleProperty" value="PageTitleFindContactListParty"/>

                <set field="contactListId" from-field="parameters.contactListId"/>
                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListParties?contactListId=${contactListId}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="menu-bar">
                                <container style="button-bar">
                                    <link text="${uiLabelMap.MarketingContactListPartyCreate}" target="EditContactListParty" style="${styles.link_nav} ${styles.action_add}">
                                        <parameter param-name="contactListId"/>
                                        <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                    </link>
                                </container>
                            </decorator-section>
                            <decorator-section name="search-options">
                                <include-form name="FindContactListParties" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListContactListParties" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                   </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditContactListCommEvent">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditContactListCommEvent"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>
                <set field="labelTitleProperty" value="PageTitleEditContactListCommEvent"/>

                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListCommEvents?contactListId=${parameters.contactListId}"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
                <set field="communicationEventId" from-field="parameters.communicationEventId"/>
                <entity-one entity-name="ContactList" value-field="contactList"/>
                <entity-and entity-name="CommunicationEventType" list="communicationEventTypes">
                    <field-map field-name="contactMechTypeId" from-field="contactList.contactMechTypeId"/>
                </entity-and>
                <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>

                <entity-one entity-name="StatusItem" value-field="status"/>                

                <!-- get the contact list owner's marketing email -->
                <script location="component://marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy"/>
                <set field="contactMechIdFrom" value="${marketingEmail.contactMechId}"/>
                <set field="partyIdFrom" value="${contactList.ownerPartyId}"/>               
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- SCIPIO: removed: title="${uiLabelMap.PageTitleEditContactList}" -->
                            <include-menu location="component://marketing/widget/ContactListMenus.xml" name="ContactListCommBar"/>
                            <container style="button-bar">
                                <link text="${uiLabelMap.MarketingContactListCommEventCreate}" target="EditContactListCommEvent" style="${styles.link_nav} ${styles.action_add}">
                                    <parameter param-name="contactListId"/>
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="EditContactListCommEvent" location="component://marketing/widget/ContactListForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ListContactListCommEvents">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleListContactListCommEvent"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>
                <set field="labelTitleProperty" value="PageTitleListContactListCommEvent"/>

                <!-- parameters for pagination -->
                <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/>
                <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="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListCommEvents?contactListId=${parameters.contactListId}"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleListContactList} ${uiLabelMap.CommonFor} contactListId=${contactListId}">
                            <container>
                                <link style="${styles.link_nav} ${styles.action_add}" text="${uiLabelMap.MarketingContactListCommEventCreate}" target="EditContactListCommEvent">
                                    <parameter param-name="contactListId"/>
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="ListContactListCommEvents" location="component://marketing/widget/ContactListForms.xml"/>
                        </screenlet>
                   </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindContactListCommEvents">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindContactListCommEvents"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>
                <set field="labelTitleProperty" value="PageTitleFindContactListCommEvents"/>

                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindContactListCommEvents?contactListId=${parameters.contactListId}"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <container style="button-bar">
                                <link text="${uiLabelMap.MarketingContactListCommEventCreate}" target="EditContactListCommEvent" style="${styles.link_nav} ${styles.action_add}">
                                    <parameter param-name="contactListId"/>
                                    <parameter param-name="DONE_PAGE" from-field="donePage"/>
                                </link>
                            </container>
                            <include-form name="FindContactListCommEvents" location="component://marketing/widget/ContactListForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="FindImportContactListParties">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindImportContactListParties"/>
                <set field="activeContactListSubMenuItem" value="ContactListImportParty"/>
                <set field="labelTitleProperty" value="PageTitleFindImportContactListParties"/>

                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="FindImportContactListParties?contactListId=${parameters.contactListId}"/>
                <set field="contactListId" from-field="parameters.contactListId"/>
                <entity-one entity-name="ContactList" value-field="contactList"/>
                <set field="contactMechTypeId" from-field="contactList.contactMechTypeId"/>
                <set field="selectedFields[+0]" value="partyId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="search-options">
                                <include-form name="FindImportContactListParties" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListImportContactListParties" location="component://marketing/widget/ContactListForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="LookupContactList">
        <section>
            <actions>
                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="titleProperty" value="PageTitleLookupContactList"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>
                <set field="labelTitleProperty" value="PageTitleLookupContactList"/>
                <set field="title" value="${uiLabelMap.PageTitleLookupContactList}"/>
                <set field="entityName" value="ContactList"/>
                <set field="searchFields" value="[contactListId, contactListName, description]"/>
            </actions>
            <widgets>
                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-options">
                        <include-form name="LookupContactList" location="component://marketing/widget/ContactListForms.xml"/>
                    </decorator-section>
                    <decorator-section name="search-results">
                        <include-form name="ListLookupContactList" location="component://marketing/widget/ContactListForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="LookupPreferredContactMech">
        <section>
            <actions>
                <property-map resource="MarketingUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="titleProperty" value="PageTitlePreferredContactMech"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>
                <set field="labelTitleProperty" value="PageTitlePreferredContactMech"/>
                <set field="title" value="${uiLabelMap.PageTitlePreferredContactMech}"/>
                <set field="donePage" from-field="parameters.DONE_PAGE" default-value="/marketing/control/ListContactLists"/>
                <set field="partyId" from-field="parameters.parm0"/>
                <set field="entityName" value="PartyAndContactMech"/>
                <set field="searchFields" value="[contactMechId, partyId, infoString, paToName, paAddress1]"/>
            </actions>
            <widgets>
                <decorator-screen name="LookupDecorator" location="component://common/widget/CommonScreens.xml">
                    <decorator-section name="search-results">
                        <include-form name="ListPreferredContactMech" location="component://marketing/widget/ContactListForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

   <screen name="PreviewContactListCommEvent">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditContactListCommEvent"/>
                <set field="activeContactListSubMenuItem" value="ContactListCommEvent"/>                
                <set field="labelTitleProperty" value="PageTitleEditContactListCommEvent"/>

                <set field="communicationEventId" from-field="parameters.communicationEventId"/>
                <set field="contactListId" from-field="parameters.contactListId"/>

                <entity-one entity-name="CommunicationEvent" value-field="communicationEvent"/>
                <entity-one entity-name="ContactList" value-field="contactList"/>
                <entity-one entity-name="ContactMech" value-field="contactMech">
                    <field-map field-name="contactMechId" from-field="communicationEvent.contactMechIdFrom"/>
                </entity-one>

                <set field="content" value="${groovy:org.ofbiz.base.util.StringUtil.wrapString(communicationEvent.content)}"/>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://marketing/webapp/marketing/contact/ContactCommunicationPreview.ftl"/>
                    </html>
                </platform-specific>                
            </widgets>
        </section>
    </screen>
    
    <screen name="DefaultOptOutScreen">
        <section>            
            <widgets>
                <decorator-screen name="CommonMarketingAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="Opt-Out Results">
                            <container>
                                <label text="You have been successfully removed from the ${contactList.contactListName} mailing list!"/>                                            
                            </container>                                        
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <screen name="OptOutResponse">
        <section>
            <actions>
                <service service-name="optOutOfListFromCommEvent" result-map="optOutResult"/>                
                <entity-one entity-name="ContactList" value-field="contactList">
                    <field-map field-name="contactListId" from-field="optOutResult.contactListId"/>                    
                </entity-one>
                <set field="contactListId" from-field="contactList.contactListId"/>
                <set field="screenName" from-field="contactList.optOutScreen" default-value="component://marketing/widget/ContactListScreens.xml#DefaultOptOutScreen"/>
            </actions>
            <widgets>
                <include-screen name="${screenName}" share-scope="true"/>                
            </widgets>
        </section>
    </screen>
    <screen name="WebSiteContactList">
        <section>
            <actions>
                <set field="titleProperty" value="MarketingWebSiteContactList"/>
                <set field="activeContactListSubMenuItem" value="WebSiteContactList"/>
                <entity-one entity-name="ContactList" value-field="contactList"/>
                <entity-and entity-name="WebSiteContactList" list="webSiteContactLists">
                    <field-map field-name="contactListId" from-field="contactList.contactListId"/>
                    <order-by field-name="-fromDate"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.MarketingWebSiteContactListCreate}">
                            <include-form location="component://marketing/widget/ContactListForms.xml" name="CreateWebSiteContactList"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.MarketingWebSiteContactListView} of contactListId[${parameters.contactListId}]">
                            <include-form location="component://marketing/widget/ContactListForms.xml" name="ViewWebSiteContactList"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
</screens>