/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: PPInteractionHelper.java,v 1.2 2008/06/25 05:47:14 qcheng Exp $
*
*/
/**
* The class <code>PPInteractionHelper</code> 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: <PPAttribute>_Value_Question for interact for value
* Question: <PPAttribute>_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.
*/
public class PPInteractionHelper {
/**
* Constructor
* @param lang Language for the properties file.
*/
} else {
}
try {
} catch (MissingResourceException mre) {
" or maximum text characters.", mre);
}
}
/**
* Gets the inquiry question for interaction for consent.
* common question if it does'nt have one.
* @param isQuery true if this is a <code>PP</code> query request,
* false if this is a <code>PP</code> modify request.
* @param ppElement leaf element in <code>PP</code> select expresssion.
* @return String inquiry question.
*/
try {
if (isQuery) {
} else {
}
} catch(MissingResourceException mre) {
"can not find question for:" + ppElement);
}
}
if (isQuery) {
} else {
return
}
}
/**
* Gets Interact For value questions for an idpp element. There will be
* mutiple questions for a non leaf element.
* @param isQuery true if this is a <code>PP</code> query request,
* false if this is a <code>PP</code> modify request.
* @param ppElement leaf element in <code>PP</code> select expression.
* @return Map map of <code>PP</code> element and question.
* key is the ppelement for e.g. CN
* value is the question for e.g. "What's the CN value?";
*/
return queries;
}
return queries;
}
return queries;
}
}
}
return queries;
}
/**
* Gets the Personal Profile DS Attribute from the attribute mapper.
* @param key PP Attribute
* @return String DS Attribute for the respective PP Attribute
*/
}
/**
* Gets the text minimum characters
* @param resource a resource that's looking for minimum text chars.
* @return BigInteger text minimum characters in BigInteger format
* @exception NumberFormatException if it can not parse the number.
*/
throws NumberFormatException {
try {
} catch (MissingResourceException mre) {
"Could not find min chars for " + resource);
}
}
return new BigInteger(minChars);
}
/**
* Gets the text maxmimum characters for a given attribute.
* @param resource an attribute that's looking for the max text chars.
* @return BigInteger text maximum characters in BigInteger format
* @exception NumberFormatException if it can not parse the number.
*/
throws NumberFormatException {
try {
} catch (MissingResourceException mre) {
"Could not find min chars for " + resource);
}
}
return new BigInteger(maxChars);
}
/**
* Gets the interact for value for a leaf element
* @param isQuery true if this is a <code>PP</code> query request,
* false if this is a <code>PP</code> modify request.
* @param ppElement leaf element in <code>PP</code> select expression.
* @return String question for the pp attribute element,
* null if does not find one.
*/
try {
if (isQuery) {
} else {
}
} catch (MissingResourceException mre) {
return null;
}
}
/**
* Gets the Personal Profile Service Leaf Element if there are any for
* the given PP Attribute element.
* @param ppElement PP Attribute element
* @return Set set of leaf elements.
*/
return set;
}
return getCommonNameElements();
return getInformalNameElements();
return getEmploymentIdentityElements();
return getLegalIdentityElements();
return getExtensionElements();
} else {
//if-else loops are followed
}
//It comes here only if it's a leaf element
return set;
}
// Static method to get the common name elements
return set;
}
// Static method to get analyzed name elements
return set;
}
// Static method to get informal name elements
return set;
}
// Static method to get employment identity elements
return set;
}
// Static method to get legal identity elements
return set;
}
// Static method to get the extension elements
}
}