<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->

<!-- This document serves as an example for Compound Screen Widget feature -->
<compound-widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:sc="http://ofbiz.apache.org/Site-Conf"
                  xmlns:wf="http://ofbiz.apache.org/Widget-Form"
                  xmlns:wm="http://ofbiz.apache.org/Widget-Menu"
                  xmlns:ws="http://ofbiz.apache.org/Widget-Screen"
                  xsi:noNamespaceSchemaLocation="../../../../framework/widget/dtd/compound-widgets.xsd">

    <sc:site-conf>
        <sc:request-map uri="WorkEffortPartyAssigns/List"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="WorkEffortPartyAssigns/List"/></sc:request-map>
        <sc:request-map uri="WorkEffortPartyAssigns/Edit"><sc:security https="true" auth="true"/><sc:response name="success" type="view" value="WorkEffortPartyAssigns/Edit"/></sc:request-map>
        <sc:request-map uri="WorkEffortPartyAssigns/create">
            <sc:security https="true" auth="true"/>
            <sc:event type="service" invoke="assignPartyToWorkEffort"/>
            <sc:response name="success" type="request" value="json"/>
            <sc:response name="error" type="request" value="json"/>
        </sc:request-map>
        <sc:request-map uri="WorkEffortPartyAssigns/update">
            <sc:security https="true" auth="true"/>
            <sc:event type="service" invoke="updatePartyToWorkEffortAssignment"/>
            <sc:response name="success" type="request" value="json"/>
            <sc:response name="error" type="request" value="json"/>
        </sc:request-map>
        <sc:request-map uri="WorkEffortPartyAssigns/delete">
            <sc:security https="true" auth="true"/>
            <sc:event type="service" invoke="deletePartyToWorkEffortAssignment"/>
            <sc:response name="success" type="request" value="json"/>
            <sc:response name="error" type="request" value="json"/>
        </sc:request-map>
        <sc:view-map name="WorkEffortPartyAssigns/List" type="screen" page="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml#ListWorkEffortPartyAssigns"/>
        <sc:view-map name="WorkEffortPartyAssigns/Edit" type="screen" page="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml#EditWorkEffortPartyAssign"/>
    </sc:site-conf>

    <ws:screens>
        <ws:screen name="ListWorkEffortPartyAssigns">
            <ws:section>
                <ws:actions>
                    <ws:set field="titleProperty" value="PageTitleListWorkEffortPartyAssigns"/>
                    <ws:entity-one entity-name="WorkEffort" value-field="workEffort"/>
                    <ws:set field="workEffortId" from-field="workEffort.workEffortId"/>
                </ws:actions>
                <ws:widgets>
                    <ws:decorator-screen name="CommonEmbeddedDecorator" location="component://workeffort/widget/CommonScreens.xml">
                        <ws:decorator-section name="actions">
                            <ws:include-menu name="WorkEffortPartyAssignTabBar" location="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml"/>
                        </ws:decorator-section>
                        <ws:decorator-section name="list">
                            <ws:include-grid name="ListWorkEffortPartyAssigns" location="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml"/>
                        </ws:decorator-section>
                    </ws:decorator-screen>
                </ws:widgets>
            </ws:section>
        </ws:screen>
        <ws:screen name="EditWorkEffortPartyAssign">
            <ws:section>
                <ws:actions>
                    <ws:set field="titleProperty" value="PageTitleAddWorkEffortPartyAssign"/>
                    <ws:entity-one entity-name="WorkEffortPartyAssignment" value-field="workEffortPartyAssignment"/>
                </ws:actions>
                <ws:widgets>
                    <ws:decorator-screen name="CommonEmbeddedDecorator" location="component://workeffort/widget/CommonScreens.xml">
                        <ws:decorator-section name="single">
                            <ws:include-form name="EditWorkEffortPartyAssign" location="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml"/>
                        </ws:decorator-section>
                    </ws:decorator-screen>
                </ws:widgets>
            </ws:section>
        </ws:screen>
    </ws:screens>

    <wm:menus>
        <wm:menu name="WorkEffortPartyAssignTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
            <wm:menu-item name="AddWorkEffortPartyAssign" title="${uiLabelMap.CommonAdd}">
                <wm:link target="WorkEffortPartyAssigns/Edit" link-type="layered-modal">
                    <wm:parameter param-name="workEffortId"/>
                    <wm:set-callback area-target="WorkEffortPartyAssigns/List">
                        <wm:parameter param-name="workEffortId"/>
                    </wm:set-callback>
                </wm:link>
            </wm:menu-item>
        </wm:menu>
        <wm:menu name="ListWorkEffortPartyAssignsInLineBar" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
            <wm:menu-item name="EditWorkEffortPartyAssign" title="${uiLabelMap.CommonUpdate}">
                <wm:link target="WorkEffortPartyAssigns/Edit" link-type="layered-modal">
                    <wm:auto-parameters-service service-name="updatePartyToWorkEffortAssignment"/>
                    <wm:set-callback area-target="WorkEffortPartyAssigns/List"/>
                </wm:link>
            </wm:menu-item>
            <wm:menu-item name="DeleteWorkEffortPartyAssign" title="${uiLabelMap.CommonExpire}">
                <wm:condition>
                    <wm:if-empty field="thruDate"/>
                </wm:condition>
                <wm:link target="WorkEffortPartyAssigns/delete" request-confirmation="true">
                    <wm:auto-parameters-service service-name="deletePartyToWorkEffortAssignment"/>
                    <wm:set-callback area-target="WorkEffortPartyAssigns/List"/>
                </wm:link>
            </wm:menu-item>
        </wm:menu>
    </wm:menus>

    <wf:forms>
        <wf:grid name="ListWorkEffortPartyAssigns" target="WorkEffortPartyAssigns/update" paginate-target="WorkEffortPartyAssigns/List"
                 extends="CommonDynamicGrid" extends-resource="component://common/widget/CommonForms.xml">
            <wf:actions>
                <wf:entity-condition entity-name="WorkEffortPartyAssignment">
                    <wf:condition-expr field-name="workEffortId" from-field="workEffortId"/>
                    <wf:order-by field-name="roleTypeId"/>
                </wf:entity-condition>
            </wf:actions>
            <wf:field name="workEffortId"><wf:hidden/></wf:field>
            <wf:field name="partyId">
                <wf:display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName} ${groupName}">
                    <wf:sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${partyId}">
                        <wf:parameter param-name="partyId"/>
                    </wf:sub-hyperlink>
                </wf:display-entity>
            </wf:field>
            <wf:field name="roleTypeId" title="${uiLabelMap.PartyRoleType}"><wf:display-entity entity-name="RoleType"/></wf:field>
            <wf:field name="statusDateTime"><wf:display/></wf:field>
            <wf:field name="fromDate"><wf:display type="date-time"/></wf:field>
            <wf:field name="thruDate"><wf:display type="date-time"/></wf:field>
            <wf:field name="statusId"><wf:display-entity entity-name="StatusItem"/></wf:field>
            <wf:field name="availabilityStatusId"><wf:display-entity entity-name="StatusItem" key-field-name="statusId"/></wf:field>
            <wf:field name="expectationEnumId" title="${uiLabelMap.CommonExpectation}"><wf:display-entity entity-name="Enumeration" key-field-name="enumId"/></wf:field>
            <wf:field name="delegateReasonEnumId" title="${uiLabelMap.WorkEffortDelegateReason}"><wf:display-entity entity-name="Enumeration" key-field-name="enumId"/></wf:field>
            <wf:field name="facilityId"><wf:display-entity entity-name="Facility" description="${facilityName}"/></wf:field>
            <wf:field name="mustRsvp"><wf:display/></wf:field>
            <wf:field name="comments"><wf:display size="10"/></wf:field>
            <wf:field name="menuAction" title=" ">
                <wf:include-menu name="ListWorkEffortPartyAssignsInLineBar" location="component://workeffort/widget/workeffort/WorkEffortPartyAssignCpd.xml"/>
            </wf:field>
        </wf:grid>
        <wf:form name="EditWorkEffortPartyAssign" target="WorkEffortPartyAssigns/update"
                 focus-field-name="partyId" default-map-name="workEffortPartyAssignment"
                 extends="CommonBasicSingle" extends-resource="component://common/widget/CommonForms.xml">
            <wf:alt-target target="WorkEffortPartyAssigns/create" use-when="workEffortPartyAssignment==null"/>
            <wf:field name="workEffortId"><wf:hidden/></wf:field>
            <wf:field name="partyId"><wf:lookup target-form-name="LookupPartyName"/></wf:field>
            <wf:field name="roleTypeId" title="${uiLabelMap.PartyRoleType}">
                <wf:drop-down>
                    <wf:entity-options entity-name="RoleType">
                        <wf:entity-order-by field-name="description"/>
                    </wf:entity-options>
                </wf:drop-down>
            </wf:field>
            <wf:field name="fromDate"><wf:date-time default-value="${nowTimestamp}"/></wf:field>
            <wf:field name="thruDate"><wf:date-time/></wf:field>
            <wf:field name="statusId">
                <wf:drop-down no-current-selected-key="PRTYASGN_ASSIGNED">
                    <wf:entity-options entity-name="StatusItem">
                        <wf:entity-constraint name="statusTypeId" value="PRTYASGN_STATUS"/>
                        <wf:entity-order-by field-name="description"/>
                    </wf:entity-options>
                </wf:drop-down>
            </wf:field>
            <wf:field name="availabilityStatusId">
                <wf:drop-down allow-empty="true">
                    <wf:entity-options entity-name="StatusItem" key-field-name="statusId">
                        <wf:entity-constraint name="statusTypeId" value="WEPA_AVAILABILITY"/>
                        <wf:entity-order-by field-name="sequenceId"/>
                    </wf:entity-options>
                </wf:drop-down>
            </wf:field>
            <wf:field name="expectationEnumId" title="${uiLabelMap.CommonExpectation}">
                <wf:drop-down allow-empty="true">
                    <wf:entity-options entity-name="Enumeration" key-field-name="enumId">
                        <wf:entity-constraint name="enumTypeId" value="WORK_EFF_EXPECT"/>
                        <wf:entity-order-by field-name="description"/>
                    </wf:entity-options>
                </wf:drop-down>
            </wf:field>
            <wf:field name="delegateReasonEnumId" title="${uiLabelMap.WorkEffortDelegateReason}">
                <wf:drop-down allow-empty="true">
                    <wf:entity-options entity-name="Enumeration" key-field-name="enumId">
                        <wf:entity-constraint name="enumTypeId" value="WORK_EFF_DEL_REAS"/>
                        <wf:entity-order-by field-name="description"/>
                    </wf:entity-options>
                </wf:drop-down>
            </wf:field>
            <wf:field name="facilityId"><wf:lookup target-form-name="LookupFacility"/></wf:field>
            <wf:field name="mustRsvp"><wf:check/></wf:field>
            <wf:field name="comments"><wf:text size="60" maxlength="255"/></wf:field>
            <wf:field name="submitButton"><wf:submit/></wf:field>
        </wf:form>
    </wf:forms>

</compound-widgets>