JBoss Portal SVN: r8194 - branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-09-06 18:07:41 -0400 (Thu, 06 Sep 2007)
New Revision: 8194
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
Log:
JBPORTAL-1626,JBPORTAL-1669 - FIrst access to a CMS HTML file through /content/ results in a NPE, Make the JBossCachePersistenceManager compatible with JBoss Cache 1.4.1
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2007-09-06 16:01:13 UTC (rev 8193)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/hibernate/state/JBossCachePersistenceManager.java 2007-09-06 22:07:41 UTC (rev 8194)
@@ -470,17 +470,8 @@
+ "/" + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId);
if (o != null)
{
- if (o instanceof WSPNode)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.WSP_NODE_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
else if (this.schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
@@ -489,17 +480,8 @@
+ "/" + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId);
if (o != null)
{
- if (o instanceof VersionNode)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.VERSION_NODE_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
return exists;
}
@@ -764,17 +746,8 @@
+ "/" + PortalCMSCacheLoader.parseNodeName(propId), propId);
if (o != null)
{
- if (o instanceof WSPProp)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.WSP_PROP_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(propId), propId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
else if (this.schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
@@ -783,17 +756,8 @@
+ "/" + PortalCMSCacheLoader.parseNodeName(propId), propId);
if (o != null)
{
- if (o instanceof VersionProp)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.VERSION_PROP_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(propId), propId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
return exists;
}
@@ -1088,17 +1052,8 @@
+ PortalCMSCacheLoader.parseNodeName(nodeId), nodeId);
if (o != null)
{
- if (o instanceof WSPRefs)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.WSP_REF_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
else if (this.schemaObjectPrefix
.equalsIgnoreCase(HibernateStoreConstants.versionPrefix))
@@ -1107,17 +1062,8 @@
+ "/" + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId);
if (o != null)
{
- if (o instanceof VersionRefs)
- {
- exists = true;
- }
- }
- else
- {
- this.pmCache.put(PortalCMSCacheLoader.VERSION_REF_NODE + "/"
- + PortalCMSCacheLoader.parseNodeName(nodeId), nodeId,
- new Boolean(false));
- }
+ exists = true;
+ }
}
return exists;
}
18 years, 8 months
JBoss Portal SVN: r8192 - in branches/JBoss_Portal_Branch_2_6: workflow and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 12:00:01 -0400 (Thu, 06 Sep 2007)
New Revision: 8192
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml
branches/JBoss_Portal_Branch_2_6/workflow/build.xml
Log:
Move some more from workflow to CMS
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml 2007-09-06 15:41:56 UTC (rev 8191)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/web.xml 2007-09-06 16:00:01 UTC (rev 8192)
@@ -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: branches/JBoss_Portal_Branch_2_6/workflow/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 15:41:56 UTC (rev 8191)
+++ branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 16:00:01 UTC (rev 8192)
@@ -191,6 +191,7 @@
<fileset dir="${build.classes}"/>
</jar>
+ <!--
<copy todir="${build.resources}/portal-workflow.war">
<fileset dir="${build.resources}/portal-workflow-war"/>
</copy>
@@ -198,17 +199,18 @@
<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>
- <!-- workflow service -->
+ <!--
<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"/>
18 years, 8 months
JBoss Portal SVN: r8191 - in branches/JBoss_Portal_Branch_2_6: workflow and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 11:41:56 -0400 (Thu, 06 Sep 2007)
New Revision: 8191
Modified:
branches/JBoss_Portal_Branch_2_6/build/distrib.xml
branches/JBoss_Portal_Branch_2_6/workflow/build.xml
Log:
Fix workflow build and add it to the distribution
Modified: branches/JBoss_Portal_Branch_2_6/build/distrib.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-09-06 13:51:45 UTC (rev 8190)
+++ branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-09-06 15:41:56 UTC (rev 8191)
@@ -247,7 +247,8 @@
<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/**"/>
</copy>
@@ -277,7 +278,8 @@
<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/**"/>
</copy>
Modified: branches/JBoss_Portal_Branch_2_6/workflow/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 13:51:45 UTC (rev 8190)
+++ branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 15:41:56 UTC (rev 8191)
@@ -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,32 +188,30 @@
<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>
- <copy todir="${build.lib}/portal-workflow-war">
+ <copy todir="${build.resources}/portal-workflow.war">
<fileset dir="${build.resources}/portal-workflow-war"/>
</copy>
<jar jarfile="${build.lib}/portal-workflow.war">
- <fileset dir="${build.lib}/portal-workflow-war"/>
+ <fileset dir="${build.resources}/portal-workflow.war"/>
</jar>
<!-- workflow service -->
- <copy todir="${build.lib}/portal-workflow-sar">
-<!--
- <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar, portal-workflow.war"/>
- <fileset dir="${jbpm.jaronly.lib}" includes="jbpm.jar"/>
- <fileset dir="${jbpm.jaronly.lib}" includes="jbpm-identity.jar"/>
--->
- <fileset dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
+ <copy todir="${build.resources}/portal-workflow.sar">
+ <fileset dir="${build.resources}/portal-workflow-sar"/>
</copy>
-
- <jar jarfile="${build.lib}/portal-workflow.sar">
- <fileset dir="${build.lib}/portal-workflow-sar"/>
- </jar>
+ <!-- workflow service -->
+ <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"
18 years, 8 months
JBoss Portal SVN: r8190 - in modules/common/trunk: mc and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-09-06 09:51:45 -0400 (Thu, 06 Sep 2007)
New Revision: 8190
Modified:
modules/common/trunk/build/build-thirdparty.xml
modules/common/trunk/mc/build.xml
modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java
Log:
use mc 1.0.2 that is compatible with 1.4 for now
Modified: modules/common/trunk/build/build-thirdparty.xml
===================================================================
--- modules/common/trunk/build/build-thirdparty.xml 2007-09-06 13:40:25 UTC (rev 8189)
+++ modules/common/trunk/build/build-thirdparty.xml 2007-09-06 13:51:45 UTC (rev 8190)
@@ -58,7 +58,12 @@
<componentref name="sun-javamail" version="1.3.1"/>
<componentref name="sun-servlet" version="2.4"/>
+ <componentref name="jboss/common" version="1.2.0.GA-brew"/>
+ <componentref name="jboss/microcontainer" version="1.0.2"/>
+
+
<!-- Based on http://anonsvn.jboss.org/repos/jbossas/tags/EMBEDDED_JBOSS_BETA_2/build/b... -->
+<!--
<componentref name="jboss/microcontainer" version="2.0.0.Beta3"/>
<componentref name="jboss/aop" version="2.0.0.alpha4"/>
<componentref name="jboss/jbossxb" version="2.0.0.CR2"/>
@@ -74,7 +79,7 @@
<componentref name="junit" version="3.8.1"/>
<componentref name="wutka-dtdparser" version="1.2.1"/>
<componentref name="trove" version="1.0.2"/>
-
+-->
</build>
<synchronizeinfo/>
Modified: modules/common/trunk/mc/build.xml
===================================================================
--- modules/common/trunk/mc/build.xml 2007-09-06 13:40:25 UTC (rev 8189)
+++ modules/common/trunk/mc/build.xml 2007-09-06 13:51:45 UTC (rev 8190)
@@ -90,7 +90,7 @@
<path id="library.classpath">
<path refid="junit.junit.classpath"/>
<path refid="jboss.microcontainer.classpath"/>
- <path refid="jboss/common.core.classpath"/>
+ <path refid="jboss.common.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="sun.servlet.classpath"/>
</path>
Modified: modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java
===================================================================
--- modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java 2007-09-06 13:40:25 UTC (rev 8189)
+++ modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java 2007-09-06 13:51:45 UTC (rev 8190)
@@ -29,6 +29,7 @@
import org.jboss.kernel.spi.event.KernelEvent;
import org.jboss.kernel.spi.registry.KernelRegistry;
import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.jboss.kernel.spi.config.KernelConfig;
import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
@@ -47,7 +48,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class WebBootstrap extends BasicBootstrap implements ServletContextListener, KernelEventListener
+public class WebBootstrap implements ServletContextListener, KernelEventListener
{
/** . */
@@ -65,25 +66,9 @@
/** . */
private boolean registered;
- protected void bootstrap() throws Throwable
- {
- log.info("Web kernel bootstrap");
+ /** . */
+ private BootstrapExt bootstrap;
- //
- super.bootstrap();
-
- //
- getKernel().getRegistry().registerListener(this, null, "ABC");
- registered = true;
-
- //
- deployer = new BeanXMLDeployer(getKernel());
-
- //
- URL url = servletContext.getResource("/WEB-INF/jboss-beans.xml");
- deployment = deployer.deploy(url);
- }
-
public void contextInitialized(ServletContextEvent event)
{
servletContext = event.getServletContext();
@@ -92,8 +77,20 @@
System.setProperty("org.jboss.logging.Logger.pluginClass", "org.jboss.logging.log4j.Log4jLoggerPlugin");
//
- run();
- log.info("Web kernel started");
+ try
+ {
+ bootstrap = new BootstrapExt();
+
+ //
+ bootstrap.run();
+
+ //
+ log.info("Web kernel started");
+ }
+ catch (Exception e)
+ {
+ log.info("Web kernel boostrap failed", e);
+ }
}
public void contextDestroyed(ServletContextEvent event)
@@ -112,7 +109,7 @@
registered = false;
try
{
- KernelRegistry registry = getKernel().getRegistry();
+ KernelRegistry registry = bootstrap.getKernel().getRegistry();
registry.unregisterListener(this, null, "ABC");
}
catch (Throwable throwable)
@@ -137,7 +134,7 @@
String type = event.getType();
if ("KERNEL_REGISTRY_REGISTERED".equals(type))
{
- KernelRegistryEntry entry = getKernel().getRegistry().getEntry(context);
+ KernelRegistryEntry entry = bootstrap.getKernel().getRegistry().getEntry(context);
Object target = entry.getTarget();
servletContext.setAttribute(key, target);
}
@@ -147,4 +144,36 @@
}
}
}
+
+ private void boostrap() throws Throwable
+ {
+ //
+ bootstrap.getKernel().getRegistry().registerListener(WebBootstrap.this, null, "ABC");
+ registered = true;
+
+ //
+ deployer = new BeanXMLDeployer(bootstrap.getKernel());
+
+ //
+ URL url = servletContext.getResource("/WEB-INF/jboss-beans.xml");
+ deployment = deployer.deploy(url);
+ }
+
+ private class BootstrapExt extends BasicBootstrap
+ {
+
+ // I don't know why we need to declare it since super() does not declare it
+ public BootstrapExt() throws Exception
+ {
+ super();
+ }
+
+ protected void bootstrap() throws Throwable
+ {
+ super.bootstrap();
+
+ //
+ boostrap();
+ }
+ }
}
18 years, 8 months
JBoss Portal SVN: r8189 - in branches/JBoss_Portal_Branch_2_6: widget and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 09:40:25 -0400 (Thu, 06 Sep 2007)
New Revision: 8189
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml
branches/JBoss_Portal_Branch_2_6/widget/build.xml
Log:
Oups
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml 2007-09-06 13:12:47 UTC (rev 8188)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/resources/portal-cms-jar/org/jboss/portal/cms/jboss-beans-workflow.xml 2007-09-06 13:40:25 UTC (rev 8189)
@@ -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: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 13:12:47 UTC (rev 8188)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 13:40:25 UTC (rev 8189)
@@ -265,7 +265,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.widget.google.QueryResultParserTestCase"/>
</x-test>
<x-classpath>
- <pathelement location="${build.lib}/potal-widget-lib.jar"/>
+ <pathelement location="${build.lib}/portal-widget-lib.jar"/>
<pathelement location="${build.resources}/test"/>
<path refid="beanshell.beanshell.classpath"/>
18 years, 8 months
JBoss Portal SVN: r8188 - in modules/common/trunk: build and 14 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-09-06 09:12:47 -0400 (Thu, 06 Sep 2007)
New Revision: 8188
Added:
modules/common/trunk/mc/
modules/common/trunk/mc/.classpath
modules/common/trunk/mc/.cvsignore
modules/common/trunk/mc/.project
modules/common/trunk/mc/build.bat
modules/common/trunk/mc/build.sh
modules/common/trunk/mc/build.xml
modules/common/trunk/mc/src/
modules/common/trunk/mc/src/main/
modules/common/trunk/mc/src/main/org/
modules/common/trunk/mc/src/main/org/jboss/
modules/common/trunk/mc/src/main/org/jboss/portal/
modules/common/trunk/mc/src/main/org/jboss/portal/common/
modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/
modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/
modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java
Removed:
modules/common/trunk/common/src/main/org/jboss/portal/common/concurrent/loader/
modules/common/trunk/common/src/main/org/jboss/portal/common/mx/ProxyUnwrapperInterceptor.java
modules/common/trunk/common/src/main/org/jboss/portal/test/common/ObjectLoaderTestCase.java
Modified:
modules/common/trunk/build/build-thirdparty.xml
modules/common/trunk/build/build.xml
modules/common/trunk/common/build.xml
modules/common/trunk/common/src/main/org/jboss/portal/common/net/URLTools.java
Log:
added mc module to common which contains mc common code
Modified: modules/common/trunk/build/build-thirdparty.xml
===================================================================
--- modules/common/trunk/build/build-thirdparty.xml 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/build/build-thirdparty.xml 2007-09-06 13:12:47 UTC (rev 8188)
@@ -51,14 +51,30 @@
<componentref name="apache-httpclient" version="3.0.1"/>
<componentref name="apache-log4j" version="1.2.8"/>
<componentref name="jbossas/core-libs" version="4.0.4.GA"/>
- <componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
- <componentref name="jboss/jbossretro-rt" version="1.0.3.GA"/>
<componentref name="jboss/test" version="1.0.0.CR1"/>
<componentref name="junit" version="3.8.1"/>
<componentref name="oswego-concurrent" version="1.3.4"/>
<componentref name="sun-jaf" version="1.0.2"/>
<componentref name="sun-javamail" version="1.3.1"/>
<componentref name="sun-servlet" version="2.4"/>
+
+ <!-- Based on http://anonsvn.jboss.org/repos/jbossas/tags/EMBEDDED_JBOSS_BETA_2/build/b... -->
+ <componentref name="jboss/microcontainer" version="2.0.0.Beta3"/>
+ <componentref name="jboss/aop" version="2.0.0.alpha4"/>
+ <componentref name="jboss/jbossxb" version="2.0.0.CR2"/>
+ <componentref name="jboss/jboss-vfs" version="2.0.0.Beta4"/>
+ <componentref name="jboss/common-core" version="2.0.4.Alpha"/>
+ <componentref name="jboss/common-logging-log4j" version="2.0.2.GA"/>
+ <componentref name="jboss/common-logging-jdk" version="2.0.2.GA"/>
+ <componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
+ <componentref name="javassist" version="3.5.0.CR1"/>
+ <componentref name="apache-log4j" version="1.2.14"/>
+ <componentref name="apache-xerces" version="2.7.1"/>
+ <componentref name="sun-jaf" version="1.1"/>
+ <componentref name="junit" version="3.8.1"/>
+ <componentref name="wutka-dtdparser" version="1.2.1"/>
+ <componentref name="trove" version="1.0.2"/>
+
</build>
<synchronizeinfo/>
Modified: modules/common/trunk/build/build.xml
===================================================================
--- modules/common/trunk/build/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/build/build.xml 2007-09-06 13:12:47 UTC (rev 8188)
@@ -113,12 +113,13 @@
<module name="common"/>
<module name="portal"/>
+ <module name="mc"/>
<!-- Module groups -->
<group name="common">
<include
- modules="common,portal"/>
+ modules="common,portal,mc"/>
</group>
<group name="default">
Modified: modules/common/trunk/common/build.xml
===================================================================
--- modules/common/trunk/common/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/common/build.xml 2007-09-06 13:12:47 UTC (rev 8188)
@@ -65,22 +65,14 @@
<!-- Configure thirdparty libraries -->
&libraries;
- <path id="jbossas_restriction">
- <pathelement location="${jbossas/core.libs.lib}/jboss-jmx.jar"/>
- <pathelement location="${jbossas/core.libs.lib}/jboss-j2ee.jar"/>
- <pathelement location="${jbossas/core.libs.lib}/jboss-common.jar"/>
- </path>
-
<path id="library.classpath">
<path refid="sun.jaf.classpath"/>
<path refid="sun.servlet.classpath"/>
<path refid="oswego.concurrent.classpath"/>
- <path refid="jbossas_restriction"/>
<path refid="apache.ant.classpath"/>
<path refid="apache.log4j.classpath"/>
<pathelement location="${jbossas/core.libs.lib}jboss-j2ee.jar"/>
<path refid="junit.junit.classpath"/>
- <path refid="jboss/backport.concurrent.classpath"/>
<path refid="apache.httpclient.classpath"/>
<pathelement location="../tools/lib/cargo-core-uberjar-0.8.jar"/>
<pathelement location="../tools/lib/cargo-ant-0.8.jar"/>
@@ -224,7 +216,6 @@
<test todir="${test.reports}" name="org.jboss.portal.test.common.BundleNameIteratorTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.BundleNameParserTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.ComplexResourceBundleFactoryTestCase"/>
- <test todir="${test.reports}" name="org.jboss.portal.test.common.ObjectLoaderTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.MarkupTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.TypedMapTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.common.AbstractInvocationContextTestCase"/>
Deleted: modules/common/trunk/common/src/main/org/jboss/portal/common/mx/ProxyUnwrapperInterceptor.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/mx/ProxyUnwrapperInterceptor.java 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/mx/ProxyUnwrapperInterceptor.java 2007-09-06 13:12:47 UTC (rev 8188)
@@ -1,78 +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. *
- ******************************************************************************/
-package org.jboss.portal.common.mx;
-
-import org.jboss.mx.interceptor.AbstractInterceptor;
-import org.jboss.mx.server.Invocation;
-import org.jboss.mx.server.registry.MBeanEntry;
-import org.jboss.mx.util.MBeanProxyExt;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.lang.reflect.Proxy;
-
-/**
- * An XMBean interceptor that unwraps the proxy injected by the microkernel when it is possible.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5451 $
- */
-public class ProxyUnwrapperInterceptor extends AbstractInterceptor
-{
- public Object invoke(Invocation invocation) throws Throwable
- {
- // Intercept set attribute only
- if (Invocation.OP_SETATTRIBUTE.equals(invocation.getType()))
- {
- Object value = invocation.getArgs()[0];
-
- // If the value is a proxy
- if (Proxy.isProxyClass(value.getClass()))
- {
- // Get the proxy
- Object handler = Proxy.getInvocationHandler(value);
-
- // If it is a JBoss service proxy
- if (handler instanceof MBeanProxyExt)
- {
- // Unwrap the server and the object name
- MBeanProxyExt abc = (MBeanProxyExt)handler;
- MBeanServer server = abc.getMBeanProxyMBeanServer();
- ObjectName name = abc.getMBeanProxyObjectName();
- if (server.isRegistered(name))
- {
- // Get the mbean entry
- MBeanEntry entry = (MBeanEntry)server.invoke(new ObjectName("JMImplementation:type=MBeanRegistry"), "get", new Object[]{name}, new String[]{ObjectName.class.getName()});
-
- // Get the managed resource (aka the service)
- Object target = entry.getInvoker().getResource();
-
- // Replace the proxy by the service
- invocation.getArgs()[0] = target;
- }
- }
- }
- }
- return super.invoke(invocation);
- }
-}
Modified: modules/common/trunk/common/src/main/org/jboss/portal/common/net/URLTools.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/common/net/URLTools.java 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/common/src/main/org/jboss/portal/common/net/URLTools.java 2007-09-06 13:12:47 UTC (rev 8188)
@@ -25,7 +25,7 @@
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod;
-import org.jboss.logging.Logger;
+import org.apache.log4j.Logger;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.util.ParameterValidation;
Deleted: modules/common/trunk/common/src/main/org/jboss/portal/test/common/ObjectLoaderTestCase.java
===================================================================
--- modules/common/trunk/common/src/main/org/jboss/portal/test/common/ObjectLoaderTestCase.java 2007-09-06 12:48:33 UTC (rev 8187)
+++ modules/common/trunk/common/src/main/org/jboss/portal/test/common/ObjectLoaderTestCase.java 2007-09-06 13:12:47 UTC (rev 8188)
@@ -1,264 +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. *
- ******************************************************************************/
-package org.jboss.portal.test.common;
-
-import junit.framework.TestCase;
-import org.jboss.portal.common.concurrent.loader.ObjectLoader;
-import org.jboss.portal.common.concurrent.loader.ObjectBatch;
-import org.jboss.portal.common.concurrent.loader.LoadingPolicy;
-import org.jboss.portal.common.concurrent.loader.LoaderContext;
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
-import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
-import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
-import edu.emory.mathcs.backport.java.util.concurrent.ExecutorCompletionService;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ObjectLoaderTestCase extends TestCase
-{
-
- private static volatile int counter;
-
- private abstract static class AbstractObjectLoader implements ObjectLoader
- {
- int loadCount;
- }
-
- private static class SimpleObjectLoader extends AbstractObjectLoader
- {
-
- /** . */
- final Object o;
-
- public SimpleObjectLoader()
- {
- this.o = null;
- }
-
- public SimpleObjectLoader(Object o)
- {
- if (o == null)
- {
- throw new IllegalArgumentException();
- }
- this.o = o;
- }
-
- public synchronized Object load()
- {
- loadCount++;
- return o;
- }
- }
-
- private static class RuntimeExceptionObjectLoader extends AbstractObjectLoader
- {
- public synchronized Object load()
- {
- loadCount++;
- throw new RuntimeException();
- }
- }
-
- private static class ErrorObjectLoader extends AbstractObjectLoader
- {
- public synchronized Object load()
- {
- loadCount++;
- throw new Error();
- }
- }
-
- private Executor executor;
-
-
- protected void setUp() throws Exception
- {
- executor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new LinkedBlockingQueue());
- }
-
- protected void tearDown() throws Exception
- {
- executor = null;
- }
-
- public void testLoadAsync() throws Exception
- {
- LoaderContext ctx = new LoaderContext(new ExecutorCompletionService(executor));
- SimpleObjectLoader l0 = new SimpleObjectLoader(new Object());
- RuntimeExceptionObjectLoader l1 = new RuntimeExceptionObjectLoader();
- SimpleObjectLoader l2 = new SimpleObjectLoader();
- AbstractObjectLoader[] loaders = new AbstractObjectLoader[]{l0,l1,l2};
- ObjectBatch o_l = new ObjectBatch(loaders, LoadingPolicy.LOAD_ALL_SYNC);
-
- //
- Object o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- Object o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- Object o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
- }
-
- public void testLoadSync() throws Exception
- {
- LoaderContext ctx = new LoaderContext(new ExecutorCompletionService(executor));
- SimpleObjectLoader l0 = new SimpleObjectLoader(new Object());
- RuntimeExceptionObjectLoader l1 = new RuntimeExceptionObjectLoader();
- SimpleObjectLoader l2 = new SimpleObjectLoader();
- AbstractObjectLoader[] loaders = new AbstractObjectLoader[]{l0,l1,l2};
- ObjectBatch o_l = new ObjectBatch(loaders, LoadingPolicy.LOAD_ALL_SYNC);
-
- //
- Object o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- Object o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- Object o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
-
- //
- o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
-
- //
- o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, l0.loadCount);
- assertEquals(1, l1.loadCount);
- assertEquals(1, l2.loadCount);
- }
-
- public void testLoadOne() throws Exception
- {
- LoaderContext ctx = new LoaderContext(new ExecutorCompletionService(executor));
- SimpleObjectLoader l0 = new SimpleObjectLoader(new Object());
- RuntimeExceptionObjectLoader l1 = new RuntimeExceptionObjectLoader();
- SimpleObjectLoader l2 = new SimpleObjectLoader();
- AbstractObjectLoader[] loaders = new AbstractObjectLoader[]{l0,l1,l2};
- ObjectBatch o_l = new ObjectBatch(loaders, LoadingPolicy.LOAD_ONE);
-
- //
- Object o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(0, loaders[1].loadCount);
- assertEquals(0, loaders[2].loadCount);
-
- //
- Object o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(0, loaders[1].loadCount);
- assertEquals(1, loaders[2].loadCount);
-
- //
- Object o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(1, loaders[1].loadCount);
- assertEquals(1, loaders[2].loadCount);
-
- //
- o0 = o_l.getObject(ctx, 0);
- assertEquals(o0, l0.o);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(1, loaders[1].loadCount);
- assertEquals(1, loaders[2].loadCount);
-
- //
- o2 = o_l.getObject(ctx, 2);
- assertEquals(o2, l2.o);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(1, loaders[1].loadCount);
- assertEquals(1, loaders[2].loadCount);
-
- //
- o1 = o_l.getObject(ctx, 1);
- assertEquals(o1, null);
- assertEquals(1, loaders[0].loadCount);
- assertEquals(1, loaders[1].loadCount);
- assertEquals(1, loaders[2].loadCount);
- }
-}
Added: modules/common/trunk/mc/.classpath
===================================================================
--- modules/common/trunk/mc/.classpath (rev 0)
+++ modules/common/trunk/mc/.classpath 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Property changes on: modules/common/trunk/mc/.classpath
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/.cvsignore
===================================================================
--- modules/common/trunk/mc/.cvsignore (rev 0)
+++ modules/common/trunk/mc/.cvsignore 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,2 @@
+bin
+output
Property changes on: modules/common/trunk/mc/.cvsignore
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/.project
===================================================================
--- modules/common/trunk/mc/.project (rev 0)
+++ modules/common/trunk/mc/.project 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>api</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: modules/common/trunk/mc/.project
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/build.bat
===================================================================
--- modules/common/trunk/mc/build.bat (rev 0)
+++ modules/common/trunk/mc/build.bat 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 2 2005-01-14 23:01:32Z vietj $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: modules/common/trunk/mc/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/build.sh
===================================================================
--- modules/common/trunk/mc/build.sh (rev 0)
+++ modules/common/trunk/mc/build.sh 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 2 2005-01-14 23:01:32Z vietj $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: modules/common/trunk/mc/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/build.xml
===================================================================
--- modules/common/trunk/mc/build.xml (rev 0)
+++ modules/common/trunk/mc/build.xml 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,185 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 7910 2007-08-14 09:46:27Z julien(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Override the javadoc packages to javax.portlet.* -->
+ <property name="javadoc.packages" value="org.jboss.portal.*"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="junit.junit.classpath"/>
+ <path refid="jboss.microcontainer.classpath"/>
+ <path refid="jboss/common.core.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/portal-common-mc-lib.jar">
+ <fileset dir="${build.classes}"/>
+ </jar>
+
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <target name="package-tests"></target>
+
+</project>
Property changes on: modules/common/trunk/mc/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java
===================================================================
--- modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java (rev 0)
+++ modules/common/trunk/mc/src/main/org/jboss/portal/common/mc/bootstrap/WebBootstrap.java 2007-09-06 13:12:47 UTC (rev 8188)
@@ -0,0 +1,150 @@
+/******************************************************************************
+ * 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.common.mc.bootstrap;
+
+import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer;
+import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.kernel.spi.event.KernelEventListener;
+import org.jboss.kernel.spi.event.KernelEvent;
+import org.jboss.kernel.spi.registry.KernelRegistry;
+import org.jboss.kernel.spi.registry.KernelRegistryEntry;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContextEvent;
+import java.net.URL;
+
+/**
+ * A kernel bootstrap with a life cycle triggered by the <code>ServletContextListener</code> interface.
+ * All beans will be injected as servlet context attributes. The bean xml file must be available as
+ * a servlet context resource under the path <i>/WEB-INF/jboss-beans.xml</i>.
+ *
+ * @todo specify an alternative logger name
+ * @todo implement the specification of an alternative xml file path
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WebBootstrap extends BasicBootstrap implements ServletContextListener, KernelEventListener
+{
+
+ /** . */
+ private final static Logger log = Logger.getLogger(WebBootstrap.class);
+
+ /** . */
+ private ServletContext servletContext;
+
+ /** . */
+ private BeanXMLDeployer deployer;
+
+ /** . */
+ private KernelDeployment deployment;
+
+ /** . */
+ private boolean registered;
+
+ protected void bootstrap() throws Throwable
+ {
+ log.info("Web kernel bootstrap");
+
+ //
+ super.bootstrap();
+
+ //
+ getKernel().getRegistry().registerListener(this, null, "ABC");
+ registered = true;
+
+ //
+ deployer = new BeanXMLDeployer(getKernel());
+
+ //
+ URL url = servletContext.getResource("/WEB-INF/jboss-beans.xml");
+ deployment = deployer.deploy(url);
+ }
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ servletContext = event.getServletContext();
+
+ // For now we do it here
+ System.setProperty("org.jboss.logging.Logger.pluginClass", "org.jboss.logging.log4j.Log4jLoggerPlugin");
+
+ //
+ run();
+ log.info("Web kernel started");
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ log.info("Web kernel shutdown");
+
+ //
+ if (deployment != null)
+ {
+ deployer.undeploy(deployment);
+ }
+
+ //
+ if (registered)
+ {
+ registered = false;
+ try
+ {
+ KernelRegistry registry = getKernel().getRegistry();
+ registry.unregisterListener(this, null, "ABC");
+ }
+ catch (Throwable throwable)
+ {
+ log.error("Cannot unregister kernel registry listener", throwable);
+ }
+ }
+
+ //
+ servletContext = null;
+
+ //
+ log.info("Web kernel stopped");
+ }
+
+ public void onEvent(KernelEvent event, Object object)
+ {
+ Object context = event.getContext();
+ if (context instanceof String)
+ {
+ String key = (String)context;
+ String type = event.getType();
+ if ("KERNEL_REGISTRY_REGISTERED".equals(type))
+ {
+ KernelRegistryEntry entry = getKernel().getRegistry().getEntry(context);
+ Object target = entry.getTarget();
+ servletContext.setAttribute(key, target);
+ }
+ else if ("KERNEL_REGISTRY_UNREGISTERED".equals(type))
+ {
+ servletContext.removeAttribute(key);
+ }
+ }
+ }
+}
18 years, 8 months
JBoss Portal SVN: r8187 - in branches/JBoss_Portal_Branch_2_6: cms/src/main/org/jboss/portal/cms/impl/interceptors and 19 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 08:48:33 -0400 (Thu, 06 Sep 2007)
New Revision: 8187
Added:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
Removed:
branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF/
branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/
branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/cms/
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
Modified:
branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
branches/JBoss_Portal_Branch_2_6/build/build.xml
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
branches/JBoss_Portal_Branch_2_6/core/build.xml
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
branches/JBoss_Portal_Branch_2_6/widget/build.xml
branches/JBoss_Portal_Branch_2_6/workflow/build.xml
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
Log:
- Seperated CMS / Workflow
- Integrated core-identity into the portal (still need to update the distrib.xml)
- Renamed widget.war to portal-widget.war
Modified: branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -87,13 +87,14 @@
<componentref name="jboss/backport-concurrent" version="2.1.0.GA"/>
<componentref name="jboss/cache" version="1.4.0.SP1"/>
<componentref name="jboss/jbossretro-rt" version="1.0.3.GA"/>
- <componentref name="jboss/jbossws14" version="1.0.0.GA"/>
- <componentref name="jboss/jbossxb" version="1.0.0.CR4"/>
+ <componentref name="jboss/jbossws14" version="1.0.3.GA"/>
+ <componentref name="jboss/jbossxb" version="1.0.0.CR7"/>
<componentref name="jboss/microcontainer" version="1.0.2"/>
<componentref name="jboss/remoting" version="1.4.3.GA"/>
<componentref name="jboss/serialization" version="1.0.1.GA"/>
<componentref name="jboss/test" version="1.0.0.CR1"/>
<componentref name="jflex" version="1.4.0"/>
+ <componentref name="jcaptcha" version="1.0.6"/>
<componentref name="jwebunit" version="1.2"/>
<componentref name="jcr" version="1.0"/>
<componentref name="jetty" version="6.0"/>
Modified: branches/JBoss_Portal_Branch_2_6/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/build/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -126,6 +126,7 @@
<module name="core"/>
<module name="core-cms"/>
<module name="core-management"/>
+ <module name="core-identity"/>
<module name="core-admin"/>
<module name="core-wsrp"/>
<module name="search"/>
@@ -140,7 +141,7 @@
<group name="portal">
<include
- modules="api, jems, server, security, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, core, wsrp, core-admin, core-cms, core-management, core-samples, widget"/>
+ modules="api, jems, server, security, search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme, workflow, cms, registration, core, wsrp, core-admin, core-cms, core-management, core-identity, core-samples, widget"/>
</group>
<group name="cms">
@@ -287,8 +288,10 @@
depends="most">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<copy file="../core/output/lib/jboss-portal.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
- <copy file="../core-admin/output/lib//portal-admin.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../core-admin/output/lib/portal-admin.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-cms/output/lib/portal-cms.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../core-identity/output/lib/portal-identity.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../workflow/output/lib/portal-workflow.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-management/output/lib/portal-management.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-samples/output/lib/portal-basic-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-samples/output/lib/portal-news-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
@@ -296,7 +299,7 @@
<copy file="../core-samples/output/lib/portal-weather-samples.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../core-samples/output/lib/portal-users-samples.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<!--<copy file="../core-search/output/lib/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>-->
- <copy file="../widget/output/lib/widget.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ <copy file="../widget/output/lib/portal-widget.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../wsrp/output/lib/portal-wsrp.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
@@ -307,6 +310,8 @@
<delete file="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-admin.sar"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-cms.sar"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-identity.sar"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-workflow.sar"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-management.sar"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-basic-samples.sar"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-news-samples.war"/>
@@ -314,7 +319,7 @@
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-weather-samples.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-users-samples.sar"/>
<!--<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
- <delete file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
</target>
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/interceptors/ApprovalWorkflowInterceptor.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -37,8 +37,8 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.jems.as.JNDI;
-import org.jboss.portal.workflow.cms.ApprovePublish;
-import org.jboss.portal.workflow.cms.Content;
+import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.portal.cms.workflow.Content;
/**
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -55,7 +55,7 @@
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.util.StopWatch;
import org.w3c.dom.DOMImplementation;
@@ -613,14 +613,14 @@
JCRCommandContext ctx = new JCRCommandContext(session, commandFactory, defaultLocale);
jcrCmd.setContext(ctx);
- ctx.setAttribute(ctx.scope, "user", JCRCMS.getUserInfo().get());
+ ctx.setAttribute(JCRCommandContext.scope, "user", JCRCMS.getUserInfo().get());
Object isWorkflowOff = JCRCMS.turnOffWorkflow.get();
if( this.approvePublishWorkflow!=null //this checks and makes sure workflow is activated for the CMS
&&
isWorkflowOff==null //this checks and makes sure workflow is not turned off only for this particular request
)
{
- ctx.setAttribute(ctx.scope, "approvePublishWorkflow", this.approvePublishWorkflow);
+ ctx.setAttribute(JCRCommandContext.scope, "approvePublishWorkflow", this.approvePublishWorkflow);
}
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -40,7 +40,7 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.Role;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
/**
* ACLEnforcer checks proper access privileges for actions before
@@ -58,7 +58,7 @@
private static final int read = 0;
private static final int write = 1;
private static final int manage = 2;
- private static final int manageWorkflow = 3;
+// private static final int manageWorkflow = 3;
private AuthorizationManager authorizationManager = null;
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublish.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.util.Set;
+
+import org.jboss.portal.workflow.WorkflowException;
+
+import java.util.Collection;
+
+/**
+ * Created on : Dec 19, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public interface ApprovePublish
+{
+ /**
+ * Called when content is added to the CMS, and needs to be approved by the managers
+ * before it can be published to go live
+ *
+ * @param content
+ * @return returns the process id of the workflow process set in motion
+ */
+ public long requestApproval(Content content) throws WorkflowException;
+
+ /**
+ * Called when a manager either approves or rejects the publishing of a specific content to
+ * go live
+ *
+ * @param processId
+ * @param manager userId of the manager
+ * @param approved true if approved, false if rejected
+ */
+ public void processManagerResponse(long processId, String manager, boolean approved) throws WorkflowException;
+
+ /**
+ * Retrieves a queue of unapproved content associated with the specified file in the CMS
+ *
+ * @param filePath
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getPendingQueue(String filePath) throws WorkflowException;
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException;
+
+ /**
+ * Returns role names of Roles that are designated to be Managers in this workflow.
+ * Managers approve/deny all content publish requests before the content goes live in the
+ * CMS
+ *
+ * @return a Set of role names
+ */
+ public Set getManagers();
+}
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishImpl.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,582 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.identity.IdentityContext;
+import org.jboss.portal.identity.IdentityServiceController;
+import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.jems.as.JNDI;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.workflow.WorkflowException;
+import org.jboss.portal.workflow.service.WorkflowService;
+import org.jbpm.JbpmContext;
+import org.jbpm.db.GraphSession;
+import org.jbpm.graph.def.ProcessDefinition;
+import org.jbpm.graph.exe.ProcessInstance;
+import org.jbpm.graph.exe.Token;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+
+
+/**
+ * Created on : Dec 19, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class ApprovePublishImpl extends AbstractJBossService implements ApprovePublish
+{
+ /**
+ *
+ */
+ private static final Logger log = Logger.getLogger(ApprovePublishImpl.class);
+
+ /**
+ *
+ */
+ private WorkflowService workflowService = null;
+ private IdentityServiceController identityServiceController = null;
+ private String process = null;
+ private String processName = null;
+ private String managerRoles = null;
+ private String[] managers = null;
+ private Set managerSet = null;
+ private boolean overwrite = false;
+ private String from = null;
+ private String subject = null;
+ private String body = null;
+ private JNDI.Binding jndiBinding;
+
+ private MembershipModule membershipModule = null;
+ private UserModule userModule = null;
+
+ private String jndiName = null;
+
+ /**
+ *
+ *
+ */
+ public ApprovePublishImpl()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ if (this.jndiName != null)
+ {
+ jndiBinding = new JNDI.Binding(jndiName, this);
+ jndiBinding.bind();
+ }
+
+ InputStream is = null;
+ JbpmContext jbpmContext = null;
+ try
+ {
+ is = new ByteArrayInputStream(this.process.getBytes());
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(is);
+
+ Element root = document.getDocumentElement();
+ this.processName = root.getAttribute("name");
+ ProcessDefinition processDefinition = jbpmContext.getGraphSession().findLatestProcessDefinition(this.processName);
+ if (processDefinition == null)
+ {
+ processDefinition = ProcessDefinition.parseXmlString(this.process);
+ jbpmContext.deployProcessDefinition(processDefinition);
+ }
+ else
+ {
+ // A process definition already exists....should deploy a new version
+ // of the definition if overwrite is true
+ ProcessDefinition fromConfig = ProcessDefinition.parseXmlString(this.process);
+ if (this.overwrite)
+ {
+ // If the two of them are not same, create a new version
+ // of this process definition
+ jbpmContext.deployProcessDefinition(fromConfig);
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ //
+ this.stopService();
+
+ //
+ throw e;
+ }
+ finally
+ {
+ IOTools.safeClose(is);
+ IOTools.safeClose(jbpmContext);
+ }
+
+ //process managers that can serve as approvers/rejecters
+ StringTokenizer st = new StringTokenizer(this.managerRoles, ",");
+ this.managers = new String[st.countTokens()];
+ this.managerSet = new HashSet();
+ for (int i = 0; i < managers.length; i++)
+ {
+ this.managers[i] = st.nextToken();
+ this.managerSet.add(this.managers[i]);
+ }
+
+ this.membershipModule = (MembershipModule)identityServiceController.getIdentityContext().
+ getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+ this.userModule = (UserModule)identityServiceController.getIdentityContext().
+ getObject(IdentityContext.TYPE_USER_MODULE);
+ }
+
+ /**
+ *
+ */
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (jndiBinding != null)
+ {
+ jndiBinding.unbind();
+ jndiBinding = null;
+ }
+ }
+
+ /** @return */
+ public WorkflowService getWorkflowService()
+ {
+ return this.workflowService;
+ }
+
+ /** @param workflowService */
+ public void setWorkflowService(WorkflowService workflowService)
+ {
+ this.workflowService = workflowService;
+ }
+
+ /** @return */
+ public String getProcess()
+ {
+ return this.process;
+ }
+
+ /** @param process */
+ public void setProcess(String process)
+ {
+ this.process = process;
+ }
+
+
+ /** @return the managerRoles */
+ public String getManagerRoles()
+ {
+ return managerRoles;
+ }
+
+ /** @param managerRoles the manager managerRoles to set */
+ public void setManagerRoles(String managerRoles)
+ {
+ this.managerRoles = managerRoles;
+ }
+
+
+ /** @return the overwrite */
+ public boolean isOverwrite()
+ {
+ return overwrite;
+ }
+
+ /** @param overwrite the overwrite to set */
+ public void setOverwrite(boolean overwrite)
+ {
+ this.overwrite = overwrite;
+ }
+
+ /** @return */
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ /** @param jndiName */
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
+
+ /**
+ *
+ */
+ public IdentityServiceController getIdentityServiceController()
+ {
+ return identityServiceController;
+ }
+
+ /**
+ *
+ * @param identityServiceController
+ */
+ public void setIdentityServiceController(
+ IdentityServiceController identityServiceController)
+ {
+ this.identityServiceController = identityServiceController;
+ }
+
+
+ /** @return the body */
+ public String getBody()
+ {
+ return body;
+ }
+
+ /** @param body the body to set */
+ public void setBody(String body)
+ {
+ this.body = body;
+ }
+
+ /** @return the from */
+ public String getFrom()
+ {
+ return from;
+ }
+
+ /** @param from the from to set */
+ public void setFrom(String from)
+ {
+ this.from = from;
+ }
+
+ /** @return the subject */
+ public String getSubject()
+ {
+ return subject;
+ }
+
+ /** @param subject the subject to set */
+ public void setSubject(String subject)
+ {
+ this.subject = subject;
+ }
+
+ //----------ApprovePublish Implementation------------------------------------------------------------------
+ /**
+ * Called when content is added to the CMS, and needs to be approved by the managers
+ * before it can be published to go live
+ *
+ * @param content
+ * @return returns the process id of the workflow process set in motion
+ */
+ public long requestApproval(Content content) throws WorkflowException
+ {
+ long processId = 0;
+ JbpmContext jbpmContext = null;
+ ProcessInstance processInstance = null;
+ boolean success = false;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ //The next line creates one execution of the process definition.
+ // After construction, the process execution has one main path
+ // of execution (=the root token) that is positioned in the
+ // start-state.
+ processInstance = jbpmContext.newProcessInstance(this.processName);
+
+ //After construction, the process execution has one main path
+ // of execution (=the root token).
+ Token token = processInstance.getRootToken();
+
+ //set the process variables
+ processInstance.getContextInstance().setVariable("content", content);
+ processInstance.getContextInstance().setVariable("managers", this.managers);
+ processInstance.getContextInstance().setVariable("from", this.from);
+ processInstance.getContextInstance().setVariable("subject", this.subject);
+ processInstance.getContextInstance().setVariable("body", this.body);
+
+ //start the workflow, starts the cms publish approval workflow
+ //this creates a task to approve/reject a cms publish for the Admins
+ token.signal();
+
+ //mark as a successfull process initiation
+ success = true;
+ }
+ catch (Exception e)
+ {
+ success = false;
+ throw new WorkflowException(e);
+ }
+ finally
+ {
+ if (processInstance != null && success)
+ {
+ jbpmContext.save(processInstance);
+ processId = processInstance.getId();
+ }
+ IOTools.safeClose(jbpmContext);
+ }
+ return processId;
+ }
+
+ /**
+ * Called when a manager either approves or rejects the publishing of a specific content to
+ * go live
+ *
+ * @param processId
+ * @param manager userId of the manager
+ * @param approved true if approved, false if rejected
+ */
+ public void processManagerResponse(long processId, String manager, boolean approved) throws WorkflowException
+ {
+ JbpmContext jbpmContext = null;
+ ProcessInstance processInstance = null;
+ boolean isManager = false;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ //Now, we search for all process instances of this process definition.
+ processInstance = jbpmContext.loadProcessInstance(processId);
+
+ if (processInstance.hasEnded())
+ {
+ log.debug("This process has already ended...");
+ return;
+ }
+
+ processInstance.getContextInstance().setVariable("approved", new Boolean(approved));
+
+ Collection allTasks = processInstance.getTaskMgmtInstance().getTaskInstances();
+ if (allTasks != null)
+ {
+ for (Iterator itr = allTasks.iterator(); itr.hasNext();)
+ {
+ TaskInstance cour = (TaskInstance)itr.next();
+ if (this.isManager(manager,cour.getActorId()))
+ {
+ isManager = true;
+ log.debug("Manager=" + cour.getActorId() + "(" + processId + ")");
+
+ //check and make sure this task instance is not marked for deletion
+ if (cour.getVariable(processInstance.getId() + ":" + cour.getId()) != null)
+ {
+ continue;
+ }
+
+ if (!approved)
+ {
+ cour.start();
+ cour.end("rejection");
+ break;
+ }
+ else
+ {
+ cour.start();
+ cour.end("approval");
+ break;
+ }
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw new WorkflowException(e);
+ }
+ finally
+ {
+ if (processInstance != null)
+ {
+ jbpmContext.save(processInstance);
+ }
+
+ if(!isManager)
+ {
+ WorkflowException we = new WorkflowException("You are not authorized to Approve/Deny content publish requests");
+ throw we;
+ }
+ IOTools.safeClose(jbpmContext);
+ }
+ }
+
+ /**
+ * Retrieves a queue of unapproved content associated with the specified file in the CMS
+ *
+ * @param filePath
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getPendingQueue(String filePath) throws WorkflowException
+ {
+ Collection pendingQueue = new ArrayList();
+ JbpmContext jbpmContext = null;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.processName);
+ List processInstances = graphSession.findProcessInstances(processDef.getId());
+
+ if (processInstances != null)
+ {
+ for (int i = 0; i < processInstances.size(); i++)
+ {
+ ProcessInstance cour = (ProcessInstance)processInstances.get(i);
+ //iterate through a list of currently pending approval tasks
+ if (!cour.hasEnded())
+ {
+ Content content = (Content)cour.getContextInstance().getVariable("content");
+
+ //apply proper criteria to extract pending content only for the specified file
+ if (content != null)
+ {
+ int lastIndex = content.getPath().lastIndexOf('/');
+ String criteriaPath = content.getPath().substring(0, lastIndex);
+
+ if (criteriaPath.trim().equals(filePath.trim()))
+ {
+ content.setProcessId(String.valueOf(cour.getId()));
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ IOTools.safeClose(jbpmContext);
+ }
+ return pendingQueue;
+ }
+
+ /**
+ * Retrieves a queue of unapproved content for everything in the CMS.
+ *
+ * @return
+ * @throws WorkflowException
+ */
+ public Collection getAllPendingInQueue() throws WorkflowException
+ {
+ Collection pendingQueue = new ArrayList();
+ JbpmContext jbpmContext = null;
+ try
+ {
+ jbpmContext = this.workflowService.getJbpmConfiguration().createJbpmContext();
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ ProcessDefinition processDef = graphSession.findLatestProcessDefinition(this.processName);
+ List processInstances = graphSession.findProcessInstances(processDef.getId());
+
+ if (processInstances != null)
+ {
+ for (int i = 0; i < processInstances.size(); i++)
+ {
+ ProcessInstance cour = (ProcessInstance)processInstances.get(i);
+ //iterate through a list of currently pending approval tasks
+ if (!cour.hasEnded())
+ {
+ Content content = (Content)cour.getContextInstance().getVariable("content");
+
+ //apply proper criteria to extract pending content only for the specified file
+ if (content != null)
+ {
+ content.setProcessId(String.valueOf(cour.getId()));
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ IOTools.safeClose(jbpmContext);
+ }
+ return pendingQueue;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Set getManagers()
+ {
+ return this.managerSet;
+ }
+ //----------------------------------------------------------------------------------------------------------------
+ /**
+ * checks to see if the user trying to approve/deny a publish request belongs to the
+ * approved list of managers
+ *
+ * @param user
+ * @param managerRole
+ * @return
+ */
+ private boolean isManager(String user,String managerRole) throws Exception
+ {
+ boolean isManager = false;
+
+ Set userRoles = this.membershipModule.getRoles(
+ this.userModule.findUserByUserName(user));
+ if(userRoles != null)
+ {
+ for(Iterator itr=userRoles.iterator();itr.hasNext();)
+ {
+ Role cour = (Role)itr.next();
+ if(cour.getName().equalsIgnoreCase(managerRole))
+ {
+ //user is allowed to be a manager for this workflow
+ isManager = true;
+ break;
+ }
+ }
+ }
+
+ return isManager;
+ }
+}
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/ApprovePublishServlet.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,108 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.UnavailableException;
+
+import javax.naming.InitialContext;
+
+/**
+ * Created on : Dec 20, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class ApprovePublishServlet extends HttpServlet
+{
+ private ApprovePublish approvePublishWorkflow = null;
+
+ /**
+ *
+ */
+ public void init() throws ServletException
+ {
+ try
+ {
+ super.init();
+ InitialContext context = new InitialContext();
+ approvePublishWorkflow = (ApprovePublish)context.lookup("java:portal/ApprovePublishWorkflow");
+ }
+ catch (Exception e)
+ {
+ throw new UnavailableException(e.toString());
+ }
+ }
+
+ /**
+ *
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ this.doPost(request, response);
+ }
+
+ /**
+ *
+ */
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ try
+ {
+ String processId = request.getParameter("pId");
+ String manager = request.getParameter("manager");
+ boolean approve = request.getRequestURI().indexOf("approve") != -1;
+
+ this.approvePublishWorkflow.processManagerResponse(
+ Long.parseLong(processId), manager, approve
+ );
+
+ /**
+ * TODO: this is a hack job until a decent GUI is integrated
+ * with this workflow..Yes Yes, this will be based on JSP then
+ */
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("<html>\n");
+ if (approve)
+ {
+ buffer.append("<span>The content was successfully published</span>\n");
+ }
+ else
+ {
+ buffer.append("<span>The content publish request was rejected</span>\n");
+ }
+ buffer.append("</html>\n");
+
+ response.getWriter().write(buffer.toString());
+ response.getWriter().flush();
+ }
+ catch (Exception e)
+ {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.toString());
+ }
+ }
+}
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/Content.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.Format;
+import java.text.SimpleDateFormat;
+
+/**
+ * Created on : Dec 20, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class Content implements Serializable
+{
+
+ private String path = null;
+ private String userName = null;
+ private String mimeType = null;
+ private int size = 0;
+ private Date creationDate = null;
+
+ private String processId = null;
+
+ /**
+ *
+ *
+ */
+ public Content()
+ {
+
+ }
+
+ /**
+ * @return the path
+ */
+ public String getPath()
+ {
+ return path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ /**
+ * @return the userName
+ */
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ /**
+ * @param userName the userName to set
+ */
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ /**
+ * @return the mimeType
+ */
+ public String getMimeType()
+ {
+ return mimeType;
+ }
+
+ /**
+ * @param mimeType the mimeType to set
+ */
+ public void setMimeType(String mimeType)
+ {
+ this.mimeType = mimeType;
+ }
+
+ /**
+ * @return the size
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+ /**
+ * @param size the size to set
+ */
+ public void setSize(int size)
+ {
+ this.size = size;
+ }
+
+ public String getSizeStr()
+ {
+ return String.valueOf((this.size / 1024)) + "kb";
+ }
+
+ /**
+ * @return the creationDate
+ */
+ public Date getCreationDate()
+ {
+ return creationDate;
+ }
+
+ /**
+ * @param creationDate the creationDate to set
+ */
+ public void setCreationDate(Date creationDate)
+ {
+ this.creationDate = creationDate;
+ }
+
+ public String getCreationDateStr()
+ {
+ String date = "";
+ if (this.creationDate != null)
+ {
+ Format formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+ date = formatter.format(this.creationDate);
+ }
+ return date;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getProcessId()
+ {
+ return processId;
+ }
+
+ /**
+ *
+ * @param processId
+ */
+ public void setProcessId(String processId)
+ {
+ this.processId = processId;
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -33,7 +33,7 @@
import org.jbpm.graph.def.*;
import org.jbpm.graph.exe.*;
-import org.jboss.portal.workflow.cms.Content;
+import org.jboss.portal.cms.workflow.Content;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.File;
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/PublishAssignmentHandler.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -22,34 +22,15 @@
******************************************************************************/
package org.jboss.portal.cms.workflow;
-import org.apache.log4j.Logger;
-
import java.util.Collection;
-import java.util.Iterator;
-import java.util.Set;
-import java.net.URLEncoder;
-import java.text.MessageFormat;
-import javax.naming.InitialContext;
-
-import org.jbpm.graph.exe.*;
-import org.jbpm.taskmgmt.def.*;
+import org.apache.log4j.Logger;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;
import org.jbpm.taskmgmt.exe.TaskInstance;
-//import org.jboss.portal.core.modules.MailModule;
-import org.jboss.portal.identity.IdentityServiceController;
-import org.jboss.portal.identity.MembershipModule;
-import org.jboss.portal.identity.UserModule;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.identity.IdentityContext;
-import org.jboss.portal.identity.User;
-
-import org.jboss.portal.workflow.cms.Content;
-
-
/**
*
* Created on : Dec 20, 2006
@@ -58,7 +39,7 @@
*/
public class PublishAssignmentHandler implements AssignmentHandler
{
- private static Logger log = Logger.getLogger(PublishAssignmentHandler.class);
+ // private static Logger log = Logger.getLogger(PublishAssignmentHandler.class);
/**
*
Added: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/workflow/TaskExceptionHandler.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.workflow;
+
+import org.jbpm.taskmgmt.exe.TaskInstance;
+import org.jbpm.graph.exe.ExecutionContext;
+import org.jbpm.graph.def.ActionHandler;
+
+
+/**
+ * Created on : Dec 21, 2006
+ *
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ */
+public class TaskExceptionHandler implements ActionHandler
+{
+
+ /**
+ *
+ */
+ public void execute(ExecutionContext executionContext)
+ {
+ TaskInstance current = executionContext.getTaskInstance();
+
+ TaskInstance t = executionContext.getTaskMgmtInstance().
+ createTaskInstance(executionContext.getTask(), executionContext);
+ t.setActorId(current.getActorId());
+
+ current.setVariable(executionContext.getProcessInstance().getId() + ":" + current.getId(), "markAsDeleted");
+
+ throw new RuntimeException(executionContext.getException());
+ }
+}
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/AbstractWorkflowTestCase.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -34,8 +34,8 @@
import org.jboss.portal.identity.db.HibernateRoleImpl;
import org.jboss.portal.identity.db.HibernateUserImpl;
import org.jboss.portal.server.impl.invocation.JBossInterceptorStack;
-import org.jboss.portal.workflow.cms.ApprovePublish;
-import org.jboss.portal.workflow.cms.ApprovePublishImpl;
+import org.jboss.portal.cms.workflow.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublishImpl;
import org.jboss.portal.test.cms.commands.AbstractCommandTestCase;
import org.jboss.portal.test.cms.commands.CMSInterceptorStackFactory;
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestApprovedPublish.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -37,7 +37,7 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.impl.jcr.JCRCMS;
/**
@@ -132,7 +132,7 @@
//Approve and publish this file into the CMS
Set managers = approvePublish.getManagers();
String manager = (String)managers.iterator().next();
- org.jboss.portal.workflow.cms.Content pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ org.jboss.portal.cms.workflow.Content pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()), manager.toLowerCase(), true);
//Make sure this resource is successfully published into the CMS, and removed from the pending queue
@@ -168,7 +168,7 @@
assertEquals(1,queueItems.size());
//Approve and publish this new version into the CMS
- pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()), manager.toLowerCase(),true);
//Check for the success of this publish, and removal from the pending queue
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestDeniedPublish.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -39,7 +39,7 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.impl.FileImpl;
import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.cms.impl.jcr.JCRCMS;
/**
@@ -135,7 +135,7 @@
//Deny the publish of this file into the CMS
Set managers = approvePublish.getManagers();
String manager = (String)managers.iterator().next();
- org.jboss.portal.workflow.cms.Content pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ org.jboss.portal.cms.workflow.Content pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()), manager.toLowerCase(), false);
//Make sure this resource is not published into the CMS, and removed from the pending queue
@@ -187,7 +187,7 @@
assertEquals(1,queueItems.size());
//Deny publishing of this new version into the CMS
- pendingItem = (org.jboss.portal.workflow.cms.Content)queueItems.iterator().next();
+ pendingItem = (org.jboss.portal.cms.workflow.Content)queueItems.iterator().next();
approvePublish.processManagerResponse(Long.parseLong(pendingItem.getProcessId()), manager.toLowerCase(),false);
//Check for the success of this denial, and removal from the pending queue
Modified: branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/workflow/TestWorkflowEnvironment.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -23,10 +23,12 @@
package org.jboss.portal.test.cms.workflow;
import java.util.Set;
+
+import junit.framework.Assert;
import junit.framework.TestSuite;
import org.jboss.portal.cms.CMSException;
-import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.cms.workflow.ApprovePublish;
/**
@@ -71,7 +73,7 @@
//Assert and make sure there is atleast one portal role that is allowed
//to function of content manager
- this.assertNotNull(managers);
- this.assertTrue(managers.size()>0);
+ Assert.assertNotNull(managers);
+ Assert.assertTrue(managers.size()>0);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -335,6 +335,7 @@
<fileset dir="${jboss.portal-theme.root}/lib" includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
<fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
+ <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar"/>
<fileset dir="${jboss.portal/modules/identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal/modules/identity.root}/lib" includes="portal-identity-sso-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
@@ -346,6 +347,9 @@
<fileset dir="${freemarker.freemarker.lib}" includes="freemarker.jar"/>
<fileset dir="${portals.bridges.lib}" includes="portals-bridges-common.jar"/>
<fileset dir="${jboss/backport.concurrent.lib}" includes="jboss-backport-concurrent.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}" includes="jbpm.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}" includes="jbpm-identity.jar"/>
+
</copy>
<!--dtd-->
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -155,19 +155,13 @@
<content-uri>/default/index.html</content-uri>
</content>
<region>center</region>
- <height>0</height>
- </window>
- <window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
- <region>left</region>
<height>1</height>
</window>
<window>
- <window-name>CurrentUsersPortletWindow</window-name>
- <instance-ref>CurrentUsersPortletInstance</instance-ref>
- <region>left</region>
- <height>2</height>
+ <window-name>CoreIdentityUserPortletWindow</window-name>
+ <instance-ref>CoreIdentityUserPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
</window>
</page>
</portal>
@@ -351,17 +345,11 @@
<page>
<page-name>Members</page-name>
<window>
- <window-name>UserPortletWindow</window-name>
- <instance-ref>UserPortletInstance</instance-ref>
+ <window-name>CoreIdentityAdminPortletWindow</window-name>
+ <instance-ref>CoreIdentityAdminPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
- <window>
- <window-name>RolePortletWindow</window-name>
- <instance-ref>RolePortletInstance</instance-ref>
- <region>left</region>
- <height>0</height>
- </window>
</page>
</portal>
</deployment>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -271,18 +271,6 @@
<fileset dir="${source.bin}/portal-cms-war"/>
<fileset dir="${build.resources}/portal-cms-war"/>
</copy>
-
- <!-- workflow service -->
- <copy todir="${build.resources}/portal-cms/portal-workflow.sar">
- <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar"/>
- <fileset dir="${jbpm.jaronly.lib}" includes="jbpm.jar"/>
- <fileset dir="${jbpm.jaronly.lib}" includes="jbpm-identity.jar"/>
- <fileset dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
- </copy>
- <!-- this war file is not needed for now -->
- <!--copy todir="${build.resources}/portal-cms/portal-workflow.sar/portal-workflow.war">
- <fileset dir="${jboss.portal-workflow.root}/lib/portal-workflow.war"/>
- </copy-->
</target>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -55,13 +55,14 @@
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.cms.security.AuthorizationManager;
import org.jboss.portal.cms.security.CMSPermission;
import org.jboss.portal.cms.security.Criteria;
import org.jboss.portal.cms.security.Permission;
-import org.jboss.portal.cms.security.AuthorizationManager;
import org.jboss.portal.cms.security.PortalCMSSecurityContext;
import org.jboss.portal.cms.util.FileUtil;
import org.jboss.portal.cms.util.NodeUtil;
+import org.jboss.portal.cms.workflow.ApprovePublish;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.AnonymousRole;
@@ -72,14 +73,12 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.search.FederatedQuery;
-import org.jboss.portal.search.Query;
import org.jboss.portal.search.impl.jcr.JCRQuery;
import org.jboss.portal.search.impl.jcr.JCRQueryConverter;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.workflow.WorkflowException;
-import org.jboss.portal.workflow.cms.ApprovePublish;
import org.jboss.portlet.JBossActionRequest;
import org.jboss.portlet.JBossActionResponse;
import org.jboss.portlet.JBossPortlet;
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -23,11 +23,10 @@
package org.jboss.portal.core.cms.ui.admin;
import java.io.IOException;
+import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -41,7 +40,6 @@
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.Content;
-import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
/**
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -573,4 +573,93 @@
optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
</mbean>
+
+ <!-- ApprovePublish workflow service -->
+ <mbean
+ code="org.jboss.portal.cms.workflow.ApprovePublishImpl"
+ name="portal:service=ApprovePublish,type=Workflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
+ portal:service=Workflow,type=WorkflowService
+ </depends>
+ <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
+ portal:service=Module,type=IdentityServiceController
+ </depends>
+ <!-- JBPM process definition -->
+ <attribute name="Process">
+ <![CDATA[
+ <!-- cms approval workflow -->
+ <process-definition name="approval_workflow">
+ <start-state>
+ <transition to="request_approval"/>
+ </start-state>
+ <task-node name="request_approval" signal="first">
+ <task name="approve_publish">
+ <assignment class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
+ <event type="task-start">
+ <action class="org.jboss.portal.cms.workflow.FinalizePublish"/>
+ </event>
+ <exception-handler>
+ <action class="org.jboss.portal.cms.workflow.TaskExceptionHandler"/>
+ </exception-handler>
+ </task>
+ <transition name="approval" to="end"/>
+ <transition name="rejection" to="end"/>
+ </task-node>
+ <end-state name="end"/>
+ </process-definition>
+ ]]>
+ </attribute>
+ <!--
+ overwrite = false creates the process first time if does not exist, for
+ subsequent server restarts, this process definition remains in tact
+
+ overwrite = true creates the process first time if does not exist,
+ for subsequent server restarts, it creates a new version of the process definition
+ which will be used for processes created from then onwards. Old processes created
+ for an older version of the definition remain in tact and use their corresponding
+ process definition.
+
+ Typically use overwrite=false and overwrite=true only when a new process definition
+ related to this workflow needs to be deployed
+ -->
+ <attribute name="Overwrite">false</attribute>
+ <!--
+ a comma separated list of portal roles that are designated
+ to act as workflow managers. They are allowed to
+ approve/reject content publish requests
+ -->
+ <attribute name="ManagerRoles">Admin</attribute>
+ <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
+
+ <!-- Now that a manager GUI is integrated..no need for email based manager screen -->
+<!--
+ <attribute name="From">do-not-reply(a)jboss.com</attribute>
+ <attribute name="Subject">Content Approval Requested</attribute>
+ <attribute name="Body">
+ <![CDATA[
+ Approval is needed to publish the following Content:
+
+ Content Location : {0}
+
+ Content Type : {1}
+
+ Content Size : {2}
+
+ Creation Date : {3}
+
+ User : {4}
+
+
+ <a href="http://localhost/workflow/approve?pId={5}&manager={6}">Approve</a>
+
+
+ <a href="http://localhost/workflow/reject?pId={7}&manager={8}">Reject</a>
+ ]]>
+ </attribute>
+-->
+ </mbean>
+
</server>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2007-09-06 12:48:33 UTC (rev 8187)
@@ -91,7 +91,7 @@
{
%>
<%
- org.jboss.portal.workflow.cms.Content cour = (org.jboss.portal.workflow.cms.Content)itr.next();
+ org.jboss.portal.cms.workflow.Content cour = (org.jboss.portal.cms.workflow.Content)itr.next();
String linkPath = cour.getPath().substring(0, cour.getPath().lastIndexOf("/"));
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2007-09-06 12:48:33 UTC (rev 8187)
@@ -341,7 +341,7 @@
{
%>
<%
- org.jboss.portal.workflow.cms.Content cour = (org.jboss.portal.workflow.cms.Content)itr.next();
+ org.jboss.portal.cms.workflow.Content cour = (org.jboss.portal.cms.workflow.Content)itr.next();
if (i % 2 == 0)
{
rowClass = "portlet-section-body";
Modified: branches/JBoss_Portal_Branch_2_6/widget/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/widget/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -165,18 +165,18 @@
description="Generate all target output."
depends="compile">
- <!-- widget-lib.jar -->
+ <!-- portal-widget-lib.jar -->
<mkdir dir="${build.lib}"/>
- <jar jarfile="${build.lib}/widget-lib.jar">
+ <jar jarfile="${build.lib}/portal-widget-lib.jar">
<fileset dir="${build.classes}"/>
</jar>
- <!-- widget.war -->
- <copy todir="${build.resources}/widget.war">
- <fileset dir="${build.resources}/widget-war"/>
+ <!-- portal-widget.war -->
+ <copy todir="${build.resources}/portal-widget.war">
+ <fileset dir="${build.resources}/portal-widget-war"/>
</copy>
- <copy todir="${build.resources}/widget.war/WEB-INF/lib">
- <fileset dir="${build.lib}" includes="widget-lib.jar"/>
+ <copy todir="${build.resources}/portal-widget.war/WEB-INF/lib">
+ <fileset dir="${build.lib}" includes="portal-widget-lib.jar"/>
</copy>
</target>
@@ -187,8 +187,8 @@
depends="artifacts">
<implode
- dir="${build.resources}/widget.war"
- tofile="${build.lib}/widget.war"/>
+ dir="${build.resources}/portal-widget.war"
+ tofile="${build.lib}/portal-widget.war"/>
</target>
@@ -228,14 +228,14 @@
description="Deploy."
depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <copy file="${build.lib}/widget.war" todir="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-widget.war" todir="${jboss.home}/server/${portal.deploy.dir}"/>
</target>
<target name="undeploy"
description="Undeploy."
depends="init">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-widget.war"/>
</target>
<target name="package-tests" depends="init, output">
@@ -265,7 +265,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.widget.google.QueryResultParserTestCase"/>
</x-test>
<x-classpath>
- <pathelement location="${build.lib}/widget-lib.jar"/>
+ <pathelement location="${build.lib}/potal-widget-lib.jar"/>
<pathelement location="${build.resources}/test"/>
<path refid="beanshell.beanshell.classpath"/>
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war (from rev 8125, branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war)
Copied: branches/JBoss_Portal_Branch_2_6/widget/src/resources/portal-widget-war/WEB-INF (from rev 8186, branches/JBoss_Portal_Branch_2_6/widget/src/resources/widget-war/WEB-INF)
Modified: branches/JBoss_Portal_Branch_2_6/workflow/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/workflow/build.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -171,13 +171,38 @@
<fileset dir="${build.classes}"/>
<!--fileset dir="${build.resources}/portal-workflow-jar"/-->
</jar>
-
- <!-- create the war file, not needed anymore -->
- <!--copy todir="${build.lib}/portal-workflow.war">
+
+ <copy todir="${build.lib}/portal-workflow-war">
<fileset dir="${build.resources}/portal-workflow-war"/>
- </copy-->
+ </copy>
+
+ <jar jarfile="${build.lib}/portal-workflow.war">
+ <fileset dir="${build.lib}/portal-workflow-war"/>
+ </jar>
+
+ <!-- workflow service -->
+ <copy todir="${build.lib}/portal-workflow-sar">
+<!--
+ <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar, portal-workflow.war"/>
+ <fileset dir="${jbpm.jaronly.lib}" includes="jbpm.jar"/>
+ <fileset dir="${jbpm.jaronly.lib}" includes="jbpm-identity.jar"/>
+-->
+ <fileset dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
+ </copy>
+
+ <jar jarfile="${build.lib}/portal-workflow.sar">
+ <fileset dir="${build.lib}/portal-workflow-sar"/>
+ </jar>
+
</target>
-
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-workflow.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ </target>
+
<!--
generates artifacts used for tests, requires output to be previously run
-->
Added: branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadService.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,163 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.workflow.service;
+
+import org.jboss.logging.Logger;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.msg.command.CommandExecutorThread;
+import org.jbpm.scheduler.impl.SchedulerThread;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class JbpmThreadService implements JbpmThreadServiceMBean
+{
+
+ private String jbpmConfigurationResource = null;
+
+ private String jbpmContextName = null;
+
+// private String commandExecutorInterval = null;
+
+ private String schedulerInterval = null;
+
+ private String priority = null;
+
+// private String maxResultCount = null;
+
+ private Logger log = Logger.getLogger(JbpmThreadService.class);
+
+ private CommandExecutorThread commandExecutorThread = null;
+
+ private SchedulerThread schedulerThread = null;
+
+ public void start()
+ {
+ if (jbpmConfigurationResource==null) {
+ log.debug("using default jbpm cfg resource");
+ } else {
+ log.debug("using jbpm cfg resource: '"+jbpmConfigurationResource+"'");
+ }
+
+ if (jbpmContextName==null) {
+ log.debug("using default jbpm context");
+ jbpmContextName = JbpmContext.DEFAULT_JBPM_CONTEXT_NAME;
+ } else {
+ log.debug("using jbpm context: '"+jbpmContextName+"'");
+ }
+
+// int commandExecutorIntervalInt = Integer.parseInt(getInitParameter(commandExecutorInterval, "5000"));
+ int schedulerIntervalInt = Integer.parseInt(getInitParameter(schedulerInterval, "5000"));
+ int priorityInt = Integer.parseInt(getInitParameter(priority, "1"));
+// int maxResultCountInt = Integer.parseInt(getInitParameter(maxResultCount, "1"));
+
+ JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance(jbpmConfigurationResource);
+
+ commandExecutorThread = new CommandExecutorThread(jbpmConfiguration);
+// commandExecutorThread.setInterval(commandExecutorIntervalInt);
+ commandExecutorThread.setPriority(priorityInt);
+ commandExecutorThread.start();
+
+ schedulerThread = new SchedulerThread(jbpmConfiguration);
+ schedulerThread.setPriority(priorityInt);
+ schedulerThread.setInterval(schedulerIntervalInt);
+// schedulerThread.setMaxResultCount(maxResultCountInt);
+ schedulerThread.start();
+ }
+
+ protected String getInitParameter(String name, String defaultValue) {
+ if (name!=null) {
+ return name;
+ }
+ return defaultValue;
+ }
+
+ public void stop()
+ {
+ if ( (schedulerThread!=null)
+ && (schedulerThread.isAlive())
+ ) {
+ schedulerThread.destroy();
+ }
+ if ( (commandExecutorThread!=null)
+ && (commandExecutorThread.isAlive())
+ ) {
+ commandExecutorThread.destroy();
+ }
+
+ }
+
+ public String getJbpmConfigurationResource()
+ {
+ return jbpmConfigurationResource;
+ }
+
+ public void setJbpmConfigurationResource(String jbpmConfigurationResource)
+ {
+ this.jbpmConfigurationResource = jbpmConfigurationResource;
+ }
+
+ public String getJbpmContextName()
+ {
+ return jbpmContextName;
+ }
+
+ public void setJbpmContextName(String jbpmContextName)
+ {
+ this.jbpmContextName = jbpmContextName;
+ }
+
+ public String getSchedulerInterval()
+ {
+ return schedulerInterval;
+ }
+
+ public void setSchedulerInterval(String schedulerInterval)
+ {
+ this.schedulerInterval = schedulerInterval;
+ }
+
+ public String getPriority()
+ {
+ return priority;
+ }
+
+ public void setPriority(String priority)
+ {
+ this.priority = priority;
+ }
+
+ public SchedulerThread getSchedulerThread()
+ {
+ return schedulerThread;
+ }
+
+ public void setSchedulerThread(SchedulerThread schedulerThread)
+ {
+ this.schedulerThread = schedulerThread;
+ }
+
+}
+
Added: branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/main/org/jboss/portal/workflow/service/JbpmThreadServiceMBean.java 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.workflow.service;
+
+import org.jbpm.scheduler.impl.SchedulerThread;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface JbpmThreadServiceMBean
+{
+ public String getJbpmConfigurationResource();
+
+ public void setJbpmConfigurationResource(String jbpmConfigurationResource);
+
+ public String getJbpmContextName();
+
+ public void setJbpmContextName(String jbpmContextName);
+
+ public String getSchedulerInterval();
+
+ public void setSchedulerInterval(String schedulerInterval);
+
+ public String getPriority();
+
+ public void setPriority(String priority);
+
+ public SchedulerThread getSchedulerThread();
+
+ public void setSchedulerThread(SchedulerThread schedulerThread);
+
+}
+
Deleted: branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -1,151 +0,0 @@
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<server>
- <!-- Hibernate service -->
- <mbean
- code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
- name="portal:service=Hibernate,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
- <attribute name="DoChecking">true</attribute>
- <attribute name="ConfigLocation">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
- <attribute name="JNDIName">java:/portal/workflow/WorkFlowSessionFactory</attribute>
- </mbean>
-
- <!-- Workflow service -->
- <mbean
- code="org.jboss.portal.workflow.service.WorkflowServiceImpl"
- name="portal:service=Workflow,type=WorkflowService"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends>portal:service=Hibernate,type=Workflow</depends>
- <attribute name="JbpmConfigurationXml">
- <![CDATA[
- <jbpm-configuration>
- <jbpm-context>
- <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory"/>
- </jbpm-context>
- <string name="resource.hibernate.cfg.xml" value="conf/hibernate/workflow/hibernate.cfg.xml"/>
- <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
- <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties"/>
- <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties"/>
- <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml"/>
- <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml"/>
- <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml"/>
- </jbpm-configuration>
- ]]>
- </attribute>
- </mbean>
-
- <!-- ApprovePublish workflow service -->
- <mbean
- code="org.jboss.portal.workflow.cms.ApprovePublishImpl"
- name="portal:service=ApprovePublish,type=Workflow"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- <depends optional-attribute-name="WorkflowService" proxy-type="attribute">
- portal:service=Workflow,type=WorkflowService
- </depends>
- <depends optional-attribute-name="IdentityServiceController" proxy-type="attribute">
- portal:service=Module,type=IdentityServiceController
- </depends>
- <!-- JBPM process definition -->
- <attribute name="Process">
- <![CDATA[
- <!-- cms approval workflow -->
- <process-definition name="approval_workflow">
- <start-state>
- <transition to="request_approval"/>
- </start-state>
- <task-node name="request_approval" signal="first">
- <task name="approve_publish">
- <assignment class="org.jboss.portal.cms.workflow.PublishAssignmentHandler"/>
- <event type="task-start">
- <action class="org.jboss.portal.cms.workflow.FinalizePublish"/>
- </event>
- <exception-handler>
- <action class="org.jboss.portal.workflow.cms.TaskExceptionHandler"/>
- </exception-handler>
- </task>
- <transition name="approval" to="end"/>
- <transition name="rejection" to="end"/>
- </task-node>
- <end-state name="end"/>
- </process-definition>
- ]]>
- </attribute>
- <!--
- overwrite = false creates the process first time if does not exist, for
- subsequent server restarts, this process definition remains in tact
-
- overwrite = true creates the process first time if does not exist,
- for subsequent server restarts, it creates a new version of the process definition
- which will be used for processes created from then onwards. Old processes created
- for an older version of the definition remain in tact and use their corresponding
- process definition.
-
- Typically use overwrite=false and overwrite=true only when a new process definition
- related to this workflow needs to be deployed
- -->
- <attribute name="Overwrite">false</attribute>
- <!--
- a comma separated list of portal roles that are designated
- to act as workflow managers. They are allowed to
- approve/reject content publish requests
- -->
- <attribute name="ManagerRoles">Admin</attribute>
- <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
-
- <!-- Now that a manager GUI is integrated..no need for email based manager screen -->
-<!--
- <attribute name="From">do-not-reply(a)jboss.com</attribute>
- <attribute name="Subject">Content Approval Requested</attribute>
- <attribute name="Body">
- <![CDATA[
- Approval is needed to publish the following Content:
-
- Content Location : {0}
-
- Content Type : {1}
-
- Content Size : {2}
-
- Creation Date : {3}
-
- User : {4}
-
-
- <a href="http://localhost/workflow/approve?pId={5}&manager={6}">Approve</a>
-
-
- <a href="http://localhost/workflow/reject?pId={7}&manager={8}">Reject</a>
- ]]>
- </attribute>
--->
- </mbean>
-</server>
Added: branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -0,0 +1,71 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <!-- Hibernate service -->
+ <mbean
+ code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+ name="portal:service=Hibernate,type=Workflow"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+ <attribute name="DoChecking">true</attribute>
+ <attribute name="ConfigLocation">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
+ <attribute name="JNDIName">java:/portal/workflow/WorkFlowSessionFactory</attribute>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.workflow.service.JbpmThreadService"
+ name="portal:service=Thread,type=WorkflowService">
+ <attribute name="JbpmConfigurationResource">conf/hibernate/workflow/hibernate.cfg.xml</attribute>
+ </mbean>
+
+ <!-- Workflow service -->
+ <mbean
+ code="org.jboss.portal.workflow.service.WorkflowServiceImpl"
+ name="portal:service=Workflow,type=WorkflowService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate,type=Workflow</depends>
+ <attribute name="JbpmConfigurationXml">
+ <![CDATA[
+ <jbpm-configuration>
+ <jbpm-context>
+ <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory" />
+ <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
+ </jbpm-context>
+ <string name="resource.hibernate.cfg.xml" value="conf/hibernate/workflow/hibernate.cfg.xml"/>
+ <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties"/>
+ <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties"/>
+ <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties"/>
+ <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml"/>
+ <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml"/>
+ <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml"/>
+ </jbpm-configuration>
+ ]]>
+ </attribute>
+ </mbean>
+
+</server>
Modified: branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-sar/conf/hibernate/workflow/hibernate.cfg.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -17,7 +17,7 @@
<!-- caching properties -->
<property name="cache.use_second_level_cache">true</property>
<property name="cache.use_query_cache">true</property>
- <property name="cache.provider_configuration_file_resource_path">conf/hibernate/cms/ehcache.xml</property>
+ <property name="cache.provider_configuration_file_resource_path">conf/hibernate/workflow/ehcache.xml</property>
<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<!-- managed environment transaction configuration -->
Modified: branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-06 12:33:24 UTC (rev 8186)
+++ branches/JBoss_Portal_Branch_2_6/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2007-09-06 12:48:33 UTC (rev 8187)
@@ -1,43 +1,43 @@
-<?xml version="1.0"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<web-app
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
- <servlet>
- <servlet-name>ApprovePublishServlet</servlet-name>
- <servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
- <!--load-on-startup>0</load-on-startup-->
- </servlet>
- <servlet-mapping>
- <servlet-name>ApprovePublishServlet</servlet-name>
- <url-pattern>/approve/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>ApprovePublishServlet</servlet-name>
- <url-pattern>/reject/*</url-pattern>
- </servlet-mapping>
-</web-app>
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+ <servlet>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+ <servlet-class>org.jboss.portal.workflow.cms.ApprovePublishServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+ <url-pattern>/approve/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ApprovePublishServlet</servlet-name>
+ <url-pattern>/reject/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
18 years, 8 months
JBoss Portal SVN: r8186 - in modules/identity/trunk: identity and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 08:33:24 -0400 (Thu, 06 Sep 2007)
New Revision: 8186
Modified:
modules/identity/trunk/
modules/identity/trunk/identity/
Log:
minor
Property changes on: modules/identity/trunk
___________________________________________________________________
Name: svn:ignore
+ thirdparty
Property changes on: modules/identity/trunk/identity
___________________________________________________________________
Name: svn:ignore
+ output
18 years, 8 months
JBoss Portal SVN: r8185 - branches/JBoss_Portal_Branch_2_6/core-identity.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-09-06 08:25:16 -0400 (Thu, 06 Sep 2007)
New Revision: 8185
Modified:
branches/JBoss_Portal_Branch_2_6/core-identity/.classpath
branches/JBoss_Portal_Branch_2_6/core-identity/build.xml
Log:
Adapt for modules
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/.classpath 2007-09-06 12:17:42 UTC (rev 8184)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/.classpath 2007-09-06 12:25:16 UTC (rev 8185)
@@ -6,14 +6,12 @@
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/faces"/>
<classpathentry combineaccessrules="false" kind="src" path="/format"/>
- <classpathentry combineaccessrules="false" kind="src" path="/identity"/>
<classpathentry combineaccessrules="false" kind="src" path="/jems"/>
<classpathentry combineaccessrules="false" kind="src" path="/portlet"/>
<classpathentry combineaccessrules="false" kind="src" path="/security"/>
<classpathentry combineaccessrules="false" kind="src" path="/server"/>
<classpathentry combineaccessrules="false" kind="src" path="/workflow"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/common"/>
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/hibernate/lib/hibernate3.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
@@ -37,14 +35,17 @@
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jnpserver.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/namespace.jar"/>
<classpathentry kind="lib" path="/thirdparty/jcaptcha/lib/jcaptcha.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar" sourcepath="/JBoss_AS_4.0.5/system/src/main"/>
- <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar" sourcepath="/JBoss_AS_4.0.5/jmx/src/main"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/jaronly/lib/jbpm.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/jaronly/lib/jbpm-identity.jar"/>
<classpathentry kind="lib" path="/thirdparty/facelets/lib/jsf-facelets.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/jstl.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-myfaces/lib/myfaces-impl.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/identity/lib/portal-identity-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-lib.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar" sourcepath="/JBoss_AS_4.0.5/jmx/src/main"/>
+ <classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar" sourcepath="/JBoss_AS_4.0.5/system/src/main"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss-portal/modules/common/lib/portal-common-portal-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jbossxb/lib/jboss-xml-binding.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/theme"/>
<classpathentry kind="output" path="bin"/>
Modified: branches/JBoss_Portal_Branch_2_6/core-identity/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-identity/build.xml 2007-09-06 12:17:42 UTC (rev 8184)
+++ branches/JBoss_Portal_Branch_2_6/core-identity/build.xml 2007-09-06 12:25:16 UTC (rev 8185)
@@ -88,6 +88,9 @@
&libraries;
<path id="library.classpath">
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="jboss.portal/modules/test.classpath"/>
+ <path refid="jboss.portal/modules/identity.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.xerces.classpath"/>
<path refid="jboss.cache.classpath"/>
@@ -110,7 +113,6 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-format.classpath"/>
- <path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-faces.classpath"/>
<path refid="jboss.portal-bridge.classpath"/>
<path refid="jboss.portal-server.classpath"/>
@@ -118,11 +120,9 @@
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-portlet-federation.classpath"/>
- <path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
- <path refid="jboss.portal-test.classpath"/>
<path refid="jboss.portal-core.classpath"/>
<path refid="jboss.portal-workflow.classpath"/>
</path>
18 years, 8 months