Added: ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml (added) +++ ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml Thu Sep 17 07:43:05 2009 @@ -0,0 +1,613 @@ +<?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. +--> + +<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd"> + + <simple-method method-name="createOrganization" short-description="Create Customer" login-required="false"> + <set field="require_email" value="true"/> + <set field="require_phone" value="false"/> + <set field="require_login" value="false"/> + <!-- this parameter must be set to true or the createUser method below will use a default password instead of the one entered by user --> + <set field="create_allow_password" value="true"/> + + <set field="parameters.roleTypeId" value="INTERNAL_ORGANIZATIO"/> + <now-timestamp field="nowStamp"/> + + <!-- Create the PartyGroup --> + <call-map-processor in-map-name="parameters" out-map-name="partyGroupContext"> + <simple-map-processor name="newPartyGroup"> + <process field="partyId"><copy/></process> + <process field="groupName"><copy to-field="groupName"/><not-empty><fail-message message="Organization name is missing"/></not-empty></process> + </simple-map-processor> + </call-map-processor> + + <!-- Create the PartyRole --> + <set field="partyRoleContext.roleTypeId" from-field="parameters.roleTypeId"/> + + <!-- Create the Postal Address --> + <if-compare field="parameters.USE_ADDRESS" operator="equals" value="false"> + <!-- address not used, do nothing --> + <else> + <call-map-processor in-map-name="parameters" out-map-name="addressContext"> + <simple-map-processor name="newPerson"> + <process field="roleTypeId"><copy/></process> + <process field="groupName"><copy to-field="toName"/></process> + <process field="USER_ADDRESS1"><copy to-field="address1"/><not-empty><fail-property resource="PartyUiLabels" property="PartyAddressLine1Missing"/></not-empty></process> + <process field="USER_ADDRESS2"><copy to-field="address2"/></process> + <process field="USER_CITY"><copy to-field="city"/><not-empty><fail-property resource="PartyUiLabels" property="PartyCityMissing"/></not-empty></process> + <process field="USER_STATE"><copy to-field="stateProvinceGeoId"/></process> + <process field="USER_POSTAL_CODE"><copy to-field="postalCode"/><not-empty><fail-property resource="PartyUiLabels" property="PartyPostalCodeMissing"/></not-empty></process> + <process field="USER_COUNTRY"><copy to-field="countryGeoId"/><not-empty><fail-property resource="PartyUiLabels" property="PartyCountryMissing"/></not-empty></process> + <process field="USER_ADDRESS_ALLOW_SOL"><copy to-field="allowSolicitation"/></process> + </simple-map-processor> + </call-map-processor> + <if-compare value="USA" operator="equals" field="parameters.USER_COUNTRY"> + <if-empty field="parameters.USER_STATE"> + <property-to-field field="tempErrorMessage" resource="PartyUiLabels" property="PartyStateInUsMissing"/> + <field-to-list field="tempErrorMessage" list="error_list"/> + </if-empty> + </if-compare> + <if-compare value="CAN" operator="equals" field="parameters.USER_COUNTRY"> + <if-empty field="parameters.USER_STATE"> + <property-to-field field="tempErrorMessage" resource="PartyUiLabels" property="PartyStateInCanadaMissing"/> + <field-to-list field="tempErrorMessage" list="error_list"/> + </if-empty> + </if-compare> + </else> + </if-compare> + <!-- Create the Work Phone --> + <if-not-empty field="parameters.USER_WORK_CONTACT"> + <call-map-processor in-map-name="parameters" out-map-name="workPhoneContext"> + <simple-map-processor name="newTelecomNumber"> + <process field="roleTypeId"><copy/></process> + <process field="USER_WORK_COUNTRY"><copy to-field="countryCode"/></process> + <process field="USER_WORK_AREA"><copy to-field="areaCode"/></process> + <process field="USER_WORK_CONTACT"><copy to-field="contactNumber"/></process> + <process field="USER_WORK_EXT"><copy to-field="extension"/></process> + <process field="USER_WORK_ALLOW_SOL"><copy to-field="allowSolicitation"/></process> + </simple-map-processor> + </call-map-processor> + </if-not-empty> + <!-- Create the Fax Phone --> + <if-not-empty field="parameters.USER_FAX_CONTACT"> + <call-map-processor in-map-name="parameters" out-map-name="faxPhoneContext"> + <simple-map-processor name="newTelecomNumber"> + <process field="roleTypeId"><copy/></process> + <process field="USER_FAX_COUNTRY"><copy to-field="countryCode"/></process> + <process field="USER_FAX_AREA"><copy to-field="areaCode"/></process> + <process field="USER_FAX_CONTACT"><copy to-field="contactNumber"/></process> + <process field="USER_FAX_EXT"><copy to-field="extension"/></process> + <process field="USER_FAX_ALLOW_SOL"><copy to-field="allowSolicitation"/></process> + </simple-map-processor> + </call-map-processor> + </if-not-empty> + <!-- Check for required Phone --> + <if-compare field="require_phone" operator="equals" value="true"> + <if-empty field="parameters.USER_HOME_CONTACT"> + <if-empty field="parameters.USER_WORK_CONTACT"> + <if-empty field="parameters.USER_MOBILE_CONTACT"> + <call-map-processor in-map-name="parameters" out-map-name="dummymap"> + <simple-map-processor name="checkRequiredPhone"> + <process field="REQUIRED_PHONE"> + <not-empty><fail-property resource="PartyUiLabels" property="PartyContactTelephoneMissing"/></not-empty> + </process> + </simple-map-processor> + </call-map-processor> + </if-empty> + </if-empty> + </if-empty> + </if-compare> + <!-- Create the email address --> + <call-map-processor in-map-name="parameters" out-map-name="emailContext"> + <simple-map-processor name="newEmail"> + <process field="roleTypeId"><copy/></process> + <process field="USER_EMAIL"><copy to-field="emailAddress"/></process> + <process field="USER_EMAIL_ALLOW_SOL"><copy to-field="allowSolicitation"/></process> + </simple-map-processor> + </call-map-processor> + <!-- Check for required E-Mail --> + <if-compare field="require_email" operator="equals" value="true"> + <if-empty field="emailContext.emailAddress"> + <call-map-processor in-map-name="emailContext" out-map-name="dummymap"> + <simple-map-processor name="checkRequiredEmail"> + <process field="emailAddress"> + <not-empty><fail-property resource="PartyUiLabels" property="PartyEmailAddressMissing"/></not-empty> + </process> + </simple-map-processor> + </call-map-processor> + </if-empty> + <if-not-empty field="emailContext.emailAddress"> + <call-map-processor in-map-name="emailContext" out-map-name="dummymap"> + <simple-map-processor name="checkRequiredEmailFormat"> + <process field="emailAddress"> + <validate-method method="isEmail"> + <fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/> + </validate-method> + </process> + </simple-map-processor> + </call-map-processor> + </if-not-empty> + </if-compare> + <!-- get the visit from the session to get the visitId --> + <session-to-field field="visit"/> + + <!-- now that everything is validated & setup, check to see if there are errors, then call the services --> + <check-errors/> + + <call-service service-name="createPartyGroup" in-map-name="partyGroupContext"> + <result-to-field result-name="partyId" field="tempMap.partyId"/> + </call-service> + + <!-- now that we have the partyId, put it where it needs to go... --> + <set field="userLoginContext.partyId" from-field="tempMap.partyId"/> + <set field="partyGroupContext.partyId" from-field="tempMap.partyId"/> + <set field="partyRoleContext.partyId" from-field="tempMap.partyId"/> + <set field="addressContext.partyId" from-field="tempMap.partyId"/> + <set field="workPhoneContext.partyId" from-field="tempMap.partyId"/> + <set field="faxPhoneContext.partyId" from-field="tempMap.partyId"/> + <set field="mobilePhoneContext.partyId" from-field="tempMap.partyId"/> + <set field="emailContext.partyId" from-field="tempMap.partyId"/> + + <call-service service-name="createPartyRole" in-map-name="partyRoleContext"/> + <!-- add Carrier roletype --> + <set field="partyRoleContext.roleTypeId" value="CARRIER"/> + <call-service service-name="createPartyRole" in-map-name="partyRoleContext"/> + + <!-- billing address --> + <if-compare field="parameters.USE_ADDRESS" operator="equals" value="false"> + <!-- address not used, do nothing --> + <else> + <call-service service-name="createPartyPostalAddress" in-map-name="addressContext"> + <result-to-field result-name="contactMechId" field="addressPurposeContext.contactMechId"/> + </call-service> + <set field="addressPurposeContext.partyId" from-field="tempMap.partyId"/> + <!-- create the payment location --> + <set field="addressPurposeContext.contactMechPurposeTypeId" value="PAYMENT_LOCATION"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="addressPurposeContext"/> + <!-- also consider this address the general correspondence address --> + <set field="addressPurposeContext.contactMechPurposeTypeId" value="GENERAL_LOCATION"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="addressPurposeContext"/> + <!-- create the billing location --> + <set field="addressPurposeContext.contactMechPurposeTypeId" value="BILLING_LOCATION"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="addressPurposeContext"/> + </else> + </if-compare> + <!-- home phone --> + <if-not-empty field="parameters.USER_HOME_CONTACT"> + <call-service service-name="createPartyTelecomNumber" in-map-name="homePhoneContext"> + <result-to-field result-name="contactMechId" field="homePhonePurposeContext.contactMechId"/> + </call-service> + <set field="homePhonePurposeContext.partyId" from-field="tempMap.partyId"/> + <set field="homePhonePurposeContext.contactMechPurposeTypeId" value="PHONE_HOME"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="homePhonePurposeContext"/> + </if-not-empty> + <!-- work phone --> + <if-not-empty field="parameters.USER_WORK_CONTACT"> + <call-service service-name="createPartyTelecomNumber" in-map-name="workPhoneContext"> + <result-to-field result-name="contactMechId" field="workPhonePurposeContext.contactMechId"/> + </call-service> + <set field="workPhonePurposeContext.partyId" from-field="tempMap.partyId"/> + <set field="workPhonePurposeContext.contactMechPurposeTypeId" value="PHONE_WORK"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="workPhonePurposeContext"/> + </if-not-empty> + <!-- fax phone --> + <if-not-empty field="parameters.USER_FAX_CONTACT"> + <call-service service-name="createPartyTelecomNumber" in-map-name="faxPhoneContext"> + <result-to-field result-name="contactMechId" field="faxPhonePurposeContext.contactMechId"/> + </call-service> + <set field="faxPhonePurposeContext.partyId" from-field="tempMap.partyId"/> + <set field="faxPhonePurposeContext.contactMechPurposeTypeId" value="FAX_NUMBER"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="faxPhonePurposeContext"/> + </if-not-empty> + <!-- mobile phone --> + <if-not-empty field="parameters.USER_MOBILE_CONTACT"> + <call-service service-name="createPartyTelecomNumber" in-map-name="mobilePhoneContext"> + <result-to-field result-name="contactMechId" field="mobilePhonePurposeContext.contactMechId"/> + </call-service> + <set field="mobilePhonePurposeContext.partyId" from-field="tempMap.partyId"/> + <set field="mobilePhonePurposeContext.contactMechPurposeTypeId" value="PHONE_MOBILE"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="mobilePhonePurposeContext"/> + </if-not-empty> + <!-- email address --> + <if-not-empty field="parameters.USER_EMAIL"> + <call-service service-name="createPartyEmailAddress" in-map-name="emailContext"> + <result-to-field result-name="contactMechId" field="emailPurposeContext.contactMechId"/> + </call-service> + <set field="emailPurposeContext.partyId" from-field="tempMap.partyId"/> + <set field="emailPurposeContext.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/> + <call-service service-name="createPartyContactMechPurpose" in-map-name="emailPurposeContext"/> + </if-not-empty> + + <!-- General Ledger Setup for the new organization --> + <call-simple-method method-name="setupDefaultGeneralLedger"/> + + <!-- Create partyId for UserLogin --> + <session-to-field field="userLoginCtx" session-name="userLogin"/> + <if-empty field="userLoginCtx.partyId"> + <make-value value-field="newEntity" entity-name="Party"/> + <set field="newEntity.partyId" from-field="userLoginCtx.userLoginId"/> + <set field="newEntity.partyTypeId" value="PERSON"/> + <create-value value-field="newEntity"/> + <clear-field field="newEntity"/> + <make-value value-field="newPerson" entity-name="Person"/> + <set field="newPerson.partyId" from-field="userLoginCtx.userLoginId"/> + <create-value value-field="newPerson"/> + <clear-field field="newPerson"/> + + <set field="userLoginCtx.partyId" from-field="userLoginCtx.userLoginId"/> + <store-value value-field="userLoginCtx"/> + </if-empty> + + <!-- set the partyId in the request --> + <field-to-request field="tempMap.partyId" request-name="partyId"/> + </simple-method> + + <simple-method method-name="setupDefaultGeneralLedger" short-description="General Ledger Setup for the new organization"> + <set field="partyId" from-field="tempMap.partyId" default-value="${parameters.partyId}"/> + <!-- create GL journal for suspended transactions (failed post) --> + <set field="createGlJournalCtx.organizationPartyId" from-field="partyId"/> + <set field="createGlJournalCtx.glJournalName" value="Suspense transactions"/> + <call-service service-name="createGlJournal" in-map-name="createGlJournalCtx"> + <result-to-field result-name="glJournalId" field="acctgPreferenceCtx.errorGlJournalId"/> + </call-service> + + <call-bsh><![CDATA[ + groupName = parameters.get("groupName"); + if(groupName != null){ + parameters.put("invoiceIdPrefix", groupName.toUpperCase().substring(0, 2)+"CI"); + }else{ + parameters.put("invoiceIdPrefix", "CI"); + } + ]]></call-bsh> + + <set field="acctgPreferenceCtx.partyId" from-field="partyId"/> + <set field="acctgPreferenceCtx.taxFormId" value="US_IRS_1120"/> + <set field="acctgPreferenceCtx.cogsMethodId" value="COGS_AVG_COST"/> + <set field="acctgPreferenceCtx.baseCurrencyUomId" value="USD"/> + <set field="acctgPreferenceCtx.invoiceSequenceEnumId" value="INVSQ_ENF_SEQ"/> + <set field="acctgPreferenceCtx.invoiceIdPrefix" from-field="parameters.invoiceIdPrefix"/> + <set field="acctgPreferenceCtx.quoteSequenceEnumId" value="INVSQ_ENF_SEQ"/> + <set field="acctgPreferenceCtx.quoteIdPrefix" value="QU"/> + <set field="acctgPreferenceCtx.orderSequenceEnumId" value="INVSQ_ENF_SEQ"/> + <set field="acctgPreferenceCtx.orderIdPrefix" value="OD"/> + <call-service service-name="createPartyAcctgPreference" in-map-name="acctgPreferenceCtx"/> + + <!-- run demo General Chart Of Accounts --> + <entity-condition entity-name="GlAccount" list="glAccountList"/> + <if-empty field="glAccountList"> + <set field="importChartOfAccountCtx.filename" value="${sys:getProperty('ofbiz.home')}/applications/accounting/data/DemoGeneralChartOfAccounts.xml"/> + <session-to-field field="importChartOfAccountCtx.userLogin" session-name="userLogin"/> + <call-service service-name="entityImport" in-map-name="importChartOfAccountCtx"/> + <check-errors/> + </if-empty> + + <!-- create General Ledger Setup --> + <set field="pathFileString" value="file:${sys:getProperty('ofbiz.home')}/applications/commonext/data/GlAccountData.xml"/> + <set field="tempFileName" value="tempGlAccountData.xml"/> + <set field="topic" value="GlAccount"/> + <now-timestamp field="nowTimestamp"/> + <set field="nowString" value="${groovy:nowTimestamp.toString()}"/> + <set field="ORGPARTYID" from-field="partyId"/> + <set field="FROMDATE" from-field="nowString"/> + <call-simple-method method-name="importTempDataFile"/> + + </simple-method> + + <simple-method method-name="createCustomer" short-description="Create Customer" login-required="false"> + <set field="require_email" value="true"/> + <set field="require_phone" value="false"/> + <set field="require_login" value="false"/> + <!-- this parameter must be set to true or the createUser method below will use a default password instead of the one entered by user --> + <set field="create_allow_password" value="true"/> + <set field="parameters.roleTypeId" value="CUSTOMER"/> + <set field="organizationPartyId" from-field="parameters.partyId"/> + <set field="personContext.partyId" from-field="parameters.customerPartyId"/> + <call-simple-method method-name="createUser" xml-resource="component://party/script/org/ofbiz/party/user/UserEvents.xml"/> + + <!-- Create PartyRelationship --> + <set field="lookupValue.partyIdFrom" from-field="tempMap.partyId"/> + <set field="lookupValue.partyIdTo" from-field="organizationPartyId"/> + <set field="lookupValue.roleTypeIdFrom" value="CUSTOMER"/> + <set field="lookupValue.roleTypeIdTo" value="INTERNAL_ORGANIZATIO"/> + <set field="lookupValue.partyRelationshipTypeId" value="CUSTOMER_REL"/> + <session-to-field field="lookupValue.userLogin" session-name="userLogin"/> + <call-service service-name="createPartyRelationship" in-map-name="lookupValue"/> + + <field-to-request field="organizationPartyId" request-name="partyId"/> + <field-to-request field="tempMap.partyId" request-name="customerId"/> + </simple-method> + + <simple-method method-name="createFacilityAndContactMech" short-description="create Facility and ContactMech"> + <make-value value-field="newEntity" entity-name="Facility"/> + <set field="defaultDaysToShip" from-field="parameters.defaultDaysToShip" type="Long"/> + <clear-field field="parameters.defaultDaysToShip"/> + <set-nonpk-fields value-field="newEntity" map="parameters"/> + <set field="newEntity.defaultDaysToShip" from-field="defaultDaysToShip" type="Long"/> + + <if-empty field="parameters.facilityId"> + <sequenced-id sequence-name="Facility" field="facilityId"/> + <to-string field="facilityId"/> + <set field="newEntity.facilityId" from-field="facilityId"/> + <else> + <set field="newEntity.facilityId" from-field="parameters.facilityId"/> + </else> + </if-empty> + <set field="facilityId" from-field="newEntity.facilityId"/> + <field-to-request field="facilityId" request-name="facilityId"/> + <create-value value-field="newEntity"/> + + <set-service-fields service-name="createPostalAddress" map="parameters" to-map="addressContext"/> + <call-service service-name="createPostalAddress" in-map-name="addressContext"> + <result-to-field result-name="contactMechId" field="contactMechId"/> + </call-service> + + <set field="facilityContactMechCtx.contactMechId" from-field="contactMechId"/> + <set field="facilityContactMechCtx.facilityId" from-field="facilityId"/> + <call-service service-name="createFacilityContactMech" in-map-name="facilityContactMechCtx"/> + + <!-- create the payment location --> + <set field="addressPurposeContext.facilityId" from-field="facilityId"/> + <set field="addressPurposeContext.contactMechId" from-field="contactMechId"/> + <set field="addressPurposeContext.contactMechPurposeTypeId" value="SHIPPING_LOCATION"/> + <call-service service-name="createFacilityContactMechPurpose" in-map-name="addressPurposeContext"/> + <!-- also consider this address the shipping origin address --> + <set field="addressPurposeContext.contactMechPurposeTypeId" value="SHIP_ORIG_LOCATION"/> + <call-service service-name="createFacilityContactMechPurpose" in-map-name="addressPurposeContext"/> + </simple-method> + + <simple-method method-name="createProductStoreWithDefaultSetting" short-description="create ProductStore and setting default value for payment and shipping"> + <!-- Create ProductStore --> + <if-compare field="parameters.showPricesWithVatTax" operator="equals" value="Y"> + <if-empty field="parameters.vatTaxAuthGeoId"> + <add-error><fail-property property="ProductVatTaxAuthGeoNotSet" resource="ProductUiLabels"/></add-error> + </if-empty> + <if-empty field="parameters.vatTaxAuthPartyId"> + <add-error><fail-property property="ProductVatTaxAuthPartyNotSet" resource="ProductUiLabels"/></add-error> + </if-empty> + <check-errors/> + </if-compare> + <make-value value-field="newEntity" entity-name="ProductStore"/> + <set-nonpk-fields value-field="newEntity" map="parameters"/> + <set field="newEntity.storeCreditValidDays" value="90" type="Long"/> + <set field="newEntity.daysToCancelNonPay" value="30" type="Long"/> + + <if-empty field="parameters.productStoreId"> + <sequenced-id sequence-name="Facility" field="productStoreId"/> + <to-string field="productStoreId"/> + <set field="newEntity.productStoreId" from-field="productStoreId"/> + <else> + <set field="newEntity.productStoreId" from-field="parameters.productStoreId"/> + </else> + </if-empty> + <set field="productStoreId" from-field="newEntity.productStoreId"/> + <field-to-request field="productStoreId" request-name="productStoreId"/> + <create-value value-field="newEntity"/> + + <!-- create the ProductStoreFacility record --> + <now-timestamp field="nowTimestamp"/> + <if-not-empty field="newEntity.inventoryFacilityId"> + <make-value value-field="storeFacility" entity-name="ProductStoreFacility"/> + <set from-field="newEntity.inventoryFacilityId" field="storeFacility.facilityId"/> + <set from-field="newEntity.productStoreId" field="storeFacility.productStoreId"/> + <set from-field="nowTimestamp" field="storeFacility.fromDate"/> + <create-value value-field="storeFacility"/> + </if-not-empty> + + <field-to-request field="parameters.partyId" request-name="partyId"/> + <set field="organizationPartyId" from-field="parameters.partyId"/> + + <!-- Create default data of ProductStoreShipmentMeth, ShipmentMethodType , CarrierShipmentMethod, and ShipmentCostEstimate. --> + <entity-condition entity-name="ShipmentMethodType" list="shipmentMethodTypeList"/> + <if-empty field="shipmentMethodTypeList"> + <!-- run demo Shipping --> + <set field="importShippingCtx.filename" value="${sys:getProperty('ofbiz.home')}/applications/commonext/data/ShippingData.xml"/> + <session-to-field field="importShippingCtx.userLogin" session-name="userLogin"/> + <call-service service-name="entityImport" in-map-name="importShippingCtx"/> + <check-errors/> + </if-empty> + + <!-- Import Default ProductStore & Shipment data --> + <set field="pathFileString" value="file:${sys:getProperty('ofbiz.home')}/applications/commonext/data/ProductStoreData.xml"/> + <set field="tempFileName" value="tempProductStore.xml"/> + <set field="topic" value="ProductStore"/> + <set field="ORGPARTYID" from-field="organizationPartyId"/> + <set field="PRODUCTSTOREID" from-field="productStoreId"/> + <call-simple-method method-name="importTempDataFile"/> + </simple-method> + + <simple-method method-name="createProdCatalogAndProductStoreCatalog" short-description="create ProdCatalog And ProductStoreCatalog"> + <set-service-fields service-name="createProdCatalog" map="parameters" to-map="createProdCatalogCtx"/> + + <call-service service-name="createProdCatalog" in-map-name="createProdCatalogCtx"> + <result-to-field result-name="prodCatalogId" field="newProductStoreCatalog.prodCatalogId"/> + <result-to-request result-name="prodCatalogId" request-name="prodCatalogId"/> + </call-service> + + <set field="newProductStoreCatalog.productStoreId" from-field="parameters.productStoreId"/> + <call-service service-name="createProductStoreCatalog" in-map-name="newProductStoreCatalog"/> + </simple-method> + + <simple-method method-name="createProductCategoryAndAddToProdCatalog" short-description="addProductCategoryToProdCatalog"> + <set-service-fields service-name="createProductCategory" map="parameters" to-map="createProductCategoryCtx"/> + <call-service service-name="createProductCategory" in-map-name="createProductCategoryCtx"> + <result-to-field result-name="productCategoryId" field="addToProdCatalogCtx.productCategoryId"/> + <result-to-request result-name="productCategoryId" request-name="productCategoryId"/> + </call-service> + + <set field="addToProdCatalogCtx.prodCatalogId" from-field="parameters.prodCatalogId"/> + <set field="addToProdCatalogCtx.prodCatalogCategoryTypeId" value="PCCT_BROWSE_ROOT"/> + <call-service service-name="addProductCategoryToProdCatalog" in-map-name="addToProdCatalogCtx"/> + </simple-method> + + <simple-method method-name="updateProductInCategory" short-description="Update a Product in a Category along with special information such as prices"> + <set value="updateProductInCategory" field="callingMethodName"/> + <set field="checkAction" value="UPDATE"/> + <call-simple-method method-name="checkCategoryRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/category/CategoryServices.xml"/> + <check-errors/> + + <if-empty field="parameters.currencyUomId"> + <!-- default to USD for lack of a better alternative, for now anyway... --> + <set field="parameters.currencyUomId" value="USD"/> + </if-empty> + + <!-- create Product --> + <set-service-fields service-name="updateProduct" map="parameters" to-map="callUpdateProductMap"/> + <call-service service-name="updateProduct" in-map-name="callUpdateProductMap"/> + + <set field="productId" from-field="parameters.productId"/> + + <!-- create/update defaultPrice and averageCost ProductPrice --> + <if-not-empty field="parameters.defaultPrice"> + <entity-condition entity-name="ProductPrice" list="defaultPriceValues" filter-by-date="true"> + <condition-list> + <condition-expr field-name="productId" from-field="productId"/> + <condition-expr field-name="productPriceTypeId" value="DEFAULT_PRICE"/> + <condition-expr field-name="productPricePurposeId" value="PURCHASE"/> + </condition-list> + </entity-condition> + <if-empty field="defaultPriceValues"> + <set field="createDefaultPriceMap.productId" from-field="productId"/> + <set field="createDefaultPriceMap.currencyUomId" from-field="parameters.currencyUomId"/> + <set field="createDefaultPriceMap.price" from-field="parameters.defaultPrice" type="BigDecimal"/> + <set field="createDefaultPriceMap.productStoreGroupId" value="_NA_"/> + <set field="createDefaultPriceMap.productPriceTypeId" value="DEFAULT_PRICE"/> + <set field="createDefaultPriceMap.productPricePurposeId" value="PURCHASE"/> + <call-service service-name="createProductPrice" in-map-name="createDefaultPriceMap"/> + + <else> + <first-from-list entry="defaultPrice" list="defaultPriceValues"/> + <set field="updateDefaultPriceMap.productId" from-field="productId"/> + <set field="updateDefaultPriceMap.price" from-field="parameters.defaultPrice" type="BigDecimal"/> + <set field="updateDefaultPriceMap.productPricePurposeId" from-field="defaultPrice.productPricePurposeId"/> + <set field="updateDefaultPriceMap.productPriceTypeId" from-field="defaultPrice.productPriceTypeId"/> + <set field="updateDefaultPriceMap.productStoreGroupId" from-field="defaultPrice.productStoreGroupId"/> + <set field="updateDefaultPriceMap.currencyUomId" from-field="defaultPrice.currencyUomId"/> + <set field="updateDefaultPriceMap.fromDate" from-field="defaultPrice.fromDate"/> + <call-service service-name="updateProductPrice" in-map-name="updateDefaultPriceMap"/> + </else> + </if-empty> + + </if-not-empty> + + <if-not-empty field="parameters.averageCost"> + <entity-condition entity-name="ProductPrice" list="averageCostValues" filter-by-date="true"> + <condition-list> + <condition-expr field-name="productId" from-field="productId"/> + <condition-expr field-name="productPriceTypeId" value="AVERAGE_COST"/> + <condition-expr field-name="productPricePurposeId" value="PURCHASE"/> + </condition-list> + </entity-condition> + <if-empty field="averageCostValues"> + <set field="createAverageCostMap.productId" from-field="productId"/> + <set field="createAverageCostMap.currencyUomId" from-field="parameters.currencyUomId"/> + <set field="createAverageCostMap.price" from-field="parameters.averageCost" type="BigDecimal"/> + <set field="createAverageCostMap.productStoreGroupId" value="_NA_"/> + <set field="createAverageCostMap.productPriceTypeId" value="AVERAGE_COST"/> + <set field="createAverageCostMap.productPricePurposeId" value="PURCHASE"/> + <call-service service-name="createProductPrice" in-map-name="createAverageCostMap"/> + + <else> + <first-from-list entry="averageCost" list="averageCostValues"/> + <set field="updateAverageCostMap.productId" from-field="productId"/> + <set field="updateAverageCostMap.productPricePurposeId" from-field="averageCost.productPricePurposeId"/> + <set field="updateAverageCostMap.productPriceTypeId" from-field="averageCost.productPriceTypeId"/> + <set field="updateAverageCostMap.productStoreGroupId" from-field="averageCost.productStoreGroupId"/> + <set field="updateAverageCostMap.currencyUomId" from-field="averageCost.currencyUomId"/> + <set field="updateAverageCostMap.fromDate" from-field="averageCost.fromDate"/> + <set field="updateAverageCostMap.price" from-field="parameters.averageCost" type="BigDecimal"/> + <call-service service-name="updateProductPrice" in-map-name="updateAverageCostMap"/> + </else> + </if-empty> + </if-not-empty> + </simple-method> + + <simple-method method-name="importTempDataFile" short-description="replace value and import a temporary data file"> + <create-object class-name="java.net.URL" field="templateUrl"> + <field field="pathFileString"/> + </create-object> + + <call-bsh><![CDATA[ + try { + InputStream templateStream = templateUrl.openStream(); + templateReader = new InputStreamReader(templateStream); + } catch (IOException ex) { + org.ofbiz.base.util.Debug.log(ex + "Unable to get template from URL : "+templateUrl.toExternalForm()); + } + return org.ofbiz.base.util.UtilMisc.toMap("templateReader", templateReader); + ]]></call-bsh> + + <create-object class-name="java.io.BufferedReader" field="reader"> + <field field="templateReader" type="java.io.Reader"/> + </create-object> + + <set field="tempDir" value="${sys:getProperty('ofbiz.home')}/runtime/tmp"/> + + <call-bsh><![CDATA[ + sfileOut = new File(tempDir); + if (!sfileOut.exists()) { + sfileOut.mkdir(); + } + fos = new FileOutputStream(new File(sfileOut, tempFileName)); + sWriter = new OutputStreamWriter(fos); + return org.ofbiz.base.util.UtilMisc.toMap("sWriter", sWriter); + ]]></call-bsh> + + <create-object class-name="java.io.BufferedWriter" field="writer"> + <field field="sWriter" type="java.io.Writer"/> + </create-object> + + <!-- replace value and write to a temporary data file --> + <call-bsh><![CDATA[ + String line = null; + + while (null != (line = reader.readLine())) { + if("GlAccount".equals(topic)){ + line = line.replaceAll("ORGPARTYID", ORGPARTYID); + line = line.replaceAll("FROMDATE", FROMDATE); + }else if("ProductStore".equals(topic)){ + line = line.replaceAll("ORGPARTYID", ORGPARTYID); + line = line.replaceAll("PRODUCTSTOREID", PRODUCTSTOREID); + } + writer.write(line); + } + writer.close(); + return org.ofbiz.base.util.UtilMisc.toMap("writer", writer); + ]]></call-bsh> + + <!-- Import a temporary data file --> + <set field="outputPathString" value="file:${tempDir}/${tempFileName}"/> + <create-object class-name="java.net.URL" field="outputPath"> + <field field="outputPathString"/> + </create-object> + + <set field="inputMap.url" from-field="outputPath"/> + <session-to-field field="inputMap.userLogin" session-name="userLogin"/> + <call-service service-name="parseEntityXmlFile" in-map-name="inputMap"/> + + <!-- Delete a temporary data file --> + <call-bsh><![CDATA[ + tmpPathFile = new File(tempDir, tempFileName); + if(tmpPathFile != null){ + tmpPathFile.delete(); + } + ]]></call-bsh> + </simple-method> +</simple-methods> \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/script/org/ofbiz/setup/SetupEvents.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy Thu Sep 17 07:43:05 2009 @@ -0,0 +1,47 @@ +/* + * 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. + */ + import org.ofbiz.base.util.* + import org.ofbiz.entity.util.EntityUtil; + +findResult = delegator.findByAnd("Facility", [ownerPartyId: partyId]); +findResultSize = findResult.size(); +if (findResultSize == 1) { + context.showScreen = "one"; + context.facility = findResult.get(0); + context.parameters.facilityId = context.facility.facilityId; +} +if ((findResultSize > 1 ) && (findResultSize <= 10)) { + context.showScreen = "ten"; +} else if ((findResultSize > 10 ) || (findResultSize <= 0)) { + context.showScreen = "more"; +} + +listPartyPostalAddress = delegator.findByAnd("PartyAndPostalAddress", [partyId: partyId]); +partyPostalAddress = EntityUtil.getFirst(EntityUtil.filterByDate(listPartyPostalAddress)); +context.partyPostalAddress = partyPostalAddress; + +if("productstore".equals(tabButtonItemTop)){ + if(findResultSize == 0){ + request.setAttribute("_ERROR_MESSAGE_", "Facility not set!"); + context.showScreen = "message"; + return; + }else{ + context.showScreen = "origin"; + } +} \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/FindFacility.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy Thu Sep 17 07:43:05 2009 @@ -0,0 +1,121 @@ +/* + * 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. + */ + import org.ofbiz.base.util.* + import org.ofbiz.entity.util.EntityUtil; + import javolution.util.FastList; + + prodCatalog = null; + prodCatalogId = parameters.prodCatalogId; + showScreen = "origin"; + List errMsgList = FastList.newInstance(); + + productStore = EntityUtil.getFirst(delegator.findByAnd("ProductStore", [payToPartyId: partyId])); + if(productStore){ + context.productStoreId = productStore.productStoreId; + } + if(UtilValidate.isEmpty(productStore)){ + errMsgList.add("Product Store not set!"); + showScreen = "message"; + }else{ + facility = delegator.findByPrimaryKey("Facility", [facilityId : productStore.inventoryFacilityId]); + webSite = EntityUtil.getFirst(delegator.findByAnd("WebSite", [productStoreId: productStore.productStoreId])); + + if(UtilValidate.isEmpty(facility)){ + errMsgList.add("Facility not set!"); + showScreen = "message"; + } + if(UtilValidate.isEmpty(webSite)){ + errMsgList.add("WebSite not set!"); + showScreen = "message"; + } + } + if (errMsgList) { + request.setAttribute("_ERROR_MESSAGE_LIST_", errMsgList); + return; + } + + productStoreCatalog = EntityUtil.getFirst(delegator.findByAnd("ProductStoreCatalog", [productStoreId: productStore.productStoreId])); + if(productStoreCatalog){ + prodCatalog = productStoreCatalog.getRelatedOne("ProdCatalog"); + prodCatalogId = prodCatalog.prodCatalogId; + } + context.prodCatalog = prodCatalog; + context.prodCatalogId = prodCatalogId + context.showScreen = showScreen; + + if(("productcategory".equals(tabButtonItem)) || ("product".equals(tabButtonItem))){ + productCategory = null; + productCategoryId = parameters.productCategoryId; + showErrorMsg = "N"; + + if(UtilValidate.isEmpty(prodCatalogId)){ + errMsgList.add("Product Catalog not set!"); + showErrorMsg = "Y"; + } + + prodCatalogCategory = EntityUtil.getFirst(delegator.findByAnd("ProdCatalogCategory", [prodCatalogId: prodCatalogId])); + + if(prodCatalogCategory){ + productCategory = prodCatalogCategory.getRelatedOne("ProductCategory"); + productCategoryId = productCategory.productCategoryId; + + } + context.productCategoryId = productCategoryId; + context.productCategory = productCategory; + + if("product".equals(tabButtonItem)){ + productId = parameters.productId; + product = null; + + if(UtilValidate.isEmpty(productCategoryId)){ + errMsgList.add("Product Category not set!"); + showErrorMsg = "Y"; + } + /**************** get product from ProductCategory ******************/ + productCategoryMember = EntityUtil.getFirst(delegator.findByAnd("ProductCategoryMember", [productCategoryId: productCategoryId])); + if(productCategoryMember){ + product = productCategoryMember.getRelatedOne("Product"); + productId = product.productId; + // Average cost + averageCostValues = delegator.findByAnd("ProductPrice", [productId : productId, productPricePurposeId : "PURCHASE", productPriceTypeId : "AVERAGE_COST"]); + if(averageCostValues){ + averageCostValue = EntityUtil.getFirst(EntityUtil.filterByDate(averageCostValues)); + if (averageCostValue?.price != null) { + context.averageCost = averageCostValue.price; + } + } + // Default cost + defaultPriceValues = delegator.findByAnd("ProductPrice", [productId : productId, productPricePurposeId : "PURCHASE", productPriceTypeId : "DEFAULT_PRICE"]); + if(defaultPriceValues){ + defaultPrice = EntityUtil.getFirst(EntityUtil.filterByDate(defaultPriceValues)); + if (defaultPrice?.price != null) { + context.defaultPrice = defaultPrice.price; + } + } + } + context.productId = productId; + context.product = product; + } + + if (errMsgList) { + request.setAttribute("_ERROR_MESSAGE_LIST_", errMsgList); + return; + } + context.showErrorMsg = showErrorMsg; + } \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProdCatalog.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy Thu Sep 17 07:43:05 2009 @@ -0,0 +1,48 @@ +/* + * 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. + */ + import org.ofbiz.base.util.* + import org.ofbiz.entity.util.EntityUtil; + import javolution.util.FastList; + import javolution.util.FastMap; + + productStoreId = null; + +productStore = EntityUtil.getFirst(delegator.findByAnd("ProductStore", [payToPartyId: partyId])); +if(productStore){ + productStoreId = productStore.productStoreId +} +context.productStoreId = productStoreId; +context.productStore = productStore; + +if("website".equals(tabButtonItemTop)){ + if(productStoreId != null){ + webSite = EntityUtil.getFirst(delegator.findByAnd("WebSite", [productStoreId: productStoreId])); + context.showScreen = "origin"; + }else{ + request.setAttribute("_ERROR_MESSAGE_", "Product Store not set!"); + context.showScreen = "message"; + return; + } + + if(webSite){ + webSiteId = webSite.webSiteId; + } + context.webSiteId = webSiteId; + context.webSite = webSite; +} \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/actions/GetProductStoreAndWebSite.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml Thu Sep 17 07:43:05 2009 @@ -0,0 +1,235 @@ +<?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" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> + <include location="component://common/webcommon/WEB-INF/common-controller.xml"/> + <include location="component://commonext/webapp/WEB-INF/controller.xml"/> + <include location="component://party/webapp/partymgr/WEB-INF/controller.xml"/> + + <request-map uri="main"> + <security https="true" auth="true"/> + <response name="success" type="view" value="initialsetup"/> + </request-map> + <request-map uri="initialsetup"> + <security https="true" auth="true"/> + <response name="success" type="view" value="initialsetup"/> + </request-map> + + <request-map uri="editpartygroup"><security https="true" auth="true"/><response name="success" type="view" value="EditPartyGroup"/></request-map> + <request-map uri="updatePartyGroup"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updatePartyGroup"/> + <response name="success" type="request" value="viewprofile"/> + <response name="error" type="view" value="EditPartyGroup"/> + </request-map> + <request-map uri="editperson"><security https="true" auth="true"/><response name="success" type="view" value="EditPerson"/></request-map> + <request-map uri="updatePerson"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updatePerson"/> + <response name="success" type="view-last"/> + <response name="error" type="view" value="EditPerson"/> + </request-map> + <request-map uri="viewprofile"> + <security https="true" auth="true"/> + <response name="success" type="view" value="viewprofile" save-home-view="true"/> + </request-map> + + <!-- Entity Export requests --> + <request-map uri="EntityExportAll"><security https="true" auth="true"/><response name="success" type="view" value="EntityExportAll"/><response name="error" type="view" value="EntityExportAll"/></request-map> + <request-map uri="entityExportAll"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="entityExportAll"/> + <response name="success" type="view" value="EntityExportAll"/> + <response name="error" type="view" value="EntityExportAll"/> + </request-map> + + <!-- ================ Product Store Requests ============= --> + <request-map uri="FindProductStore"> + <security https="true" auth="true"/> + <response name="success" type="view" value="FindProductStore"/> + </request-map> + <request-map uri="EditProductStore"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditProductStore"/> + </request-map> + <request-map uri="createProductStore"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createProductStoreWithDefaultSetting"/> + <response name="success" type="view" value="EditProductStore"/> + <response name="error" type="view" value="EditProductStore"/> + </request-map> + <request-map uri="updateProductStore"> + <security https="true" auth="true"/> + <event type="service" invoke="updateProductStore"/> + <response name="success" type="view" value="EditProductStore"/> + <response name="error" type="view" value="EditProductStore"/> + </request-map> + + <request-map uri="createOrganization"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createOrganization"/> + <response name="success" type="view" value="viewprofile"/> + <response name="error" type="view" value="initialsetup"/> + </request-map> + + <request-map uri="addGeneralLedger"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="setupDefaultGeneralLedger"/> + <response name="success" type="view" value="viewprofile"/> + <response name="error" type="view" value="initialsetup"/> + </request-map> + + <request-map uri="OrganizationToComplete"> + <security https="true" auth="true"/> + <event type="service" invoke="createPartyRole"/> + <response name="success" type="view" value="initialsetup"/> + <response name="error" type="view" value="initialsetup"/> + </request-map> + + <request-map uri="ViewFacility"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ViewFacility"/> + </request-map> + <request-map uri="EditFacility"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditFacility"/> + </request-map> + <request-map uri="CreateFacility"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createFacilityAndContactMech"/> + <response name="success" type="view" value="EditFacility"/> + <response name="error" type="view" value="EditFacility"/> + </request-map> + <request-map uri="UpdateFacility"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updateFacility"/> + <response name="success" type="view" value="EditFacility"/> + <response name="error" type="view" value="EditFacility"/> + </request-map> + + <request-map uri="FindWebSite"><security https="true" auth="true"/><response name="success" type="view" value="FindWebSite"/></request-map> + <request-map uri="EditWebSite"><security https="true" auth="true"/><response name="success" type="view" value="EditWebSite"/></request-map> + <request-map uri="createWebSite"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="createWebSite"/> + <response name="success" type="view" value="EditWebSite"/> + <response name="error" type="view" value="EditWebSite"/> + </request-map> + <request-map uri="updateWebSite"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updateWebSite"/> + <response name="success" type="view" value="EditWebSite"/> + <response name="error" type="view" value="EditWebSite"/> + </request-map> + <!-- ================ First Product Requests ============= --> + <request-map uri="firstproduct"> + <security https="true" auth="true"/> + <response name="success" type="view" value="firstproduct"/> + </request-map> + <request-map uri="createProdCatalog"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createProdCatalogAndProductStoreCatalog"/> + <response name="success" type="view" value="firstproduct"/> + <response name="error" type="view" value="firstproduct"/> + </request-map> + <request-map uri="updateProdCatalog"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updateProdCatalog"/> + <response name="success" type="view" value="firstproduct"/> + <response name="error" type="view" value="firstproduct"/> + </request-map> + + <request-map uri="EditCategory"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditCategory"/> + </request-map> + <request-map uri="createProductCategory"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createProductCategoryAndAddToProdCatalog"/> + <response name="success" type="view" value="EditCategory"/> + <response name="error" type="view" value="EditCategory"/> + </request-map> + + <request-map uri="updateProductCategory"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updateProductCategory"/> + <response name="success" type="view" value="EditCategory"/> + <response name="error" type="view" value="EditCategory"/> + </request-map> + <request-map uri="NewProduct"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditProduct"/> + </request-map> + <request-map uri="createProduct"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="createProductInCategory"/> + <response name="success" type="view" value="EditProduct"/> + <response name="error" type="view" value="EditProduct"/> + </request-map> + <request-map uri="updateProduct"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="updateProductInCategory"/> + <response name="success" type="view" value="EditProduct"/> + <response name="error" type="view" value="EditProduct"/> + </request-map> + <!-- ================ First Customer Requests ============= --> + <request-map uri="firstcustomer"> + <security https="true" auth="true"/> + <response name="success" type="view" value="firstcustomer" save-home-view="true"/> + </request-map> + <request-map uri="createCustomer"> + <security https="true" auth="true"/> + <event type="simple" path="component://commonext/script/org/ofbiz/setup/SetupEvents.xml" invoke="createCustomer"/> + <response name="success" type="view" value="firstcustomer"/> + <response name="error" type="view" value="firstcustomer"/> + </request-map> + + <!-- ================ Lookup Requests ============= --> + <request-map uri="LookupFacility"><security https="true" auth="true"/><response name="success" type="view" value="LookupFacility"/></request-map> + <request-map uri="LookupPartyName"><security https="true" auth="true"/><response name="success" type="view" value="LookupPartyName"/></request-map> + <!-- end of request mappings --> + + <!-- View Mappings --> + <view-map name="initialsetup" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#InitialSetup"/> + <view-map name="viewprofile" type="screen" page="component://commonext/widget/ofbizsetup/ProfileScreens.xml#viewprofile"/> + <view-map name="EditPerson" type="screen" page="component://commonext/widget/ofbizsetup/ProfileScreens.xml#EditPerson"/> + <view-map name="EditPartyGroup" type="screen" page="component://commonext/widget/ofbizsetup/ProfileScreens.xml#EditPartyGroup"/> + + <view-map name="ViewFacility" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#ViewFacility"/> + <view-map name="EditFacility" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditFacility"/> + + <view-map name="FindProductStore" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#FindProductStore"/> + <view-map name="EditProductStore" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditProductStore"/> + + <view-map name="EntityExportAll" type="screen" page="component://commonext/widget/ofbizsetup/CommonScreens.xml#EntityExportAll"/> + <view-map name="EditProductStore" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditProductStore"/> + + <view-map name="FindWebSite" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#FindWebSite" type="screen"/> + <view-map name="EditWebSite" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditWebSite" type="screen"/> + + <view-map name="firstcustomer" type="screen" page="component://commonext/widget/ofbizsetup/ProfileScreens.xml#FirstCustomer"/> + <view-map name="firstproduct" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditProdCatalog"/> + <view-map name="EditCategory" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditCategory"/> + <view-map name="EditProduct" type="screen" page="component://commonext/widget/ofbizsetup/SetupScreens.xml#EditProduct"/> + + <view-map name="LookupFacility" type="screen" page="component://product/widget/facility/LookupScreens.xml#LookupFacility"/> + <view-map name="LookupPartyName" type="screen" page="component://party/widget/partymgr/LookupScreens.xml#LookupPartyName"/> +</site-conf> \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/controller.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml Thu Sep 17 07:43:05 2009 @@ -0,0 +1,109 @@ +<?xml version="1.0"?> +<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> + +<!-- + 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. +--> + +<web-app> + <display-name>Open For Business - Setup Manager</display-name> + <description>Setup Manager Module of the Open For Business Project</description> + + <context-param> + <param-name>webSiteId</param-name> + <param-value>SETUP</param-value> + <description>A unique ID used to look up the WebSite entity</description> + </context-param> + <context-param> + <param-name>entityDelegatorName</param-name> + <param-value>default</param-value> + <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description> + </context-param> + <context-param> + <param-name>localDispatcherName</param-name> + <param-value>setup</param-value> + <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description> + </context-param> + <context-param> + <param-name>mainDecoratorLocation</param-name> + <param-value>component://commonext/widget/ofbizsetup/CommonScreens.xml</param-value> + <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description> + </context-param> + <context-param> + <param-name>serviceReaderUrls</param-name> + <param-value>/WEB-INF/services.xml</param-value> + <description>Configuration File(s) For The Service Dispatcher</description> + </context-param> + <context-param> + <param-name>scriptLocationPath</param-name> + <param-value>/WEB-INF/bsh</param-value> + <description>BeanShell Script Location</description> + </context-param> + + <filter> + <filter-name>ContextFilter</filter-name> + <display-name>ContextFilter</display-name> + <filter-class>org.ofbiz.webapp.control.ContextFilter</filter-class> + <init-param> + <param-name>disableContextSecurity</param-name> + <param-value>N</param-value> + </init-param> + <init-param> + <param-name>allowedPaths</param-name> + <param-value>/control:/select:/index.html:/index.jsp:/default.html:/default.jsp:/images:/static:/js</param-value> + </init-param> + <init-param> + <param-name>errorCode</param-name> + <param-value>403</param-value> + </init-param> + <init-param> + <param-name>redirectPath</param-name> + <param-value>/control/main</param-value> + </init-param> + </filter> + <filter-mapping> + <filter-name>ContextFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + + <listener><listener-class>org.ofbiz.webapp.control.ControlEventListener</listener-class></listener> + <listener><listener-class>org.ofbiz.webapp.control.LoginEventListener</listener-class></listener> + <!-- NOTE: not all app servers support mounting implementations of the HttpSessionActivationListener interface --> + <!-- <listener><listener-class>org.ofbiz.webapp.control.ControlActivationEventListener</listener-class></listener> --> + + <servlet> + <servlet-name>ControlServlet</servlet-name> + <display-name>ControlServlet</display-name> + <description>Main Control Servlet</description> + <servlet-class>org.ofbiz.webapp.control.ControlServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>ControlServlet</servlet-name> + <url-pattern>/control/*</url-pattern> + </servlet-mapping> + + <session-config> + <session-timeout>60</session-timeout> <!-- in minutes --> + </session-config> + + <welcome-file-list> + <welcome-file>index.jsp</welcome-file> + </welcome-file-list> + +</web-app> \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp Thu Sep 17 07:43:05 2009 @@ -0,0 +1,20 @@ +<%-- +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. +--%> + +<%response.sendRedirect("control/main");%> \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/index.jsp ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl?rev=816083&view=auto ============================================================================== --- ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl (added) +++ ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl Thu Sep 17 07:43:05 2009 @@ -0,0 +1,93 @@ +<#-- +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. +--> + +<#if security.hasEntityPermission("FACILITY", "_VIEW", session)> +<#if facilityId?has_content> + <h1>${uiLabelMap.ProductEditFacility} ${facility.facilityName?if_exists} [${facilityId?if_exists}]</h1> + <#--div class="button-bar"> + <a href="<@ofbizUrl>EditFacility</@ofbizUrl>" name="EditFacilityForm" class="buttontext">${uiLabelMap.ProductNewFacility}</a> + <a href="/workeffort/control/calendar?facilityId=${facilityId}&externalLoginKey=${requestAttributes.externalLoginKey?if_exists}" class="buttontext">${uiLabelMap.CommonViewCalendar}</a> + </div--> +<#else> + <h1>${uiLabelMap.ProductNewFacility}</h1> +</#if> + +<#if facility?exists && facilityId?has_content> + <form action="<@ofbizUrl>UpdateFacility</@ofbizUrl>" name="EditFacilityForm" method="post"> + <input type="hidden" name="facilityId" value="${facilityId?if_exists}"> + <table class="basic-table" cellspacing='0'> + <tr> + <td class="label">${uiLabelMap.ProductFacilityId}</td> + <td> + ${facilityId?if_exists} <span class="tooltip">${uiLabelMap.ProductNotModificationRecrationFacility}</span> + </td> + </tr> +<#else> + <form action="<@ofbizUrl>CreateFacility</@ofbizUrl>" name="EditFacilityForm" method="post" style='margin: 0;'> + <#if facilityId?exists> + <h3>${uiLabelMap.ProductCouldNotFindFacilityWithId} "${facilityId?if_exists}".</h3> + </#if> + <table class="basic-table" cellspacing='0'> + <tr> + <td class="label">${uiLabelMap.ProductFacilityId}</td> + <td><input type="text" class="required" name="facilityId" value="${partyId?default("")}" size="30" maxlength="60"><span class="tooltip">${uiLabelMap.CommonRequired}</span></td> + </tr> +</#if> + <input type="hidden" name="partyId" value="${partyId?default("")}"/> + <input type="hidden" name="facilityTypeId" value="${facilityType.facilityTypeId?default("WAREHOUSE")}"/> + <input type="hidden" name="ownerPartyId" value="${facility.ownerPartyId?default(partyId)?default("")}"/> + <input type="hidden" name="defaultInventoryItemTypeId" value="${facility.defaultInventoryItemTypeId?default("NON_SERIAL_INV_ITEM")}"/> + <input type="hidden" name="defaultWeightUomId" value="${facility.defaultWeightUomId?default("WT_lb")}"/> + <input type="hidden" name="squareFootage" value="${facility.squareFootage?if_exists}"/> +<#if partyPostalAddress?has_content> + <input type="hidden" name="toName" value="${partyPostalAddress.toName?if_exists}"/> + <input type="hidden" name="attnName" value="${partyPostalAddress.attnName?if_exists}"/> + <input type="hidden" name="address1" value="${partyPostalAddress.address1?if_exists}"/> + <input type="hidden" name="address2" value="${partyPostalAddress.address2?if_exists}"/> + <input type="hidden" name="city" value="${partyPostalAddress.city?if_exists}"/> + <input type="hidden" name="countryGeoId" value="${partyPostalAddress.countryGeoId?if_exists}"/> + <input type="hidden" name="postalCode" value="${partyPostalAddress.postalCode?if_exists}"/> + <input type="hidden" name="stateProvinceGeoId" value="${partyPostalAddress.stateProvinceGeoId?if_exists}"/> +</#if> + <tr> + <td class="label">${uiLabelMap.ProductName}</td> + <td><input type="text" name="facilityName" value="${facility.facilityName?if_exists}" size="30" maxlength="60"></td> + </tr> + <tr> + <td class="label">${uiLabelMap.SetupFacilityDescription}</td> + <td ><input type="text" name="description" value="${facility.description?if_exists}" size="60" maxlength="250"></td> + </tr> + <tr> + <td class="label">${uiLabelMap.ProductDefaultDaysToShip}</td> + <td><input type="text" name="defaultDaysToShip" value="${facility.defaultDaysToShip?if_exists}" size="10" maxlength="20"></td> + </tr> + <tr> + <td> </td> + <#if facilityId?has_content> + <td><input type="submit" name="Update" value="${uiLabelMap.CommonUpdate}"></td> + <#else> + <td><input type="submit" name="Update" value="${uiLabelMap.CommonSave}"></td> + </#if> + </tr> +</table> +</form> + +<#else> + <h3>${uiLabelMap.ProductFacilityViewPermissionError}</h3> +</#if> \ No newline at end of file Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/commonext/webapp/ofbizsetup/organization/EditFacility.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |