Author: thomas.heute(a)jboss.com
Date: 2007-09-06 08:48:33 -0400 (Thu, 06 Sep 2007)
New Revision: 8187
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
Removed:
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/cms/
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
Modified:
branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
branches/JBoss_Portal_Branch_2_6/core/build.xml
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
branches/JBoss_Portal_Branch_2_6/widget/build.xml
branches/JBoss_Portal_Branch_2_6/workflow/build.xml
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
Log:
- Seperated CMS / Workflow
- Integrated core-identity into the portal (still need to update the distrib.xml)
- Renamed widget.war to portal-widget.war
Modified: branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-09-06 12:33:24 UTC
(rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-09-06 12:48:33 UTC
(rev 8187)
@@ -87,13 +87,14 @@
<componentref name="jboss/backport-concurrent"
version="2.1.0.GA"/>
<componentref name="jboss/cache" version="1.4.0.SP1"/>
<componentref name="jboss/jbossretro-rt"
version="1.0.3.GA"/>
- <componentref name="jboss/jbossws14"
version="1.0.0.GA"/>
- <componentref name="jboss/jbossxb" version="1.0.0.CR4"/>
+ <componentref name="jboss/jbossws14"
version="1.0.3.GA"/>
+ <componentref name="jboss/jbossxb" version="1.0.0.CR7"/>
<componentref name="jboss/microcontainer"
version="1.0.2"/>
<componentref name="jboss/remoting" version="1.4.3.GA"/>
<componentref name="jboss/serialization"
version="1.0.1.GA"/>
<componentref name="jboss/test" version="1.0.0.CR1"/>
<componentref name="jflex" version="1.4.0"/>
+ <componentref name="jcaptcha" version="1.0.6"/>
<componentref name="jwebunit" version="1.2"/>
<componentref name="jcr" version="1.0"/>
<componentref name="jetty" version="6.0"/>
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -126,6 +126,7 @@
<module name="core"/>
<module name="core-cms"/>
<module name="core-management"/>
+ <module name="core-identity"/>
<module name="core-admin"/>
<module name="core-wsrp"/>
<module name="search"/>
@@ -140,7 +141,7 @@
<group name="portal">
<include
- modules="api, jems, server, security, search, format, portlet,
portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration,
core, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
+ modules="api, jems, server, security, search, format, portlet,
portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration,
core, wsrp, core-admin, core-cms, core-management, core-identity, core-samples,
widget"/>
</group>
<group name="cms">
@@ -287,8 +288,10 @@
depends="most">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<copy file="../core/output/lib/jboss-portal.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
- <copy file="../core-admin/output/lib//portal-admin.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-admin/output/lib/portal-admin.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-cms/output/lib/portal-cms.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../core-identity/output/lib/portal-identity.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../workflow/output/lib/portal-workflow.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-management/output/lib/portal-management.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-samples/output/lib/portal-basic-samples.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-samples/output/lib/portal-news-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
@@ -296,7 +299,7 @@
<copy file="../core-samples/output/lib/portal-weather-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-samples/output/lib/portal-users-samples.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<!--<copy file="../core-search/output/lib/portal-search.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>-->
- <copy file="../widget/output/lib/widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ <copy file="../widget/output/lib/portal-widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../wsrp/output/lib/portal-wsrp.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
</target>
@@ -307,6 +310,8 @@
<delete
file="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.sar"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-cms.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-identity.sar"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-workflow.sar"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-management.sar"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-basic-samples.sar"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-news-samples.war"/>
@@ -314,7 +319,7 @@
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-users-samples.sar"/>
<!--<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
- <delete
file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
</target>
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -37,8 +37,8 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.jems.as.JNDI;
-import org.jboss.portal.workflow.cms.ApprovePublish;
-import org.jboss.portal.workflow.cms.Content;
+import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.portal.cms.workflow.Content;
/**
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -55,7 +55,7 @@
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.util.StopWatch;
import org.w3c.dom.DOMImplementation;
@@ -613,14 +613,14 @@
JCRCommandContext ctx = new JCRCommandContext(session, commandFactory,
defaultLocale);
jcrCmd.setContext(ctx);
- ctx.setAttribute(ctx.scope, "user", JCRCMS.getUserInfo().get());
+ ctx.setAttribute(JCRCommandContext.scope, "user",
JCRCMS.getUserInfo().get());
Object isWorkflowOff = JCRCMS.turnOffWorkflow.get();
if( this.approvePublishWorkflow!=null //this checks and makes sure workflow is
activated for the CMS
&&
isWorkflowOff==null //this checks and makes sure workflow is not turned off
only for this particular request
)
{
- ctx.setAttribute(ctx.scope, "approvePublishWorkflow",
this.approvePublishWorkflow);
+ ctx.setAttribute(JCRCommandContext.scope, "approvePublishWorkflow",
this.approvePublishWorkflow);
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -40,7 +40,7 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.Role;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
/**
* ACLEnforcer checks proper access privileges for actions before
@@ -58,7 +58,7 @@
private static final int read = 0;
private static final int write = 1;
private static final int manage = 2;
- private static final int manageWorkflow = 3;
+// private static final int manageWorkflow = 3;
private AuthorizationManager authorizationManager = null;
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.util.Set;
+
+import org.jboss.portal.workflow.WorkflowException;
+
+import java.util.Collection;
+
+/**
+ * Created on : Dec 19, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public interface ApprovePublish
+{
+ /**
+ * Called when content is added to the CMS, and needs to be approved by the managers
+ * before it can be published to go live
+ *
+ * @param content
+ * @return returns the process id of the workflow process set in motion
+ */
+ public long requestApproval(Content content) throws WorkflowException;
+
+ /**
+ * Called when a manager either approves or rejects the publishing of a specific
content to
+ * go live
+ *
+ * @param processId
+ * @param manager userId of the manager
+ * @param approved true if approved, false if rejected
+ */
+ public void processManagerResponse(long processId, String manager, boolean approved)
throws WorkflowException;
+
+ /**
+ * Retrieves a queue of unapproved content associated with the specified file in the
CMS
+ *
+ * @param filePath
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getPendingQueue(String filePath) throws WorkflowException;
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException;
+
+ /**
+ * Returns role names of Roles that are designated to be Managers in this workflow.
+ * Managers approve/deny all content publish requests before the content goes live in
the
+ * CMS
+ *
+ * @return a Set of role names
+ */
+ public Set getManagers();
+}
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,582 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.jems.as.JNDI;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.WorkflowException;
+import org.jboss.portal.workflow.service.WorkflowService;
+import org.jbpm.JbpmContext;
+import org.jbpm.db.GraphSession;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+
+/**
+ * Created on : Dec 19, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class ApprovePublishImpl extends AbstractJBossService implements ApprovePublish
+{
+ /**
+ *
+ */
+ private static final Logger log = Logger.getLogger(ApprovePublishImpl.class);
+
+ /**
+ *
+ */
+ private WorkflowService workflowService = null;
+ private IdentityServiceController identityServiceController = null;
+ private String process = null;
+ private String processName = null;
+ private String managerRoles = null;
+ private String[] managers = null;
+ private Set managerSet = null;
+ private boolean overwrite = false;
+ private String from = null;
+ private String subject = null;
+ private String body = null;
+ private JNDI.Binding jndiBinding;
+
+ private MembershipModule membershipModule = null;
+ private UserModule userModule = null;
+
+ private String jndiName = null;
+
+ /**
+ *
+ *
+ */
+ public ApprovePublishImpl()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+
+ InputStream is = null;
+ JbpmContext jbpmContext = null;
+ try
+ {
+ is = new ByteArrayInputStream(this.process.getBytes());
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ Document document =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
+
+ Element root = document.getDocumentElement();
+ this.processName = root.getAttribute("name");
+ ProcessDefinition processDefinition =
jbpmContext.getGraphSession().findLatestProcessDefinition(this.processName);
+ if (processDefinition == null)
+ {
+ processDefinition = ProcessDefinition.parseXmlString(this.process);
+ jbpmContext.deployProcessDefinition(processDefinition);
+ }
+ else
+ {
+ // A process definition already exists....should deploy a new version
+ // of the definition if overwrite is true
+ ProcessDefinition fromConfig =
ProcessDefinition.parseXmlString(this.process);
+ if (this.overwrite)
+ {
+ // If the two of them are not same, create a new version
+ // of this process definition
+ jbpmContext.deployProcessDefinition(fromConfig);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ //
+ this.stopService();
+
+ //
+ throw e;
+ }
+ finally
+ {
+ IOTools.safeClose(is);
+ IOTools.safeClose(jbpmContext);
+ }
+
+ //process managers that can serve as approvers/rejecters
+ StringTokenizer st = new StringTokenizer(this.managerRoles, ",");
+ this.managers = new String[st.countTokens()];
+ this.managerSet = new HashSet();
+ for (int i = 0; i < managers.length; i++)
+ {
+ this.managers[i] = st.nextToken();
+ this.managerSet.add(this.managers[i]);
+ }
+
+ this.membershipModule =
(MembershipModule)identityServiceController.getIdentityContext().
+ getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+ this.userModule = (UserModule)identityServiceController.getIdentityContext().
+ getObject(IdentityContext.TYPE_USER_MODULE);
+ }
+
+ /**
+ *
+ */
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (jndiBinding != null)
+ {
+ jndiBinding.unbind();
+ jndiBinding = null;
+ }
+ }
+
+ /** @return */
+ public WorkflowService getWorkflowService()
+ {
+ return this.workflowService;
+ }
+
+ /** @param workflowService */
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
+ /** @return */
+ public String getProcess()
+ {
+ return this.process;
+ }
+
+ /** @param process */
+ public void setProcess(String process)
+ {
+ this.process = process;
+ }
+
+
+ /** @return the managerRoles */
+ public String getManagerRoles()
+ {
+ return managerRoles;
+ }
+
+ /** @param managerRoles the manager managerRoles to set */
+ public void setManagerRoles(String managerRoles)
+ {
+ this.managerRoles = managerRoles;
+ }
+
+
+ /** @return the overwrite */
+ public boolean isOverwrite()
+ {
+ return overwrite;
+ }
+
+ /** @param overwrite the overwrite to set */
+ public void setOverwrite(boolean overwrite)
+ {
+ this.overwrite = overwrite;
+ }
+
+ /** @return */
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ /** @param jndiName */
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ /**
+ *
+ */
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ /**
+ *
+ * @param identityServiceController
+ */
+ public void setIdentityServiceController(
+ IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+
+ /** @return the body */
+ public String getBody()
+ {
+ return body;
+ }
+
+ /** @param body the body to set */
+ public void setBody(String body)
+ {
+ this.body = body;
+ }
+
+ /** @return the from */
+ public String getFrom()
+ {
+ return from;
+ }
+
+ /** @param from the from to set */
+ public void setFrom(String from)
+ {
+ this.from = from;
+ }
+
+ /** @return the subject */
+ public String getSubject()
+ {
+ return subject;
+ }
+
+ /** @param subject the subject to set */
+ public void setSubject(String subject)
+ {
+ this.subject = subject;
+ }
+
+ //----------ApprovePublish
Implementation------------------------------------------------------------------
+ /**
+ * Called when content is added to the CMS, and needs to be approved by the managers
+ * before it can be published to go live
+ *
+ * @param content
+ * @return returns the process id of the workflow process set in motion
+ */
+ public long requestApproval(Content content) throws WorkflowException
+ {
+ long processId = 0;
+ JbpmContext jbpmContext = null;
+ ProcessInstance processInstance = null;
+ boolean success = false;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ //The next line creates one execution of the process definition.
+ // After construction, the process execution has one main path
+ // of execution (=the root token) that is positioned in the
+ // start-state.
+ processInstance = jbpmContext.newProcessInstance(this.processName);
+
+ //After construction, the process execution has one main path
+ // of execution (=the root token).
+ Token token = processInstance.getRootToken();
+
+ //set the process variables
+ processInstance.getContextInstance().setVariable("content", content);
+ processInstance.getContextInstance().setVariable("managers",
this.managers);
+ processInstance.getContextInstance().setVariable("from", this.from);
+ processInstance.getContextInstance().setVariable("subject",
this.subject);
+ processInstance.getContextInstance().setVariable("body", this.body);
+
+ //start the workflow, starts the cms publish approval workflow
+ //this creates a task to approve/reject a cms publish for the Admins
+ token.signal();
+
+ //mark as a successfull process initiation
+ success = true;
+ }
+ catch (Exception e)
+ {
+ success = false;
+ throw new WorkflowException(e);
+ }
+ finally
+ {
+ if (processInstance != null && success)
+ {
+ jbpmContext.save(processInstance);
+ processId = processInstance.getId();
+ }
+ IOTools.safeClose(jbpmContext);
+ }
+ return processId;
+ }
+
+ /**
+ * Called when a manager either approves or rejects the publishing of a specific
content to
+ * go live
+ *
+ * @param processId
+ * @param manager userId of the manager
+ * @param approved true if approved, false if rejected
+ */
+ public void processManagerResponse(long processId, String manager, boolean approved)
throws WorkflowException
+ {
+ JbpmContext jbpmContext = null;
+ ProcessInstance processInstance = null;
+ boolean isManager = false;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ //Now, we search for all process instances of this process definition.
+ processInstance = jbpmContext.loadProcessInstance(processId);
+
+ if (processInstance.hasEnded())
+ {
+ log.debug("This process has already ended...");
+ return;
+ }
+
+ processInstance.getContextInstance().setVariable("approved", new
Boolean(approved));
+
+ Collection allTasks = processInstance.getTaskMgmtInstance().getTaskInstances();
+ if (allTasks != null)
+ {
+ for (Iterator itr = allTasks.iterator(); itr.hasNext();)
+ {
+ TaskInstance cour = (TaskInstance)itr.next();
+ if (this.isManager(manager,cour.getActorId()))
+ {
+ isManager = true;
+ log.debug("Manager=" + cour.getActorId() + "(" +
processId + ")");
+
+ //check and make sure this task instance is not marked for deletion
+ if (cour.getVariable(processInstance.getId() + ":" +
cour.getId()) != null)
+ {
+ continue;
+ }
+
+ if (!approved)
+ {
+ cour.start();
+ cour.end("rejection");
+ break;
+ }
+ else
+ {
+ cour.start();
+ cour.end("approval");
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WorkflowException(e);
+ }
+ finally
+ {
+ if (processInstance != null)
+ {
+ jbpmContext.save(processInstance);
+ }
+
+ if(!isManager)
+ {
+ WorkflowException we = new WorkflowException("You are not authorized to
Approve/Deny content publish requests");
+ throw we;
+ }
+ IOTools.safeClose(jbpmContext);
+ }
+ }
+
+ /**
+ * Retrieves a queue of unapproved content associated with the specified file in the
CMS
+ *
+ * @param filePath
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getPendingQueue(String filePath) throws WorkflowException
+ {
+ Collection pendingQueue = new ArrayList();
+ JbpmContext jbpmContext = null;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDef =
graphSession.findLatestProcessDefinition(this.processName);
+ List processInstances = graphSession.findProcessInstances(processDef.getId());
+
+ if (processInstances != null)
+ {
+ for (int i = 0; i < processInstances.size(); i++)
+ {
+ ProcessInstance cour = (ProcessInstance)processInstances.get(i);
+ //iterate through a list of currently pending approval tasks
+ if (!cour.hasEnded())
+ {
+ Content content =
(Content)cour.getContextInstance().getVariable("content");
+
+ //apply proper criteria to extract pending content only for the
specified file
+ if (content != null)
+ {
+ int lastIndex = content.getPath().lastIndexOf('/');
+ String criteriaPath = content.getPath().substring(0, lastIndex);
+
+ if (criteriaPath.trim().equals(filePath.trim()))
+ {
+ content.setProcessId(String.valueOf(cour.getId()));
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ IOTools.safeClose(jbpmContext);
+ }
+ return pendingQueue;
+ }
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException
+ {
+ Collection pendingQueue = new ArrayList();
+ JbpmContext jbpmContext = null;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDef =
graphSession.findLatestProcessDefinition(this.processName);
+ List processInstances = graphSession.findProcessInstances(processDef.getId());
+
+ if (processInstances != null)
+ {
+ for (int i = 0; i < processInstances.size(); i++)
+ {
+ ProcessInstance cour = (ProcessInstance)processInstances.get(i);
+ //iterate through a list of currently pending approval tasks
+ if (!cour.hasEnded())
+ {
+ Content content =
(Content)cour.getContextInstance().getVariable("content");
+
+ //apply proper criteria to extract pending content only for the
specified file
+ if (content != null)
+ {
+ content.setProcessId(String.valueOf(cour.getId()));
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ IOTools.safeClose(jbpmContext);
+ }
+ return pendingQueue;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Set getManagers()
+ {
+ return this.managerSet;
+ }
+
//----------------------------------------------------------------------------------------------------------------
+ /**
+ * checks to see if the user trying to approve/deny a publish request belongs to the
+ * approved list of managers
+ *
+ * @param user
+ * @param managerRole
+ * @return
+ */
+ private boolean isManager(String user,String managerRole) throws Exception
+ {
+ boolean isManager = false;
+
+ Set userRoles = this.membershipModule.getRoles(
+ this.userModule.findUserByUserName(user));
+ if(userRoles != null)
+ {
+ for(Iterator itr=userRoles.iterator();itr.hasNext();)
+ {
+ Role cour = (Role)itr.next();
+ if(cour.getName().equalsIgnoreCase(managerRole))
+ {
+ //user is allowed to be a manager for this workflow
+ isManager = true;
+ break;
+ }
+ }
+ }
+
+ return isManager;
+ }
+}
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.UnavailableException;
+
+import javax.naming.InitialContext;
+
+/**
+ * Created on : Dec 20, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class ApprovePublishServlet extends HttpServlet
+{
+ private ApprovePublish approvePublishWorkflow = null;
+
+ /**
+ *
+ */
+ public void init() throws ServletException
+ {
+ try
+ {
+ super.init();
+ InitialContext context = new InitialContext();
+ approvePublishWorkflow =
(ApprovePublish)context.lookup("java:portal/ApprovePublishWorkflow");
+ }
+ catch (Exception e)
+ {
+ throw new UnavailableException(e.toString());
+ }
+ }
+
+ /**
+ *
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
+ {
+ this.doPost(request, response);
+ }
+
+ /**
+ *
+ */
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException, IOException
+ {
+ try
+ {
+ String processId = request.getParameter("pId");
+ String manager = request.getParameter("manager");
+ boolean approve = request.getRequestURI().indexOf("approve") != -1;
+
+ this.approvePublishWorkflow.processManagerResponse(
+ Long.parseLong(processId), manager, approve
+ );
+
+ /**
+ * TODO: this is a hack job until a decent GUI is integrated
+ * with this workflow..Yes Yes, this will be based on JSP then
+ */
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<html>\n");
+ if (approve)
+ {
+ buffer.append("<span>The content was successfully
published</span>\n");
+ }
+ else
+ {
+ buffer.append("<span>The content publish request was
rejected</span>\n");
+ }
+ buffer.append("</html>\n");
+
+ response.getWriter().write(buffer.toString());
+ response.getWriter().flush();
+ }
+ catch (Exception e)
+ {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+ }
+ }
+}
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.Format;
+import java.text.SimpleDateFormat;
+
+/**
+ * Created on : Dec 20, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class Content implements Serializable
+{
+
+ private String path = null;
+ private String userName = null;
+ private String mimeType = null;
+ private int size = 0;
+ private Date creationDate = null;
+
+ private String processId = null;
+
+ /**
+ *
+ *
+ */
+ public Content()
+ {
+
+ }
+
+ /**
+ * @return the path
+ */
+ public String getPath()
+ {
+ return path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ /**
+ * @return the userName
+ */
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ /**
+ * @param userName the userName to set
+ */
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ /**
+ * @return the mimeType
+ */
+ public String getMimeType()
+ {
+ return mimeType;
+ }
+
+ /**
+ * @param mimeType the mimeType to set
+ */
+ public void setMimeType(String mimeType)
+ {
+ this.mimeType = mimeType;
+ }
+
+ /**
+ * @return the size
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+ /**
+ * @param size the size to set
+ */
+ public void setSize(int size)
+ {
+ this.size = size;
+ }
+
+ public String getSizeStr()
+ {
+ return String.valueOf((this.size / 1024)) + "kb";
+ }
+
+ /**
+ * @return the creationDate
+ */
+ public Date getCreationDate()
+ {
+ return creationDate;
+ }
+
+ /**
+ * @param creationDate the creationDate to set
+ */
+ public void setCreationDate(Date creationDate)
+ {
+ this.creationDate = creationDate;
+ }
+
+ public String getCreationDateStr()
+ {
+ String date = "";
+ if (this.creationDate != null)
+ {
+ Format formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+ date = formatter.format(this.creationDate);
+ }
+ return date;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getProcessId()
+ {
+ return processId;
+ }
+
+ /**
+ *
+ * @param processId
+ */
+ public void setProcessId(String processId)
+ {
+ this.processId = processId;
+ }
+}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -33,7 +33,7 @@
import org.jbpm.graph.def.*;
import org.jbpm.graph.exe.*;
-import org.jboss.portal.workflow.cms.Content;
+import org.jboss.portal.cms.workflow.Content;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.File;
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -22,34 +22,15 @@
******************************************************************************/
package org.jboss.portal.cms.workflow;
-import org.apache.log4j.Logger;
-
import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-import java.net.URLEncoder;
-import java.text.MessageFormat;
-import javax.naming.InitialContext;
-
-import org.jbpm.graph.exe.*;
-import org.jbpm.taskmgmt.def.*;
+import org.apache.log4j.Logger;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
import org.jbpm.taskmgmt.exe.TaskInstance;
-//import org.jboss.portal.core.modules.MailModule;
-import org.jboss.portal.identity.IdentityServiceController;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.User;
-
-import org.jboss.portal.workflow.cms.Content;
-
-
/**
*
* Created on : Dec 20, 2006
@@ -58,7 +39,7 @@
*/
public class PublishAssignmentHandler implements AssignmentHandler
{
- private static Logger log = Logger.getLogger(PublishAssignmentHandler.class);
+ // private static Logger log = Logger.getLogger(PublishAssignmentHandler.class);
/**
*
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import org.jbpm.taskmgmt.exe.TaskInstance;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.def.ActionHandler;
+
+
+/**
+ * Created on : Dec 21, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class TaskExceptionHandler implements ActionHandler
+{
+
+ /**
+ *
+ */
+ public void execute(ExecutionContext executionContext)
+ {
+ TaskInstance current = executionContext.getTaskInstance();
+
+ TaskInstance t = executionContext.getTaskMgmtInstance().
+ createTaskInstance(executionContext.getTask(), executionContext);
+ t.setActorId(current.getActorId());
+
+ current.setVariable(executionContext.getProcessInstance().getId() + ":" +
current.getId(), "markAsDeleted");
+
+ throw new RuntimeException(executionContext.getException());
+ }
+}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -34,8 +34,8 @@
import org.jboss.portal.identity.db.HibernateRoleImpl;
import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.server.impl.invocation.JBossInterceptorStack;
-import org.jboss.portal.workflow.cms.ApprovePublish;
-import org.jboss.portal.workflow.cms.ApprovePublishImpl;
+import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublishImpl;
import org.jboss.portal.test.cms.commands.AbstractCommandTestCase;
import org.jboss.portal.test.cms.commands.CMSInterceptorStackFactory;
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -37,7 +37,7 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.impl.jcr.JCRCMS;
/**
@@ -132,7 +132,7 @@
//Approve and publish this file into the CMS
Set managers = approvePublish.getManagers();
String manager = (String)managers.iterator().next();
- org.jboss.portal.workflow.cms.Content pendingItem =
(org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ org.jboss.portal.cms.workflow.Content pendingItem =
(org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()),
manager.toLowerCase(), true);
//Make sure this resource is successfully published into the CMS, and removed from
the pending queue
@@ -168,7 +168,7 @@
assertEquals(1,queueItems.size());
//Approve and publish this new version into the CMS
- pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()),
manager.toLowerCase(),true);
//Check for the success of this publish, and removal from the pending queue
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -39,7 +39,7 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.impl.jcr.JCRCMS;
/**
@@ -135,7 +135,7 @@
//Deny the publish of this file into the CMS
Set managers = approvePublish.getManagers();
String manager = (String)managers.iterator().next();
- org.jboss.portal.workflow.cms.Content pendingItem =
(org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ org.jboss.portal.cms.workflow.Content pendingItem =
(org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()),
manager.toLowerCase(), false);
//Make sure this resource is not published into the CMS, and removed from the
pending queue
@@ -187,7 +187,7 @@
assertEquals(1,queueItems.size());
//Deny publishing of this new version into the CMS
- pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()),
manager.toLowerCase(),false);
//Check for the success of this denial, and removal from the pending queue
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -23,10 +23,12 @@
package org.jboss.portal.test.cms.workflow;
import java.util.Set;
+
+import junit.framework.Assert;
import junit.framework.TestSuite;
import org.jboss.portal.cms.CMSException;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
/**
@@ -71,7 +73,7 @@
//Assert and make sure there is atleast one portal role that is allowed
//to function of content manager
- this.assertNotNull(managers);
- this.assertTrue(managers.size()>0);
+ Assert.assertNotNull(managers);
+ Assert.assertTrue(managers.size()>0);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -335,6 +335,7 @@
<fileset dir="${jboss.portal-theme.root}/lib"
includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib"
includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-search.root}/lib"
includes="portal-search-lib.jar"/>
+ <fileset dir="${jboss.portal-workflow.root}/lib"
includes="portal-workflow-lib.jar"/>
<fileset dir="${jboss.portal/modules/identity.root}/lib"
includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal/modules/identity.root}/lib"
includes="portal-identity-sso-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
@@ -346,6 +347,9 @@
<fileset dir="${freemarker.freemarker.lib}"
includes="freemarker.jar"/>
<fileset dir="${portals.bridges.lib}"
includes="portals-bridges-common.jar"/>
<fileset dir="${jboss/backport.concurrent.lib}"
includes="jboss-backport-concurrent.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm-identity.jar"/>
+
</copy>
<!--dtd-->
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -155,19 +155,13 @@
<content-uri>/default/index.html</content-uri>
</content>
<region>center</region>
- <height>0</height>
- </window>
- <window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
- <region>left</region>
<height>1</height>
</window>
<window>
- <window-name>CurrentUsersPortletWindow</window-name>
- <instance-ref>CurrentUsersPortletInstance</instance-ref>
- <region>left</region>
- <height>2</height>
+ <window-name>CoreIdentityUserPortletWindow</window-name>
+ <instance-ref>CoreIdentityUserPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
</window>
</page>
</portal>
@@ -351,17 +345,11 @@
<page>
<page-name>Members</page-name>
<window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
+ <window-name>CoreIdentityAdminPortletWindow</window-name>
+ <instance-ref>CoreIdentityAdminPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
- <window>
- <window-name>RolePortletWindow</window-name>
- <instance-ref>RolePortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
</page>
</portal>
</deployment>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-09-06 12:33:24 UTC (rev
8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-09-06 12:48:33 UTC (rev
8187)
@@ -271,18 +271,6 @@
<fileset dir="${source.bin}/portal-cms-war"/>
<fileset dir="${build.resources}/portal-cms-war"/>
</copy>
-
- <!-- workflow service -->
- <copy todir="${build.resources}/portal-cms/portal-workflow.sar">
- <fileset dir="${jboss.portal-workflow.root}/lib"
includes="portal-workflow-lib.jar"/>
- <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm.jar"/>
- <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm-identity.jar"/>
- <fileset
dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
- </copy>
- <!-- this war file is not needed for now -->
- <!--copy
todir="${build.resources}/portal-cms/portal-workflow.sar/portal-workflow.war">
- <fileset
dir="${jboss.portal-workflow.root}/lib/portal-workflow.war"/>
- </copy-->
</target>
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -55,13 +55,14 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.security.AuthorizationManager;
import org.jboss.portal.cms.security.CMSPermission;
import org.jboss.portal.cms.security.Criteria;
import org.jboss.portal.cms.security.Permission;
-import org.jboss.portal.cms.security.AuthorizationManager;
import org.jboss.portal.cms.security.PortalCMSSecurityContext;
import org.jboss.portal.cms.util.FileUtil;
import org.jboss.portal.cms.util.NodeUtil;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.AnonymousRole;
@@ -72,14 +73,12 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.search.FederatedQuery;
-import org.jboss.portal.search.Query;
import org.jboss.portal.search.impl.jcr.JCRQuery;
import org.jboss.portal.search.impl.jcr.JCRQueryConverter;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.workflow.WorkflowException;
-import org.jboss.portal.workflow.cms.ApprovePublish;
import org.jboss.portlet.JBossActionRequest;
import org.jboss.portlet.JBossActionResponse;
import org.jboss.portlet.JBossPortlet;
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -23,11 +23,10 @@
package org.jboss.portal.core.cms.ui.admin;
import java.io.IOException;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -41,7 +40,6 @@
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.Content;
-import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
/**
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -573,4 +573,93 @@
optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
</mbean>
+
+ <!-- ApprovePublish workflow service -->
+ <mbean
+ code="org.jboss.portal.cms.workflow.ApprovePublishImpl"
+ name="portal:service=ApprovePublish,type=Workflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="WorkflowService"
proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
+ <depends optional-attribute-name="IdentityServiceController"
proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+ <!-- JBPM process definition -->
+ <attribute name="Process">
+ <![CDATA[
+ <!-- cms approval workflow -->
+ <process-definition name="approval_workflow">
+ <start-state>
+ <transition to="request_approval"/>
+ </start-state>
+ <task-node name="request_approval" signal="first">
+ <task name="approve_publish">
+ <assignment
class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
+ <event type="task-start">
+ <action
class="org.jboss.portal.cms.workflow.FinalizePublish"/>
+ </event>
+ <exception-handler>
+ <action
class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
+ </exception-handler>
+ </task>
+ <transition name="approval" to="end"/>
+ <transition name="rejection" to="end"/>
+ </task-node>
+ <end-state name="end"/>
+ </process-definition>
+ ]]>
+ </attribute>
+ <!--
+ overwrite = false creates the process first time if does not exist, for
+ subsequent server restarts, this process definition remains in tact
+
+ overwrite = true creates the process first time if does not exist,
+ for subsequent server restarts, it creates a new version of the process
definition
+ which will be used for processes created from then onwards. Old processes
created
+ for an older version of the definition remain in tact and use their
corresponding
+ process definition.
+
+ Typically use overwrite=false and overwrite=true only when a new process
definition
+ related to this workflow needs to be deployed
+ -->
+ <attribute name="Overwrite">false</attribute>
+ <!--
+ a comma separated list of portal roles that are designated
+ to act as workflow managers. They are allowed to
+ approve/reject content publish requests
+ -->
+ <attribute name="ManagerRoles">Admin</attribute>
+ <attribute
name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
+
+ <!-- Now that a manager GUI is integrated..no need for email based manager
screen -->
+<!--
+ <attribute name="From">do-not-reply(a)jboss.com</attribute>
+ <attribute name="Subject">Content Approval
Requested</attribute>
+ <attribute name="Body">
+ <![CDATA[
+ Approval is needed to publish the following Content:
+
+ Content Location : {0}
+
+ Content Type : {1}
+
+ Content Size : {2}
+
+ Creation Date : {3}
+
+ User : {4}
+
+
+ <a
href="http://localhost/workflow/approve?pId={5}&manager={6}">Approve</a>
+
+
+ <a
href="http://localhost/workflow/reject?pId={7}&manager={8}">Reject</a>
+ ]]>
+ </attribute>
+-->
+ </mbean>
+
</server>
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-06
12:48:33 UTC (rev 8187)
@@ -91,7 +91,7 @@
{
%>
<%
- org.jboss.portal.workflow.cms.Content cour =
(org.jboss.portal.workflow.cms.Content)itr.next();
+ org.jboss.portal.cms.workflow.Content cour =
(org.jboss.portal.cms.workflow.Content)itr.next();
String linkPath = cour.getPath().substring(0,
cour.getPath().lastIndexOf("/"));
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-06
12:48:33 UTC (rev 8187)
@@ -341,7 +341,7 @@
{
%>
<%
- org.jboss.portal.workflow.cms.Content cour =
(org.jboss.portal.workflow.cms.Content)itr.next();
+ org.jboss.portal.cms.workflow.Content cour =
(org.jboss.portal.cms.workflow.Content)itr.next();
if (i % 2 == 0)
{
rowClass = "portlet-section-body";
Modified: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -165,18 +165,18 @@
description="Generate all target output."
depends="compile">
- <!-- widget-lib.jar -->
+ <!-- portal-widget-lib.jar -->
<mkdir dir="${build.lib}"/>
- <jar jarfile="${build.lib}/widget-lib.jar">
+ <jar jarfile="${build.lib}/portal-widget-lib.jar">
<fileset dir="${build.classes}"/>
</jar>
- <!-- widget.war -->
- <copy todir="${build.resources}/widget.war">
- <fileset dir="${build.resources}/widget-war"/>
+ <!-- portal-widget.war -->
+ <copy todir="${build.resources}/portal-widget.war">
+ <fileset dir="${build.resources}/portal-widget-war"/>
</copy>
- <copy todir="${build.resources}/widget.war/WEB-INF/lib">
- <fileset dir="${build.lib}"
includes="widget-lib.jar"/>
+ <copy todir="${build.resources}/portal-widget.war/WEB-INF/lib">
+ <fileset dir="${build.lib}"
includes="portal-widget-lib.jar"/>
</copy>
</target>
@@ -187,8 +187,8 @@
depends="artifacts">
<implode
- dir="${build.resources}/widget.war"
- tofile="${build.lib}/widget.war"/>
+ dir="${build.resources}/portal-widget.war"
+ tofile="${build.lib}/portal-widget.war"/>
</target>
@@ -228,14 +228,14 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-widget.war"
todir="${jboss.home}/server/${portal.deploy.dir}"/>
</target>
<target name="undeploy"
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete
file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
+ <delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
</target>
<target name="package-tests" depends="init, output">
@@ -265,7 +265,7 @@
<test todir="${test.reports}"
name="org.jboss.portal.test.widget.google.QueryResultParserTestCase"/>
</x-test>
<x-classpath>
- <pathelement location="${build.lib}/widget-lib.jar"/>
+ <pathelement location="${build.lib}/potal-widget-lib.jar"/>
<pathelement location="${build.resources}/test"/>
<path refid="beanshell.beanshell.classpath"/>
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war (from rev
8125, branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war)
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF
(from rev 8186, branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF)
Modified: branches/JBoss_Portal_Branch_2_6/workflow/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 12:33:24 UTC (rev
8186)
+++ branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 12:48:33 UTC (rev
8187)
@@ -171,13 +171,38 @@
<fileset dir="${build.classes}"/>
<!--fileset
dir="${build.resources}/portal-workflow-jar"/-->
</jar>
-
- <!-- create the war file, not needed anymore -->
- <!--copy todir="${build.lib}/portal-workflow.war">
+
+ <copy todir="${build.lib}/portal-workflow-war">
<fileset dir="${build.resources}/portal-workflow-war"/>
- </copy-->
+ </copy>
+
+ <jar jarfile="${build.lib}/portal-workflow.war">
+ <fileset dir="${build.lib}/portal-workflow-war"/>
+ </jar>
+
+ <!-- workflow service -->
+ <copy todir="${build.lib}/portal-workflow-sar">
+<!--
+ <fileset dir="${jboss.portal-workflow.root}/lib"
includes="portal-workflow-lib.jar, portal-workflow.war"/>
+ <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}"
includes="jbpm-identity.jar"/>
+-->
+ <fileset
dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
+ </copy>
+
+ <jar jarfile="${build.lib}/portal-workflow.sar">
+ <fileset dir="${build.lib}/portal-workflow-sar"/>
+ </jar>
+
</target>
-
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-workflow.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
+ </target>
+
<!--
generates artifacts used for tests, requires output to be previously run
-->
Added:
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.workflow.service;
+
+import org.jboss.logging.Logger;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.msg.command.CommandExecutorThread;
+import org.jbpm.scheduler.impl.SchedulerThread;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class JbpmThreadService implements JbpmThreadServiceMBean
+{
+
+ private String jbpmConfigurationResource = null;
+
+ private String jbpmContextName = null;
+
+// private String commandExecutorInterval = null;
+
+ private String schedulerInterval = null;
+
+ private String priority = null;
+
+// private String maxResultCount = null;
+
+ private Logger log = Logger.getLogger(JbpmThreadService.class);
+
+ private CommandExecutorThread commandExecutorThread = null;
+
+ private SchedulerThread schedulerThread = null;
+
+ public void start()
+ {
+ if (jbpmConfigurationResource==null) {
+ log.debug("using default jbpm cfg resource");
+ } else {
+ log.debug("using jbpm cfg resource:
'"+jbpmConfigurationResource+"'");
+ }
+
+ if (jbpmContextName==null) {
+ log.debug("using default jbpm context");
+ jbpmContextName = JbpmContext.DEFAULT_JBPM_CONTEXT_NAME;
+ } else {
+ log.debug("using jbpm context:
'"+jbpmContextName+"'");
+ }
+
+// int commandExecutorIntervalInt =
Integer.parseInt(getInitParameter(commandExecutorInterval, "5000"));
+ int schedulerIntervalInt = Integer.parseInt(getInitParameter(schedulerInterval,
"5000"));
+ int priorityInt = Integer.parseInt(getInitParameter(priority, "1"));
+// int maxResultCountInt = Integer.parseInt(getInitParameter(maxResultCount,
"1"));
+
+ JbpmConfiguration jbpmConfiguration =
JbpmConfiguration.getInstance(jbpmConfigurationResource);
+
+ commandExecutorThread = new CommandExecutorThread(jbpmConfiguration);
+// commandExecutorThread.setInterval(commandExecutorIntervalInt);
+ commandExecutorThread.setPriority(priorityInt);
+ commandExecutorThread.start();
+
+ schedulerThread = new SchedulerThread(jbpmConfiguration);
+ schedulerThread.setPriority(priorityInt);
+ schedulerThread.setInterval(schedulerIntervalInt);
+// schedulerThread.setMaxResultCount(maxResultCountInt);
+ schedulerThread.start();
+ }
+
+ protected String getInitParameter(String name, String defaultValue) {
+ if (name!=null) {
+ return name;
+ }
+ return defaultValue;
+ }
+
+ public void stop()
+ {
+ if ( (schedulerThread!=null)
+ && (schedulerThread.isAlive())
+ ) {
+ schedulerThread.destroy();
+ }
+ if ( (commandExecutorThread!=null)
+ && (commandExecutorThread.isAlive())
+ ) {
+ commandExecutorThread.destroy();
+ }
+
+ }
+
+ public String getJbpmConfigurationResource()
+ {
+ return jbpmConfigurationResource;
+ }
+
+ public void setJbpmConfigurationResource(String jbpmConfigurationResource)
+ {
+ this.jbpmConfigurationResource = jbpmConfigurationResource;
+ }
+
+ public String getJbpmContextName()
+ {
+ return jbpmContextName;
+ }
+
+ public void setJbpmContextName(String jbpmContextName)
+ {
+ this.jbpmContextName = jbpmContextName;
+ }
+
+ public String getSchedulerInterval()
+ {
+ return schedulerInterval;
+ }
+
+ public void setSchedulerInterval(String schedulerInterval)
+ {
+ this.schedulerInterval = schedulerInterval;
+ }
+
+ public String getPriority()
+ {
+ return priority;
+ }
+
+ public void setPriority(String priority)
+ {
+ this.priority = priority;
+ }
+
+ public SchedulerThread getSchedulerThread()
+ {
+ return schedulerThread;
+ }
+
+ public void setSchedulerThread(SchedulerThread schedulerThread)
+ {
+ this.schedulerThread = schedulerThread;
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.workflow.service;
+
+import org.jbpm.scheduler.impl.SchedulerThread;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface JbpmThreadServiceMBean
+{
+ public String getJbpmConfigurationResource();
+
+ public void setJbpmConfigurationResource(String jbpmConfigurationResource);
+
+ public String getJbpmContextName();
+
+ public void setJbpmContextName(String jbpmContextName);
+
+ public String getSchedulerInterval();
+
+ public void setSchedulerInterval(String schedulerInterval);
+
+ public String getPriority();
+
+ public void setPriority(String priority);
+
+ public SchedulerThread getSchedulerThread();
+
+ public void setSchedulerThread(SchedulerThread schedulerThread);
+
+}
+
Deleted:
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -1,151 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<server>
- <!-- Hibernate service -->
- <mbean
- code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
- name="portal:service=Hibernate,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
-
<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
- <attribute name="DoChecking">true</attribute>
- <attribute
name="ConfigLocation">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
- <attribute
name="JNDIName">java:/portal/workflow/WorkFlowSessionFactory</attribute>
- </mbean>
-
- <!-- Workflow service -->
- <mbean
- code="org.jboss.portal.workflow.service.WorkflowServiceImpl"
- name="portal:service=Workflow,type=WorkflowService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate,type=Workflow</depends>
- <attribute name="JbpmConfigurationXml">
- <![CDATA[
- <jbpm-configuration>
- <jbpm-context>
- <service name="persistence"
factory="org.jbpm.persistence.db.DbPersistenceServiceFactory"/>
- </jbpm-context>
- <string name="resource.hibernate.cfg.xml"
value="conf/hibernate/workflow/hibernate.cfg.xml"/>
- <string name="resource.business.calendar"
value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
- <string name="resource.default.modules"
value="org/jbpm/graph/def/jbpm.default.modules.properties"/>
- <string name="resource.converter"
value="org/jbpm/db/hibernate/jbpm.converter.properties"/>
- <string name="resource.action.types"
value="org/jbpm/graph/action/action.types.xml"/>
- <string name="resource.node.types"
value="org/jbpm/graph/node/node.types.xml"/>
- <string name="resource.varmapping"
value="org/jbpm/context/exe/jbpm.varmapping.xml"/>
- </jbpm-configuration>
- ]]>
- </attribute>
- </mbean>
-
- <!-- ApprovePublish workflow service -->
- <mbean
- code="org.jboss.portal.workflow.cms.ApprovePublishImpl"
- name="portal:service=ApprovePublish,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="WorkflowService"
proxy-type="attribute">
- portal:service=Workflow,type=WorkflowService
- </depends>
- <depends optional-attribute-name="IdentityServiceController"
proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
- </depends>
- <!-- JBPM process definition -->
- <attribute name="Process">
- <![CDATA[
- <!-- cms approval workflow -->
- <process-definition name="approval_workflow">
- <start-state>
- <transition to="request_approval"/>
- </start-state>
- <task-node name="request_approval" signal="first">
- <task name="approve_publish">
- <assignment
class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
- <event type="task-start">
- <action
class="org.jboss.portal.cms.workflow.FinalizePublish"/>
- </event>
- <exception-handler>
- <action
class="org.jboss.portal.workflow.cms.TaskExceptionHandler"/>
- </exception-handler>
- </task>
- <transition name="approval" to="end"/>
- <transition name="rejection" to="end"/>
- </task-node>
- <end-state name="end"/>
- </process-definition>
- ]]>
- </attribute>
- <!--
- overwrite = false creates the process first time if does not exist, for
- subsequent server restarts, this process definition remains in tact
-
- overwrite = true creates the process first time if does not exist,
- for subsequent server restarts, it creates a new version of the process
definition
- which will be used for processes created from then onwards. Old processes
created
- for an older version of the definition remain in tact and use their
corresponding
- process definition.
-
- Typically use overwrite=false and overwrite=true only when a new process
definition
- related to this workflow needs to be deployed
- -->
- <attribute name="Overwrite">false</attribute>
- <!--
- a comma separated list of portal roles that are designated
- to act as workflow managers. They are allowed to
- approve/reject content publish requests
- -->
- <attribute name="ManagerRoles">Admin</attribute>
- <attribute
name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
-
- <!-- Now that a manager GUI is integrated..no need for email based manager
screen -->
-<!--
- <attribute name="From">do-not-reply(a)jboss.com</attribute>
- <attribute name="Subject">Content Approval
Requested</attribute>
- <attribute name="Body">
- <![CDATA[
- Approval is needed to publish the following Content:
-
- Content Location : {0}
-
- Content Type : {1}
-
- Content Size : {2}
-
- Creation Date : {3}
-
- User : {4}
-
-
- <a
href="http://localhost/workflow/approve?pId={5}&manager={6}">Approve</a>
-
-
- <a
href="http://localhost/workflow/reject?pId={7}&manager={8}">Reject</a>
- ]]>
- </attribute>
--->
- </mbean>
-</server>
Added:
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -0,0 +1,71 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <!-- Hibernate service -->
+ <mbean
+ code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+ name="portal:service=Hibernate,type=Workflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+
<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+ <attribute name="DoChecking">true</attribute>
+ <attribute
name="ConfigLocation">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
+ <attribute
name="JNDIName">java:/portal/workflow/WorkFlowSessionFactory</attribute>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.workflow.service.JbpmThreadService"
+ name="portal:service=Thread,type=WorkflowService">
+ <attribute
name="JbpmConfigurationResource">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
+ </mbean>
+
+ <!-- Workflow service -->
+ <mbean
+ code="org.jboss.portal.workflow.service.WorkflowServiceImpl"
+ name="portal:service=Workflow,type=WorkflowService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate,type=Workflow</depends>
+ <attribute name="JbpmConfigurationXml">
+ <![CDATA[
+ <jbpm-configuration>
+ <jbpm-context>
+ <service name="persistence"
factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
+ <service name="scheduler"
factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
+ </jbpm-context>
+ <string name="resource.hibernate.cfg.xml"
value="conf/hibernate/workflow/hibernate.cfg.xml"/>
+ <string name="resource.business.calendar"
value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
+ <string name="resource.default.modules"
value="org/jbpm/graph/def/jbpm.default.modules.properties"/>
+ <string name="resource.converter"
value="org/jbpm/db/hibernate/jbpm.converter.properties"/>
+ <string name="resource.action.types"
value="org/jbpm/graph/action/action.types.xml"/>
+ <string name="resource.node.types"
value="org/jbpm/graph/node/node.types.xml"/>
+ <string name="resource.varmapping"
value="org/jbpm/context/exe/jbpm.varmapping.xml"/>
+ </jbpm-configuration>
+ ]]>
+ </attribute>
+ </mbean>
+
+</server>
Modified:
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -17,7 +17,7 @@
<!-- caching properties -->
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
- <property
name="cache.provider_configuration_file_resource_path">conf/hibernate/cms/ehcache.xml</property>
+ <property
name="cache.provider_configuration_file_resource_path">conf/hibernate/workflow/ehcache.xml</property>
<property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<!-- managed environment transaction configuration -->
Modified:
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-06
12:33:24 UTC (rev 8186)
+++
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-06
12:48:33 UTC (rev 8187)
@@ -1,43 +1,43 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<web-app
-
xmlns="http://java.sun.com/xml/ns/j2ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
- <servlet>
- <servlet-name>ApprovePublishServlet</servlet-name>
-
<servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
- <!--load-on-startup>0</load-on-startup-->
- </servlet>
- <servlet-mapping>
- <servlet-name>ApprovePublishServlet</servlet-name>
- <url-pattern>/approve/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>ApprovePublishServlet</servlet-name>
- <url-pattern>/reject/*</url-pattern>
- </servlet-mapping>
-</web-app>
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+ <servlet>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+
<servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+ <url-pattern>/approve/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+ <url-pattern>/reject/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>