Author: jleroux Date: Sun Oct 18 12:29:37 2015 New Revision: 1709272 URL: http://svn.apache.org/viewvc?rev=1709272&view=rev Log: Completes r1709192 for Changes for "SalaryStep entity missing From and Thru dates" https://issues.apache.org/jira/browse/OFBIZ-5758
This adds the migrateSalaryStep service to migrates data from OldSalaryStep to SalaryStep. Since revision 1709214 (2015-10-18) the entity SalaryStep has been deprecated. This service can be used to upgrade existing data from the OldSalaryStep entity to the new SalaryStep entity. This service must be run only once, else you will get duplicates. Added: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml (with props) ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml (with props) Modified: ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml ofbiz/trunk/applications/humanres/ofbiz-component.xml Modified: ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml?rev=1709272&r1=1709271&r2=1709272&view=diff ============================================================================== --- ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml Sun Oct 18 12:29:37 2015 @@ -593,7 +593,7 @@ under the License. <key-map field-name="periodTypeId"/> </relation> </entity> - <entity entity-name="SalaryStep" + <entity entity-name="SalaryStep" table-name="SALARY_STEP_NEW" package-name="org.ofbiz.humanres.employment" title="Salary Step Entity"> <field name="salaryStepSeqId" type="id-ne"></field> Modified: ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml?rev=1709272&r1=1709271&r2=1709272&view=diff ============================================================================== --- ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml (original) +++ ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml Sun Oct 18 12:29:37 2015 @@ -52,4 +52,19 @@ under the License. <key-map field-name="rateTypeId"/> </relation> </entity> + + <entity entity-name="OldSalaryStep" table-name="SALARY_STEP" + package-name="org.ofbiz.humanres.employment" + title="Salary Step Entity"> + <field name="salaryStepSeqId" type="id-ne"></field> + <field name="payGradeId" type="id-ne"></field> + <field name="dateModified" type="date-time"></field> + <field name="amount" type="currency-amount"></field> + <prim-key field="salaryStepSeqId"/> + <prim-key field="payGradeId"/> + <relation type="one" fk-name="SLRY_STP_PGRD" rel-entity-name="PayGrade"> + <key-map field-name="payGradeId"/> + </relation> + </entity> + </entitymodel> Modified: ofbiz/trunk/applications/humanres/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/ofbiz-component.xml?rev=1709272&r1=1709271&r2=1709272&view=diff ============================================================================== --- ofbiz/trunk/applications/humanres/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/humanres/ofbiz-component.xml Sun Oct 18 12:29:37 2015 @@ -33,6 +33,7 @@ under the License. <entity-resource type="data" reader-name="seed" loader="main" location="data/HumanResPortletData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/HumanResDemoData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> + <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/> <webapp name="humanres" title="HR" Added: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml?rev=1709272&view=auto ============================================================================== --- ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml (added) +++ ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml Sun Oct 18 12:29:37 2015 @@ -0,0 +1,43 @@ +<?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-v2.xsd"> + + <simple-method method-name="migrateSalaryStep" short-description="Migrate data from OldSalaryStep to SalaryStep"> + <entity-condition entity-name="OldSalaryStep" list="oldSalarySteps"/> + <now field="fromDate"/> + <entity-one value-field="systemUserLogin" entity-name="UserLogin"> + <field-map field-name="userLoginId" value="system"/> + </entity-one> + <iterate list="oldSalarySteps" entry="oldSalaryStep"> + <make-value entity-name="SalaryStep" value-field="SalaryStep"/> + <set field="SalaryStep.salaryStepSeqId" from-field="oldSalaryStep.salaryStepSeqId"/> + <set field="SalaryStep.payGradeId" from-field="oldSalaryStep.payGradeId"/> + <set field="SalaryStep.dateModified" from-field="oldSalaryStep.dateModified"/> + <set field="SalaryStep.amount" from-field="oldSalaryStep.amount"/> + <set field="SalaryStep.createdByUserLogin" from-field="systemUserLogin.userLoginId"/> + <set field="SalaryStep.lastModifiedByUserLogin" from-field="systemUserLogin.userLoginId"/> + <set field="SalaryStep.fromDate" from-field="fromDate"/> + <create-value value-field="SalaryStep"/> + </iterate> + </simple-method> + +</simple-methods> Propchange: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/UpgradeServices.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml?rev=1709272&view=auto ============================================================================== --- ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml (added) +++ ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml Sun Oct 18 12:29:37 2015 @@ -0,0 +1,35 @@ +<?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. +--> + +<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd"> + <description>Humanres Services</description> + <vendor>OFBiz</vendor> + + <service name="migrateSalaryStep" engine="simple" + location="component://humanres/script/org/ofbiz/humanres/UpgradeServices.xml" invoke="migrateSalaryStep"> + <description> + Migrate data from OldSalaryStep to SalaryStep. + Since revision 1709214 (2015-10-18) the entity SalaryStep has been deprecated. + This service can be used to upgrade existing data from the OldSalaryStep entity to the new SalaryStep entity. + This service must be run only once, else you will get duplicates. + </description> + </service> +</services> Propchange: ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/humanres/servicedef/services_upgrade.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml