<!--
  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.
  -->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://ofbiz.apache.org/Widget-Screen" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <!-- Personal Information -->
    <screen name="EbayPersonalInformation">
        <section>
            <actions>
                <set field="accountItem" value="personalInformation"/>
                <service service-name="getEbayUser" result-map="results">
                    <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                </service>
            </actions>
            <widgets>
                <decorator-screen name="AccountDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet name="" title="${uiLabelMap.EbayPersonalInformation}">
                            <include-form name="EbayPersonalInformationForm" location="component://ebaystore/widget/EbayAccountForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- feedback -->
    <screen name="EbayFeedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="accountItem" value="feedback"/>
            </actions>
            <widgets>
                <decorator-screen name="AccountDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-has-permission permission="EBAY" action="_VIEW"/>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.EbayFeedback}">
                                    <include-menu name="EbayFeedbackTabBar" location="${parameters.mainMenuLocation}"/>
                                    <decorator-section-include name="body"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <label style="h3">${uiLabelMap.EbayViewPermissionError}</label>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="Feedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="helpAnchor" value="_ebay_feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="feedbackItem" value="Feedback"/>
                <service service-name="loadFeedback">
                    <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                </service>
                <service service-name="getItemsAwaitingFeedback" result-map="results">
                    <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                </service>
                <set field="itemsAwaitingFeedbackList" from-field="results.itemsAwaitingFeedback"/>
                <script location="component://ebaystore/src/main/groovy/org/apache/ofbiz/ebaystore/feedback/FeedbackList.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="EbayFeedback" >
                    <decorator-section name="body">
                        <screenlet>
                            <screenlet navigation-form-name="ItemsAwaitingFeedback" title="Items Awaiting Feedback">
                                <include-form name="ItemsAwaitingFeedback" location="component://ebaystore/widget/EbayAccountForms.xml"/>
                            </screenlet>
                        </screenlet>
                        <screenlet>
                            <screenlet navigation-form-name="RecentFeedback" title="Recent Feedback">
                                <include-form name="RecentFeedback" location="component://ebaystore/widget/EbayAccountForms.xml"/>
                            </screenlet>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="LeaveFeedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="helpAnchor" value="_ebay_leave_feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="feedbackItem" value="LeaveFeedback"/>
                <set field="role" from-field="parameters.role" default-value="all"/>
                <service service-name="getItemsAwaitingFeedback" result-map="results"/>
            </actions>
            <widgets>
                <decorator-screen name="EbayFeedback" >
                    <decorator-section name="body">
                        <screenlet>
                            <screenlet title="${uiLabelMap.EbayLeaveFeedback}">
                                <include-menu name="EbayFeedbackSubTabBar" location="${parameters.mainMenuLocation}"/>
                                <platform-specific>
                                    <html><html-template multi-block="true" location="component://ebaystore/template/feedback/LeaveFeedback.ftl"/></html>
                                </platform-specific>
                            </screenlet>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <!-- ebay feedback -->
    <screen name="EbayFeedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="accountItem" value="feedback"/>
            </actions>
            <widgets>
                <decorator-screen name="AccountDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-has-permission permission="EBAY" action="_VIEW"/>
                            </condition>
                            <widgets>
                                <screenlet title="${uiLabelMap.EbayFeedback}">
                                    <include-menu name="EbayFeedbackTabBar" location="${parameters.mainMenuLocation}"/>
                                    <decorator-section-include name="body"/>
                                </screenlet>
                            </widgets>
                            <fail-widgets>
                                <label style="h3">${uiLabelMap.EbayViewPermissionError}</label>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="Feedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="feedbackItem" value="Feedback"/>
                <service service-name="loadFeedback">
                    <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                </service>
                <service service-name="getItemsAwaitingFeedback" result-map="results">
                    <field-map field-name="productStoreId" from-field="parameters.productStoreId"/>
                </service>
                <set field="itemsAwaitingFeedbackList" from-field="results.itemsAwaitingFeedback"/>
                <script location="component://ebaystore/src/main/groovy/org/apache/ofbiz/ebaystore/feedback/FeedbackList.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="EbayFeedback" >
                    <decorator-section name="body">
                        <screenlet>
                            <screenlet navigation-form-name="ItemsAwaitingFeedback" title="Items Awaiting Feedback">
                                <include-grid name="ItemsAwaitingFeedback" location="component://ebaystore/widget/EbayAccountForms.xml"/>
                            </screenlet>
                        </screenlet>
                        <screenlet>
                            <screenlet navigation-form-name="RecentFeedback" title="Recent Feedback">
                                <include-grid name="RecentFeedback" location="component://ebaystore/widget/EbayAccountForms.xml"/>
                            </screenlet>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="LeaveFeedback">
        <section>
            <actions>
                <set field="titleProperty" value="eBay Feedback"/>
                <set field="headerItem" value="ebayStore"/>
                <set field="feedbackItem" value="LeaveFeedback"/>
                <set field="role" from-field="parameters.role" default-value="all"/>
                <service service-name="getItemsAwaitingFeedback" result-map="results"/>
            </actions>
            <widgets>
                <decorator-screen name="EbayFeedback" >
                    <decorator-section name="body">
                        <screenlet>
                            <screenlet title="${uiLabelMap.EbayLeaveFeedback}">
                                <include-menu name="EbayFeedbackSubTabBar" location="${parameters.mainMenuLocation}"/>
                                <platform-specific>
                                    <html><html-template multi-block="true" location="component://ebaystore/template/feedback/LeaveFeedback.ftl"/></html>
                                </platform-specific>
                            </screenlet>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
</screens>
