cmailleux 2005/06/17 13:37:08 CEST
Modified files:
core/src/java/org/jahia/workflow/nstep NStepWorkflow.java
Log:
Correct bug on reinit (no include on initstep and no trim of action name)
Correct bug if resource bundle for a step is not found (initstep workaround
for rollback email subject)
Revision Changes Path
1.2 +20 -9
jahia/core/src/java/org/jahia/workflow/nstep/NStepWorkflow.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/java/org/jahia/workflow/nstep/NStepWorkflow.java.diff?r1=1.1&r2=1.2&f=h
Index: NStepWorkflow.java
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/java/org/jahia/workflow/nstep/NStepWorkflow.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- NStepWorkflow.java 16 Jun 2005 08:43:07 -0000 1.1
+++ NStepWorkflow.java 17 Jun 2005 11:37:08 -0000 1.2
@@ -458,16 +458,26 @@
string = string.replaceAll("\\$\\{authorName\\}", authorName);
string = string.replaceAll("\\$\\{pageLink\\}",
jParams.getSiteURL(contentObject.getID(), false, false));
if (curStep != null) {
- string = string.replaceAll("\\$\\{step\\}",
- resourceBundle.getString("process." +
trimActionName(processName.toLowerCase()) +
- ".step." +
-
trimActionName(curStep.getName().toLowerCase())));
+ String stepLabel = curStep.getName();
+ try {
+ stepLabel = resourceBundle.getString("process." +
trimActionName(processName.toLowerCase()) +
+
".step." +
+
trimActionName(curStep.getName().toLowerCase()));
+ } catch(Exception e) {
+ log.error("Resource bundle not found",e);
+ }
+ string = string.replaceAll("\\$\\{step\\}",stepLabel);
}
if (nextStep != null) {
- string = string.replaceAll("\\$\\{nextStep\\}",
- resourceBundle.getString("process." +
trimActionName(processName.toLowerCase()) +
- ".step." +
-
trimActionName(nextStep.getName().toLowerCase())));
+ String stepLabel = curStep.getName();
+ try {
+ stepLabel = resourceBundle.getString("process." +
trimActionName(processName.toLowerCase()) +
+
".step." +
+
trimActionName(curStep.getName().toLowerCase()));
+ } catch(Exception e) {
+ log.error("Resource bundle not found",e);
+ }
+ string = string.replaceAll("\\$\\{nextStep\\}",stepLabel);
}
return string;
}
@@ -506,8 +516,9 @@
steps.add(step);
}
} else {
+ steps.add(existingSteps.get(0));
for (int j = 0; j < stepNamesArray.length; j++) {
- String s1 = stepNamesArray[j];
+ String s1 = stepNamesArray[j].trim();
WorkflowStep workflowStep;
try {
workflowStep =
(org.jahia.workflow.nstep.model.WorkflowStep) existingSteps.get(j + 1);