Class PPInteractionHelper


  • public class PPInteractionHelper
    extends Object
    The class PPInteractionHelper is a helper class for the Personal Profile Service for creating questions for Interaction for value and interaction for consent. The question key will always be of the following form in a properties file. Question: _Value_Question for interact for value Question: _Consent_Question for interfact for consent For e.g. CN_Value_Question or CN_Consent_Question. There will be a default question key for Consent if there's not one for the rquested attribute., but it's not true for interact for the value.
    • Constructor Detail

      • PPInteractionHelper

        public PPInteractionHelper​(String lang)
        Constructor
        Parameters:
        lang - Language for the properties file.
    • Method Detail

      • getInteractForConsentQuestion

        public String getInteractForConsentQuestion​(boolean isQuery,
                                                    String ppElement)
        Gets the inquiry question for interaction for consent. common question if it does'nt have one.
        Parameters:
        isQuery - true if this is a PP query request, false if this is a PP modify request.
        ppElement - leaf element in PP select expresssion.
        Returns:
        String inquiry question.
      • getInteractForValueQuestions

        public Map getInteractForValueQuestions​(boolean isQuery,
                                                String ppElement)
        Gets Interact For value questions for an idpp element. There will be mutiple questions for a non leaf element.
        Parameters:
        isQuery - true if this is a PP query request, false if this is a PP modify request.
        ppElement - leaf element in PP select expression.
        Returns:
        Map map of PP element and question. key is the ppelement for e.g. CN value is the question for e.g. "What's the CN value?";
      • getPPAttribute

        public String getPPAttribute​(String key)
        Gets the Personal Profile DS Attribute from the attribute mapper.
        Parameters:
        key - PP Attribute
        Returns:
        String DS Attribute for the respective PP Attribute
      • getTextMinChars

        public BigInteger getTextMinChars​(String resource)
                                   throws NumberFormatException
        Gets the text minimum characters
        Parameters:
        resource - a resource that's looking for minimum text chars.
        Returns:
        BigInteger text minimum characters in BigInteger format
        Throws:
        NumberFormatException - if it can not parse the number.
      • getTextMaxChars

        public BigInteger getTextMaxChars​(String resource)
                                   throws NumberFormatException
        Gets the text maxmimum characters for a given attribute.
        Parameters:
        resource - an attribute that's looking for the max text chars.
        Returns:
        BigInteger text maximum characters in BigInteger format
        Throws:
        NumberFormatException - if it can not parse the number.