You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/09/08 16:38:31 UTC
svn commit: r812532 - in /ofbiz/trunk/applications: marketing/data/
order/config/ party/config/ party/data/ party/entitydef/
party/script/org/ofbiz/party/party/ party/servicedef/
party/src/org/ofbiz/party/party/ party/webapp/partymgr/WEB-INF/ party/web...
Author: jleroux
Date: Tue Sep 8 14:38:30 2009
New Revision: 812532
URL: http://svn.apache.org/viewvc?rev=812532&view=rev
Log:
A slightly modified patch (see comment in Jira) from Nicolas Malin "Add PartyIdentification feature" (https://issues.apache.org/jira/browse/OFBIZ-2848) - OFBIZ-2848
I also changed some "numéro" to n°, but I kepts numéros as n°s is bad (French language is really weird, full of exceptions ;o)
Modified:
ofbiz/trunk/applications/marketing/data/sfaDemoData.xml
ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
ofbiz/trunk/applications/party/config/PartyUiLabels.xml
ofbiz/trunk/applications/party/data/PartyDemoData.xml
ofbiz/trunk/applications/party/data/PartyPortletData.xml
ofbiz/trunk/applications/party/entitydef/entitymodel.xml
ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
ofbiz/trunk/applications/party/servicedef/services.xml
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java
ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
ofbiz/trunk/applications/party/widget/partymgr/ProfileScreens.xml
Modified: ofbiz/trunk/applications/marketing/data/sfaDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/data/sfaDemoData.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/marketing/data/sfaDemoData.xml (original)
+++ ofbiz/trunk/applications/marketing/data/sfaDemoData.xml Tue Sep 8 14:38:30 2009
@@ -19,8 +19,6 @@
<PartyContactMechPurpose partyId="sfa100" contactMechId="sfa102" contactMechPurposeTypeId="PRIMARY_EMAIL" fromDate="2000-01-01 00:00:00.000"/>
<Party partyId="DemoCustCompany"/>
<PartyRole partyId="DemoCustCompany" roleTypeId="ACCOUNT"/>
- <Party partyId="DemoSupplier"/>
- <PartyRole partyId="DemoSupplier" roleTypeId="ACCOUNT"/>
<!-- demo contacts -->
<Party partyId="DemoCustomer1"/>
@@ -42,7 +40,7 @@
<UserLogin userLoginId="DemoLeadOwner" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a" partyId="DemoLeadOwner" enabled="Y"/>
<!-- FIXME: Establish SecurityGroup for SFA. This user should have access only to SFA -->
<UserLoginSecurityGroup groupId="FULLADMIN" userLoginId="DemoLeadOwner" fromDate="2001-05-13 00:00:00.000"/>
-
+
<Party partyId="DemoLeadOwner1" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
<Person partyId="DemoLeadOwner1" firstName="Demo" lastName="LeadOwner1"/>
<PartyRole partyId="DemoLeadOwner1" roleTypeId="_NA_"/>
@@ -70,12 +68,12 @@
<PartyContactMechPurpose partyId="sfa101" contactMechId="sfa103" contactMechPurposeTypeId="PRIMARY_EMAIL" fromDate="2000-01-01 00:00:00.000"/>
<!-- Status Valid Change -->
<StatusValidChange statusId="PARTY_ENABLED" statusIdTo="LEAD_CONVERTED" transitionName="Convert Lead To Contact"/>
-
+
<Party partyId="DemoLead" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
<Person partyId="DemoLead" firstName="Demo" lastName="Lead"/>
<PartyRole partyId="DemoLead" roleTypeId="_NA_"/>
<PartyRole partyId="DemoLead" roleTypeId="LEAD"/>
-
+
<Party partyId="DemoLead1" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
<Person partyId="DemoLead1" firstName="Demo" lastName="Lead1"/>
<PartyRole partyId="DemoLead1" roleTypeId="_NA_"/>
@@ -85,7 +83,7 @@
<Person partyId="DemoLead2" firstName="Demo" lastName="Lead2"/>
<PartyRole partyId="DemoLead2" roleTypeId="_NA_"/>
<PartyRole partyId="DemoLead2" roleTypeId="LEAD"/>
-
+
<Party partyId="DemoLead3" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
<Person partyId="DemoLead3" firstName="Demo" lastName="Lead3"/>
<PartyRole partyId="DemoLead3" roleTypeId="_NA_"/>
@@ -107,11 +105,11 @@
<PartyRelationship partyIdFrom="DemoLeadOwner" roleTypeIdFrom="OWNER" partyIdTo="DemoLead" roleTypeIdTo="LEAD" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/>
<PartyRelationship partyIdFrom="DemoLeadOwner" roleTypeIdFrom="OWNER" partyIdTo="DemoLead1" roleTypeIdTo="LEAD" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/>
<PartyRelationship partyIdFrom="DemoLeadOwner" roleTypeIdFrom="OWNER" partyIdTo="DemoLead2" roleTypeIdTo="LEAD" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/>
-
+
<!-- Leads of DemoLeadOwner1 -->
<PartyRelationship partyIdFrom="DemoLeadOwner1" roleTypeIdFrom="OWNER" partyIdTo="DemoLead3" roleTypeIdTo="LEAD" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/>
<PartyRelationship partyIdFrom="DemoLeadOwner1" roleTypeIdFrom="OWNER" partyIdTo="DemoLead4" roleTypeIdTo="LEAD" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWNER"/>
<PartyRelationship partyIdFrom="DemoLeadOwnersGroup" roleTypeIdFrom="INTERNAL_ORGANIZATIO" partyIdTo="DemoLeadOwner" roleTypeIdTo="OWNER" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWN_GRP_MEMBER"/>
<PartyRelationship partyIdFrom="DemoLeadOwnersGroup" roleTypeIdFrom="INTERNAL_ORGANIZATIO" partyIdTo="DemoLeadOwner1" roleTypeIdTo="OWNER" fromDate="2001-05-13 00:00:00.000" partyRelationshipTypeId="LEAD_OWN_GRP_MEMBER"/>
-</entity-engine-xml>
\ No newline at end of file
+</entity-engine-xml>
Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Tue Sep 8 14:38:30 2009
@@ -167,7 +167,7 @@
<property key="OrderCaughtNumberFormatExceptionOnCartUpdate">
<value xml:lang="en">Caught number format exception on cart update. </value>
<value xml:lang="es">Excepción de formato de número capturada en la actualización del carro.</value>
- <value xml:lang="fr">Exception du format de numéro attrpé dans la mise à jour du chariot. </value>
+ <value xml:lang="fr">Exception du format de n° lors de la mise à jour du panier. </value>
<value xml:lang="it">Eccezione formato numerico sull'aggiornamento carrello. </value>
<value xml:lang="ro">Exceptie format numeric </value>
<value xml:lang="ru">ÐÑи обновлении коÑÐ·Ð¸Ð½Ñ Ð¿ÐµÑеÑ
ваÑено иÑклÑÑение вÑзванное невеÑнÑм ÑоÑмаÑом ÑиÑла. </value>
Modified: ofbiz/trunk/applications/party/config/PartyUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/config/PartyUiLabels.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/config/PartyUiLabels.xml (original)
+++ ofbiz/trunk/applications/party/config/PartyUiLabels.xml Tue Sep 8 14:38:30 2009
@@ -901,6 +901,14 @@
<value xml:lang="th">รหัสà¸à¸¥à¸¸à¹à¸¡à¸à¸¹à¹à¹à¸à¹</value>
<value xml:lang="zh">ä¼åæ è¯</value>
</property>
+ <property key="FormFieldTitle_partyIdentTypeDesc">
+ <value xml:lang="en">Identification Type</value>
+ <value xml:lang="fr">Type de numéro</value>
+ </property>
+ <property key="FormFieldTitle_partyIdentificationTypeId">
+ <value xml:lang="en">Identification Type</value>
+ <value xml:lang="fr">Type de numéro</value>
+ </property>
<property key="FormFieldTitle_partyIdFrom">
<value xml:lang="de">Akteur ID von</value>
<value xml:lang="en">From Party ID</value>
@@ -1952,6 +1960,10 @@
<property key="PageTitleListCommunicationsRelatedParties">
<value xml:lang="en">List Communications of related parties</value>
</property>
+ <property key="PageTitleListPartyIdentifications">
+ <value xml:lang="en">List Identification Number</value>
+ <value xml:lang="fr">Liste des numéros d'identification</value>
+ </property>
<property key="PageTitleListUnknownPartyComms">
<value xml:lang="de">Kommunikation von unbekannter Herkunft</value>
<value xml:lang="en">Communications from Unknown origin</value>
@@ -7356,6 +7368,18 @@
<value xml:lang="th">รหัสà¸à¸¥à¸¸à¹à¸¡à¸à¸¹à¹à¹à¸à¹</value>
<value xml:lang="zh">ä¼åæ è¯</value>
</property>
+ <property key="PartyPartyIdentification">
+ <value xml:lang="en">Identification Number</value>
+ <value xml:lang="fr">N° d'identification</value>
+ </property>
+ <property key="PartyPartyIdentificationList">
+ <value xml:lang="en">List Identification Number</value>
+ <value xml:lang="fr">Liste des numéros d'identification</value>
+ </property>
+ <property key="PartyPartyIdentifications">
+ <value xml:lang="en">Identification Numbers</value>
+ <value xml:lang="fr">Numéros d'identification</value>
+ </property>
<property key="PartyPartyIdMissing">
<value xml:lang="de">Akteur ID fehlt</value>
<value xml:lang="en">Party ID missing</value>
@@ -7811,7 +7835,7 @@
<value xml:lang="de">Mindestens eine Telefonnummer wird im folgenden benötigt</value>
<value xml:lang="en">At least one phone number is required below</value>
<value xml:lang="es">Se requiere al menos un número de teléfono debajo</value>
- <value xml:lang="fr">Au moins un numéro de téléphone est exigé ci-dessous</value>
+ <value xml:lang="fr">Au moins un n° de téléphone est exigé ci-dessous</value>
<value xml:lang="hi_IN">नà¥à¤à¥ à¤à¤® सॠà¤à¤® à¤à¤ फà¥à¤¨ नà¤à¤¬à¤° à¤à¤µà¤¶à¥à¤¯à¤ हà¥</value>
<value xml:lang="it">Al minimo un numero di telefono è richiesto qui sotto</value>
<value xml:lang="nl">Ten minste één telefoonnummer moet worden opgegeven</value>
Modified: ofbiz/trunk/applications/party/data/PartyDemoData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyDemoData.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyDemoData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyDemoData.xml Tue Sep 8 14:38:30 2009
@@ -7,9 +7,9 @@
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
@@ -28,11 +28,20 @@
<PartyRelationship partyIdFrom="admin" roleTypeIdFrom="EMAIL_ADMIN" partyIdTo="Company" roleTypeIdTo="_NA_" fromDate="2000-01-01 00:00:00"/>
<PartyRole partyId="DemoEmployee" roleTypeId="EMAIL_ADMIN"/>
<PartyRelationship partyIdFrom="DemoEmployee" roleTypeIdFrom="EMAIL_ADMIN" partyIdTo="Company" roleTypeIdTo="_NA_" fromDate="2000-01-01 00:00:00"/>
-
+
<ContactMech contactMechId="admin" contactMechTypeId="EMAIL_ADDRESS" infoString="ofbiztest@yahoo.com"/>
<PartyContactMech partyId="admin" contactMechId="admin" fromDate="2003-01-01 00:00:00.0" allowSolicitation="Y"/>
<PartyContactMechPurpose contactMechPurposeTypeId="PRIMARY_EMAIL" partyId="admin" contactMechId="admin" fromDate="2003-01-01 00:00:00.0"/>
-
+
+ <!-- Party Identification numbers-->
+ <Party partyId="DemoSupplier"/>
+ <PartyRole partyId="DemoSupplier" roleTypeId="ACCOUNT"/>
+ <PartyIdentificationType partyIdentificationTypeId="EURO_TAX" description="euro vat number tax identification"/>
+ <PartyIdentificationType partyIdentificationTypeId="SIRET" description="french company identification number"/>
+ <PartyIdentification partyId="DemoSupplier" partyIdentificationTypeId="EURO_TAX" idValue="FR1234 5678 90123"/>
+ <PartyIdentification partyId="DemoSupplier" partyIdentificationTypeId="SIRET" idValue="1234 5678 90123"/>
+
+
<!-- email from an unknown party -->
<CommunicationEvent communicationEventId="9000" communicationEventTypeId="EMAIL_COMMUNICATION" statusId="COM_UNKNOWN_PARTY" contactMechTypeId="EMAIL_ADDRESS" contactMechIdTo="admin" roleTypeIdFrom="_NA_" roleTypeIdTo="_NA_" partyIdTo="admin" entryDate="2008-07-28 13:55:55.827" datetimeStarted="2008-07-28 13:55:19.0" subject="Why i would use the OFBiz system" contentMimeTypeId="text/plain" content="Every time i think of you, only you...you are always on my mind......." note="Sent from: my@email.com; Sent Name from: Jo Easy User; Sent to: ofbiztest@yahoo.com; Delivered-To: ofbiztest@yahoo.com; " fromString="mailinglist@antwebsystems.com" toString="ofbiztest@yahoo.com"/>
<PartyRole partyId="admin" roleTypeId="ADDRESSEE"/>
@@ -40,4 +49,4 @@
<!-- new registration notification -->
<EmailTemplateSetting emailTemplateSettingId="PARTY_REGISTER" bodyScreenLocation="component://party/widget/partymgr/PartyScreens.xml#CreateUserNotification" subject="New Account Created" bccAddress="ofbiztest@yahoo.com" fromAddress="ofbiztest@yahoo.com"/>
-</entity-engine-xml>
\ No newline at end of file
+</entity-engine-xml>
Modified: ofbiz/trunk/applications/party/data/PartyPortletData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyPortletData.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/data/PartyPortletData.xml (original)
+++ ofbiz/trunk/applications/party/data/PartyPortletData.xml Tue Sep 8 14:38:30 2009
@@ -36,6 +36,13 @@
screenshot="/images/portlets/Attributes.png"/>
<PortletPortletCategory portalPortletId="Attributes" portletCategoryId="PROFILE"/>
+ <PortalPortlet portalPortletId="PartyIdentifications" portletName="Party Identification"
+ screenName="PartyIdentifications"
+ screenLocation="component://party/widget/partymgr/ProfileScreens.xml"
+ description="Identification associate to a party"
+ screenshot=""/>
+ <PortletPortletCategory portalPortletId="PartyIdentifications" portletCategoryId="PROFILE"/>
+
<PortalPortlet portalPortletId="AvsSettings" portletName="Avs Settings"
screenName="AvsSettings"
screenLocation="component://party/widget/partymgr/ProfileScreens.xml"
@@ -137,6 +144,7 @@
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="contact" portletSeqId="00001" columnSeqId="00001" sequenceNum="3"/>
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="LoyaltyPoints" portletSeqId="00001" columnSeqId="00001" sequenceNum="4"/>
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="PaymentMethods" portletSeqId="00001" columnSeqId="00001" sequenceNum="5"/>
+ <PortalPagePortlet portalPageId="PartyProfile" portalPortletId="PartyIdentifications" portletSeqId="00001" columnSeqId="00001" sequenceNum="6"/>
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="UserLogin" portletSeqId="00001" columnSeqId="00002" sequenceNum="1"/>
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="Attributes" portletSeqId="00001" columnSeqId="00002" sequenceNum="2"/>
<PortalPagePortlet portalPageId="PartyProfile" portalPortletId="AvsSettings" portletSeqId="00001" columnSeqId="00002" sequenceNum="3"/>
Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Tue Sep 8 14:38:30 2009
@@ -1671,6 +1671,54 @@
<key-map field-name="partyId"/>
</view-link>
</view-entity>
+
+ <entity entity-name="PartyIdentification"
+ package-name="org.ofbiz.party.party"
+ title="Party Identification Entity">
+ <field name="partyId" type="id-ne"></field>
+ <field name="partyIdentificationTypeId" type="id-ne"></field>
+ <field name="idValue" type="id-long"></field>
+ <prim-key field="partyId"/>
+ <prim-key field="partyIdentificationTypeId"/>
+ <relation type="one" fk-name="PARTY_ID_TYPE" rel-entity-name="PartyIdentificationType">
+ <key-map field-name="partyIdentificationTypeId"/>
+ </relation>
+ <relation type="one" fk-name="PARTY_ID_PRODICT" rel-entity-name="Party">
+ <key-map field-name="partyId"/>
+ </relation>
+ <index name="PARTY_ID_VALIDX" unique="false">
+ <index-field name="idValue"/>
+ </index>
+ </entity>
+ <view-entity entity-name="PartyIdentificationAndParty"
+ package-name="org.ofbiz.party.party"
+ title="PartyIdentification and Party View Entity">
+ <member-entity entity-alias="PI" entity-name="PartyIdentification"/>
+ <member-entity entity-alias="PIT" entity-name="PartyIdentificationType"/>
+ <member-entity entity-alias="PA" entity-name="Party"/>
+ <alias-all entity-alias="PI" />
+ <alias-all entity-alias="PA" />
+ <alias name="partyIdentTypeDesc" field="description" entity-alias="PIT"/>
+ <view-link entity-alias="PI" rel-entity-alias="PA">
+ <key-map field-name="partyId"/>
+ </view-link>
+ <view-link entity-alias="PI" rel-entity-alias="PIT">
+ <key-map field-name="partyIdentificationTypeId"/>
+ </view-link>
+ </view-entity>
+ <entity entity-name="PartyIdentificationType"
+ package-name="org.ofbiz.party.party"
+ title="Party Identification Type Entity">
+ <field name="partyIdentificationTypeId" type="id-ne"></field>
+ <field name="parentTypeId" type="id"></field>
+ <field name="hasTable" type="indicator"></field>
+ <field name="description" type="description"></field>
+ <prim-key field="partyIdentificationTypeId"/>
+ <relation type="one" fk-name="PARTY_ID_TYPE_PAR" title="Parent" rel-entity-name="PartyIdentificationType">
+ <key-map field-name="parentTypeId" rel-field-name="partyIdentificationTypeId"/>
+ </relation>
+ </entity>
+
<entity entity-name="PartyGeoPoint"
package-name="org.ofbiz.party.party"
title="Party Geo Location with history">
Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/party/PartyServices.xml Tue Sep 8 14:38:30 2009
@@ -192,6 +192,24 @@
</iterate>
<field-to-result field="geos"/>
</simple-method>
+
+ <!-- PartyIdentification methods -->
+ <simple-method method-name="createPartyIdentifications" short-description="create mass party identification with association between vale and type">
+ <set field="partyIdentCtx.partyId" from-field="parameters.partyId"/>
+ <iterate-map key="key" value="value" map="parameters.identifications">
+ <entity-one value-field="identificationType" entity-name="PartyIdentificationType" use-cache="true">
+ <field-map field-name="partyIdentificationTypeId" from-field="value"/>
+ </entity-one>
+ <if-not-empty field="identificationType">
+ <set field="idValue" value="${parameters.identifications.${identificationType.partyIdentificationTypeId}}"/>
+ <if-not-empty field="idValue">
+ <set field="partyIdentCtx.partyIdentificationTypeId" from-field="identificationType.partyIdentificationTypeId"/>
+ <set field="partyIdentCtx.idValue" from-field="idValue"/>
+ <call-service service-name="createPartyIdentification" in-map-name="partyIdentCtx"/>
+ </if-not-empty>
+ </if-not-empty>
+ </iterate-map>
+ </simple-method>
<!-- PartyClassification methods -->
<simple-method method-name="createPartyClassification" short-description="create a PartyClassification">
Modified: ofbiz/trunk/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/party/servicedef/services.xml Tue Sep 8 14:38:30 2009
@@ -247,6 +247,17 @@
<attribute name="lastName" type="String" form-display="true" form-label="Last name" mode="IN" optional="true"/>
<attribute name="lookupResult" type="List" mode="OUT" optional="false"/>
</service>
+
+ <service name="findPartiesById" engine="java" auth="true"
+ location="org.ofbiz.party.party.PartyServices" invoke="findPartyById">
+ <description>Find the partyId corresponding to a reference and a reference type</description>
+ <attribute type="String" mode="IN" name="idToFind" optional="false"/>
+ <attribute type="String" mode="IN" name="partyIdentificationTypeId" optional="true"/>
+ <attribute type="String" mode="IN" name="searchPartyFirst" optional="true"/>
+ <attribute type="String" mode="IN" name="searchAllId" optional="true"/>
+ <attribute type="org.ofbiz.entity.GenericValue" mode="OUT" name="party" optional="true"/>
+ <attribute type="List" mode="OUT" name="partiesFound" optional="true"/>
+ </service>
<!-- Party Role services -->
<service name="createPartyRole" engine="simple"
@@ -634,6 +645,33 @@
<permission-service service-name="partyBasePermissionCheck" main-action="DELETE"/>
<auto-attributes mode="IN" include="pk" optional="false"/>
</service>
+
+ <!-- PartyIdentification -->
+ <service name="createPartyIdentification" engine="entity-auto" default-entity-name="PartyIdentification" invoke="create">
+ <description>create PartyIdentification entity</description>
+ <permission-service service-name="partyBasePermissionCheck" main-action="CREATE"/>
+ <auto-attributes mode="IN" include="pk"/>
+ <auto-attributes mode="IN" optional="true" include="nonpk"/>
+ </service>
+ <service name="updatePartyIdentification" engine="entity-auto" default-entity-name="PartyIdentification" invoke="update">
+ <description>update PartyIdentification entity</description>
+ <permission-service service-name="partyBasePermissionCheck" main-action="UPDATE"/>
+ <auto-attributes mode="IN" include="pk"/>
+ <auto-attributes mode="IN" optional="true" include="nonpk"/>
+ </service>
+ <service name="deletePartyIdentification" engine="entity-auto" default-entity-name="PartyIdentification" invoke="delete">
+ <description>delete PartyClassificationGroup</description>
+ <permission-service service-name="partyBasePermissionCheck" main-action="DELETE"/>
+ <auto-attributes mode="IN" include="pk"/>
+ </service>
+ <service name="createPartyIdentifications" engine="simple" default-entity-name="PartyIdentification"
+ location="component://party/script/org/ofbiz/party/party/PartyServices.xml" invoke="updatePartyNameFromPerson">
+ <description>create many identifications with format in map identifications : [partyType : TYPE, TYPE : value]</description>
+ <permission-service service-name="partyBasePermissionCheck" main-action="CREATE"/>
+ <attribute name="partyId" mode="IN" type="String"/>
+ <attribute name="indentifications" mode="IN" type="Map" />
+ </service>
+
<!-- Vendor -->
<service name="createVendor" engine="simple"
Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Tue Sep 8 14:38:30 2009
@@ -1735,4 +1735,46 @@
}
return partyId;
}
+
+
+ /**
+ * Finds partyId(s) corresponding to a party reference, partyId or a GoodIdentification idValue
+ * @param dctx
+ * @param context
+ * @param context.partyId use to search with partyId or goodIdentification.idValue
+ * @return a GenericValue with a partyId and a List of complementary partyId found
+ */
+ public static Map<String, Object> findPartyById(DispatchContext ctx, Map<String, Object> context) {
+ GenericDelegator delegator = ctx.getDelegator();
+ String idToFind = (String) context.get("idToFind");
+ String partyIdentificationTypeId = (String) context.get("partyIdentificationTypeId");
+ String searchPartyFirstContext = (String) context.get("searchPartyFirst");
+ String searchAllIdContext = (String) context.get("searchAllId");
+
+ boolean searchPartyFirst = UtilValidate.isNotEmpty(searchPartyFirstContext) && "N".equals(searchPartyFirstContext) ? false : true;
+ boolean searchAllId = UtilValidate.isNotEmpty(searchAllIdContext)&& "Y".equals(searchAllIdContext) ? true : false;
+
+ GenericValue party = null;
+ List<GenericValue> partiesFound = null;
+ try {
+ partiesFound = PartyWorker.findPartiesById(delegator, idToFind, partyIdentificationTypeId, searchPartyFirst, searchAllId);
+ } catch (GenericEntityException e) {
+ Debug.logError(e, module);
+ ServiceUtil.returnError(e.getMessage());
+ }
+
+ if (UtilValidate.isNotEmpty(partiesFound)) {
+ // gets the first partyId of the List
+ party = EntityUtil.getFirst(partiesFound);
+ // remove this partyId
+ partiesFound.remove(0);
+ }
+
+ Map<String, Object> result = ServiceUtil.returnSuccess();
+ result.put("party", party);
+ result.put("partiesFound", partiesFound);
+
+ return result;
+ }
+
}
Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java (original)
+++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyWorker.java Tue Sep 8 14:38:30 2009
@@ -407,4 +407,107 @@
}
return partyIds;
}
+
+ /**
+ * Generic service to find party by id.
+ * By default return the party find by partyId
+ * but you can pass searchPartyFirst at false if you want search in partyIdentification before
+ * or pass searchAllId at true to find apartyuct with this id (party.partyId and partyIdentification.idValue)
+ * @param delegator
+ * @param idToFind
+ * @param partyIdentificationTypeId
+ * @param searchPartyFirst
+ * @param searchAllId
+ * @return
+ * @throws GenericEntityException
+ */
+ public static List<GenericValue> findPartiesById(GenericDelegator delegator,
+ String idToFind, String partyIdentificationTypeId,
+ boolean searchPartyFirst, boolean searchAllId) throws GenericEntityException {
+
+ if (Debug.verboseOn()) Debug.logVerbose("Analyze partyIdentification: entered id = " + idToFind + ", partyIdentificationTypeId = " + partyIdentificationTypeId, module);
+
+ GenericValue party = null;
+ List<GenericValue> partiesFound = null;
+
+ // 1) look if the idToFind given is a real partyId
+ if (searchPartyFirst) {
+ party = delegator.findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId", idToFind));
+ }
+
+ if (searchAllId || (searchPartyFirst && UtilValidate.isEmpty(party))) {
+ // 2) Retrieve party in PartyIdentification
+ Map<String, String> conditions = UtilMisc.toMap("idValue", idToFind);
+ if (UtilValidate.isNotEmpty(partyIdentificationTypeId)) {
+ conditions.put("partyIdentificationTypeId", partyIdentificationTypeId);
+ }
+ partiesFound = delegator.findByAndCache("PartyIdentificationAndParty", conditions, UtilMisc.toList("partyId"));
+ }
+
+ if (! searchPartyFirst) {
+ party = delegator.findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId", idToFind));
+ }
+
+ if (UtilValidate.isNotEmpty(party)) {
+ if (UtilValidate.isNotEmpty(partiesFound)) partiesFound.add(party);
+ else partiesFound = UtilMisc.toList(party);
+ }
+ if (Debug.verboseOn()) Debug.logVerbose("Analyze partyIdentification: found party.partyId = " + party + ", and list : " + partiesFound, module);
+ return partiesFound;
+ }
+
+ public static List<GenericValue> findPartiesById(GenericDelegator delegator, String idToFind, String partyIdentificationTypeId)
+ throws GenericEntityException {
+ return findPartiesById(delegator, idToFind, partyIdentificationTypeId, true, false);
+ }
+
+ public static String findPartyId(GenericDelegator delegator, String idToFind, String partyIdentificationTypeId) throws GenericEntityException {
+ GenericValue party = findParty(delegator, idToFind, partyIdentificationTypeId);
+ if (UtilValidate.isNotEmpty(party)) {
+ return party.getString("partyId");
+ } else {
+ return null;
+ }
+ }
+
+ public static String findPartyId(GenericDelegator delegator, String idToFind) throws GenericEntityException {
+ return findPartyId(delegator, idToFind, null);
+ }
+
+ public static GenericValue findParty(GenericDelegator delegator, String idToFind, String partyIdentificationTypeId) throws GenericEntityException {
+ List<GenericValue> parties = findPartiesById(delegator, idToFind, partyIdentificationTypeId);
+ GenericValue party = EntityUtil.getFirst(parties);
+ return party;
+ }
+
+ public static List<GenericValue> findParties(GenericDelegator delegator, String idToFind, String partyIdentificationTypeId) throws GenericEntityException {
+ List<GenericValue> partiesByIds = findPartiesById(delegator, idToFind, partyIdentificationTypeId);
+ List<GenericValue> parties = null;
+ if (UtilValidate.isNotEmpty(partiesByIds)) {
+ for (GenericValue party : partiesByIds) {
+ GenericValue partyToAdd = party;
+ //retreive party GV if the actual genericValue came from viewEntity
+ if (! "Party".equals(party.getEntityName())) {
+ partyToAdd = delegator.findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId", party.get("partyId")));
+ }
+
+ if (UtilValidate.isEmpty(parties)) {
+ parties = UtilMisc.toList(partyToAdd);
+ }
+ else {
+ parties.add(partyToAdd);
+ }
+ }
+ }
+ return parties;
+ }
+
+ public static List<GenericValue> findParties(GenericDelegator delegator, String idToFind) throws GenericEntityException {
+ return findParties(delegator, idToFind, null);
+ }
+
+ public static GenericValue findParty(GenericDelegator delegator, String idToFind) throws GenericEntityException {
+ return findParty(delegator, idToFind, null);
+ }
+
}
Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Tue Sep 8 14:38:30 2009
@@ -53,6 +53,7 @@
</request-map>
<request-map uri="EditPartyRelationships"><security https="true" auth="true"/><response name="success" type="view" value="EditPartyRelationships"/></request-map>
<request-map uri="viewroles"><security https="true" auth="true"/><response name="success" type="view" value="viewroles"/></request-map>
+ <request-map uri="viewidentifications"><security https="true" auth="true"/><response name="success" type="view" value="viewidentifications"/></request-map>
<request-map uri="linkparty"><security https="true" auth="true"/><response name="success" type="view" value="linkparty"/></request-map>
<request-map uri="partyInvitation"><security https="true" auth="true"/><response name="success" type="view" value="partyInvitation"/></request-map>
<request-map uri="editPartyInvitation"><security https="true" auth="true"/><response name="success" type="view" value="editPartyInvitation"/></request-map>
@@ -650,6 +651,25 @@
<response name="error" type="view" value="viewroles"/>
</request-map>
+ <request-map uri="createPartyIdentification">
+ <security https="true" auth="true"/>
+ <event type="service" path="" invoke="createPartyIdentification"/>
+ <response name="success" type="view" value="viewidentifications"/>
+ <response name="error" type="view" value="viewidentifications"/>
+ </request-map>
+ <request-map uri="deletePartyIdentification">
+ <security https="true" auth="true"/>
+ <event type="service" path="" invoke="deletePartyIdentification"/>
+ <response name="success" type="view" value="viewidentifications"/>
+ <response name="error" type="view" value="viewidentifications"/>
+ </request-map>
+ <request-map uri="updatePartyIdentification">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="updatePartyIdentification"/>
+ <response name="success" type="view" value="viewidentifications"/>
+ <response name="error" type="view" value="viewidentifications"/>
+ </request-map>
+
<request-map uri="createPartyRelationshipType">
<security https="true" auth="true"/>
<event type="service" path="" invoke="createPartyRelationshipType"/>
@@ -1251,6 +1271,7 @@
<view-map name="viewprofile" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#viewprofile"/>
<view-map name="partyContentList" type="screen" page="component://party/widget/partymgr/ProfileScreens.xml#ContentList"/>
<view-map name="viewroles" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#viewroles"/>
+ <view-map name="viewidentifications" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#ListPartyIdentifications"/>
<view-map name="linkparty" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#linkparty"/>
<view-map name="EditPartyRelationships" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#EditPartyRelationships"/>
<view-map name="viewvendor" type="screen" page="component://party/widget/partymgr/PartyScreens.xml#viewvendor"/>
Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Tue Sep 8 14:38:30 2009
@@ -1025,4 +1025,44 @@
<field name="estimatedAmount"><display/></field>
<field name="partyId"><display/></field>
</form>
+
+ <form name="listPartyIdentification" type="list" list-name="listIt"
+ default-table-style="basic-table hover-bar" target="updatePartyIdentification">
+ <actions>
+ <entity-and entity-name="PartyIdentificationAndParty" >
+ <field-map field-name="partyId" from-field="partyId"/>
+ </entity-and>
+ </actions>
+ <field name="partyIdentificationTypeId"><hidden /></field>
+ <field name="partyId"><hidden /></field>
+ <field name="partyIdentTypeDesc"><display /></field>
+ <field name="idValue"><display /></field>
+ <field name="delete">
+ <hyperlink target="deletePartyIdentification" description="${uiLabelMap.CommonDelete}">
+ <parameter param-name="partyId"/>
+ <parameter param-name="partyIdentificationTypeId"/>
+ </hyperlink>
+ </field>
+ <field name="submit" title="${uiLabelMap.CommonUpdate}"><submit /></field>
+ </form>
+
+ <form name="editPartyIdentification" type="single" list-name="partyIdents"
+ default-table-style="basic-table hover-bar" target="createPartyIdentification" focus-field-name="idValue">
+ <alt-target use-when="partyIdentification !=null" target="updatePartyIdentification"/>
+ <field name="partyIdentificationTypeId" use-when="partyIdentification == null">
+ <drop-down>
+ <entity-options description="${description}" entity-name="PartyIdentificationType">
+ <entity-order-by field-name="description"/>
+ </entity-options>
+ </drop-down>
+ </field>
+ <field name="partyIdentificationTypeId" use-when="partyIdentification != null">
+ <display-entity entity-name="PartyIdentificationType"/>
+ </field>
+ <field name="partyId"><hidden /></field>
+ <field name="idValue"><text /></field>
+ <field name="submit" title="${uiLabelMap.CommonCreate}" use-when="partyIdentification == null"><submit /></field>
+ <field name="submit" title="${uiLabelMap.CommonUpdate}" use-when="partyIdentification != null"><submit /></field>
+ </form>
+
</forms>
Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyMenus.xml Tue Sep 8 14:38:30 2009
@@ -77,6 +77,11 @@
<parameter param-name="partyId"/>
</link>
</menu-item>
+ <menu-item name="viewidentifications" title="${uiLabelMap.PartyPartyIdentifications}">
+ <link target="viewidentifications">
+ <parameter param-name="partyId"/>
+ </link>
+ </menu-item>
<menu-item name="linkparty" title="${uiLabelMap.PartyLink}">
<link target="linkparty">
<parameter param-name="partyId"/>
@@ -657,4 +662,12 @@
</menu-item>
</menu>
+ <menu name="newPartyIdentification">
+ <menu-item name="new" title="${uiLabelMap.CommonNew}">
+ <link target="viewidentifications">
+ <parameter param-name="partyId" from-field="parameters.partyId"/>
+ </link>
+ </menu-item>
+ </menu>
+
</menus>
Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Tue Sep 8 14:38:30 2009
@@ -1229,4 +1229,35 @@
</widgets>
</section>
</screen>
+
+ <!-- PartyIdentification Screen -->
+ <screen name="ListPartyIdentifications">
+ <section>
+ <actions>
+ <set field="titleProperty" value="PageTitleListPartyIdentifications"/>
+ <set field="headerItem" value="find"/>
+ <set field="tabButtonItem" value="viewidentifications"/>
+
+ <set field="labelTitleProperty" value="PartyIdentification"/>
+
+ <set field="partyId" from-field="parameters.partyId"/>
+ <entity-one entity-name="Party" value-field="party" use-cache="true"/>
+ <entity-one entity-name="PartyIdentification" value-field="partyIdentification"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonPartyDecorator" location="${parameters.mainDecoratorLocation}">
+ <decorator-section name="body">
+ <screenlet title="${uiLabelMap.PartyPartyIdentificationList}">
+ <include-form name="listPartyIdentification" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+ </screenlet>
+ <screenlet title="${uiLabelMap.PartyPartyIdentification}" navigation-menu-name="newPartyIdentification" id="PartyIdentificationCreationPanel">
+ <include-menu name="newPartyIdentification" location="component://party/widget/partymgr/PartyMenus.xml"/>
+ <include-form name="editPartyIdentification" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+ </screenlet>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
</screens>
\ No newline at end of file
Modified: ofbiz/trunk/applications/party/widget/partymgr/ProfileScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/ProfileScreens.xml?rev=812532&r1=812531&r2=812532&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/ProfileScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/ProfileScreens.xml Tue Sep 8 14:38:30 2009
@@ -137,6 +137,20 @@
</widgets>
</section>
</screen>
+
+ <screen name="PartyIdentifications">
+ <section>
+ <actions>
+ <set field="partyId" from-field="parameters.partyId"/>
+ </actions>
+ <widgets>
+ <screenlet title="${uiLabelMap.PartyPartyIdentifications}" navigation-menu-name="newPartyIdentification" id="PartyIdentificationPanel">
+ <include-menu name="newPartyIdentification" location="component://party/widget/partymgr/PartyMenus.xml"/>
+ <include-form name="listPartyIdentification" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ </screen>
<screen name="PaymentMethods">
<section>