try{
tryClass=(JavaClassDestination)Class.forName(javaClassPath).newInstance();
}
catch (ClassCastException e) {
logger.error("Error in istantiating class");
EMFValidationError emfError=new EMFValidationError(EMFErrorSeverity.ERROR, "sendtojavaclass_"+biobId+"__"+index, "12200");
errorHandler.addError(emfError);
}
catch (Exception e) {
logger.error("Error in istantiating class");
EMFValidationError emfError=new EMFValidationError(EMFErrorSeverity.ERROR, "sendtojavaclass_"+biobId+"__"+index, "12100");
errorHandler.addError(emfError);
}
sInfo.setJavaClassPath(javaClassPath);
}
String saveasdoc = (String)request.getAttribute("saveasdocument_"+biobId+"__"+index);
if(saveasdoc!=null) {
sInfo.setSaveAsDocument(true);
String docname = (String)request.getAttribute("documentname_"+biobId+"__"+index);
sInfo.setDocumentName(docname);
String docdescr = (String)request.getAttribute("documentdescription_"+biobId+"__"+index);
sInfo.setDocumentDescription(docdescr);
boolean useFixedFolder = "true".equalsIgnoreCase((String) request.getAttribute("useFixedFolder_"+biobId+"__"+index));
sInfo.setUseFixedFolder(useFixedFolder);
if (useFixedFolder) {
String functIdsConcat = "";
String tmpValReq = "tree_"+biobId+"__"+index+"_funct_id";
List functIds = request.getAttributeAsList(tmpValReq);
Iterator iterFunctIds = functIds.iterator();
while(iterFunctIds.hasNext()) {
String idFunct = (String)iterFunctIds.next();
functIdsConcat += idFunct;
if(iterFunctIds.hasNext()){
functIdsConcat += ",";
}
}
sInfo.setFunctionalityIds(functIdsConcat);
}
//gestire acquisizione folder
boolean useFolderDataset = "true".equalsIgnoreCase((String) request.getAttribute("useFolderDataset_"+biobId+"__"+index));
sInfo.setUseFolderDataSet(useFolderDataset);
if (useFolderDataset) {
String dsLabel = (String)request.getAttribute("datasetFolderLabel_"+biobId+"__"+index);
sInfo.setDataSetFolderLabel(dsLabel);
String datasetParameterLabel = (String)request.getAttribute("datasetFolderParameter_"+biobId+"__"+index);
sInfo.setDataSetFolderParameterLabel(datasetParameterLabel);
if (dsLabel == null || dsLabel.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSet", params, "component_scheduler_messages"));
}
if (datasetParameterLabel == null || datasetParameterLabel.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSetParameter", params, "component_scheduler_messages"));
}
// sInfo.setFunctionalityIds(functIdsConcat);
}
}
String sendmail = (String)request.getAttribute("sendmail_"+biobId+"__"+index);
if(sendmail!=null) {
sInfo.setSendMail(true);
boolean useFixedRecipients = "true".equalsIgnoreCase((String) request.getAttribute("useFixedRecipients_"+biobId+"__"+index));
sInfo.setUseFixedRecipients(useFixedRecipients);
if (useFixedRecipients) {
String mailtos = (String)request.getAttribute("mailtos_"+biobId+"__"+index);
sInfo.setMailTos(mailtos);
if (mailtos == null || mailtos.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingFixedRecipients", params, "component_scheduler_messages"));
}
}
boolean useDataset = "true".equalsIgnoreCase((String) request.getAttribute("useDataset_"+biobId+"__"+index));
sInfo.setUseDataSet(useDataset);
if (useDataset) {
String dsLabel = (String)request.getAttribute("datasetLabel_"+biobId+"__"+index);
sInfo.setDataSetLabel(dsLabel);
String datasetParameterLabel = (String)request.getAttribute("datasetParameter_"+biobId+"__"+index);
sInfo.setDataSetParameterLabel(datasetParameterLabel);
if (dsLabel == null || dsLabel.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSet", params, "component_scheduler_messages"));
}
if (datasetParameterLabel == null || datasetParameterLabel.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingDataSetParameter", params, "component_scheduler_messages"));
}
}
boolean useExpression = "true".equalsIgnoreCase((String) request.getAttribute("useExpression_"+biobId+"__"+index));
sInfo.setUseExpression(useExpression);
if (useExpression) {
String expression = (String)request.getAttribute("expression_"+biobId+"__"+index);
sInfo.setExpression(expression);
if (expression == null || expression.trim().equals("")) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingExpression", params, "component_scheduler_messages"));
}
}
if (!useFixedRecipients && !useDataset && !useExpression) {
BIObject biobj = DAOFactory.getBIObjectDAO().loadBIObjectById(biobId);
List params = new ArrayList();
params.add(biobj.getName());
this.getErrorHandler().addError(new EMFValidationError(EMFErrorSeverity.ERROR, null, "errors.trigger.missingRecipients", params, "component_scheduler_messages"));
}
String mailsubj = (String)request.getAttribute("mailsubj_"+biobId+"__"+index);
sInfo.setMailSubj(mailsubj);
String mailtxt = (String)request.getAttribute("mailtxt_"+biobId+"__"+index);