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

<site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://ofbiz.apache.org/Site-Conf" xsi:schemaLocation="http://ofbiz.apache.org/Site-Conf http://ofbiz.apache.org/dtds/site-conf.xsd">
    <include location="component://common/webcommon/WEB-INF/common-controller.xml"/>
    <include location="component://common/webcommon/WEB-INF/portal-controller.xml"/>
    <include location="component://party/webapp/partymgr/WEB-INF/controller.xml"/>
    <include location="component://workeffort/webapp/workeffort/WEB-INF/controller.xml"/>
    <description>SFA Manager Module Site Configuration File</description>
    
    <!-- Request Mappings -->
    <request-map uri="main">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="main" save-home-view="true"/>
    </request-map>
    <!-- Sales Opportunity Requests -->
    <request-map uri="FindSalesOpportunity">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="FindSalesOpportunity"/>
    </request-map>
    <request-map uri="ViewSalesOpportunity">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ViewSalesOpportunity"/>
    </request-map>
    <request-map uri="EditSalesOpportunity">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="EditSalesOpportunity"/>
    </request-map>
    <request-map uri="createSalesOpportunity">
        <security https="true" auth="true"/>
        <event type="service" invoke="createSalesOpportunity"/>
        <response name="success" type="view" value="ViewSalesOpportunity"/>
        <response name="error" type="view" value="EditSalesOpportunity"/>
    </request-map>
    <request-map uri="updateSalesOpportunity">
        <security https="true" auth="true"/>
        <event type="service" invoke="updateSalesOpportunity"/>
        <response name="success" type="request" value="ViewSalesOpportunity"/>
        <response name="error" type="view" value="EditSalesOpportunity"/>
    </request-map>
    <request-map uri="closeSalesOpportunity">
        <security https="true" auth="true"/>
        <event type="service" invoke="updateSalesOpportunity"/>
        <response name="success" type="request" value="FindSalesOpportunity"/>
        <response name="error" type="view" value="FindSalesOpportunity"/>
    </request-map>

    <!-- Account Entry Requests -->
    <request-map uri="ViewAccountProfile">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ViewAccountProfile" save-home-view="true"/>
    </request-map>
    <request-map uri="ViewAccountLeadProfile">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ViewAccountLeadProfile" save-home-view="true"/>
    </request-map>
    <request-map uri="FindAccounts">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="FindAccounts" save-home-view="true"/>
    </request-map>
    <request-map uri="NewAccount">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="NewAccount"/>
    </request-map>
    <request-map uri="createAccount">
        <security https="true" auth="true"/>
        <event type="service" invoke="createAccount"/>
        <response name="success" type="view" value="FindAccounts"/>
        <response name="error" type="view" value="NewAccount"/>
    </request-map>
    <request-map uri="ContactMechTypeOnly">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ContactMechTypeOnly"/>
    </request-map>

    <!-- Lead Requests -->
    <request-map uri="ViewLeadProfile">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ViewLeadProfile" save-home-view="true"/>
    </request-map>
    <request-map uri="FindLeads">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="FindLeads" save-home-view="true"/>
    </request-map>
    <request-map uri="NewLead">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="NewLead"/>
    </request-map>
    <request-map uri="createLead">
        <security https="true" auth="true"/>
        <event type="service" invoke="createLead"/>
        <response name="success" type="request-redirect" value="viewprofile">
            <redirect-parameter name="partyId"/>
            <redirect-parameter name="roleTypeId"/>
        </response>
        <response name="error" type="request-redirect" value="NewLead"/>
    </request-map>
    <request-map uri="ConvertLead">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ConvertLead"/>
    </request-map>
    <request-map uri="convertLead">
        <security https="true" auth="true"/>
        <event type="service" invoke="convertLeadToContact"/>
        <response name="success" type="request" value="viewprofile"/>
        <response name="error" type="view" value="ConvertLead"/>
    </request-map>
    <request-map uri="CloneLead">
        <security https="true" auth="true" external-view="false"/>
        <response type="view" name="success" value="CloneLead"/>
    </request-map>
    <request-map uri="MergeLeads">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="MergeLeads"/>
    </request-map>
    <request-map uri="mergeLeads">
        <security https="true" auth="true"/>
        <!-- TO DO
        <event type="service" invoke="mergeLeads"/>
        -->
        <response name="success" type="request" value="viewprofile"/>
        <response name="error" type="view" value="MergeLeads"/>
    </request-map>
    <request-map uri="NewLeadFromVCard">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="NewLeadFromVCard"/>
    </request-map>
    <request-map uri="createLeadFromVCard">
        <security https="true" auth="true"/>
        <event type="service" invoke="importVCard"/>
        <response name="success" type="view" value="ViewPartiesCreatedByVCard"/>
        <response name="error" type="view" value="NewLeadFromVCard"/>
    </request-map>
    <request-map uri="quickAddLead">
        <security https="true" auth="true"/>
        <event type="service" invoke="createLead"/>
        <response name="success" type="request" value="viewprofile"/>
    </request-map>
    <request-map uri="createLeadPartyDataSource">
        <security https="true" auth="true"/>
        <event type="service" invoke="createPartyDataSource"/>
        <response name="success" type="request-redirect" value="viewprofile">
            <redirect-parameter name="partyId"/>
            <redirect-parameter name="roleTypeId"/>
        </response>
        <response name="error" type="request-redirect" value="viewprofile">
            <redirect-parameter name="partyId"/>
            <redirect-parameter name="roleTypeId"/>
        </response>
    </request-map>
    <request-map uri="AddRelatedCompany">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="AddRelatedCompany"/>
    </request-map>
    <!-- Contact Requests -->
    <request-map uri="ViewContactProfile">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="ViewContactProfile" save-home-view="true"/>
    </request-map>
    <request-map uri="FindContacts">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="FindContacts" save-home-view="true"/>
    </request-map>
    <request-map uri="NewContact">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="NewContact"/>
    </request-map>
    <request-map uri="createContact">
        <security https="true" auth="true"/>
        <event type="service" invoke="createContact"/>
        <response name="success" type="request" value="viewprofile"/>
        <response name="error" type="view" value="NewContact"/>
    </request-map>
    <request-map uri="MergeContacts">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="MergeContacts"/>
    </request-map>
    <request-map uri="mergeContacts">
        <security https="true" auth="true"/>
        <event type="service" invoke="mergeContacts"/>
        <response name="success" type="request" value="viewprofile"/>
        <response name="error" type="view" value="MergeContacts"/>
    </request-map>
    <request-map uri="NewContactFromVCard">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="NewContactFromVCard"/>
    </request-map>
    <request-map uri="createContactFromVCard">
        <security https="true" auth="true"/>
        <event type="service" invoke="importVCard"/>
        <response name="success" type="view" value="ViewPartiesCreatedByVCard"/>
        <response name="error" type="view" value="NewContactFromVCard"/>
    </request-map>
    <request-map uri="createVCardFromContact">
        <security https="true" auth="true"/>
        <event type="service" invoke="exportVCard"/>
        <response name="success" type="view" value="FindContacts"/><!-- This need to be fixed -->
        <response name="error" type="view" value="FindContacts"/>
    </request-map>
    <request-map uri="quickAddContact">
        <security https="true" auth="true"/>
        <event type="service" invoke="createContact"/>
        <response name="success" type="request-redirect" value="viewprofile">
            <redirect-parameter name="partyId"/>
            <redirect-parameter name="roleTypeId"/>
        </response>
    </request-map>

    <!-- Forecast Requests -->
    <request-map uri="FindSalesForecast">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="FindSalesForecast"/>
    </request-map>
    <request-map uri="EditSalesForecast">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="EditSalesForecast"/>
    </request-map>
    <request-map uri="createSalesForecast">
        <security https="true" auth="true"/>
        <event type="service" invoke="createSalesForecast"/>
        <response name="success" type="view" value="EditSalesForecast"/>
        <response name="error" type="view" value="EditSalesForecast"/>
    </request-map>
    <request-map uri="updateSalesForecast">
        <security https="true" auth="true"/>
        <event type="service" invoke="updateSalesForecast"/>
        <response name="success" type="view" value="EditSalesForecast"/>
        <response name="error" type="view" value="EditSalesForecast"/>
    </request-map>

    <request-map uri="EditSalesForecastDetail">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="EditSalesForecastDetail"/>
    </request-map>
    <request-map uri="createSalesForecastDetail">
        <security https="true" auth="true"/>
        <event type="service" invoke="createSalesForecastDetail"/>
        <response name="success" type="view" value="EditSalesForecastDetail"/>
        <response name="error" type="view" value="EditSalesForecastDetail"/>
    </request-map>
    <request-map uri="updateSalesForecastDetail">
        <security https="true" auth="true"/>
        <event type="service" invoke="updateSalesForecastDetail"/>
        <response name="success" type="view" value="EditSalesForecastDetail"/>
        <response name="error" type="view" value="EditSalesForecastDetail"/>
    </request-map>
    <request-map uri="deleteSalesForecastDetail">
        <security https="true" auth="true"/>
        <event type="service" invoke="deleteSalesForecastDetail"/>
        <response name="success" type="view" value="EditSalesForecastDetail"/>
        <response name="error" type="view" value="EditSalesForecastDetail"/>
    </request-map>
    
    <!-- Event Requests -->
    <request-map uri="Events">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="Events" save-home-view="true"/>
    </request-map>
    <request-map uri="updateTaskAssigment">
        <security https="true" auth="true"/>
        <event type="service" invoke="updateTaskAssigment"/>
        <response name="success" type="view-home"/>
        <response name="error" type="view-home"/>
    </request-map>
    <request-map uri="EditEvent">
        <security https="true" auth="true"/>
        <response name="success" type="view" value="EditEvent" save-home-view="true"/>
    </request-map>
    <request-map uri="createCommunicationEvent">
        <security https="true" auth="true"/>
        <event type="service" invoke="createCommunicationEvent"/>
        <response name="success" type="view-last"/>
        <response name="error" type="view" value="EditCommunicationEvent"/>
    </request-map>

    <!-- Lookup requests -->
    <request-map uri="LookupSalesForecast"><security https="true" auth="true"/><response name="success" type="view" value="LookupSalesForecast"/></request-map>
    <request-map uri="LookupProduct"><security auth="true" https="true"/><response name="success" type="view" value="LookupProduct"/></request-map>
    <request-map uri="LookupProductCategory"><security auth="true" https="true"/><response name="success" type="view" value="LookupProductCategory"/></request-map>
    <request-map uri="LookupLeads"><security auth="true" https="true"/><response name="success" type="view" value="LookupLeads"/></request-map>
    <request-map uri="LookupAccounts"><security auth="true" https="true"/><response name="success" type="view" value="LookupAccounts"/></request-map>
    <request-map uri="LookupAccountLeads"><security auth="true" https="true"/><response name="success" type="view" value="LookupAccountLeads"/></request-map>
    <!-- end of request mappings -->

    <!-- View Mappings -->
    <view-map name="ViewLeadProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewLeadProfile"/>
    <view-map name="ViewAccountProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewAccountProfile"/>
    <view-map name="ViewContactProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewContactProfile"/>
    <view-map name="ViewAccountLeadProfile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewAccountLeadProfile"/>
    <view-map name="main" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#main"/>
    <view-map name="viewprofile" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewProfile"/>
    <view-map name="ViewPartiesCreatedByVCard" type="screen" page="component://marketing/widget/sfa/CommonScreens.xml#ViewPartiesCreatedByVCard"/>

    <view-map name="FindSalesOpportunity" type="screen" page="component://marketing/widget/sfa/OpportunityScreens.xml#FindSalesOpportunity"/>
    <view-map name="ViewSalesOpportunity" type="screen" page="component://marketing/widget/sfa/OpportunityScreens.xml#ViewSalesOpportunity"/>
    <view-map name="EditSalesOpportunity" type="screen" page="component://marketing/widget/sfa/OpportunityScreens.xml#EditSalesOpportunity"/>

    <view-map name="FindAccounts" type="screen" page="component://marketing/widget/sfa/AccountScreens.xml#FindAccounts"/>
    <view-map name="NewAccount" type="screen" page="component://marketing/widget/sfa/AccountScreens.xml#NewAccount"/>
    <view-map name="ContactMechTypeOnly" type="screen" page="component://marketing/widget/sfa/AccountScreens.xml#ContactMechTypeOnly"/>

    <view-map name="FindLeads" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#FindLeads"/>
    <view-map name="NewLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#NewLead"/>
    <view-map name="CloneLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#CloneLead"/>
    <view-map name="ConvertLead" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#ConvertLead"/>
    <view-map name="MergeLeads" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#MergeLeads"/>
    <view-map name="NewLeadFromVCard" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#NewLeadFromVCard"/>
    <view-map name="AddRelatedCompany" type="screen" page="component://marketing/widget/sfa/LeadScreens.xml#AddRelatedCompany"/>

    <view-map name="FindContacts" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#FindContacts"/>
    <view-map name="NewContact" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#NewContact"/>
    <view-map name="MergeContacts" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#MergeContacts"/>
    <view-map name="NewContactFromVCard" type="screen" page="component://marketing/widget/sfa/ContactScreens.xml#NewContactFromVCard"/>

    <view-map name="FindSalesForecast" type="screen" page="component://marketing/widget/sfa/ForecastScreens.xml#FindSalesForecast"/>
    <view-map name="EditSalesForecast" type="screen" page="component://marketing/widget/sfa/ForecastScreens.xml#EditSalesForecast"/>
    <view-map name="EditSalesForecastDetail" type="screen" page="component://marketing/widget/sfa/ForecastScreens.xml#EditSalesForecastDetail"/>
    
    <view-map name="Events" type="screen" page="component://marketing/widget/sfa/EventScreens.xml#main"/>
    <view-map name="EditEvent" type="screen" page="component://marketing/widget/sfa/EventScreens.xml#EditEvent"/>

    <view-map name="LookupSalesForecast" type="screen" page="component://marketing/widget/LookupScreens.xml#LookupSalesForecast"/>
    <view-map name="LookupProduct" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProduct"/>
    <view-map name="LookupProductCategory" type="screen" page="component://product/widget/catalog/LookupScreens.xml#LookupProductCategory"/>
    <view-map name="LookupLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupLeads"/>
    <view-map name="LookupAccounts" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccounts"/>
    <view-map name="LookupAccountLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccountLeads"/>
    
    <view-map name="ListPartyCommEvents" type="screen" page="component://marketing/widget/sfa/OpportunityScreens.xml#OpportunityCommEvent"/>

    <!-- end of view mappings -->
</site-conf>
