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/09/01 19:01:48 UTC

cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/workflow WorkflowFactory.java CMSHistory.java CMSSituation.java

andreas     2003/09/01 10:01:48

  Modified:    src/java/org/apache/lenya/cms/workflow WorkflowFactory.java
                        CMSHistory.java CMSSituation.java
  Log:
  writing initial state on history initialization
  
  Revision  Changes    Path
  1.22      +5 -4      cocoon-lenya/src/java/org/apache/lenya/cms/workflow/WorkflowFactory.java
  
  Index: WorkflowFactory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/workflow/WorkflowFactory.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- WorkflowFactory.java	25 Aug 2003 20:47:35 -0000	1.21
  +++ WorkflowFactory.java	1 Sep 2003 17:01:48 -0000	1.22
  @@ -239,10 +239,11 @@
        * Initializes the history of a document.
        * @param document The document object.
        * @param workflowId The ID of the workflow.
  +     * @param situation The current situation.
        * @throws WorkflowException When something goes wrong.
        */
  -    public static void initHistory(Document document, String workflowId) throws WorkflowException {
  -        new CMSHistory(document).initialize(workflowId);
  +    public static void initHistory(Document document, String workflowId, Situation situation) throws WorkflowException {
  +        new CMSHistory(document).initialize(workflowId, situation);
       }
       
       /**
  @@ -264,7 +265,7 @@
       public static void initHistory(Document sourceDocument, Document destinationDocument)
           throws WorkflowException {
           CMSHistory history = new CMSHistory(sourceDocument);
  -        history.initialize(destinationDocument);
  +        history.initialize(destinationDocument, null);
       }
   
   }
  
  
  
  1.14      +7 -9      cocoon-lenya/src/java/org/apache/lenya/cms/workflow/CMSHistory.java
  
  Index: CMSHistory.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/workflow/CMSHistory.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- CMSHistory.java	25 Aug 2003 20:47:04 -0000	1.13
  +++ CMSHistory.java	1 Sep 2003 17:01:48 -0000	1.14
  @@ -57,11 +57,9 @@
   
   import org.apache.lenya.cms.publication.Document;
   import org.apache.lenya.cms.publication.DocumentIdToPathMapper;
  -import org.apache.lenya.workflow.Event;
   import org.apache.lenya.workflow.Situation;
   import org.apache.lenya.workflow.WorkflowException;
   import org.apache.lenya.workflow.impl.History;
  -import org.apache.lenya.workflow.impl.StateImpl;
   import org.apache.lenya.workflow.impl.Version;
   import org.apache.lenya.workflow.impl.WorkflowInstanceImpl;
   import org.apache.lenya.xml.NamespaceHelper;
  @@ -99,11 +97,10 @@
       public static final String IP_ATTRIBUTE = "ip-address";
   
       /** (non-Javadoc)
  -     * @see org.apache.lenya.cms.workflow.History#createVersionElement(org.apache.lenya.xml.NamespaceHelper, org.apache.lenya.workflow.impl.StateImpl, org.apache.lenya.workflow.Situation, org.apache.lenya.workflow.Event)
  +     * @see org.apache.lenya.cms.workflow.History#createVersionElement(org.apache.lenya.xml.NamespaceHelper, org.apache.lenya.workflow.Situation)
        */
  -    protected Element createVersionElement(NamespaceHelper helper, StateImpl state,
  -        Situation situation, Event event) {
  -        Element element = super.createVersionElement(helper, state, situation, event);
  +    protected Element createVersionElement(NamespaceHelper helper, Situation situation) {
  +        Element element = super.createVersionElement(helper, situation);
   
           CMSSituation cmsSituation = (CMSSituation) situation;
           
  @@ -198,12 +195,13 @@
        * Initializes the workflow history of another document using the same
        * workflow schema like this history.
        * @param newDocument The document to initialize the history for.
  +     * @param situation The current situation.
        * @throws WorkflowException when something went wrong.
        */
  -    protected void initialize(Document newDocument) throws WorkflowException {
  +    protected void initialize(Document newDocument, Situation situation) throws WorkflowException {
           String workflowId = getWorkflowId();
           CMSHistory newHistory = new CMSHistory(newDocument);
  -        newHistory.initialize(workflowId);
  +        newHistory.initialize(workflowId, situation);
       }
       
       /**
  
  
  
  1.8       +3 -1      cocoon-lenya/src/java/org/apache/lenya/cms/workflow/CMSSituation.java
  
  Index: CMSSituation.java
  ===================================================================
  RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/workflow/CMSSituation.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CMSSituation.java	25 Aug 2003 09:54:58 -0000	1.7
  +++ CMSSituation.java	1 Sep 2003 17:01:48 -0000	1.8
  @@ -88,6 +88,8 @@
   	 */
       protected CMSSituation(String[] roleIds, String userId, String machineIp) {
           this.roleIds = roleIds;
  +        this.userId = userId;
  +        this.machineIp = machineIp;
       }
   
       private String[] roleIds;
  
  
  

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