ilscipio/scipio-erp

View on GitHub
applications/content/widget/WebSiteScreens.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="FindWebSite">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleFindWebSite"/>
                <set field="labelTitleProperty" value="PageTitleFindWebSite"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- title="${uiLabelMap.PageTitleListWebSite}" -->
                            <!-- SCIPIO: redundant
                            <container style="button-bar">
                                <link text="${uiLabelMap.ContentNewWebSite}" target="EditWebSite" style="${styles.link_nav} ${styles.action_add}"/>
                            </container>
                            -->
                            <include-form name="ListWebSites" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditWebSite">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditWebSite"/>
                <set field="activeSubMenuItem" value="EditWebSite"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <set field="isCreateWebSite" type="Boolean" value="${groovy: !(context.webSite || (parameters.webSiteId &amp;&amp; parameters.isCreate != 'true'))}"/>
                <set field="labelTitleProperty" value="${groovy: isCreateWebSite ? 'ContentNewWebSite' : 'ContentWebSite'}"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet>
                            <include-form name="EditWebSite" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteContent">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditWebSiteContent"/>
                <set field="activeSubMenuItem" value="ListWebSiteContent"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <entity-and entity-name="WebSiteContent" list="webSiteContent">
                    <field-map field-name="webSiteId" from-field="webSiteId"/>
                </entity-and>
                <set field="labelTitleProperty" value="ContentWebSiteContent"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleWebSiteContent}">
                            <include-form name="ListWebSiteContent" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.PageTitleCreateWebSiteContent}">
                            <include-form name="CreateWebSiteContent" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.PageTitleAutoCreateContentPublishPoints}">
                            <include-form name="AutoCreateWebsiteContent" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="EditWebSiteParties">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditWebSiteParties"/>
                <set field="activeSubMenuItem" value="EditWebSiteParties"/>
                <set field="labelTitleProperty" value="ContentWebSiteParties"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <property-map map-name="uiLabelMap" resource="PartyUiLabels"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <script location="component://content/webapp/content/WEB-INF/actions/website/EditWebSiteParties.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="AddWebSiteRolePanel" title="${uiLabelMap.PageTitleCreateWebSiteParties}" collapsible="true">
                            <include-form name="CreateWebSiteRole" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                        <include-form name="UpdateWebSiteRole" location="component://content/widget/website/WebSiteForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMS">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleEditWebSiteCMS"/>
                <set field="activeSubMenuItem" value="WebSiteCMS"/>
                <set field="labelTitleProperty" value="PageTitleEditWebSiteCMS"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>

                <script location="component://content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <not>
                                    <if-empty field="contentRoot"/>
                                </not>
                            </condition>
                            <widgets>
                                <container id="cmsnav" style="left">
                                    <include-screen name="WebSiteCMSNav"/>
                                </container>
                                <container id="cmsmain" style="leftonly">
                                    <include-screen name="WebSiteCMSContent"/>
                                </container>
                            </widgets>
                            <fail-widgets>
                                <container id="norender" style="tableheadtext">
                                    <label text="${uiLabelMap.ContentCMSNotExist}"/>
                                </container>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMSNav">
        <section>
            <actions>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>

                <script location="component://content/webapp/content/WEB-INF/actions/website/WebSitePublishPoint.groovy"/>
                <set field="language" from-field="userLogin.lastLocale" default-value="en"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.PageTitleWebSiteCMSNav}">
                    <platform-specific><html><html-template location="component://content/webapp/content/website/WebSiteCMSNav.ftl"/></html></platform-specific>
                </screenlet>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMSContent">
        <section>
            <actions>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/>

                <set field="contentAssocTypeId" from-field="parameters.contentAssocTypeId"/>
                <set field="dataResourceTypeId" from-field="parameters.dataResourceTypeId"/>
                <set field="contentIdFrom" from-field="parameters.contentIdFrom"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <set field="contentId" from-field="parameters.contentId"/>
                <set field="mimeTypeId" value="text/html"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <entity-one entity-name="Content" value-field="content"/>
                <entity-one entity-name="DataResource" value-field="dataResource">
                    <field-map field-name="dataResourceId" from-field="content.dataResourceId"/>
                </entity-one>
                <entity-one entity-name="ElectronicText" value-field="dataText">
                    <field-map field-name="dataResourceId" from-field="content.dataResourceId"/>
                </entity-one>
                
                <set field="parameters.fromDate" type="Timestamp" from-field="parameters.fromDate"/>
                <entity-condition entity-name="ContentAssoc" list="assocs">
                    <condition-list>
                        <condition-expr field-name="contentId" from-field="parameters.contentIdFrom"/>
                        <condition-expr field-name="contentIdTo" from-field="parameters.contentId"/>
                        <condition-expr field-name="fromDate" from-field="parameters.fromDate" ignore-if-empty="true"/>
                        <condition-expr field-name="contentAssocTypeId" from-field="parameters.contentAssocTypeId" ignore-if-empty="true"/>
                    </condition-list>
                    <order-by field-name="-fromDate"/>
                </entity-condition>
                <set field="assoc" value="${assocs[0]}"/>
                <entity-and entity-name="ContentPurpose" list="currentPurposes">
                    <field-map field-name="contentId" from-field="contentId"/>
                </entity-and>
                <entity-condition entity-name="ContentPurposeType" list="purposeTypes">
                    <order-by field-name="description"/>
                </entity-condition>
                <entity-and entity-name="DataResource" list="templates">
                    <field-map field-name="dataCategoryId" value="TEMPLATE"/>
                    <order-by field-name="dataResourceName"/>
                </entity-and>
                <entity-and entity-name="StatusItem" list="statuses">
                    <field-map field-name="statusTypeId" value="CONTENT_STATUS"/>
                    <order-by field-name="sequenceId"/>
                </entity-and>
                <entity-condition entity-name="DataTemplateType" list="templateTypes"/>
                <entity-and entity-name="Content" list="decorators">
                    <field-map field-name="contentTypeId" value="DECORATOR"/>
                </entity-and>
            </actions>
            <widgets>
                <container id="cmscontent" style="no-clear">
                    <screenlet title="${uiLabelMap.PageTitleWebSiteCMSContent}">
                        <platform-specific>
                            <html>
                                <html-template location="component://content/webapp/content/website/WebSiteCMSContent.ftl"/>
                            </html>
                        </platform-specific>
                    </screenlet>
               </container>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMSEditor">
        <section>
            <actions>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <set field="contentId" from-field="parameters.contentId"/>
                <set field="mimeTypeId" value="text/html"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <entity-one entity-name="Content" value-field="content"/>
                <entity-one entity-name="DataResource" value-field="dataResource">
                    <field-map field-name="dataResourceId" from-field="content.dataResourceId"/>
                </entity-one>
                <entity-one entity-name="ElectronicText" value-field="dataText">
                    <field-map field-name="dataResourceId" from-field="content.dataResourceId"/>
                </entity-one>
            </actions>
            <widgets>
                <!-- SCIPIO: stock bug: This *.ftl file did not exist even in stock. Unused in Scipio.
                <platform-specific>
                    <html>
                        <html-template location="component://content/webapp/content/website/WebSiteCMSEditor.ftl"/>
                    </html>
                </platform-specific>-->
                <label text="${uiLabelMap.CommonNotImplementedSentence}"/>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMSMetaInfo">
        <section>
            <actions>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <set field="contentId" from-field="parameters.contentId"/>
                <entity-one entity-name="Content" value-field="content"/>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap"/>
                <script location="component://content/webapp/content/WEB-INF/actions/website/WebSiteCMSMetaInfo.groovy"/>
                <!-- SCIPIO: NOTE: title/titleProperty set by groovy, for local template only -->
            </actions>
            <widgets>
                <container id="cmscontent" style="no-clear">
                    <screenlet title="${uiLabelMap.PageTitleWebSiteCMSContent}">
                        <platform-specific>
                            <html>
                                <html-template location="component://content/webapp/content/website/WebSiteCMSMeta.ftl"/>
                            </html>
                        </platform-specific>
                    </screenlet>
                </container>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteCMSPathAlias">
        <section>
            <actions>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <set field="contentId" from-field="parameters.contentId"/>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <entity-one entity-name="Content" value-field="content"/>
                <entity-and entity-name="WebSitePathAlias" list="aliases">
                    <field-map field-name="webSiteId" from-field="webSiteId"/>
                    <field-map field-name="contentId" from-field="contentId"/>
                </entity-and>
            </actions>
            <widgets>
                <container id="cmscontent" style="no-clear">
                    <screenlet title="${uiLabelMap.PageTitleWebSiteCMSContent}">
                        <platform-specific>
                            <html>
                                <html-template location="component://content/webapp/content/website/WebSiteCMSPathAlias.ftl"/>
                            </html>
                        </platform-specific>
                    </screenlet>
                </container>
            </widgets>
        </section>
    </screen>
    <screen name="WebSiteAliases">
        <section>
            <actions>
                <set field="titleProperty" value="ContentWebSitePathAlias"/><!-- ContentPathAlias -->
                <set field="labelTitleProperty" value="ContentWebSitePathAlias"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <set field="activeSubMenuItem" value="PathAlias"/>
                <set field="viewIndex" from-field="requestParameters.VIEW_INDEX" type="Integer"/>
                <set field="viewSize" from-field="requestParameters.VIEW_SIZE" type="Integer" default-value="30"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" 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="FindWebSitePathAlias" location="component://content/widget/website/WebSiteForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListWebSitePathAlias" location="component://content/widget/website/WebSiteForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="WebSiteAliasesSearchResults">
        <section>
            <actions>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
            </actions>
            <widgets>
                <include-form name="ListWebSitePathAlias" location="component://content/widget/website/WebSiteForms.xml"/>
            </widgets>
        </section>
    </screen>

    <screen name="WebSiteSEO">
        <section>
            <actions>
                <set field="titleProperty" value="ContentWebSiteSEO"/><!-- PageTitleWebSiteSEO -->
                <set field="activeSubMenuItem" value="WebSiteSEO"/>
                <set field="labelTitleProperty" value="ContentWebSiteSEO"/><!-- PageTitleWebSiteSEO -->
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.PageTitleWebSiteSEO}">
                            <label style="common-msg-info" text="${uiLabelMap.ContentGenerateSeoUrlInfo} ${uiLabelMap.ContentGenerateSeoUrlInfoMayChangeUrls}"/>
                            <include-form name="CreateWebsiteSEO" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                        <!-- SCIPIO: new: remove SEO alt URLs, needed to rebuild when above fails -->
                        <screenlet title="${uiLabelMap.PageTitleRemoveWebSiteSEO}">
                            <label style="common-msg-info" text="${uiLabelMap.ContentRemoveSeoUrlInfo}"/>
                            <include-form name="RemoveWebsiteSEO" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                        <!-- SCIPIO: new: sitemap generation -->
                        <screenlet title="${uiLabelMap.ContentGenerateSitemaps}">
                            <label style="common-msg-info" text="${uiLabelMap.ContentGenerateSitemapsInfo}"/>
                            <include-form name="CreateWebsiteSitemaps" location="component://content/widget/website/WebSiteForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="WebSiteContactList">
        <section>
            <actions>
                <set field="titleProperty" value="ContentWebSiteContactList"/>
                <set field="activeSubMenuItem" value="WebSiteContactList"/>
                <set field="labelTitleProperty" value="ContentWebSiteContactList"/>
                <set field="webSiteId" from-field="parameters.webSiteId"/>
                <entity-one entity-name="WebSite" value-field="webSite"/>
                <entity-and entity-name="WebSiteContactList" list="webSiteContactLists">
                    <field-map field-name="webSiteId" from-field="webSiteId"/>
                    <order-by field-name="-fromDate"/>
                </entity-and>
            </actions>
            <widgets>
                <decorator-screen name="CommonWebSiteDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet title="${uiLabelMap.ContentWebSiteContactListCreate}">
                            <include-form location="component://content/widget/website/WebSiteForms.xml" name="CreateWebSiteContactList"/>
                        </screenlet>
                        <screenlet title="${uiLabelMap.ContentWebSiteContactListView} of webSiteId[${webSiteId}]">
                            <include-form location="component://content/widget/website/WebSiteForms.xml" name="ViewWebSiteContactList"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
</screens>