You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2003/10/16 23:50:06 UTC
cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/components/modules/input WorkflowModule.java
andreas 2003/10/16 14:50:06
Modified: src/java/org/apache/lenya/cms/cocoon/components/modules/input
WorkflowModule.java
Log:
throwing exception when attribute is not supported
Revision Changes Path
1.4 +9 -2 cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/components/modules/input/WorkflowModule.java
Index: WorkflowModule.java
===================================================================
RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/components/modules/input/WorkflowModule.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WorkflowModule.java 17 Sep 2003 16:03:43 -0000 1.3
+++ WorkflowModule.java 16 Oct 2003 21:50:06 -0000 1.4
@@ -91,6 +91,7 @@
Object value = null;
+
try {
PageEnvelope envelope = PageEnvelopeFactory.getInstance().getPageEnvelope(objectModel);
Document document = envelope.getDocument();
@@ -100,7 +101,8 @@
WorkflowInstance instance = factory.buildInstance(document);
if (name.equals(STATE)) {
value = instance.getCurrentState().toString();
- } else if (name.startsWith(VARIABLE_PREFIX)) {
+ }
+ else if (name.startsWith(VARIABLE_PREFIX)) {
String variableName = name.substring(VARIABLE_PREFIX.length());
String[] variableNames = instance.getWorkflow().getVariableNames();
if (Arrays.asList(variableNames).contains(variableName)) {
@@ -110,7 +112,12 @@
else if (name.equals(HISTORY_PATH)) {
value = ((CMSHistory) WorkflowFactory.getHistory(document)).getHistoryPath();
}
+ else {
+ throw new ConfigurationException("The attribute [" + name + "] is not supported!");
+ }
}
+ } catch (ConfigurationException e) {
+ throw e;
} catch (Exception e) {
throw new ConfigurationException("Resolving attribute failed: ", e);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org