Package org.apache.ofbiz.party.party
Class PartyWorker
- java.lang.Object
-
- org.apache.ofbiz.party.party.PartyWorker
-
public class PartyWorker extends java.lang.Object
Worker methods for Party Information
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
createClubId(Delegator delegator, java.lang.String prefix, int length)
Generate a sequenced club id using the prefix passed and a sequence value + check digitstatic java.lang.String[]
findFirstMatchingPartyAndContactMechId(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName)
static java.lang.String
findFirstMatchingPartyId(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName)
static java.util.List<GenericValue>
findMatchingPartyAndPostalAddress(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName)
static java.util.List<GenericValue>
findMatchingPartyPostalAddress(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String partyTypeId)
Finds all matching parties based on the values provided.static java.util.List<GenericValue>
findMatchingPersonPostalAddresses(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName)
Finds all matching PartyAndPostalAddress records based on the values provided.static java.util.List<GenericValue>
findParties(Delegator delegator, java.lang.String idToFind)
static java.util.List<GenericValue>
findParties(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId)
static java.util.List<GenericValue>
findPartiesById(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId)
static java.util.List<GenericValue>
findPartiesById(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId, boolean searchPartyFirst, boolean searchAllId)
Generic service to find party by id.static GenericValue
findParty(Delegator delegator, java.lang.String idToFind)
static GenericValue
findParty(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId)
static java.lang.String
findPartyId(Delegator delegator, java.lang.String idToFind)
static java.lang.String
findPartyId(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId)
static java.util.Locale
findPartyLastLocale(java.lang.String partyId, Delegator delegator)
static java.sql.Timestamp
findPartyLastLoginTime(java.lang.String partyId, Delegator delegator)
static GenericValue
findPartyLatestContactMech(java.lang.String partyId, java.lang.String contactMechTypeId, Delegator delegator)
static GenericValue
findPartyLatestPostalAddress(java.lang.String partyId, Delegator delegator)
static GenericValue
findPartyLatestPostalAddressGeoPoint(java.lang.String partyId, Delegator delegator)
static GenericValue
findPartyLatestTelecomNumber(java.lang.String partyId, Delegator delegator)
static GenericValue
findPartyLatestUserLogin(java.lang.String partyId, Delegator delegator)
static java.util.List<java.lang.String>
getAssociatedPartyIdsByRelationshipType(Delegator delegator, java.lang.String partyIdFrom, java.lang.String partyRelationshipTypeId)
static java.util.Map<java.lang.String,GenericValue>
getPartyOtherValues(javax.servlet.ServletRequest request, java.lang.String partyId, java.lang.String partyAttr, java.lang.String personAttr, java.lang.String partyGroupAttr)
static java.lang.String
makeMatchingString(Delegator delegator, java.lang.String address)
Converts the supplied String into a String suitable for address line matching.
-
-
-
Method Detail
-
getPartyOtherValues
public static java.util.Map<java.lang.String,GenericValue> getPartyOtherValues(javax.servlet.ServletRequest request, java.lang.String partyId, java.lang.String partyAttr, java.lang.String personAttr, java.lang.String partyGroupAttr)
-
createClubId
public static java.lang.String createClubId(Delegator delegator, java.lang.String prefix, int length)
Generate a sequenced club id using the prefix passed and a sequence value + check digit- Parameters:
delegator
- used to obtain a sequenced valueprefix
- prefix inserted at the beginning of the IDlength
- total length of the ID including prefix and check digit- Returns:
- Sequenced Club ID string with a length as defined starting with the prefix defined
-
findPartyLatestContactMech
public static GenericValue findPartyLatestContactMech(java.lang.String partyId, java.lang.String contactMechTypeId, Delegator delegator)
-
findPartyLatestPostalAddress
public static GenericValue findPartyLatestPostalAddress(java.lang.String partyId, Delegator delegator)
-
findPartyLatestPostalAddressGeoPoint
public static GenericValue findPartyLatestPostalAddressGeoPoint(java.lang.String partyId, Delegator delegator)
-
findPartyLatestTelecomNumber
public static GenericValue findPartyLatestTelecomNumber(java.lang.String partyId, Delegator delegator)
-
findPartyLatestUserLogin
public static GenericValue findPartyLatestUserLogin(java.lang.String partyId, Delegator delegator)
-
findPartyLastLoginTime
public static java.sql.Timestamp findPartyLastLoginTime(java.lang.String partyId, Delegator delegator)
-
findPartyLastLocale
public static java.util.Locale findPartyLastLocale(java.lang.String partyId, Delegator delegator)
-
findFirstMatchingPartyId
public static java.lang.String findFirstMatchingPartyId(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName) throws GeneralException
- Throws:
GeneralException
-
findFirstMatchingPartyAndContactMechId
public static java.lang.String[] findFirstMatchingPartyAndContactMechId(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName) throws GeneralException
- Throws:
GeneralException
-
findMatchingPersonPostalAddresses
public static java.util.List<GenericValue> findMatchingPersonPostalAddresses(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName) throws GeneralException
Finds all matching PartyAndPostalAddress records based on the values provided. Excludes party records with a statusId of PARTY_DISABLED. Results are ordered by descending PartyContactMech.fromDate. The matching process is as follows: 1. CallsfindMatchingPartyPostalAddress(Delegator, String, String, String, String, String, String, String, String)
to retrieve a list of address matched PartyAndPostalAddress records. Results are limited to Parties of type PERSON. 2. For each matching PartyAndPostalAddress record, the Person record for the Party is then retrieved and an upper case comparison is performed against the supplied firstName, lastName and if provided, middleName.- Parameters:
delegator
- Delegator instanceaddress1
- PostalAddress.address1 to match against (Required).address2
- Optional PostalAddress.address2 to match against.city
- PostalAddress.city value to match against (Required).stateProvinceGeoId
- Optional PostalAddress.stateProvinceGeoId value to match against. If null or "**" is passed then the value will be ignored during matching. "NA" can be passed in place of "_NA_".postalCode
- PostalAddress.postalCode value to match against. Cannot be null but can be skipped by passing a value starting with an "*". If the length of the supplied string is 10 characters and the string contains a "-" then the postal code will be split at the "-" and the second half will be used as the postalCodeExt.postalCodeExt
- Optional PostalAddress.postalCodeExt value to match against. Will be overridden if a postalCodeExt value is retrieved from postalCode as described above.countryGeoId
- Optional PostalAddress.countryGeoId value to match against.firstName
- Person.firstName to match against (Required).middleName
- Optional Person.middleName to match against.lastName
- Person.lastName to match against (Required).- Returns:
- List of PartyAndPostalAddress GenericValue objects that match the supplied criteria.
- Throws:
GeneralException
-
findMatchingPartyAndPostalAddress
@Deprecated public static java.util.List<GenericValue> findMatchingPartyAndPostalAddress(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName) throws GeneralException
Deprecated.- Throws:
GeneralException
-
findMatchingPartyPostalAddress
public static java.util.List<GenericValue> findMatchingPartyPostalAddress(Delegator delegator, java.lang.String address1, java.lang.String address2, java.lang.String city, java.lang.String stateProvinceGeoId, java.lang.String postalCode, java.lang.String postalCodeExt, java.lang.String countryGeoId, java.lang.String partyTypeId) throws GenericEntityException
Finds all matching parties based on the values provided. Excludes party records with a statusId of PARTY_DISABLED. Results are ordered by descending PartyContactMech.fromDate. 1. Candidate addresses are found by querying PartyAndPostalAddress using the supplied city and if provided, stateProvinceGeoId, postalCode, postalCodeExt and countryGeoId 2. In-memory address line comparisons are then performed against the supplied address1 and if provided, address2. Address lines are compared after the strings have been converted usingmakeMatchingString(Delegator, String)
.- Parameters:
delegator
- Delegator instanceaddress1
- PostalAddress.address1 to match against (Required).address2
- Optional PostalAddress.address2 to match against.city
- PostalAddress.city value to match against (Required).stateProvinceGeoId
- Optional PostalAddress.stateProvinceGeoId value to match against. If null or "**" is passed then the value will be ignored during matching. "NA" can be passed in place of "_NA_".postalCode
- PostalAddress.postalCode value to match against. Cannot be null but can be skipped by passing a value starting with an "*". If the length of the supplied string is 10 characters and the string contains a "-" then the postal code will be split at the "-" and the second half will be used as the postalCodeExt.postalCodeExt
- Optional PostalAddress.postalCodeExt value to match against. Will be overridden if a postalCodeExt value is retrieved from postalCode as described above.countryGeoId
- Optional PostalAddress.countryGeoId value to match against.partyTypeId
- Optional Party.partyTypeId to match against.- Returns:
- List of PartyAndPostalAddress GenericValue objects that match the supplied criteria.
- Throws:
GenericEntityException
-
makeMatchingString
public static java.lang.String makeMatchingString(Delegator delegator, java.lang.String address)
Converts the supplied String into a String suitable for address line matching. Performs the following transformations on the supplied String: - Converts to upper case - Retrieves all records from the AddressMatchMap table and replaces all occurrences of addressMatchMap.mapKey with addressMatchMap.mapValue using upper case matching. - Removes all non-word characters from the String i.e. everything except A-Z, 0-9 and _- Parameters:
delegator
- A Delegator instanceaddress
- The address String to convert- Returns:
- The converted Address
-
getAssociatedPartyIdsByRelationshipType
public static java.util.List<java.lang.String> getAssociatedPartyIdsByRelationshipType(Delegator delegator, java.lang.String partyIdFrom, java.lang.String partyRelationshipTypeId)
-
findPartiesById
public static java.util.List<GenericValue> findPartiesById(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId, boolean searchPartyFirst, boolean searchAllId) throws GenericEntityException
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)- Parameters:
delegator
- the delegatoridToFind
- the party id to findpartyIdentificationTypeId
- the party identification type id to usesearchPartyFirst
- search first with party idsearchAllId
- search all the party ids- Returns:
- returns the parties founds
- Throws:
GenericEntityException
-
findPartiesById
public static java.util.List<GenericValue> findPartiesById(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId) throws GenericEntityException
- Throws:
GenericEntityException
-
findPartyId
public static java.lang.String findPartyId(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId) throws GenericEntityException
- Throws:
GenericEntityException
-
findPartyId
public static java.lang.String findPartyId(Delegator delegator, java.lang.String idToFind) throws GenericEntityException
- Throws:
GenericEntityException
-
findParty
public static GenericValue findParty(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId) throws GenericEntityException
- Throws:
GenericEntityException
-
findParties
public static java.util.List<GenericValue> findParties(Delegator delegator, java.lang.String idToFind, java.lang.String partyIdentificationTypeId) throws GenericEntityException
- Throws:
GenericEntityException
-
findParties
public static java.util.List<GenericValue> findParties(Delegator delegator, java.lang.String idToFind) throws GenericEntityException
- Throws:
GenericEntityException
-
findParty
public static GenericValue findParty(Delegator delegator, java.lang.String idToFind) throws GenericEntityException
- Throws:
GenericEntityException
-
-