lenya-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andr...@apache.org
Subject cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/transformation WorkflowMenuTransformer.java
Date Thu, 28 Aug 2003 10:11:09 GMT
andreas     2003/08/28 03:11:09

  Modified:    src/java/org/apache/lenya/cms/cocoon/transformation
                        WorkflowMenuTransformer.java
  Log:
  adding is_live variable to XML
  
  Revision  Changes    Path
  1.20      +20 -1     cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/transformation/WorkflowMenuTransformer.java
  
  Index: WorkflowMenuTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/cocoon/transformation/WorkflowMenuTransformer.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- WorkflowMenuTransformer.java	22 Aug 2003 16:37:24 -0000	1.19
  +++ WorkflowMenuTransformer.java	28 Aug 2003 10:11:09 -0000	1.20
  @@ -68,6 +68,7 @@
   import org.apache.lenya.workflow.Event;
   import org.apache.lenya.workflow.Situation;
   import org.apache.lenya.workflow.Workflow;
  +import org.apache.lenya.workflow.WorkflowException;
   import org.apache.lenya.workflow.WorkflowInstance;
   
   import org.xml.sax.Attributes;
  @@ -76,6 +77,7 @@
   
   import java.io.IOException;
   
  +import java.util.Arrays;
   import java.util.Map;
   
   /**
  @@ -142,6 +144,23 @@
               char[] characters = instance.getCurrentState().toString().toCharArray();
               super.characters(characters, 0, characters.length);
               super.endElement(uri, "workflow-state", prefix + "workflow-state");
  +            
  +            if (Arrays.asList(instance.getWorkflow().getVariableNames()).contains("is-live"))
{
  +                super.startElement(
  +                    uri,
  +                    "is-live",
  +                    prefix + "is-live",
  +                    new AttributesImpl());
  +
  +                try {
  +                    characters = Boolean.toString(instance.getValue("is_live")).toCharArray();
  +                } catch (WorkflowException e) {
  +                    throw new SAXException(e);
  +                }
  +                super.characters(characters, 0, characters.length);
  +                super.endElement(uri, "is-live", prefix + "is-live");
  +            }
  +            
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-cvs-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-cvs-help@cocoon.apache.org


Mime
View raw message