public List calculateRoles(String parameters) throws EMFInternalError, EMFUserError {
logger.debug("IN");
String[] splittedParameters = parameters.split("&");
if (splittedParameters == null || splittedParameters.length == 0) {
logger.error("Missing parameters for roles retrieval");
throw new EMFInternalError(EMFErrorSeverity.ERROR, "Missing parameters for roles retrieval");
}
String biobjectIdStr = null;
for (int i = 0; i < splittedParameters.length; i++) {
String parameter = splittedParameters[i].trim();
String[] splittedParameter = parameter.split("=");
String parameterName = splittedParameter[0];
if (parameterName.trim().equalsIgnoreCase("document")) {
if (splittedParameter.length != 2) {
logger.error("Malformed parameter for roles retrieval");
throw new EMFInternalError(EMFErrorSeverity.ERROR, "Malformed parameter for roles retrieval");
}
biobjectIdStr = splittedParameter[1];
break;
}
}
if (biobjectIdStr == null) {
logger.error("Missing parameters for roles retrieval");
throw new EMFInternalError(EMFErrorSeverity.ERROR, "Missing parameters for roles retrieval");
}
Integer biobjectId = null;
try {
biobjectId = new Integer(biobjectIdStr);
} catch (Exception e) {
logger.error("Malformed BIObject id: " + biobjectIdStr, e);
throw new EMFInternalError(EMFErrorSeverity.ERROR, "Malformed BIObject id: " + biobjectIdStr);
}
List roles = null;
try {
roles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(biobjectId);
Iterator iter=roles.iterator();