Author: thomas.heute(a)jboss.com
Date: 2007-09-12 04:25:28 -0400 (Wed, 12 Sep 2007)
New Revision: 8236
Added:
trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/Content.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml
trunk/widget/src/resources/portal-widget-war/
trunk/widget/src/resources/portal-widget-war/WEB-INF/
trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/
trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp
trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml
trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml
trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
Removed:
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml
trunk/widget/src/resources/portal-widget-war/WEB-INF/
trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/
trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp
trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml
trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml
trunk/widget/src/resources/widget-war/
trunk/workflow/src/main/org/jboss/portal/workflow/cms/
trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
trunk/workflow/src/resources/portal-workflow-war/
Modified:
trunk/build/build-thirdparty.xml
trunk/build/build.xml
trunk/build/distrib.xml
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
trunk/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
trunk/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml
trunk/core-cms/build.xml
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml
trunk/core/build.xml
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
trunk/widget/build.xml
trunk/workflow/build.xml
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
Log:
Merge from 2_6 Branch.
- CMS/workflow seperation
- New identity portlets integration
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/build/build-thirdparty.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -85,14 +85,15 @@
<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="jboss-jsfunit"
version="1.0-snapshot"/>
<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="jcaptcha" version="1.0.6"/>
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/build/build.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -132,6 +132,7 @@
<module name="core-management"/>
<module name="core-admin"/>
<module name="core-wsrp"/>
+ <module name="core-identity"/>
<module name="search"/>
<module name="core-samples"/>
<module name="wsrp"/>
@@ -144,7 +145,7 @@
<group name="portal">
<include
- modules="common, test, api, web, jems, server, security, identity,
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="common, test, api, web, jems, server, security, identity,
search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme,
workflow, cms, registration, core, wsrp, core-admin, core-cms, core-management,
core-samples, core-identity, widget"/>
</group>
<group name="cms">
@@ -293,13 +294,14 @@
<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-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="../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"/>
<copy file="../core-samples/output/lib/portal-jsp-samples.war"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
<copy file="../core-samples/output/lib/portal-weather-samples.war"
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>
@@ -310,13 +312,14 @@
<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-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"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-jsp-samples.war"/>
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
<!--<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: trunk/build/distrib.xml
===================================================================
--- trunk/build/distrib.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/build/distrib.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -224,7 +224,6 @@
<antcall target="package-normal"/>
<antcall target="package-ha"/>
<antcall target="package-normal-bundled"/>
- <antcall target="package-ha-bundled"/>
</target>
<!--
@@ -243,9 +242,11 @@
<fileset
dir="${source.dir}/core-cms/output/resources/portal-cms.sar"
includes="**"/>
</copy>
<copy todir="${portal.build.normal.bin}/jboss-portal.sar">
- <fileset dir="${source.dir}/widget/output/resources"
includes="widget.war/**"/>
+ <fileset dir="${source.dir}/workflow/output/resources"
includes="portal-workflow.sar/**"/>
+ <fileset dir="${source.dir}/widget/output/resources"
includes="portal-widget.war/**"/>
<fileset dir="${source.dir}/core-management/output/resources"
includes="portal-management.sar/**"/>
<fileset dir="${source.dir}/core-admin/output/resources"
includes="portal-admin.sar/**"/>
+ <fileset dir="${source.dir}/core-identity/output/resources"
includes="portal-identity.sar/**"/>
</copy>
<copy todir="${portal.build.normal.bin}/jboss-portal.sar/samples">
<fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-jsp-samples.war/**"/>
@@ -273,9 +274,11 @@
<fileset
dir="${source.dir}/core-cms/output/resources/portal-cms-ha.sar"
includes="**"/>
</copy>
<copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar">
- <fileset dir="${source.dir}/widget/output/resources"
includes="widget.war/**"/>
+ <fileset dir="${source.dir}/workflow/output/resources"
includes="portal-workflow.sar/**"/>
+ <fileset dir="${source.dir}/widget/output/resources"
includes="portal-widget.war/**"/>
<fileset dir="${source.dir}/core-management/output/resources"
includes="portal-management.sar/**"/>
<fileset dir="${source.dir}/core-admin/output/resources"
includes="portal-admin.sar/**"/>
+ <fileset dir="${source.dir}/core-identity/output/resources"
includes="portal-identity.sar/**"/>
</copy>
<copy todir="${portal.build.ha.bin}/jboss-portal-ha.sar/samples">
<fileset dir="${source.dir}/core-samples/output/resources"
includes="portal-jsp-samples.war/**"/>
@@ -323,7 +326,7 @@
<!--
| JBoss Portal ha bundled distribution
-->
-
+ <!--
<target name="package-ha-bundled" depends="package-ha"
if="jboss.home"
description="package jboss-portal-ha bundled with JBoss AS">
<mkdir dir="${portal.build.ha.bundled}"/>
@@ -346,9 +349,9 @@
<antcall target="patch-log4j">
<param name="todir"
value="${portal.build.normal.bundled}/server/default"/>
</antcall>
+ </target>
+ -->
- </target>
-
<!-- Create packages -->
<target name="zip">
Modified:
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-12 08:04:19 UTC
(rev 8235)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-12 08:25:28 UTC
(rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-12
08:04:19 UTC (rev 8235)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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;
Copied: trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java (from rev
8187,
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java)
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
(rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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();
+}
Copied: trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java (from rev
8187,
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java)
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
(rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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;
+ }
+}
Copied: trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java (from
rev 8187,
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java)
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
(rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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());
+ }
+ }
+}
Copied: trunk/cms/src/main/org/jboss/portal/cms/workflow/Content.java (from rev 8187,
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java)
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/Content.java
(rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/Content.java 2007-09-12 08:25:28 UTC
(rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-12
08:04:19 UTC (rev 8235)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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);
/**
*
Copied: trunk/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java (from
rev 8187,
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java)
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
(rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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:
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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:
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
===================================================================
---
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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:
trunk/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml
===================================================================
---
trunk/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -185,7 +185,7 @@
</property>
</bean>
- <bean name="ApprovePublish"
class="org.jboss.portal.workflow.cms.ApprovePublishImpl">
+ <bean name="ApprovePublish"
class="org.jboss.portal.cms.workflow.ApprovePublishImpl">
<property name="workflowService"><inject
bean="WorkflowService"/></property>
<property name="identityServiceController"><inject
bean="IdentityServiceController"/></property>
<property name="overwrite">false</property>
@@ -205,7 +205,7 @@
<action
class="org.jboss.portal.cms.workflow.FinalizePublish"/>
</event>
<exception-handler>
- <action
class="org.jboss.portal.workflow.cms.TaskExceptionHandler"/>
+ <action
class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
</exception-handler>
</task>
<transition name="approval" to="end"/>
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/core/build.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -333,6 +333,7 @@
<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-identity.root}/lib"
includes="portal-identity-lib.jar"/>
+ <fileset dir="${jboss.portal-workflow.root}/lib"
includes="portal-workflow-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib"
includes="portal-registration-lib.jar"/>
<fileset dir="${ehcache.ehcache.lib}"
includes="ehcache.jar"/>
<fileset dir="${apache.collections.lib}"
includes="commons-collections.jar"/>
@@ -342,6 +343,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: trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-12
08:04:19 UTC (rev 8235)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -155,11 +155,11 @@
<content-uri>/default/index.html</content-uri>
</content>
<region>center</region>
- <height>0</height>
+ <height>1</height>
</window>
<window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
+ <window-name>IdentityUserPortletWindow</window-name>
+ <instance-ref>IdentityUserPortletInstance</instance-ref>
<region>left</region>
<height>1</height>
</window>
@@ -303,8 +303,8 @@
<height>0</height>
</window>
<window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
+ <window-name>IdentityUserPortletWindow</window-name>
+ <instance-ref>IdentityUserPortletInstance</instance-ref>
<region>left</region>
<height>1</height>
</window>
@@ -345,17 +345,11 @@
<page>
<page-name>Members</page-name>
<window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
+ <window-name>IdentityAdminPortletWindow</window-name>
+ <instance-ref>IdentityAdminPortletInstance</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>
Copied: trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow (from rev 8230,
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/hibernate/workflow)
Deleted: trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml 2007-09-11
15:27:23 UTC (rev 8230)
+++
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -1,61 +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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<ehcache>
-
- <!-- Sets the path to the directory where cache .data files are created.
-
- If the path is a Java System Property it is replaced by
- its value in the running VM.
-
- The following properties are translated:
- user.home - User's home directory
- user.dir - User's current working directory
- java.io.tmpdir - Default temp file path -->
- <diskStore path="java.io.tmpdir/workflow"/>
-
-
- <!--Default Cache configuration. These will applied to caches programmatically
created through
- the CacheManager.
-
- The following attributes are required for defaultCache:
-
- maxInMemory - Sets the maximum number of objects that will be created in memory
- eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
- is never expired.
- timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only
used
- if the element is not eternal. Idle time is now - last accessed
time
- timeToLiveSeconds - Sets the time to live for an element before it expires. Is only
used
- if the element is not eternal. TTL is now - creation time
- overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
- has reached the maxInMemory limit.
-
- -->
- <defaultCache
- maxElementsInMemory="10000"
- eternal="false"
- timeToIdleSeconds="120"
- timeToLiveSeconds="120"
- overflowToDisk="false"
- />
-</ehcache>
Copied: trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml (from
rev 8230,
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml
(rev 0)
+++
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/ehcache.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,61 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<ehcache>
+
+ <!-- Sets the path to the directory where cache .data files are created.
+
+ If the path is a Java System Property it is replaced by
+ its value in the running VM.
+
+ The following properties are translated:
+ user.home - User's home directory
+ user.dir - User's current working directory
+ java.io.tmpdir - Default temp file path -->
+ <diskStore path="java.io.tmpdir/workflow"/>
+
+
+ <!--Default Cache configuration. These will applied to caches programmatically
created through
+ the CacheManager.
+
+ The following attributes are required for defaultCache:
+
+ maxInMemory - Sets the maximum number of objects that will be created in memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only
used
+ if the element is not eternal. Idle time is now - last accessed
time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is only
used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
+ has reached the maxInMemory limit.
+
+ -->
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="120"
+ timeToLiveSeconds="120"
+ overflowToDisk="false"
+ />
+</ehcache>
Deleted:
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-11
15:27:23 UTC (rev 8230)
+++
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -1,170 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
-
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-
-<hibernate-configuration>
- <session-factory>
- <!-- jdbc connection properties -->
- <property
name="connection.datasource">java:@portal.datasource.name@</property>
-
- <!-- other hibernate properties -->
- <property name="show_sql">@portal.sql.show(a)</property>
- <property name="hibernate.format_sql">true</property>
- <property name="hibernate.use_sql_comments">true</property>
-
- <!-- 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/workflow/ehcache.xml</property>
- <property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
-
- <!-- managed environment transaction configuration -->
- <property
name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
- <property
name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
-
- <!-- ############################################ -->
- <!-- # mapping files with external dependencies # -->
- <!-- ############################################ -->
-
- <!-- following mapping file has a dependendy on -->
- <!-- 'bsh-{version}.jar'. -->
- <!-- uncomment this if you don't have bsh on your -->
- <!-- classpath. you won't be able to use the -->
- <!-- script element in process definition files -->
- <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
-
- <!-- following mapping files have a dependendy on -->
- <!-- 'jbpm-identity-{version}.jar', mapping files -->
- <!-- of the pluggable jbpm identity component. -->
- <!-- comment out the following 3 lines if you don't-->
- <!-- want to use the default jBPM identity mgmgt -->
- <!-- component -->
- <mapping resource="org/jbpm/identity/User.hbm.xml"/>
- <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
- <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
-
- <!-- ###################### -->
- <!-- # jbpm mapping files # -->
- <!-- ###################### -->
-
- <!-- hql queries and type defs -->
- <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
-
- <!-- graph.def mapping files -->
- <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
- <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
-
- <!-- graph.node mapping files -->
- <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
- <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
-
- <!-- context.def mapping files -->
- <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
-
- <!-- taskmgmt.def mapping files -->
- <mapping
resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
-
- <!-- module.def mapping files -->
- <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
-
- <!-- bytes mapping files -->
- <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
-
- <!-- file.def mapping files -->
- <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
-
- <!-- scheduler.def mapping files -->
- <mapping
resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
- <mapping
resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
-
- <!-- graph.exe mapping files -->
- <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
- <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
-
- <!-- module.exe mapping files -->
- <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
-
- <!-- context.exe mapping files -->
- <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
- <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
- <mapping
resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
-
- <!-- msg.db mapping files -->
- <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
- <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
- <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
- <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
- <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
- <mapping
resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
-
- <!-- taskmgmt.exe mapping files -->
- <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
-
- <!-- scheduler.exe mapping files -->
- <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
-
- <!-- logging mapping files -->
- <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
- <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
- <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
- <mapping
resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
- <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
- <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
- <mapping
resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
- <mapping
resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
-
- </session-factory>
-</hibernate-configuration>
Copied: trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml
(from rev 8230,
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml)
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml
(rev 0)
+++
trunk/core/src/resources/portal-core-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,170 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- jdbc connection properties -->
+ <property
name="connection.datasource">java:@portal.datasource.name@</property>
+
+ <!-- other hibernate properties -->
+ <property name="show_sql">@portal.sql.show(a)</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="hibernate.use_sql_comments">true</property>
+
+ <!-- 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/workflow/ehcache.xml</property>
+ <property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+
+ <!-- managed environment transaction configuration -->
+ <property
name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property
name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity-{version}.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- comment out the following 3 lines if you don't-->
+ <!-- want to use the default jBPM identity mgmgt -->
+ <!-- component -->
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping
resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping
resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping
resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- msg.db mapping files -->
+ <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
+ <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
+ <mapping
resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- scheduler.exe mapping files -->
+ <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping
resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
Modified: trunk/core-cms/build.xml
===================================================================
--- trunk/core-cms/build.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/core-cms/build.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -270,18 +270,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: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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;
@@ -77,7 +78,6 @@
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;
@@ -1549,4 +1549,4 @@
this.setApprovePublish(null);
}
}
-}
\ No newline at end of file
+}
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-12
08:04:19 UTC (rev 8235)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
---
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
---
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml 2007-09-12 08:04:19 UTC
(rev 8235)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml 2007-09-12 08:25:28 UTC
(rev 8236)
@@ -43,4 +43,17 @@
<servlet-name>CMSExportServlet</servlet-name>
<url-pattern>/cmsexport/*</url-pattern>
</servlet-mapping>
+
+ <servlet>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+
<servlet-class>org.jboss.portal.cms.workflow.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>
Modified: trunk/widget/build.xml
===================================================================
--- trunk/widget/build.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/widget/build.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -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}/portal-widget-lib.jar"/>
<pathelement location="${build.resources}/test"/>
<path refid="beanshell.beanshell.classpath"/>
Copied: trunk/widget/src/resources/portal-widget-war (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war)
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF)
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp)
Deleted: trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp 2007-09-06
12:48:33 UTC (rev 8187)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp 2007-09-12 08:25:28
UTC (rev 8236)
@@ -1,262 +0,0 @@
-<%@ page import="org.jboss.portal.widget.google.provider.GGQueryResult"
%>
-<%@ page import="org.jboss.portal.widget.google.provider.GGProvider" %>
-<%@ page import="java.util.Iterator" %>
-<%@ page import="org.jboss.portal.widget.google.GGWidget" %>
-<%@ page import="org.jboss.portal.widget.google.info.GGPreferenceInfo"
%>
-<%@ page import="org.jboss.portal.widget.google.type.DataType" %>
-<%@ page import="org.jboss.portal.widget.google.info.GGWidgetCategoryInfo"
%>
-<%@ page import="org.jboss.portal.widget.google.provider.GGQuery" %>
-<%@ page import="org.jboss.portal.widget.google.type.EnumType" %>
-<%@ page import="javax.portlet.PortletURL" %>
-<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
-<%@ page import="java.util.Collection" %>
-<%@ page language="java"%>
-<%@ taglib
uri="http://java.sun.com/portlet" prefix="p" %>
-<%@ page isELIgnored="false" %>
-
-<p:defineObjects/>
-<div>
-
-<%
- // Get useful request attributes
- GGProvider provider = (GGProvider)request.getAttribute("provider");
-
- // Get the selected widget if any
- GGWidget selWidget = null;
- String uri = request.getParameter("content.uri");
- if (uri != null)
- {
- selWidget = provider.getWidget(uri);
- }
-
- // Get query term
- String queryTerm = request.getParameter("query");
- if (queryTerm == null)
- {
- queryTerm = "";
- }
-
- // Get category term
- String catTerm = request.getParameter("cat");
- if (catTerm == null)
- {
- catTerm = "";
- }
-
- // Compute query
- GGQuery query = new GGQuery(0, catTerm, queryTerm, request.getLocale());
- Collection widgets = provider.search(query);
-
- String ggPickMethod = request.getParameter("gg_pick_method");
- boolean uriPickMethod = false;
- if (ggPickMethod != null && ggPickMethod.equals("uri"))
- {
- uriPickMethod = true;
- }
- else
- {
- }
-%>
-<div id="<p:namespace/>selection">
- <input type="RADIO" name="gg_pick_method"
value="directory" <%= !uriPickMethod ? "CHECKED" : ""
%>
onclick="document.getElementById('<p:namespace/>directory_search_div').style.display
= 'block';
document.getElementById('<p:namespace/>gadget_url_div').style.display =
'none'; "> Gadget Directory
- <input type="RADIO" name="gg_pick_method" value="uri"
<%= uriPickMethod ? "CHECKED" : "" %>
onclick="document.getElementById('<p:namespace/>directory_search_div').style.display
= 'none';
document.getElementById('<p:namespace/>gadget_url_div').style.display =
'block'; "> Gadget URI
- <br>
- <hr>
-</div>
-
-<div id="<p:namespace/>gadget_url_div" style="display: <%=
uriPickMethod ? "block" : "none" %>;">
- <%
- PortletURL contentURL = renderResponse.createActionURL();
-
contentURL.setParameter("content.action.select","content.action.select");
- contentURL.setParameter("gg_pick_method", "uri");
- %>
- <form action="<%= contentURL %>" method="post">
-
- <%
- if (uri != null && selWidget == null)
- {
-
- %>
- <p style="color: red;">
- <%
- out.println("Failed to obtain widget with URI: " + uri);
- %>
- </p>
- <%
- }
- else if (selWidget != null)
- {
- %>
- <p style="color: blue;">
- Selected Widget: <%=
selWidget.getDirectoryTitle().getDefaultString().length() > 0 ?
selWidget.getDirectoryTitle().getDefaultString() : selWidget.getTitle().getDefaultString()
%>
- </p>
- <%
- }
- %>
-
- <input type="text" name="content.uri" value="<%= uri
!= null ? uri : "" %>" class="portlet-form-field"/>
- <input type="submit" value="Select Gadget"
class="portlet-form-button"/>
- </form>
-</div>
-
-<div id="<p:namespace/>directory_search_div" style="display:
<%= !uriPickMethod ? "block" : "none" %>;">
-
- <form action="<p:renderURL></p:renderURL>"
method="post">
- <input type="text" name="query"
class="portlet-form-field"/>
- <select name="cat" class="portlet-form-field">
- <option value=""> </option>
- <%
- for (Iterator i = provider.getCategories().iterator(); i.hasNext();)
- {
- GGWidgetCategoryInfo cat = (GGWidgetCategoryInfo)i.next();
- boolean selected = cat.getName().equals(catTerm);
- %>
- <option value="<%= cat.getName() %>" <%= selected ?
"selected=\"selected\"" : "" %>><%=
cat.getDisplayName() %></option>
- <%
- }
- %>
- </select>
- <input type="submit" value="Search Gadgets"
class="portlet-form-button"/>
- </form>
-
- <p>
- <table style="width:100%;border:1px solid" cellspacing="0"
cellpadding="0">
- <%
- for (IteratorStatus i = new IteratorStatus(widgets.iterator());
i.hasNext();)
- {
- GGWidget widget = (GGWidget)i.next();
- boolean selected = selWidget != null &&
selWidget.getId().equals(widget.getId());
- PortletURL selectURL = renderResponse.createActionURL();
-
- // Set parameters for selection
- selectURL.setParameter("content.action.select",
"content.action.select");
- selectURL.setParameter("content.uri", widget.getId());
-
- // Set default parametrization state
- for (Iterator j =
widget.getInfo().getPreferences().getPreferences().iterator(); j.hasNext();)
- {
- GGPreferenceInfo prefInfo = (GGPreferenceInfo)j.next();
- String paramName = "content.param." + prefInfo.getName();
- String defaultValue = prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "";
- selectURL.setParameter(paramName, defaultValue);
- }
-
- // Propagage search nav state
- selectURL.setParameter("cat", catTerm);
- selectURL.setParameter("query", queryTerm);
-
- //
- String rowClass = selected ? "portlet-section-selected" :
(i.getIndex() % 2 == 0 ? "portlet-section-body" :
"portlet-section-alternate");
- %>
- <tr class="<%= rowClass %>">
- <td><a href="<%= selectURL %>"><%=
widget.getDirectoryTitle().getDefaultString().length() > 0 ?
widget.getDirectoryTitle().getDefaultString() : widget.getTitle().getDefaultString()
%></a></td>
- </tr>
- <%
- }
- %>
- </table>
- </p>
-
-</div>
-<div>
- <%
- if (selWidget != null &&
!selWidget.getInfo().getPreferences().getPreferences().isEmpty())
- {
- PortletURL selectURL = renderResponse.createActionURL();
-
- // Set parameters for selection
- selectURL.setParameter("content.action.select",
"content.action.select");
- selectURL.setParameter("content.uri", selWidget.getId());
-
- // Propagage search nav state
- selectURL.setParameter("cat", catTerm);
- selectURL.setParameter("query", queryTerm);
-
- //propagate visable div
- if (uriPickMethod)
- {
- selectURL.setParameter("gg_pick_method", "uri");
- }
- %>
- <p>
- <form action="<%= selectURL %>" method="post">
- <%
- for (Iterator i =
selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
- {
- GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
- if (prefInfo.getType().getOrdinal() == DataType.HIDDEN)
- {
-
- %>
- <input type="hidden" name="content.param.<%=
prefInfo.getName() %>" value="<%= prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "" %>"/>
- <%
- }
- }
- %>
- <table>
- <tbody>
- <%
- for (Iterator i =
selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
- {
- GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
-
- // Get param value from nav state otherwise we use the default
value
- String prefValue = request.getParameter("content.param." +
prefInfo.getName());
- if (prefValue == null)
- {
- prefInfo.getDefaultValue();
- }
- if (prefValue == null)
- {
- prefValue = "";
- }
- %>
- <tr>
- <td><%= prefInfo.getDisplayName() != null ?
prefInfo.getDisplayName() : prefInfo.getName() %>:</td>
- <%
- switch (prefInfo.getType().getOrdinal())
- {
- case DataType.HIDDEN:
- break;
- case DataType.ENUM:
- %>
- <td><select name="content.param.<%= prefInfo.getName()
%>" class="portlet-form-field">
- <%
- EnumType e = (EnumType)prefInfo.getType();
- for (int j = 0;j < e.getSize();j++)
- {
- EnumType.Value value = e.getValue(j);
- boolean selected = value.getValue().equals(prefValue);
- %>
- <option <%= selected ?
"selected=\"selected\"" : "" %> value="<%=
value.getValue() %>"><%= value.getDisplayValue() != null ?
value.getDisplayValue() : value.getValue() %></option>
- <%
- }
- %>
- </select></td>
- <%
- break;
- default:
- %>
- <td><input type="text"
name="content.param.<%= prefInfo.getName() %>"
class="portlet-form-field" value="<%= prefValue
%>"/></td>
- <%
- break;
- }
- %>
- </tr>
- <%
- }
- %>
- <tr>
- <td colspan="2"><input type="submit"
value="Update" class="portlet-form-button"/></td>
- </tr>
- </tbody>
- </table>
- </form>
- </p>
- <%
- }
- %>
-</div>
-
-</div>
-
\ No newline at end of file
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp)
===================================================================
--- trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp
(rev 0)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/jsp/edit.jsp 2007-09-12 08:25:28
UTC (rev 8236)
@@ -0,0 +1,262 @@
+<%@ page import="org.jboss.portal.widget.google.provider.GGQueryResult"
%>
+<%@ page import="org.jboss.portal.widget.google.provider.GGProvider" %>
+<%@ page import="java.util.Iterator" %>
+<%@ page import="org.jboss.portal.widget.google.GGWidget" %>
+<%@ page import="org.jboss.portal.widget.google.info.GGPreferenceInfo"
%>
+<%@ page import="org.jboss.portal.widget.google.type.DataType" %>
+<%@ page import="org.jboss.portal.widget.google.info.GGWidgetCategoryInfo"
%>
+<%@ page import="org.jboss.portal.widget.google.provider.GGQuery" %>
+<%@ page import="org.jboss.portal.widget.google.type.EnumType" %>
+<%@ page import="javax.portlet.PortletURL" %>
+<%@ page import="org.jboss.portal.common.util.IteratorStatus" %>
+<%@ page import="java.util.Collection" %>
+<%@ page language="java"%>
+<%@ taglib
uri="http://java.sun.com/portlet" prefix="p" %>
+<%@ page isELIgnored="false" %>
+
+<p:defineObjects/>
+<div>
+
+<%
+ // Get useful request attributes
+ GGProvider provider = (GGProvider)request.getAttribute("provider");
+
+ // Get the selected widget if any
+ GGWidget selWidget = null;
+ String uri = request.getParameter("content.uri");
+ if (uri != null)
+ {
+ selWidget = provider.getWidget(uri);
+ }
+
+ // Get query term
+ String queryTerm = request.getParameter("query");
+ if (queryTerm == null)
+ {
+ queryTerm = "";
+ }
+
+ // Get category term
+ String catTerm = request.getParameter("cat");
+ if (catTerm == null)
+ {
+ catTerm = "";
+ }
+
+ // Compute query
+ GGQuery query = new GGQuery(0, catTerm, queryTerm, request.getLocale());
+ Collection widgets = provider.search(query);
+
+ String ggPickMethod = request.getParameter("gg_pick_method");
+ boolean uriPickMethod = false;
+ if (ggPickMethod != null && ggPickMethod.equals("uri"))
+ {
+ uriPickMethod = true;
+ }
+ else
+ {
+ }
+%>
+<div id="<p:namespace/>selection">
+ <input type="RADIO" name="gg_pick_method"
value="directory" <%= !uriPickMethod ? "CHECKED" : ""
%>
onclick="document.getElementById('<p:namespace/>directory_search_div').style.display
= 'block';
document.getElementById('<p:namespace/>gadget_url_div').style.display =
'none'; "> Gadget Directory
+ <input type="RADIO" name="gg_pick_method" value="uri"
<%= uriPickMethod ? "CHECKED" : "" %>
onclick="document.getElementById('<p:namespace/>directory_search_div').style.display
= 'none';
document.getElementById('<p:namespace/>gadget_url_div').style.display =
'block'; "> Gadget URI
+ <br>
+ <hr>
+</div>
+
+<div id="<p:namespace/>gadget_url_div" style="display: <%=
uriPickMethod ? "block" : "none" %>;">
+ <%
+ PortletURL contentURL = renderResponse.createActionURL();
+
contentURL.setParameter("content.action.select","content.action.select");
+ contentURL.setParameter("gg_pick_method", "uri");
+ %>
+ <form action="<%= contentURL %>" method="post">
+
+ <%
+ if (uri != null && selWidget == null)
+ {
+
+ %>
+ <p style="color: red;">
+ <%
+ out.println("Failed to obtain widget with URI: " + uri);
+ %>
+ </p>
+ <%
+ }
+ else if (selWidget != null)
+ {
+ %>
+ <p style="color: blue;">
+ Selected Widget: <%=
selWidget.getDirectoryTitle().getDefaultString().length() > 0 ?
selWidget.getDirectoryTitle().getDefaultString() : selWidget.getTitle().getDefaultString()
%>
+ </p>
+ <%
+ }
+ %>
+
+ <input type="text" name="content.uri" value="<%= uri
!= null ? uri : "" %>" class="portlet-form-field"/>
+ <input type="submit" value="Select Gadget"
class="portlet-form-button"/>
+ </form>
+</div>
+
+<div id="<p:namespace/>directory_search_div" style="display:
<%= !uriPickMethod ? "block" : "none" %>;">
+
+ <form action="<p:renderURL></p:renderURL>"
method="post">
+ <input type="text" name="query"
class="portlet-form-field"/>
+ <select name="cat" class="portlet-form-field">
+ <option value=""> </option>
+ <%
+ for (Iterator i = provider.getCategories().iterator(); i.hasNext();)
+ {
+ GGWidgetCategoryInfo cat = (GGWidgetCategoryInfo)i.next();
+ boolean selected = cat.getName().equals(catTerm);
+ %>
+ <option value="<%= cat.getName() %>" <%= selected ?
"selected=\"selected\"" : "" %>><%=
cat.getDisplayName() %></option>
+ <%
+ }
+ %>
+ </select>
+ <input type="submit" value="Search Gadgets"
class="portlet-form-button"/>
+ </form>
+
+ <p>
+ <table style="width:100%;border:1px solid" cellspacing="0"
cellpadding="0">
+ <%
+ for (IteratorStatus i = new IteratorStatus(widgets.iterator());
i.hasNext();)
+ {
+ GGWidget widget = (GGWidget)i.next();
+ boolean selected = selWidget != null &&
selWidget.getId().equals(widget.getId());
+ PortletURL selectURL = renderResponse.createActionURL();
+
+ // Set parameters for selection
+ selectURL.setParameter("content.action.select",
"content.action.select");
+ selectURL.setParameter("content.uri", widget.getId());
+
+ // Set default parametrization state
+ for (Iterator j =
widget.getInfo().getPreferences().getPreferences().iterator(); j.hasNext();)
+ {
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)j.next();
+ String paramName = "content.param." + prefInfo.getName();
+ String defaultValue = prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "";
+ selectURL.setParameter(paramName, defaultValue);
+ }
+
+ // Propagage search nav state
+ selectURL.setParameter("cat", catTerm);
+ selectURL.setParameter("query", queryTerm);
+
+ //
+ String rowClass = selected ? "portlet-section-selected" :
(i.getIndex() % 2 == 0 ? "portlet-section-body" :
"portlet-section-alternate");
+ %>
+ <tr class="<%= rowClass %>">
+ <td><a href="<%= selectURL %>"><%=
widget.getDirectoryTitle().getDefaultString().length() > 0 ?
widget.getDirectoryTitle().getDefaultString() : widget.getTitle().getDefaultString()
%></a></td>
+ </tr>
+ <%
+ }
+ %>
+ </table>
+ </p>
+
+</div>
+<div>
+ <%
+ if (selWidget != null &&
!selWidget.getInfo().getPreferences().getPreferences().isEmpty())
+ {
+ PortletURL selectURL = renderResponse.createActionURL();
+
+ // Set parameters for selection
+ selectURL.setParameter("content.action.select",
"content.action.select");
+ selectURL.setParameter("content.uri", selWidget.getId());
+
+ // Propagage search nav state
+ selectURL.setParameter("cat", catTerm);
+ selectURL.setParameter("query", queryTerm);
+
+ //propagate visable div
+ if (uriPickMethod)
+ {
+ selectURL.setParameter("gg_pick_method", "uri");
+ }
+ %>
+ <p>
+ <form action="<%= selectURL %>" method="post">
+ <%
+ for (Iterator i =
selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
+ {
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+ if (prefInfo.getType().getOrdinal() == DataType.HIDDEN)
+ {
+
+ %>
+ <input type="hidden" name="content.param.<%=
prefInfo.getName() %>" value="<%= prefInfo.getDefaultValue() != null ?
prefInfo.getDefaultValue() : "" %>"/>
+ <%
+ }
+ }
+ %>
+ <table>
+ <tbody>
+ <%
+ for (Iterator i =
selWidget.getInfo().getPreferences().getPreferences().iterator(); i.hasNext();)
+ {
+ GGPreferenceInfo prefInfo = (GGPreferenceInfo)i.next();
+
+ // Get param value from nav state otherwise we use the default
value
+ String prefValue = request.getParameter("content.param." +
prefInfo.getName());
+ if (prefValue == null)
+ {
+ prefInfo.getDefaultValue();
+ }
+ if (prefValue == null)
+ {
+ prefValue = "";
+ }
+ %>
+ <tr>
+ <td><%= prefInfo.getDisplayName() != null ?
prefInfo.getDisplayName() : prefInfo.getName() %>:</td>
+ <%
+ switch (prefInfo.getType().getOrdinal())
+ {
+ case DataType.HIDDEN:
+ break;
+ case DataType.ENUM:
+ %>
+ <td><select name="content.param.<%= prefInfo.getName()
%>" class="portlet-form-field">
+ <%
+ EnumType e = (EnumType)prefInfo.getType();
+ for (int j = 0;j < e.getSize();j++)
+ {
+ EnumType.Value value = e.getValue(j);
+ boolean selected = value.getValue().equals(prefValue);
+ %>
+ <option <%= selected ?
"selected=\"selected\"" : "" %> value="<%=
value.getValue() %>"><%= value.getDisplayValue() != null ?
value.getDisplayValue() : value.getValue() %></option>
+ <%
+ }
+ %>
+ </select></td>
+ <%
+ break;
+ default:
+ %>
+ <td><input type="text"
name="content.param.<%= prefInfo.getName() %>"
class="portlet-form-field" value="<%= prefValue
%>"/></td>
+ <%
+ break;
+ }
+ %>
+ </tr>
+ <%
+ }
+ %>
+ <tr>
+ <td colspan="2"><input type="submit"
value="Update" class="portlet-form-button"/></td>
+ </tr>
+ </tbody>
+ </table>
+ </form>
+ </p>
+ <%
+ }
+ %>
+</div>
+
+</div>
+
\ No newline at end of file
Deleted: trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml 2007-09-06
12:48:33 UTC (rev 8187)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -1,36 +0,0 @@
-<?xml version="1.0" standalone="yes"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
- "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
-
-<deployments>
- <deployment>
- <instance>
- <instance-id>GoogleWidgetPortletInstance</instance-id>
- <portlet-ref>GoogleWidgetPortlet</portlet-ref>
- </instance>
- </deployment>
-</deployments>
\ No newline at end of file
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml (from
rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml)
===================================================================
--- trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml
(rev 0)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet-instances.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>GoogleWidgetPortletInstance</instance-id>
+ <portlet-ref>GoogleWidgetPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Deleted: trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-09-06
12:48:33 UTC (rev 8187)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-09-12 08:25:28
UTC (rev 8236)
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ 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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<portlet-app
-
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
- version="1.0">
- <portlet>
- <description>Google Widget Portlet</description>
- <portlet-name>GoogleWidgetPortlet</portlet-name>
- <display-name>Google Widget Portlet</display-name>
- <portlet-class>org.jboss.portal.widget.WidgetPortlet</portlet-class>
- <init-param>
- <description>Connection timeout when retreiving gadgets from google
directory</description>
- <name>connectionTimeout</name>
- <value>5000</value>
- </init-param>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT_CONTENT</portlet-mode>
- </supports>
- <portlet-info>
- <title>Google Widget</title>
- <keywords>widget</keywords>
- </portlet-info>
- </portlet>
-</portlet-app>
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml)
===================================================================
--- trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml
(rev 0)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/portlet.xml 2007-09-12 08:25:28
UTC (rev 8236)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Google Widget Portlet</description>
+ <portlet-name>GoogleWidgetPortlet</portlet-name>
+ <display-name>Google Widget Portlet</display-name>
+ <portlet-class>org.jboss.portal.widget.WidgetPortlet</portlet-class>
+ <init-param>
+ <description>Connection timeout when retreiving gadgets from google
directory</description>
+ <name>connectionTimeout</name>
+ <value>5000</value>
+ </init-param>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT_CONTENT</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Google Widget</title>
+ <keywords>widget</keywords>
+ </portlet-info>
+ </portlet>
+</portlet-app>
Deleted: trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/web.xml 2007-09-06
12:48:33 UTC (rev 8187)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml 2007-09-12 08:25:28 UTC
(rev 8236)
@@ -1,41 +0,0 @@
-<?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">
- <context-param>
- <param-name>org.jboss.portal.content_type</param-name>
- <param-value>widget/google</param-value>
- </context-param>
- <context-param>
- <param-name>org.jboss.portal.portlet_instance</param-name>
- <param-value>GoogleWidgetPortletInstance</param-value>
- </context-param>
- <listener>
-
<listener-class>org.jboss.portlet.content.ContentTypeRegistration</listener-class>
- </listener>
-</web-app>
Copied: trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml (from rev 8187,
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/web.xml)
===================================================================
--- trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml
(rev 0)
+++ trunk/widget/src/resources/portal-widget-war/WEB-INF/web.xml 2007-09-12 08:25:28 UTC
(rev 8236)
@@ -0,0 +1,41 @@
+<?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">
+ <context-param>
+ <param-name>org.jboss.portal.content_type</param-name>
+ <param-value>widget/google</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.jboss.portal.portlet_instance</param-name>
+ <param-value>GoogleWidgetPortletInstance</param-value>
+ </context-param>
+ <listener>
+
<listener-class>org.jboss.portlet.content.ContentTypeRegistration</listener-class>
+ </listener>
+</web-app>
Modified: trunk/workflow/build.xml
===================================================================
--- trunk/workflow/build.xml 2007-09-12 08:04:19 UTC (rev 8235)
+++ trunk/workflow/build.xml 2007-09-12 08:25:28 UTC (rev 8236)
@@ -134,10 +134,30 @@
<!--| Define module specific elements here. |-->
<!--+=======================================+-->
<property name="javadoc.private" value="true"/>
- <property name="javadoc.protected" value="false"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
- </target>
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
<!--+====================================================================+-->
<!--| Compile |-->
<!--| |-->
@@ -168,16 +188,41 @@
<mkdir dir="${build.lib}"/>
<jar jarfile="${build.lib}/portal-workflow-lib.jar"
manifest="${build.etc}/portal-workflow-lib-jar.mf">
- <fileset dir="${build.classes}"/>
- <!--fileset
dir="${build.resources}/portal-workflow-jar"/-->
+ <fileset dir="${build.classes}"/>
</jar>
-
- <!-- create the war file, not needed anymore -->
- <!--copy todir="${build.lib}/portal-workflow.war">
+
+ <!--
+ <copy todir="${build.resources}/portal-workflow.war">
<fileset dir="${build.resources}/portal-workflow-war"/>
- </copy-->
+ </copy>
+
+ <jar jarfile="${build.lib}/portal-workflow.war">
+ <fileset dir="${build.resources}/portal-workflow.war"/>
+ </jar>
+ -->
+
+ <!-- workflow service -->
+ <copy todir="${build.resources}/portal-workflow.sar">
+ <fileset dir="${build.resources}/portal-workflow-sar"/>
+ </copy>
+
+ <!--
+ <copy
todir="${build.resources}/portal-workflow.sar/portal-worflow.war">
+ <fileset dir="${build.resources}/portal-workflow.war"/>
+ </copy>
+ -->
+ <implode
+ dir="${build.resources}/portal-workflow.sar"
+ tofile="${build.lib}/portal-workflow.sar"/>
</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
-->
Copied: trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
(from rev 8187,
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java)
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
(rev 0)
+++
trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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.JbpmConfiguration;
+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 int schedulerInterval = 5000;
+
+ private int priority = 1;
+
+ private WorkflowService workflowService = null;
+
+ private CommandExecutorThread commandExecutorThread = null;
+
+ private SchedulerThread schedulerThread = null;
+
+ public void start()
+ {
+ JbpmConfiguration jbpmConfiguration = workflowService.getJbpmConfiguration();
+
+ commandExecutorThread = new CommandExecutorThread(jbpmConfiguration);
+ commandExecutorThread.setPriority(priority);
+ commandExecutorThread.start();
+
+ schedulerThread = new SchedulerThread(jbpmConfiguration);
+ schedulerThread.setPriority(priority);
+ schedulerThread.setInterval(schedulerInterval);
+ schedulerThread.start();
+ }
+
+ public void stop()
+ {
+ }
+
+ public int getSchedulerInterval()
+ {
+ return schedulerInterval;
+ }
+
+ public void setSchedulerInterval(int schedulerInterval)
+ {
+ this.schedulerInterval = schedulerInterval;
+ }
+
+ public int getPriority()
+ {
+ return priority;
+ }
+
+ public void setPriority(int priority)
+ {
+ this.priority = priority;
+ }
+
+ public WorkflowService getWorkflowService()
+ {
+ return workflowService;
+ }
+
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
+}
+
Copied:
trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
(from rev 8187,
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java)
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
(rev 0)
+++
trunk/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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;
+
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface JbpmThreadServiceMBean
+{
+ public void start();
+
+ public void stop();
+
+ public WorkflowService getWorkflowService();
+
+ public void setWorkflowService(WorkflowService workflowService);
+
+ public int getSchedulerInterval();
+
+ public void setSchedulerInterval(int schedulerInterval);
+
+ public int getPriority();
+
+ public void setPriority(int priority);
+}
+
Deleted: trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-12
08:04:19 UTC (rev 8235)
+++ trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -1,153 +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" />
- <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>
- <attribute
name="JNDIName">java:/portal/WorkflowService</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>
Copied: trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml (from
rev 8187,
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml)
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
(rev 0)
+++ trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -0,0 +1,74 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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">
+ <depends optional-attribute-name="WorkflowService"
+
proxy-type="attribute">portal:service=Workflow,type=WorkflowService</depends>
+ <attribute name="SchedulerInterval">60000</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" />
+ <service name="message"
factory="org.jbpm.msg.db.DbMessageServiceFactory" />
+ </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:
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
===================================================================
---
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-12
08:04:19 UTC (rev 8235)
+++
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-12
08:25:28 UTC (rev 8236)
@@ -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 -->