Class PartyWorker


  • public class PartyWorker
    extends java.lang.Object
    Worker methods for Party Information
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • getPartyOtherValues

        public static java.util.Map<java.lang.String,​GenericValue> getPartyOtherValues​(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 value
        prefix - prefix inserted at the beginning of the ID
        length - 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. Calls findMatchingPartyPostalAddress(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 instance
        address1 - 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
      • 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 using makeMatchingString(Delegator, String).
        Parameters:
        delegator - Delegator instance
        address1 - 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 instance
        address - 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 delegator
        idToFind - the party id to find
        partyIdentificationTypeId - the party identification type id to use
        searchPartyFirst - search first with party id
        searchAllId - search all the party ids
        Returns:
        returns the parties founds
        Throws:
        GenericEntityException