Commits

Anonymous committed 0e58c7b

Initial import from SourceForge

Comments (0)

Files changed (6)

src/java/com/opensymphony/workflow/spi/ejb/CurrentStepEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import com.opensymphony.ejb.ExceptionlessEntityAdapter;
+
+import java.sql.Timestamp;
+
+import javax.ejb.CreateException;
+
+
+/**
+ * EJB implementation for current steps.
+ *
+ * @ejb.bean
+ *  type="CMP"
+ *  view-type="local"
+ *  name="CurrentStep"
+ *  reentrant="False"
+ *  schema="CurrentStep"
+ *  primkey-field="id"
+ *
+ * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
+ *
+ * @ejb.persistence table-name="OS_CURRENTSTEP"
+ *
+ * @ejb.home local-extends="javax.ejb.EJBLocalHome"
+ *
+ * @ejb.interface local-extends="javax.ejb.EJBLocalObject,com.opensymphony.workflow.spi.ejb.AbstractLocalStep"
+ *
+ * @ejb.env-entry
+ *  name="sequenceName"
+ *  type="java.lang.String"
+ *  value="WorkflowEntryEJB"
+ *
+ * @ejb.ejb-external-ref
+ *  ref-name="ejb/SequenceGenerator"
+ *  type="Session"
+ *  view-type="remote"
+ *  link="SequenceGenerator"
+ *  home="com.opensymphony.module.sequence.SequenceGeneratorHome"
+ *  business="com.opensymphony.module.sequence.SequenceGenerator"
+ *
+ * @ejb.finder
+ *  signature="java.util.Collection findByEntryId(long entryId)"
+ *  query="SELECT DISTINCT OBJECT(o) from CurrentStep o where o.entryId = ?1"
+ *
+ * @ejb.permission unchecked="true"
+ * @ejb.transaction type="Supports"
+ *
+ * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
+ * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
+ */
+public abstract class CurrentStepEJB extends ExceptionlessEntityAdapter {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setActionId(int actionId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ACTION_ID"
+     */
+    public abstract int getActionId();
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setCaller(String caller);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="CALLER"
+     */
+    public abstract String getCaller();
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setDueDate(Timestamp dueDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="DUE_DATE"
+     */
+    public abstract Timestamp getDueDate();
+
+    public abstract void setEntryId(long entryId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ENTRY_ID"
+     */
+    public abstract long getEntryId();
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setFinishDate(Timestamp finishDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="FINISH_DATE"
+     */
+    public abstract Timestamp getFinishDate();
+
+    public abstract void setId(Long id);
+
+    /**
+     * @ejb.pk-field
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ID"
+     */
+    public abstract Long getId();
+
+    public abstract void setOwner(String owner);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="OWNER"
+     */
+    public abstract String getOwner();
+
+    public abstract void setStartDate(Timestamp startDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="START_DATE"
+     */
+    public abstract Timestamp getStartDate();
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setStatus(String status);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="STATUS"
+     */
+    public abstract String getStatus();
+
+    public abstract void setStepId(int stepId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="STEP_ID"
+     */
+    public abstract int getStepId();
+
+    /**
+     * @ejb.create-method
+     */
+    public Long ejbCreate(long entryId, int stepId, String owner, Timestamp startDate, Timestamp dueDate, String status) throws CreateException {
+        try {
+            Long id = new Long(nextLong());
+            setId(id);
+            setEntryId(entryId);
+            setStepId(stepId);
+            setOwner(owner);
+            setStartDate(startDate);
+            setDueDate(dueDate);
+            setStatus(status);
+
+            return id;
+        } catch (Exception e) {
+            throw new CreateException(e.getMessage());
+        }
+    }
+
+    public void ejbPostCreate(long entryId, int stepId, String owner, Timestamp startDate, Timestamp dueDate, String status) throws CreateException {
+    }
+}

src/java/com/opensymphony/workflow/spi/ejb/HistoryStepEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import java.sql.Timestamp;
+
+import javax.ejb.CreateException;
+import javax.ejb.EntityBean;
+
+
+/**
+ * EJB implementation for history steps.
+ *
+ * @ejb.bean
+ *  type="CMP"
+ *  view-type="local"
+ *  name="HistoryStep"
+ *  reentrant="False"
+ *  schema="HistoryStep"
+ *  primkey-field="id"
+ *
+ * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
+ *
+ * @ejb.persistence table-name="OS_HISTORYSTEP"
+ *
+ * @ejb.home local-extends="javax.ejb.EJBLocalHome"
+ *
+ * @ejb.interface local-extends="javax.ejb.EJBLocalObject,com.opensymphony.workflow.spi.ejb.AbstractLocalStep"
+ *
+ * @ejb.ejb-external-ref
+ *  ref-name="ejb/SequenceGenerator"
+ *  type="Session"
+ *  view-type="remote"
+ *  link="SequenceGenerator"
+ *  home="com.opensymphony.module.sequence.SequenceGeneratorHome"
+ *  business="com.opensymphony.module.sequence.SequenceGenerator"
+ *
+ * @ejb.finder
+ *  signature="java.util.Collection findByEntryId(long entryId)"
+ *  query="SELECT DISTINCT OBJECT(o) from HistoryStep o where o.entryId = ?1"
+ *
+ * @ejb.permission unchecked="true"
+ * @ejb.transaction type="Supports"
+ *
+ * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
+ * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
+ */
+public abstract class HistoryStepEJB implements EntityBean {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public abstract void setActionId(int actionId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ACTION_ID"
+     */
+    public abstract int getActionId();
+
+    public abstract void setCaller(String caller);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="CALLER"
+     */
+    public abstract String getCaller();
+
+    public abstract void setDueDate(Timestamp dueDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="DUE_DATE"
+     */
+    public abstract Timestamp getDueDate();
+
+    public abstract void setEntryId(long entryId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ENTRY_ID"
+     */
+    public abstract long getEntryId();
+
+    public abstract void setFinishDate(Timestamp finishDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="FINISH_DATE"
+     */
+    public abstract Timestamp getFinishDate();
+
+    public abstract void setId(Long id);
+
+    /**
+     * @ejb.pk-field
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ID"
+     */
+    public abstract Long getId();
+
+    public abstract void setOwner(String owner);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="OWNER"
+     */
+    public abstract String getOwner();
+
+    public abstract void setStartDate(Timestamp startDate);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="START_DATE"
+     */
+    public abstract Timestamp getStartDate();
+
+    public abstract void setStatus(String status);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="STATUS"
+     */
+    public abstract String getStatus();
+
+    public abstract void setStepId(int stepId);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="STEP_ID"
+     */
+    public abstract int getStepId();
+
+    /**
+     * @ejb.create-method
+     */
+    public Long ejbCreate(long id, long entryId, int stepId, int actionId, String owner, Timestamp startDate, Timestamp dueDate, Timestamp finishDate, String status, String caller) throws CreateException {
+        try {
+            Long pk = new Long(id);
+            setId(pk);
+            setEntryId(entryId);
+            setStepId(stepId);
+            setActionId(actionId);
+            setOwner(owner);
+            setStartDate(startDate);
+            setFinishDate(finishDate);
+            setStatus(status);
+            setCaller(caller);
+
+            return pk;
+        } catch (Exception e) {
+            throw new CreateException(e.getMessage());
+        }
+    }
+
+    public void ejbPostCreate(long id, long entryId, int stepId, int actionId, String owner, Timestamp startDate, Timestamp dueDate, Timestamp finishDate, String status, String caller) throws CreateException {
+    }
+}

src/java/com/opensymphony/workflow/spi/ejb/PreviousCurrentStepEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import com.opensymphony.workflow.spi.ejb.PreviousStepPK;
+
+import javax.ejb.CreateException;
+
+
+/**
+ * @ejb.bean
+ *  type="CMP"
+ *  view-type="local"
+ *  name="CurrentStepPrev"
+ *  reentrant="False"
+ *  schema="CurrentStepPrev"
+ *
+ * @ejb.pk extends="java.lang.Object" class="com.opensymphony.workflow.spi.ejb.PreviousStepPK"
+ *
+ * @ejb.home local-extends="javax.ejb.EJBLocalHome"
+ *
+ * @ejb.interface local-extends="javax.ejb.EJBLocalObject"
+ *
+ * @ejb.persistence table-name="OS_CURRENTSTEP_PREV"
+ *
+ * @ejb.ejb-external-ref
+ *  ref-name="ejb/SequenceGenerator"
+ *  type="Session"
+ *  view-type="remote"
+ *  link="SequenceGenerator"
+ *  home="com.opensymphony.module.sequence.SequenceGeneratorHome"
+ *  business="com.opensymphony.module.sequence.SequenceGenerator"
+ *
+ * @ejb.finder
+ *  signature="java.util.Collection findByStepId(long entryId)"
+ *  query="SELECT DISTINCT OBJECT(o) from CurrentStepPrev o where o.id = ?1"
+ *
+ * @ejb.permission unchecked="true"
+ * @ejb.transaction type="Supports"
+ *
+ * @author Hani Suleiman (hani@formicary.net)
+ * Date: Apr 7, 2003
+ * Time: 8:17:26 PM
+ */
+public abstract class PreviousCurrentStepEJB extends PreviousStepEJB {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * @ejb.create-method
+     */
+    public PreviousStepPK ejbCreate(long id, long previousId) throws CreateException {
+        try {
+            Long pkA = new Long(id);
+            Long pkB = new Long(previousId);
+            setId(pkA);
+            setPreviousId(pkB);
+
+            return new PreviousStepPK(pkA, pkB);
+        } catch (Exception e) {
+            throw new CreateException(e.getMessage());
+        }
+    }
+
+    public void ejbPostCreate(long id, long previousId) throws CreateException {
+    }
+}

src/java/com/opensymphony/workflow/spi/ejb/PreviousHistoryStepEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import com.opensymphony.workflow.spi.ejb.PreviousStepPK;
+
+import javax.ejb.CreateException;
+
+
+/**
+ * @ejb.bean
+ *  type="CMP"
+ *  view-type="local"
+ *  name="HistoryStepPrev"
+ *  reentrant="False"
+ *  schema="HistoryStepPrev"
+ *
+ * @ejb.pk extends="java.lang.Object" class="com.opensymphony.workflow.spi.ejb.PreviousStepPK"
+ *
+ * @ejb.persistence table-name="OS_HISTORYSTEP_PREV"
+ *
+ * @ejb.home local-extends="javax.ejb.EJBLocalHome"
+ *
+ * @ejb.interface local-extends="javax.ejb.EJBLocalObject"
+ *
+ * @ejb.ejb-external-ref
+ *  ref-name="ejb/SequenceGenerator"
+ *  type="Session"
+ *  view-type="remote"
+ *  link="SequenceGenerator"
+ *  home="com.opensymphony.module.sequence.SequenceGeneratorHome"
+ *  business="com.opensymphony.module.sequence.SequenceGenerator"
+ *
+ * @ejb.finder
+ *  signature="java.util.Collection findByStepId(long entryId)"
+ *  query="SELECT DISTINCT OBJECT(o) from HistoryStepPrev o where o.id = ?1"
+ *
+ * @ejb.permission unchecked="true"
+ * @ejb.transaction type="Supports"
+ *
+ * @author Hani Suleiman (hani@formicary.net)
+ * Date: Apr 7, 2003
+ * Time: 8:17:09 PM
+ */
+public abstract class PreviousHistoryStepEJB extends PreviousStepEJB {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    /**
+     * @ejb.create-method
+     */
+    public PreviousStepPK ejbCreate(long id, long previousId) throws CreateException {
+        try {
+            Long pkA = new Long(id);
+            Long pkB = new Long(previousId);
+            setId(pkA);
+            setPreviousId(pkB);
+
+            return new PreviousStepPK(pkA, pkB);
+        } catch (Exception e) {
+            throw new CreateException(e.getMessage());
+        }
+    }
+
+    public void ejbPostCreate(long id, long previousId) throws CreateException {
+    }
+}

src/java/com/opensymphony/workflow/spi/ejb/PreviousStepEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import javax.ejb.EntityBean;
+
+
+/**
+ * @ejb.bean generate="false"
+ * @ejb.pk generate="false"
+ * @ejb.interface generate="false"
+ * @ejb.home generate="false"
+ *
+ * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
+ * @version $Revision: 1.1.1.1 $
+ */
+public abstract class PreviousStepEJB implements EntityBean {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public abstract void setId(Long id);
+
+    /**
+     * @ejb.pk-field
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ID"
+     */
+    public abstract Long getId();
+
+    public abstract void setPreviousId(Long previousId);
+
+    /**
+     * @ejb.pk-field
+     * @ejb.interface-method
+     * @ejb.persistence column-name="PREVIOUS_ID"
+     */
+    public abstract Long getPreviousId();
+}

src/java/com/opensymphony/workflow/spi/ejb/WorkflowEntryEJB.java

+/*
+ * Copyright (c) 2002-2003 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.workflow.spi.ejb;
+
+import com.opensymphony.ejb.ExceptionlessEntityAdapter;
+
+import javax.ejb.CreateException;
+
+
+/**
+ * EJB implementation for workflow entries.
+ *
+ * @ejb.bean
+ *  type="CMP"
+ *  view-type="local"
+ *  name="WorkflowEntry"
+ *  reentrant="False"
+ *  schema="WorkflowEntry"
+ *  primkey-field="id"
+ *
+ * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
+ *
+ * @ejb.persistence table-name="OS_WFENTRY"
+ *
+ * @ejb.home local-extends="javax.ejb.EJBLocalHome"
+ *
+ * @ejb.interface local-extends="javax.ejb.EJBLocalObject"
+ *
+ * @ejb.ejb-external-ref
+ *  ref-name="ejb/SequenceGenerator"
+ *  type="Session"
+ *  view-type="remote"
+ *  link="SequenceGenerator"
+ *  home="com.opensymphony.module.sequence.SequenceGeneratorHome"
+ *  business="com.opensymphony.module.sequence.SequenceGenerator"
+ *
+ * @ejb.env-entry
+ *  name="sequenceName"
+ *  type="java.lang.String"
+ *  value="WorkflowEntryEJB"
+ *
+ * @ejb.permission unchecked="true"
+ * @ejb.transaction type="Supports"
+ *
+ * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
+ * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
+ */
+public abstract class WorkflowEntryEJB extends ExceptionlessEntityAdapter {
+    //~ Methods ////////////////////////////////////////////////////////////////
+
+    public abstract void setId(Long id);
+
+    /**
+     * @ejb.pk-field
+     * @ejb.interface-method
+     * @ejb.persistence column-name="ID"
+     */
+    public abstract Long getId();
+
+    /**
+     * @ejb.interface-method
+     */
+    public abstract void setInitialized(int initialized);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="INITIALIZED"
+     */
+    public abstract int getInitialized();
+
+    public abstract void setWorkflowName(String workflowName);
+
+    /**
+     * @ejb.interface-method
+     * @ejb.persistence column-name="NAME"
+     */
+    public abstract String getWorkflowName();
+
+    /**
+     * @ejb.create-method
+     */
+    public Long ejbCreate(String workflowName) throws CreateException {
+        try {
+            Long id = new Long(nextLong());
+            setId(id);
+            setWorkflowName(workflowName);
+            setInitialized(0);
+
+            return null;
+        } catch (Exception e) {
+            throw new CreateException(e.getMessage());
+        }
+    }
+
+    public void ejbPostCreate(String workflowName) throws CreateException {
+    }
+}