JBoss Portal SVN: r5930 - in trunk/wsrp: . src/main/org/jboss/portal/test/wsrp/config src/main/org/jboss/portal/test/wsrp/framework src/main/org/jboss/portal/wsrp src/main/org/jboss/portal/wsrp/deployment src/main/org/jboss/portal/wsrp/producer/config src/main/org/jboss/portal/wsrp/producer/config/impl src/resources/portal-wsrp-sar src/resources/portal-wsrp-sar/META-INF src/resources/portal-wsrp-sar/conf src/resources/tests src/resources/tests/test-producer-configuration-lib-jar
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-22 16:16:44 -0500 (Fri, 22 Dec 2006)
New Revision: 5930
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml
Removed:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml
trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/portal-wsrp-sar/conf/config.xml
trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
Log:
Re-factored producer configuration code and tests (registration-configuration -> producer-configuration).
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/build.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -346,10 +346,10 @@
</jar>
</target>
- <target name="package-registration-configuration-test"
- description="Generates the registration configuration test artifacts" depends="compile">
- <jar jarfile="${build.lib.test}/test-registration-configuration-lib.jar">
- <fileset dir="${build.resources.test}/test-registration-configuration-lib-jar"/>
+ <target name="package-producer-configuration-test"
+ description="Generates the producer configuration test artifacts" depends="compile">
+ <jar jarfile="${build.lib.test}/test-producer-configuration-lib.jar">
+ <fileset dir="${build.resources.test}/test-producer-configuration-lib-jar"/>
<fileset dir="${build.classes}/">
<include name="org/jboss/portal/test/wsrp/config/**"/>
</fileset>
@@ -523,7 +523,7 @@
<!-- Packages all the test related artifacts. Note that compilation should have been already executed -->
<target name="package-tests" depends="package-consumer-test, package-deployment-test, package-other-test,
- package-producer-test, package-registration-configuration-test"
+ package-producer-test, package-producer-configuration-test"
description="Packages all the test-related artifacts. Does NOT compile classes so this should be done before
calling this task."/>
@@ -545,7 +545,7 @@
<antcall target="consumer-test"/>
<antcall target="deployment-test"/>
<antcall target="other-test"/>
- <antcall target="registration-configuration-test"/>
+ <antcall target="producer-configuration-test"/>
<antcall target="agent-undeploy"/>
<server:stop name="default"/>
<antcall target="reports"/>
@@ -556,7 +556,7 @@
<antcall target="consumer-test"/>
<antcall target="deployment-test"/>
<antcall target="other-test"/>
- <antcall target="registration-configuration-test"/>
+ <antcall target="producer-configuration-test"/>
</target>
<!-- WSRP Producer tests -->
@@ -642,10 +642,10 @@
</target>
<!-- Producer registration configuration tests -->
- <target name="registration-configuration-test" depends="package-registration-configuration-test">
+ <target name="producer-configuration-test" depends="package-producer-configuration-test">
<execute-tests>
<x-test>
- <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.config.RegistrationConfigurationTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.config.ProducerConfigurationTestCase"/>
</x-test>
<x-sysproperty>
<!--<jvmarg value="-Xdebug"/>
@@ -656,7 +656,7 @@
</x-sysproperty>
<x-classpath>
<fileset dir="${build.lib}" includes="portal-wsrp-lib.jar"/>
- <fileset dir="${build.lib.test}" includes="test-registration-configuration-lib.jar"/>
+ <fileset dir="${build.lib.test}" includes="test-producer-configuration-lib.jar"/>
<path refid="jboss.microcontainer.classpath"/>
<path refid="library.classpath"/>
<path refid="dependentmodule.classpath"/>
Copied: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java (from rev 5917, trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java)
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java 2006-12-20 22:09:59 UTC (rev 5917)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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.wsrp.config;
+
+import junit.framework.TestCase;
+import org.jboss.portal.wsrp.producer.config.LocalizedString;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationFactory;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ProducerConfigurationTestCase extends TestCase
+{
+ private Unmarshaller unmarshaller;
+ private ObjectModelFactory factory;
+
+
+ protected void setUp() throws Exception
+ {
+ unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+ factory = new ProducerConfigurationFactory();
+ }
+
+ public void testExtendedUnmarshalling() throws Exception
+ {
+ URL wsrpXMLLocation = Thread.currentThread().getContextClassLoader().getResource("extended.xml");
+ assertNotNull(wsrpXMLLocation);
+
+ Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
+ assertNotNull(o);
+ assertTrue(o instanceof ProducerConfiguration);
+ ProducerRegistrationRequirements requirements = ((ProducerConfiguration)o).getRegistrationRequirements();
+ assertNotNull(requirements);
+ assertTrue(requirements.requiresRegistration());
+ assertTrue(requirements.fullServiceDescriptionRequiresRegistration());
+ Map properties = requirements.getRegistrationProperties();
+ assertNotNull(properties);
+ assertEquals(2, properties.size());
+
+ checkRegistrationProperty(requirements, 1);
+ checkRegistrationProperty(requirements, 2);
+ }
+
+ public void testMinimalUnmarshalling() throws Exception
+ {
+ URL wsrpXMLLocation = Thread.currentThread().getContextClassLoader().getResource("minimal.xml");
+ assertNotNull(wsrpXMLLocation);
+ Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
+ assertNotNull(o);
+ assertTrue(o instanceof ProducerConfiguration);
+ ProducerRegistrationRequirements requirements = ((ProducerConfiguration)o).getRegistrationRequirements();
+ assertNotNull(requirements);
+ assertTrue(requirements.requiresRegistration());
+ assertTrue(!requirements.fullServiceDescriptionRequiresRegistration());
+ Map properties = requirements.getRegistrationProperties();
+ assertNotNull(properties);
+ assertTrue(properties.isEmpty());
+ }
+
+ private void checkRegistrationProperty(ProducerRegistrationRequirements requirements, int index)
+ {
+ RegistrationPropertyDescription desc = requirements.getRegistrationPropertyWith("name" + index);
+ assertNotNull(desc);
+ assertEquals(new QName("name" + index), desc.getName());
+ assertEquals(new QName("xsd:string"), desc.getType());
+
+ LocalizedString localizedString = new LocalizedString("hint" + index, Locale.ENGLISH);
+ localizedString.setResourceName("resource.hint" + index);
+ localizedString.setValue("hint" + index);
+ assertEquals(localizedString, desc.getHint());
+
+ localizedString = new LocalizedString("label" + index, Locale.ENGLISH);
+ localizedString.setResourceName("resource.label" + index);
+ localizedString.setValue("label" + index);
+ assertEquals(localizedString, desc.getLabel());
+ }
+}
Deleted: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/RegistrationConfigurationTestCase.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -1,108 +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.wsrp.config;
-
-import junit.framework.TestCase;
-import org.jboss.portal.wsrp.producer.config.LocalizedString;
-import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
-import org.jboss.portal.wsrp.producer.config.RegistrationConfigurationFactory;
-import org.jboss.portal.wsrp.producer.config.RegistrationPropertyDescription;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.Unmarshaller;
-import org.jboss.xb.binding.UnmarshallerFactory;
-
-import javax.xml.namespace.QName;
-import java.net.URL;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class RegistrationConfigurationTestCase extends TestCase
-{
- private Unmarshaller unmarshaller;
- private ObjectModelFactory factory;
-
-
- protected void setUp() throws Exception
- {
- unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- factory = new RegistrationConfigurationFactory();
- }
-
- public void testExtendedUnmarshalling() throws Exception
- {
- URL wsrpXMLLocation = Thread.currentThread().getContextClassLoader().getResource("extended.xml");
- assertNotNull(wsrpXMLLocation);
-
- Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
- assertNotNull(o);
- assertTrue(o instanceof ProducerRegistrationRequirements);
- ProducerRegistrationRequirements requirements = (ProducerRegistrationRequirements)o;
- assertTrue(requirements.requiresRegistration());
- assertTrue(requirements.fullServiceDescriptionRequiresRegistration());
- Map properties = requirements.getRegistrationProperties();
- assertNotNull(properties);
- assertEquals(2, properties.size());
-
- checkRegistrationProperty(requirements, 1);
- checkRegistrationProperty(requirements, 2);
- }
-
- public void testMinimalUnmarshalling() throws Exception
- {
- URL wsrpXMLLocation = Thread.currentThread().getContextClassLoader().getResource("minimal.xml");
- assertNotNull(wsrpXMLLocation);
- Object o = unmarshaller.unmarshal(wsrpXMLLocation.openStream(), factory, null);
- assertNotNull(o);
- assertTrue(o instanceof ProducerRegistrationRequirements);
- ProducerRegistrationRequirements requirements = (ProducerRegistrationRequirements)o;
- assertTrue(requirements.requiresRegistration());
- assertTrue(!requirements.fullServiceDescriptionRequiresRegistration());
- Map properties = requirements.getRegistrationProperties();
- assertNotNull(properties);
- assertTrue(properties.isEmpty());
- }
-
- private void checkRegistrationProperty(ProducerRegistrationRequirements requirements, int index)
- {
- RegistrationPropertyDescription desc = requirements.getRegistrationPropertyWith("name" + index);
- assertNotNull(desc);
- assertEquals(new QName("name" + index), desc.getName());
- assertEquals(new QName("xsd:string"), desc.getType());
-
- LocalizedString localizedString = new LocalizedString("hint" + index, Locale.ENGLISH);
- localizedString.setResourceName("resource.hint" + index);
- localizedString.setValue("hint" + index);
- assertEquals(localizedString, desc.getHint());
-
- localizedString = new LocalizedString("label" + index, Locale.ENGLISH);
- localizedString.setResourceName("resource.label" + index);
- localizedString.setValue("label" + index);
- assertEquals(localizedString, desc.getLabel());
- }
-}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -72,6 +72,7 @@
import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import javax.servlet.http.Cookie;
@@ -370,4 +371,15 @@
{
throw new UnsupportedOperationException("getRegistrationManager not implemented");
}
+
+
+ public ProducerConfiguration getProducerConfiguration()
+ {
+ throw new UnsupportedOperationException("getProducerConfiguration not implemented");
+ }
+
+ public void setProducerConfiguration(ProducerConfiguration producerConfiguration)
+ {
+ throw new UnsupportedOperationException("setProducerConfiguration not implemented");
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -29,6 +29,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
/**
@@ -90,7 +91,27 @@
*/
void setSessionExpirationTime(int sessionExpirationTime);
+ /**
+ * @return
+ * @since 2.6
+ */
ProducerRegistrationRequirements getProducerRegistrationRequirements();
+ /**
+ * @return
+ * @since 2.6
+ */
RegistrationManager getRegistrationManager();
+
+ /**
+ * @return
+ * @since 2.6
+ */
+ ProducerConfiguration getProducerConfiguration();
+
+ /**
+ * @param producerConfiguration
+ * @since 2.6
+ */
+ void setProducerConfiguration(ProducerConfiguration producerConfiguration);
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/deployment/WSRPDeployment.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.wsrp.deployment;
-import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.system.ServiceMBeanSupport;
import java.util.ArrayList;
@@ -36,7 +34,6 @@
public class WSRPDeployment extends ServiceMBeanSupport implements WSRPDeploymentMBean
{
private final List services;
- private ProducerRegistrationRequirements registrationRequirements;
public WSRPDeployment()
{
@@ -47,15 +44,4 @@
{
return services;
}
-
- public ProducerRegistrationRequirements getRegistrationRequirements()
- {
- return registrationRequirements;
- }
-
- public void setRegistrationRequirements(ProducerRegistrationRequirements registrationRequirements)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(registrationRequirements, "Registration requirements");
- this.registrationRequirements = registrationRequirements;
- }
}
Copied: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java (from rev 5917, trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java)
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java 2006-12-20 22:09:59 UTC (rev 5917)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -0,0 +1,211 @@
+/******************************************************************************
+ * 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.wsrp.producer.config;
+
+import org.jboss.portal.common.util.LocaleInfo;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationImpl;
+import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
+import org.jboss.util.StringPropertyReplacer;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+import javax.xml.namespace.QName;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ProducerConfigurationFactory implements ObjectModelFactory
+{
+ private static final String REGISTRATION_CONFIG = "registration-configuration";
+ private static final boolean DEBUG = false;
+
+ public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newRoot " + localName);
+ }
+
+ if ("producer-configuration".equals(localName))
+ {
+ return new ProducerConfigurationImpl();
+ }
+ throw new IllegalArgumentException("The processed file doesn't seem to have the proper format");
+ }
+
+ public Object newChild(ProducerConfigurationImpl producerConfiguration, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newChild prodConf " + localName);
+ }
+
+ if (REGISTRATION_CONFIG.equals(localName))
+ {
+ ProducerRegistrationRequirements registrationRequirements = new ProducerRegistrationRequirementsImpl();
+ registrationRequirements.setRequiresRegistration(true);
+ String descRequiresRegistration = attrs.getValue("fullServiceDescriptionRequiresRegistration");
+ if ("true".equals(descRequiresRegistration))
+ {
+ registrationRequirements.setFullServiceDescriptionRequiresRegistration(true);
+ }
+ return registrationRequirements;
+ }
+ return null;
+ }
+
+ public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
+ {
+ return root;
+ }
+
+ public Object newChild(ProducerRegistrationRequirementsImpl regReq, UnmarshallingContext nav, String nsURI,
+ String localName, Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newChild regReq " + localName);
+ }
+
+ if ("registration-property-description".equals(localName))
+ {
+ return new RegistrationPropertyDescription();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setValue(RegistrationPropertyDescription desc, UnmarshallingContext nav, String nsURI,
+ String localName, String value)
+ {
+ if (DEBUG)
+ {
+ System.out.println("setvalue desc " + localName);
+ }
+
+ if ("name".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ desc.setName(new QName(value));
+ }
+ else if ("type".equals(localName))
+ {
+ value = StringPropertyReplacer.replaceProperties(value);
+ desc.setType(new QName(value));
+ }
+ }
+
+ public Object newChild(RegistrationPropertyDescription desc, UnmarshallingContext nav, String nsURI, String localName,
+ Attributes attrs)
+ {
+ if (DEBUG)
+ {
+ System.out.println("newchild desc " + localName);
+ }
+
+ if ("hint".equals(localName) || "label".equals(localName))
+ {
+ String lang = attrs.getValue("xml:lang");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "xml:lang", localName);
+ Locale locale = LocaleInfo.decodeLocaleInfo(lang).getLocale();
+
+ String resourceName = attrs.getValue("resourceName");
+
+ LocalizedString string = new LocalizedString();
+ string.setLocale(locale);
+
+ if (resourceName != null && resourceName.length() > 0)
+ {
+ string.setResourceName(resourceName);
+ }
+
+ return string;
+ }
+
+ return null;
+ }
+
+ public void setValue(LocalizedString string, UnmarshallingContext nav, String nsURI, String localName, String value)
+ {
+ if (DEBUG)
+ {
+ System.out.println("setvalue string " + localName);
+ }
+
+ value = StringPropertyReplacer.replaceProperties(value);
+ string.setValue(value);
+ }
+
+ public void addChild(ProducerConfigurationImpl conf, ProducerRegistrationRequirementsImpl regReq,
+ UnmarshallingContext nav, String nsURI, String localName)
+ {
+ if (DEBUG)
+ {
+ System.out.println("addchild conf regReq " + localName);
+ }
+
+ if (conf.getRegistrationRequirements() != null)
+ {
+ throw new IllegalStateException("ProducerConfiguration already has registration information set!");
+ }
+
+ conf.setRegistrationRequirements(regReq);
+ }
+
+ public void addChild(ProducerRegistrationRequirementsImpl regReq, RegistrationPropertyDescription desc,
+ UnmarshallingContext nav, String nsURI, String localName)
+ {
+ if (DEBUG)
+ {
+ System.out.println("addchild regreq desc " + localName);
+ }
+
+ regReq.addRegistrationProperty(desc);
+ }
+
+ public void addChild(RegistrationPropertyDescription desc, LocalizedString string, UnmarshallingContext nav,
+ String nsURI, String localName)
+ {
+ if (DEBUG)
+ {
+ System.out.println("addchild desc string " + localName);
+ }
+
+ if ("hint".equals(localName))
+ {
+ desc.setHint(string);
+ }
+ else if ("label".equals(localName))
+ {
+ desc.setLabel(string);
+ }
+ }
+}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -25,6 +25,7 @@
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.wsrp.WSRPProducer;
import org.jboss.xb.binding.ObjectModelFactory;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
@@ -36,16 +37,11 @@
* @version $Revision$
* @since 2.6
*/
-public class ProducerConfigurationService extends AbstractJBossService implements ProducerConfiguration
+public class ProducerConfigurationService extends AbstractJBossService
{
- private ProducerRegistrationRequirements requirements;
private String configLocation;
+ private WSRPProducer producer;
- public ProducerRegistrationRequirements getRegistrationRequirements()
- {
- return requirements;
- }
-
public String getConfigLocation()
{
return configLocation;
@@ -56,9 +52,18 @@
this.configLocation = configLocation;
}
+ public WSRPProducer getProducer()
+ {
+ return producer;
+ }
- protected void createService() throws Exception
+ public void setProducer(WSRPProducer producer)
{
+ this.producer = producer;
+ }
+
+ protected void startService() throws Exception
+ {
// Setup URLs
if (configLocation == null)
{
@@ -75,7 +80,7 @@
}
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
- ObjectModelFactory factory = new RegistrationConfigurationFactory();
- requirements = (ProducerRegistrationRequirements)unmarshaller.unmarshal(configURL.openStream(), factory, null);
+ ObjectModelFactory factory = new ProducerConfigurationFactory();
+ producer.setProducerConfiguration((ProducerConfiguration)unmarshaller.unmarshal(configURL.openStream(), factory, null));
}
}
Deleted: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/RegistrationConfigurationFactory.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -1,175 +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.wsrp.producer.config;
-
-import org.jboss.portal.common.util.LocaleInfo;
-import org.jboss.portal.common.util.ParameterValidation;
-import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
-import org.jboss.util.StringPropertyReplacer;
-import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.xb.binding.UnmarshallingContext;
-import org.xml.sax.Attributes;
-
-import javax.xml.namespace.QName;
-import java.util.Locale;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- * @since 2.6
- */
-public class RegistrationConfigurationFactory implements ObjectModelFactory
-{
- private static final String REGISTRATION_CONFIG = "registration-configuration";
- private static final boolean DEBUG = false;
-
- public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
- {
- if (REGISTRATION_CONFIG.equals(localName))
- {
- ProducerRegistrationRequirements registrationRequirements = new ProducerRegistrationRequirementsImpl();
- registrationRequirements.setRequiresRegistration(true);
- String descRequiresRegistration = attrs.getValue("fullServiceDescriptionRequiresRegistration");
- if ("true".equals(descRequiresRegistration))
- {
- registrationRequirements.setFullServiceDescriptionRequiresRegistration(true);
- }
- return registrationRequirements;
- }
- throw new IllegalArgumentException("The processed file doesn't seem to have the proper format");
- }
-
- public Object completeRoot(Object root, UnmarshallingContext nav, String nsURI, String localName)
- {
- return root;
- }
-
- public Object newChild(ProducerRegistrationRequirementsImpl regReq, UnmarshallingContext nav, String nsURI,
- String localName, Attributes attrs)
- {
- if (DEBUG)
- {
- System.out.println("newChild regReq " + localName);
- }
-
- if ("registration-property-description".equals(localName))
- {
- return new RegistrationPropertyDescription();
- }
- else
- {
- return null;
- }
- }
-
- public void setValue(RegistrationPropertyDescription desc, UnmarshallingContext nav, String nsURI,
- String localName, String value)
- {
- if (DEBUG)
- {
- System.out.println("setvalue desc " + localName);
- }
-
- if ("name".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- desc.setName(new QName(value));
- }
- else if ("type".equals(localName))
- {
- value = StringPropertyReplacer.replaceProperties(value);
- desc.setType(new QName(value));
- }
- }
-
- public Object newChild(RegistrationPropertyDescription desc, UnmarshallingContext nav, String nsURI, String localName,
- Attributes attrs)
- {
- if (DEBUG)
- {
- System.out.println("newchild desc " + localName);
- }
-
- if ("hint".equals(localName) || "label".equals(localName))
- {
- String lang = attrs.getValue("xml:lang");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "xml:lang", localName);
- Locale locale = LocaleInfo.decodeLocaleInfo(lang).getLocale();
-
- String resourceName = attrs.getValue("resourceName");
-
- LocalizedString string = new LocalizedString();
- string.setLocale(locale);
-
- if (resourceName != null && resourceName.length() > 0)
- {
- string.setResourceName(resourceName);
- }
-
- return string;
- }
-
- return null;
- }
-
- public void setValue(LocalizedString string, UnmarshallingContext nav, String nsURI, String localName, String value)
- {
- if (DEBUG)
- {
- System.out.println("setvalue string " + localName);
- }
-
- value = StringPropertyReplacer.replaceProperties(value);
- string.setValue(value);
- }
-
- public void addChild(ProducerRegistrationRequirementsImpl regReq, RegistrationPropertyDescription desc,
- UnmarshallingContext nav, String nsURI, String localName)
- {
- if (DEBUG)
- {
- System.out.println("addchild regreq desc " + localName);
- }
-
- regReq.addRegistrationProperty(desc);
- }
-
- public void addChild(RegistrationPropertyDescription desc, LocalizedString string, UnmarshallingContext nav,
- String nsURI, String localName)
- {
- if (DEBUG)
- {
- System.out.println("addchild desc string " + localName);
- }
-
- if ("hint".equals(localName))
- {
- desc.setHint(string);
- }
- else if ("label".equals(localName))
- {
- desc.setLabel(string);
- }
- }
-}
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2006-12-22 21:16:44 UTC (rev 5930)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.wsrp.producer.config.impl;
+
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ProducerConfigurationImpl implements ProducerConfiguration
+{
+ private ProducerRegistrationRequirements requirements;
+
+ public ProducerRegistrationRequirements getRegistrationRequirements()
+ {
+ return requirements;
+ }
+
+ public void setRegistrationRequirements(ProducerRegistrationRequirements requirements)
+ {
+ this.requirements = requirements;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -79,7 +79,6 @@
<xmbean/>
<depends optional-attribute-name="Invoker"
proxy-type="attribute">portal:service=PortletInvoker,type=WSRPProducer</depends>
- <depends optional-attribute-name="ProducerConfiguration" proxy-type="attribute">portal.wsrp:service=ProducerConfiguration</depends>
<depends optional-attribute-name="RegistrationManager" proxy-type="attribute">portal.wsrp:service=RegistrationManager</depends>
</mbean>
@@ -106,12 +105,13 @@
<xmbean/>
</mbean>
- <!-- Registration configuration service -->
+ <!-- Producer configuration service -->
<mbean code="org.jboss.portal.wsrp.producer.config.ProducerConfigurationService"
name="portal.wsrp:service=ProducerConfiguration" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<attribute name="ConfigLocation">conf/config.xml</attribute>
+ <depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
<!-- Configure a consumer that is the portal itself -->
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/config.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/config.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/config.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -21,4 +21,7 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<registration-configuration fullServiceDescriptionRequiresRegistration="true"/>
+<producer-configuration>
+ <registration-configuration fullServiceDescriptionRequiresRegistration="true"/>
+</producer-configuration>
+
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/default-wsrp.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -40,35 +40,35 @@
<registration-data/>
</wsrp-producer>
</deployment>
- <!--<deployment>
+ <deployment>
<wsrp-producer>
<producer-id>NetUnity</producer-id>
<expiration-cache>120</expiration-cache>
<endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Ope...</endpoint-wsdl-url>
<registration-data/>
</wsrp-producer>
- </deployment>-->
- <!--<deployment>
- <wsrp-producer>
- <producer-id>vignette</producer-id>
- <expiration-cache>120</expiration-cache>
- <endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
- <registration-data>
- <property>
- <name>com.vignette.wsrp.registration.username</name>
- <lang>en</lang>
- <value>test</value>
- </property>
- <property>
- <name>com.vignette.wsrp.registration.password</name>
- <lang>en</lang>
- <value>test</value>
- </property>
- </registration-data>
- </wsrp-producer>
- </deployment>-->
- <!--<deployment>
+ </deployment>
+ <deployment>
<wsrp-producer>
+ <producer-id>vignette</producer-id>
+ <expiration-cache>120</expiration-cache>
+ <endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>com.vignette.wsrp.registration.username</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ <property>
+ <name>com.vignette.wsrp.registration.password</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>
+ <deployment>
+ <wsrp-producer>
<producer-id>bea</producer-id>
<expiration-cache>120</expiration-cache>
<endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
@@ -80,13 +80,13 @@
</property>
</registration-data>
</wsrp-producer>
- </deployment>-->
- <!--<deployment>
+ </deployment>
+ <deployment>
<wsrp-producer>
<producer-id>oracle</producer-id>
<expiration-cache>120</expiration-cache>
<endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlets?WSDL</endpoint-wsdl-url>
<registration-data/>
</wsrp-producer>
- </deployment>-->
+ </deployment>
</deployments>
\ No newline at end of file
Copied: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar (from rev 5917, trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar)
Deleted: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/extended.xml 2006-12-20 22:09:59 UTC (rev 5917)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -1,37 +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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<registration-configuration fullServiceDescriptionRequiresRegistration="true">
- <registration-property-description>
- <name>name1</name>
- <type>xsd:string</type>
- <hint xml:lang="en" resourceName="resource.hint1">hint1</hint>
- <label xml:lang="en" resourceName="resource.label1">label1</label>
- </registration-property-description>
- <registration-property-description>
- <name>name2</name>
- <type>xsd:string</type>
- <hint xml:lang="en" resourceName="resource.hint2">hint2</hint>
- <label xml:lang="en" resourceName="resource.label2">label2</label>
- </registration-property-description>
-</registration-configuration>
Copied: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml (from rev 5929, trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/extended.xml)
===================================================================
--- trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/extended.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -0,0 +1,39 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<producer-configuration>
+ <registration-configuration fullServiceDescriptionRequiresRegistration="true">
+ <registration-property-description>
+ <name>name1</name>
+ <type>xsd:string</type>
+ <hint xml:lang="en" resourceName="resource.hint1">hint1</hint>
+ <label xml:lang="en" resourceName="resource.label1">label1</label>
+ </registration-property-description>
+ <registration-property-description>
+ <name>name2</name>
+ <type>xsd:string</type>
+ <hint xml:lang="en" resourceName="resource.hint2">hint2</hint>
+ <label xml:lang="en" resourceName="resource.label2">label2</label>
+ </registration-property-description>
+ </registration-configuration>
+</producer-configuration>
Deleted: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/minimal.xml 2006-12-20 22:09:59 UTC (rev 5917)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -1,24 +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. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-
-<registration-configuration/>
Copied: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml (from rev 5929, trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/minimal.xml)
===================================================================
--- trunk/wsrp/src/resources/tests/test-registration-configuration-lib-jar/minimal.xml 2006-12-22 20:15:42 UTC (rev 5929)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/minimal.xml 2006-12-22 21:16:44 UTC (rev 5930)
@@ -0,0 +1,25 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<producer-configuration><registration-configuration/></producer-configuration>
+
19 years, 4 months
JBoss Portal SVN: r5929 - in trunk: . build cms cms/src/main/org/jboss/portal/cms cms/src/main/org/jboss/portal/cms/impl cms/src/main/org/jboss/portal/cms/impl/interceptors cms/src/main/org/jboss/portal/cms/impl/jcr cms/src/main/org/jboss/portal/cms/impl/jcr/command cms/src/main/org/jboss/portal/cms/model cms/src/main/org/jboss/portal/cms/workflow core core/src/main/org/jboss/portal/core core/src/main/org/jboss/portal/core/portlet/cms/admin core/src/main/org/jboss/portal/core/workflow core/
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2006-12-22 15:15:42 -0500 (Fri, 22 Dec 2006)
New Revision: 5929
Added:
trunk/cms/src/main/org/jboss/portal/cms/workflow/
trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
trunk/core/src/main/org/jboss/portal/core/workflow/
trunk/core/src/main/org/jboss/portal/core/workflow/cms/
trunk/core/src/main/org/jboss/portal/core/workflow/cms/PublishAssignmentHandler.java
trunk/workflow/
trunk/workflow/build.bat
trunk/workflow/build.log
trunk/workflow/build.sh
trunk/workflow/build.xml
trunk/workflow/src/
trunk/workflow/src/etc/
trunk/workflow/src/etc/portal-workflow-lib-jar.mf
trunk/workflow/src/main/
trunk/workflow/src/main/org/
trunk/workflow/src/main/org/jboss/
trunk/workflow/src/main/org/jboss/portal/
trunk/workflow/src/main/org/jboss/portal/workflow/
trunk/workflow/src/main/org/jboss/portal/workflow/WorkflowException.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/
trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishServlet.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/Content.java
trunk/workflow/src/main/org/jboss/portal/workflow/cms/TaskExceptionHandler.java
trunk/workflow/src/main/org/jboss/portal/workflow/service/
trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowService.java
trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowServiceImpl.java
trunk/workflow/src/main/org/jboss/portal/workflow/test/
trunk/workflow/src/main/org/jboss/portal/workflow/test/Finalize.java
trunk/workflow/src/main/org/jboss/portal/workflow/test/HelloWorldDbTest.java
trunk/workflow/src/main/org/jboss/portal/workflow/test/PortalCMSPublish.java
trunk/workflow/src/main/org/jboss/portal/workflow/test/PublishAssignmentHandler.java
trunk/workflow/src/resources/
trunk/workflow/src/resources/portal-workflow-jar/
trunk/workflow/src/resources/portal-workflow-sar/
trunk/workflow/src/resources/portal-workflow-sar/META-INF/
trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
trunk/workflow/src/resources/portal-workflow-sar/conf/
trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml
trunk/workflow/src/resources/portal-workflow-war/
trunk/workflow/src/resources/portal-workflow-war/WEB-INF/
trunk/workflow/src/resources/portal-workflow-war/WEB-INF/jboss-web.xml
trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
trunk/workflow/src/resources/test/
trunk/workflow/src/resources/test/conf/
trunk/workflow/src/resources/test/conf/hibernate.cfg.xml
Modified:
trunk/build/build-thirdparty.xml
trunk/build/build.xml
trunk/cms/build.xml
trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java
trunk/cms/src/main/org/jboss/portal/cms/impl/ContentImpl.java
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateCommand.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateNewVersionCommand.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentGetVersionsCommand.java
trunk/cms/src/main/org/jboss/portal/cms/model/Content.java
trunk/core/build.xml
trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java
trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp
trunk/tools/etc/buildfragments/modules.ent
Log:
[JBPORTAL-931],[JBPORTAL-372] - CMS Approval Workflow using JBPM
Modified: trunk/build/build-thirdparty.xml
===================================================================
--- trunk/build/build-thirdparty.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/build/build-thirdparty.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -110,7 +110,7 @@
<componentref name="sun-opends" version="snapshot"/>
<componentref name="sun-servlet" version="2.4"/>
<componentref name="xdoclet" version="1.2.3"/>
-
+ <componentref name="jbpm" version="3.1.2"/>
</build>
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/build/build.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -129,16 +129,17 @@
<module name="core"/>
<module name="wsrp"/>
<module name="registration"/>
+ <module name="workflow"/>
<!-- Module groups -->
<group name="portal">
<include
- modules="common, test, api, faces, jems, server, security, identity, format, portlet, federation, theme, cms, bridge, samples, registration, wsrp, core"/>
+ modules="common, test, api, faces, jems, server, security, identity, format, portlet, federation, theme, workflow, cms, bridge, samples, registration, wsrp, core"/>
</group>
<group name="cms">
- <include modules="common, test, jems, cms"/>
+ <include modules="common, test, jems, workflow, cms"/>
</group>
<group name="security">
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/build.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -110,6 +110,8 @@
<!-- cms optimization integration -->
<path refid="jgroups.jgroups.classpath"/>
<path refid="sun.servlet.classpath"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
</path>
@@ -132,6 +134,8 @@
<!-- clustered testcases related -->
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
+ <!-- workflow integration -->
+ <path refid="jboss.portal-workflow.classpath"/>
</path>
Modified: trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -82,5 +82,5 @@
Command createFileGetListCommand(String sFilePath);
- Command createGetArchiveCommand(String sRootPath, String sLanguage);
+ Command createGetArchiveCommand(String sRootPath, String sLanguage);
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/ContentImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/ContentImpl.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/ContentImpl.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -61,6 +61,9 @@
protected String mimeType;
protected int size;
+
+ protected boolean isWaitingForPublishApproval = false;
+ protected String approvalProcessId = null;
public String getTitle()
{
@@ -182,6 +185,39 @@
{
this.size = size;
}
+
+ /**
+ *
+ */
+ public boolean isWaitingForPublishApproval()
+ {
+ return this.isWaitingForPublishApproval;
+ }
+
+ /**
+ *
+ * @param isWaitingForPublishApproval
+ */
+ public void setWaitingForPublishApproval(boolean isWaitingForPublishApproval)
+ {
+ this.isWaitingForPublishApproval = isWaitingForPublishApproval;
+ }
+
+ /**
+ * @return the approvalProcessId
+ */
+ public String getApprovalProcessId()
+ {
+ return approvalProcessId;
+ }
+
+ /**
+ * @param approvalProcessId the approvalProcessId to set
+ */
+ public void setApprovalProcessId(String approvalProcessId)
+ {
+ this.approvalProcessId = approvalProcessId;
+ }
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -177,38 +177,46 @@
*
*/
protected Object invoke(JCRCommand invocation) throws Exception, InvocationException
- {
- Session session = Tools.getOpenSession();
- Transaction tx = session.beginTransaction();
-
- //make the acl check before this command is executed
- User user = (User)JCRCMS.getUserInfo().get();
-
-
- //setup the security context with enough information for the authorization provider
- //to be able to make an enforcement decision
- PortalSecurityContext securityContext = new PortalSecurityContext(user);
- securityContext.setAttribute("command",invocation);
-
-
- //perform access check
- boolean allowAccess = this.authorizationProvider.hasAccess(securityContext);
- tx.commit();
- Tools.closeSession(session);
-
- if(allowAccess)
- {
- Object response = invocation.invokeNext();
-
- //also filter lists of files and folders based on access allowed on these resources
- response = this.applyFilter(response,securityContext);
-
- return response;
- }
- else
- {
- throw new CMSException("Access to this resource is denied");
- }
+ {
+ if(ACLInterceptor.turnOff.get()==null )
+ {
+ Session session = Tools.getOpenSession();
+ Transaction tx = session.beginTransaction();
+
+ //make the acl check before this command is executed
+ User user = (User)JCRCMS.getUserInfo().get();
+
+
+ //setup the security context with enough information for the authorization provider
+ //to be able to make an enforcement decision
+ PortalSecurityContext securityContext = new PortalSecurityContext(user);
+ securityContext.setAttribute("command",invocation);
+
+
+ //perform access check
+ boolean allowAccess = this.authorizationProvider.hasAccess(securityContext);
+ tx.commit();
+ Tools.closeSession(session);
+
+ if(allowAccess)
+ {
+ Object response = invocation.invokeNext();
+
+ //also filter lists of files and folders based on access allowed on these resources
+ response = this.applyFilter(response,securityContext);
+
+ return response;
+ }
+ else
+ {
+ throw new CMSException("Access to this resource is denied");
+ }
+ }
+ else
+ {
+ //this is turned off for this thread that is trying to integrate with the CMS
+ return invocation.invokeNext();
+ }
}
/**
@@ -461,4 +469,22 @@
return bootRequired;
}
+
+ /**
+ * This turns off acl security only for a particular thread.
+ * This is used by system level operations that need to integrate with the CMS
+ *
+ * Example is: the workflow daemon that publishes a content as live when a manager
+ * approves it. Without turning this off, the daemon thread is running in Anonymous mode
+ * which obviously does not have the rights to publish the content
+ */
+ private static ThreadLocal turnOff = new ThreadLocal();
+ public static void turnOff()
+ {
+ ACLInterceptor.turnOff.set(new Boolean(true));
+ }
+ public static void turnOn()
+ {
+ ACLInterceptor.turnOff.set(null);
+ }
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCMS.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -25,6 +25,7 @@
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.jboss.cache.Version;
+import org.jboss.naming.NonSerializableFactory;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.CMSMimeMappings;
@@ -49,6 +50,9 @@
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import org.jboss.portal.workflow.cms.ApprovePublish;
+
import org.jboss.util.StopWatch;
import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;
@@ -58,10 +62,10 @@
import javax.jcr.Session;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
+import javax.naming.CompositeName;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Date;
@@ -96,6 +100,10 @@
private Element config;
private UserModule userModule = null;
+
+ private ApprovePublish approvePublishWorkflow = null;
+
+ private String jndiName = null;
private InvocationHandler handler = new InvocationHandler()
@@ -115,6 +123,20 @@
{
return JCRCMS.userInfo;
}
+
+ /**
+ * This is used to turnoff workflow triggering only
+ * for this particular request through the CMS commands
+ */
+ protected static ThreadLocal turnOffWorkflow = new ThreadLocal();
+ public static void turnOffWorkflow()
+ {
+ turnOffWorkflow.set(new Boolean(true));
+ }
+ public static void turnOnWorkflow()
+ {
+ turnOffWorkflow.set(null);
+ }
public JCRCMS()
{
@@ -185,8 +207,26 @@
{
this.doChecking = doChecking;
}
+
- /**
+
+ /**
+ * @return the approvePublishWorkflow
+ */
+ public ApprovePublish getApprovePublishWorkflow()
+ {
+ return approvePublishWorkflow;
+ }
+
+ /**
+ * @param approvePublishWorkflow the approvePublishWorkflow to set
+ */
+ public void setApprovePublishWorkflow(ApprovePublish approvePublishWorkflow)
+ {
+ this.approvePublishWorkflow = approvePublishWorkflow;
+ }
+
+ /**
*
* @return
*/
@@ -203,19 +243,42 @@
{
this.userModule = userModule;
}
+
+ /**
+ *
+ * @return
+ */
+ public String getJNDIName()
+ {
+ return this.jndiName;
+ }
+
+ /**
+ *
+ * @param jndiName
+ */
+ public void setJNDIName(String jndiName)
+ {
+ this.jndiName = jndiName;
+ }
/** CMS Start */
public void startService() throws Exception
{
try
- {
+ {
this.userModule = (UserModule)new InitialContext().lookup("java:portal/UserModule");
- }
- catch (NamingException e)
- {
+ }
+ catch (NamingException e)
+ {
log.error("Cannot obtain UserModule from JNDI: ", e);
throw e;
- }
+ }
+
+ if (this.jndiName != null)
+ {
+ NonSerializableFactory.rebind(new CompositeName(this.jndiName), this, true);
+ }
//check the version of jbosscache being run
String cacheVersion = Version.getVersionString(Version.getVersionShort());
@@ -226,6 +289,7 @@
cacheLogger.setLevel(Level.ERROR);
Logger groupsLogger = Logger.getLogger("org.jgroups");
groupsLogger.setLevel(Level.ERROR);
+
// See how long it takes us to start up
StopWatch watch = new StopWatch(true);
@@ -240,6 +304,17 @@
/** Shuts down the repo and unregisters it */
public void stopService()
{
+ try
+ {
+ if (this.jndiName != null)
+ {
+ NonSerializableFactory.unbind(this.jndiName);
+ }
+ }
+ catch(Exception e)
+ {
+ log.error(this, e);
+ }
log.info("Stopping JCR CMS");
stopJCR();
// removeInterceptors();
@@ -430,6 +505,7 @@
file.setContent(new Locale(getDefaultLocale()), content);
Command newFileCMD = getCommandFactory().createNewFileCommand(file, content);
+ JCRCMS.turnOffWorkflow();
execute(newFileCMD);
}
@@ -503,6 +579,16 @@
JCRCommand jcrCmd = (JCRCommand)cmd;
JCRCommandContext ctx = new JCRCommandContext(session, commandFactory, defaultLocale);
jcrCmd.setContext(ctx);
+
+ ctx.setAttribute(ctx.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);
+ }
if ((stackFactory != null) && (stackFactory.getInterceptorStack().getLength() != 0))
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandContext.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -24,6 +24,8 @@
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.common.invocation.AbstractInvocationContext;
+import org.jboss.portal.server.impl.MapAttributeResolver;
+import org.jboss.portal.common.invocation.Scope;
import javax.jcr.Session;
import java.util.Locale;
@@ -34,7 +36,8 @@
*/
public class JCRCommandContext extends AbstractInvocationContext
{
-
+ public static final Scope scope = new Scope("Thread");
+
private final Session session;
private final JCRCommandFactory commandFactory;
@@ -46,6 +49,7 @@
this.session = session;
this.commandFactory = factory;
this.locale = locale;
+ this.addResolver(JCRCommandContext.scope, new MapAttributeResolver());
}
public JCRCommandFactory getCommandFactory()
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -177,5 +177,4 @@
{
return new GetArchiveCommand(sRootPath, sLanguage);
}
-
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateCommand.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateCommand.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateCommand.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -62,7 +62,7 @@
contentNode.setProperty("portalcms:description", new StringValue(mFile.getContent().getDescription()));
contentNode.setProperty("portalcms:title", new StringValue(mFile.getContent().getTitle()));
contentNode.setProperty("portalcms:language", new StringValue(mFile.getContent().getLocale().getLanguage()));
- contentNode.setProperty("portalcms:size", new StringValue(String.valueOf(mFile.getContent().getBytes().length)));
+
if (mFile.getContent().getMimeType() != null)
{
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateNewVersionCommand.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateNewVersionCommand.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentCreateNewVersionCommand.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -22,19 +22,27 @@
******************************************************************************/
package org.jboss.portal.cms.impl.jcr.command;
+import org.apache.jackrabbit.value.StringValue;
import org.jboss.portal.cms.impl.jcr.JCRCommand;
import org.jboss.portal.cms.impl.jcr.util.VersionUtil;
import org.jboss.portal.cms.model.Content;
+import org.jboss.portal.common.invocation.Scope;
+import org.jboss.portal.identity.User;
+
+import org.jboss.portal.workflow.cms.ApprovePublish;
+
import javax.jcr.Node;
import java.util.ArrayList;
import java.util.List;
+import java.util.Date;
/**
* Creates a new version of the content and labels it "LIVE".
*
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author Sohil Shah - sohil.shah(a)jboss.com
*/
public class ContentCreateNewVersionCommand extends JCRCommand
{
@@ -59,24 +67,93 @@
this.bMakeLive = bMakeLive;
}
+ /**
+ *
+ */
public Object execute()
{
try
{
+ Scope scope = this.context.scope;
// create versions
for (int i = 0; i < mContents.size(); i++)
{
Content content = (Content)mContents.get(i);
Node contentNode = (Node)context.getSession().getItem(content.getBasePath());
- VersionUtil.createVersion(contentNode, this.bMakeLive);
+
+ //if the creator of this content is known, record it
+ User user = (User)this.context.getAttribute(scope,"user");
+ if(user != null)
+ {
+ contentNode.setProperty("portalcms:user", user.getUserName());
+ }
+
+ contentNode.setProperty("portalcms:size", new StringValue(String.valueOf(content.getBytes().length)));
+ context.getSession().save();
+
+ ApprovePublish approvePublishWorkflow = (ApprovePublish)this.context.getAttribute(scope, "approvePublishWorkflow");
+
+ //integration of publish/approval workflow
+ if(this.bMakeLive)
+ {
+ if(approvePublishWorkflow!=null)
+ {
+ //call the workflow service here
+ org.jboss.portal.workflow.cms.Content workflowContent =
+ new org.jboss.portal.workflow.cms.Content();
+ workflowContent.setPath(content.getBasePath());
+ workflowContent.setUserName(user.getUserName());
+ workflowContent.setMimeType(content.getMimeType());
+ if(content.getBytes()!=null)
+ {
+ workflowContent.setSize(content.getBytes().length);
+ }
+ workflowContent.setCreationDate(new Date());
+
+ long processId = approvePublishWorkflow.requestApproval(workflowContent);
+
+ if(processId > 0)
+ {
+ //now save workflow related meta data on this version
+ //so that this version can be processed later in the execution
+ //of the workflow
+ contentNode.setProperty("portalcms:processid",String.valueOf(processId));
+
+ //save
+ context.getSession().save();
+
+ //create a new version, but dont make it live
+ VersionUtil.createVersion(contentNode,false);
+ }
+ }
+ else
+ {
+ //remove any processid if they are present on the node
+ contentNode.setProperty("portalcms:processid",(String)null);
+ contentNode.save();
+
+ //no workflow is activated....just publish the content straight up
+ VersionUtil.createVersion(contentNode, this.bMakeLive);
+ }
+ }
+ else
+ {
+ //remove any processid if they are present on the node
+ contentNode.setProperty("portalcms:processid",(String)null);
+ contentNode.save();
+
+ //not asking to publish the content...no workflow needed
+ //even if its activated
+ VersionUtil.createVersion(contentNode, this.bMakeLive);
+ }
}
context.getSession().save();
}
catch (Exception e)
- {
+ {
e.printStackTrace();
+ throw new RuntimeException(e);
}
return null;
}
-
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentGetVersionsCommand.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentGetVersionsCommand.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ContentGetVersionsCommand.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -32,6 +32,7 @@
import javax.jcr.version.Version;
import javax.jcr.version.VersionHistory;
import javax.jcr.version.VersionIterator;
+import javax.jcr.PathNotFoundException;
import java.util.Locale;
import java.util.Vector;
@@ -110,6 +111,27 @@
content.setEncoding(node.getProperty("jcr:encoding").getString());
+
+ //check if this content is waiting to be approved for publishing or not
+ try
+ {
+ String processid = node.getProperty("portalcms:processid").getString();
+ if(processid != null && processid.trim().length()>0)
+ {
+ content.setWaitingForPublishApproval(true);
+ content.setApprovalProcessId(processid);
+ }
+ else
+ {
+ content.setWaitingForPublishApproval(false);
+ content.setApprovalProcessId(null);
+ }
+ }
+ catch(PathNotFoundException pne)
+ {
+ content.setWaitingForPublishApproval(false);
+ content.setApprovalProcessId(null);
+ }
contents.addElement(content);
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/model/Content.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/model/Content.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/model/Content.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -73,5 +73,31 @@
boolean isLive();
void setLive(boolean live);
+
+ /**
+ * this is used to signify that a content is waiting to be approved before being published to go
+ * live
+ *
+ * @return
+ */
+ public boolean isWaitingForPublishApproval();
+
+ /**
+ *
+ *
+ */
+ public void setWaitingForPublishApproval(boolean isWaitingForPublishApproval);
+
+ /**
+ *
+ * @return
+ */
+ public String getApprovalProcessId();
+
+ /**
+ *
+ *
+ */
+ public void setApprovalProcessId(String processId);
}
Added: trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/cms/src/main/org/jboss/portal/cms/workflow/FinalizePublish.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,147 @@
+/******************************************************************************
+ * 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.Locale;
+import java.util.List;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+import org.jbpm.graph.def.*;
+import org.jbpm.graph.exe.*;
+
+import org.jboss.portal.workflow.cms.Content;
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.impl.jcr.JCRCMS;
+import org.jboss.portal.cms.impl.interceptors.ACLInterceptor;
+
+/**
+ *
+ * Created on : Dec 20, 2006
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class FinalizePublish implements ActionHandler
+{
+ /**
+ *
+ */
+ private static Logger log = Logger.getLogger(FinalizePublish.class);
+ private static CMS cms = null;
+
+ static
+ {
+ try
+ {
+ cms = (CMS)new InitialContext().lookup("java:portal/CMS");
+ }
+ catch (NamingException e)
+ {
+ log.error("Cannot obtain CMS from JNDI: ", e);
+ cms = null;
+ }
+ }
+
+ /**
+ *
+ */
+ public void execute(ExecutionContext executionContext)
+ {
+ Content content = (Content)executionContext.getContextInstance().getVariable("content");
+ boolean approved = ((Boolean)executionContext.getContextInstance().getVariable("approved")).booleanValue();
+ long processId = executionContext.getProcessInstance().getId();
+
+ if(approved)
+ {
+ ACLInterceptor.turnOff();
+ JCRCMS.turnOffWorkflow();
+
+ //create this content in the CMS and make it live
+ int lastIndex = content.getPath().lastIndexOf('/');
+ String path = content.getPath().substring(0,lastIndex);
+ String language = content.getPath().substring(lastIndex+1);
+
+ Command command = cms.getCommandFactory().createContentGetVersionsCommand(content.getPath());
+ List versions = (List)cms.execute(command);
+ org.jboss.portal.cms.model.Content processContent = this.findProcessContent(processId, versions);
+
+ /**
+ * if processContent is null, a pending version of the content was not found
+ * this could be due to an outdated link. let the process finish, but nothing
+ * new will be published
+ */
+ if(processContent != null)
+ {
+ //get the file to be updated and published live
+ command = cms.getCommandFactory().createFileGetCommand(path,processContent.getVersionNumber(),
+ new Locale(language));
+ File file = (File)cms.execute(command);
+
+ //now publish this
+ file.getContent().setApprovalProcessId(null);
+ file.getContent().setWaitingForPublishApproval(false);
+ command = cms.getCommandFactory().createUpdateFileCommand(file, file.getContent(), true);
+ cms.execute(command);
+ }
+
+
+ JCRCMS.turnOnWorkflow();
+ ACLInterceptor.turnOn();
+ }
+ }
+
+ /**
+ *
+ * @param processId
+ * @param versions
+ * @return
+ */
+ private org.jboss.portal.cms.model.Content findProcessContent(long processId,List versions)
+ {
+ org.jboss.portal.cms.model.Content content = null;
+
+ if(versions != null)
+ {
+ for(int i=0;i<versions.size();i++)
+ {
+ org.jboss.portal.cms.model.Content cour = (org.jboss.portal.cms.model.Content)versions.get(i);
+ if(cour.isWaitingForPublishApproval())
+ {
+ if( cour.getApprovalProcessId()!=null &&
+ cour.getApprovalProcessId().trim().equals(String.valueOf(processId)))
+ {
+ //not if found...the content of this version should be published to go live
+ return cour;
+ }
+ }
+ }
+ }
+
+ return content;
+ }
+}
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/core/build.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -113,6 +113,8 @@
<path refid="trove.trove.classpath"/>
<path refid="qdox.qdox.classpath"/>
<pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
</path>
<!-- Configure modules -->
@@ -132,6 +134,7 @@
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
<path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-workflow.classpath"/>
</path>
<!--+=======================================+-->
@@ -366,7 +369,19 @@
<fileset dir="${portals.bridges.lib}" includes="portals-bridges-common.jar"/>
<fileset dir="${apache.tomahawk.lib}" includes="tomahawk.jar"/>
<fileset dir="${apache.lang.lib}" includes="commons-lang-2.0.jar"/>
- </copy>
+ </copy>
+
+ <!-- workflow service -->
+ <copy todir="${build.resources}/jboss-portal/portal-workflow.sar">
+ <fileset dir="${jboss.portal-workflow.root}/lib" includes="portal-workflow-lib.jar"/>
+ <fileset dir="${jbpm.jbpm.lib}" includes="jbpm-3.1.2.jar"/>
+ <fileset dir="${jbpm.jbpm.lib}" includes="jbpm-identity-3.1.2.jar"/>
+ <fileset dir="${jboss.portal-workflow.root}/resources/portal-workflow-sar"/>
+ </copy>
+ <!-- workflow war packaging -->
+ <copy todir="${build.resources}/jboss-portal/portal-workflow.sar/portal-workflow.war">
+ <fileset dir="${jboss.portal-workflow.root}/lib/portal-workflow.war"/>
+ </copy>
</target>
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -61,6 +61,8 @@
import org.jboss.portal.identity.AnnonymousRole;
import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.workflow.cms.ApprovePublish;
+import org.jboss.portal.workflow.WorkflowException;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
@@ -79,6 +81,8 @@
import java.util.ArrayList;
import java.util.HashSet;
+import javax.naming.InitialContext;
+
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -90,6 +94,7 @@
private UserModule userModule;
private RoleModule roleModule;
private MembershipModule membershipModule;
+ private ApprovePublish approvePublish;
public void init() throws PortletException
{
@@ -114,6 +119,8 @@
{
throw new PortletException("No membership module");
}
+
+ this.initializeApprovePublishWorkflow();
}
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
@@ -243,6 +250,20 @@
List versionList = (List)CMSService.execute(getContentVersionsCMD);
contents.add(versionList);
}
+
+ //get the unapproved content for this file
+ if(this.approvePublish!=null)
+ {
+ try
+ {
+ Collection pendingQueue = this.approvePublish.getPendingQueue(sPath);
+ rReq.setAttribute("pendingQueue",pendingQueue);
+ }
+ catch(WorkflowException we)
+ {
+ rReq.setAttribute("pendingQueue",null);
+ }
+ }
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
@@ -1289,4 +1310,21 @@
return false;
}
}
+
+ /**
+ *
+ * @return
+ */
+ private void initializeApprovePublishWorkflow()
+ {
+ try
+ {
+ InitialContext context = new InitialContext();
+ this.approvePublish = (ApprovePublish)context.lookup("java:portal/ApprovePublishWorkflow");
+ }
+ catch(Exception e)
+ {
+ this.approvePublish = null;
+ }
+ }
}
\ No newline at end of file
Added: trunk/core/src/main/org/jboss/portal/core/workflow/cms/PublishAssignmentHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/workflow/cms/PublishAssignmentHandler.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/core/src/main/org/jboss/portal/core/workflow/cms/PublishAssignmentHandler.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,135 @@
+/******************************************************************************
+ * 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.core.workflow.cms;
+
+import org.apache.log4j.Logger;
+
+import java.util.Collection;
+import java.net.URLEncoder;
+import java.text.MessageFormat;
+
+import javax.naming.InitialContext;
+
+import org.jbpm.graph.exe.*;
+import org.jbpm.taskmgmt.def.*;
+import org.jbpm.taskmgmt.exe.Assignable;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+
+import org.jboss.portal.core.modules.MailModule;
+import org.jboss.portal.workflow.cms.Content;
+
+
+/**
+ *
+ * Created on : Dec 20, 2006
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class PublishAssignmentHandler implements AssignmentHandler
+{
+ private static Logger log = Logger.getLogger(PublishAssignmentHandler.class);
+
+ private static MailModule mailModule = null;
+ static
+ {
+ try
+ {
+ InitialContext context = new InitialContext();
+ mailModule = (MailModule)context.lookup("java:portal/MailModule");
+ }
+ catch(Exception e)
+ {
+ mailModule = null;
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ *
+ */
+ public void assign(Assignable assignable,ExecutionContext executionContext)
+ {
+ int taskInstances = 0;
+ Collection assignedTasks = executionContext.getTaskMgmtInstance().getTaskInstances();
+ if(assignedTasks!=null)
+ {
+ taskInstances = assignedTasks.size();
+ }
+
+ if(taskInstances == 1)
+ {
+ String[] managers = (String[])executionContext.getContextInstance().getVariable("managers");
+ if(managers!=null && managers.length>0)
+ {
+ this.notifyManager(executionContext,managers[0]);
+ assignable.setActorId(managers[0]);
+
+ for(int i=1;i<managers.length;i++)
+ {
+ this.notifyManager(executionContext,managers[i]);
+ TaskInstance t = executionContext.getTaskMgmtInstance().
+ createTaskInstance(((TaskInstance)assignable).getTask(),executionContext);
+ t.setActorId(managers[i]);
+ }
+ }
+ }
+ }
+
+ /**
+ *
+ * @param email
+ */
+ private void notifyManager(ExecutionContext executionContext,String email)
+ {
+ try
+ {
+ long processId = executionContext.getProcessInstance().getId();
+ String from = (String)executionContext.getContextInstance().getVariable("from");
+ String to = email;
+ String subject = (String)executionContext.getContextInstance().getVariable("subject");
+ String body = (String)executionContext.getContextInstance().getVariable("body");
+ Content content = (Content)executionContext.getContextInstance().getVariable("content");
+
+ Object[] arguments =
+ {
+ content.getPath(),
+ content.getMimeType(),
+ content.getSizeStr(),
+ content.getCreationDateStr(),
+ content.getUserName(),
+ String.valueOf(processId),
+ URLEncoder.encode(email, "UTF-8"),
+ String.valueOf(processId),
+ URLEncoder.encode(email, "UTF-8")
+ };
+ body = MessageFormat.format(body, arguments);
+
+ mailModule.send(from,email,subject,body);
+ }
+ catch(Exception e)
+ {
+ //eat it for now
+ log.error(this, e);
+ }
+ }
+}
Modified: trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/core/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -58,8 +58,10 @@
<depends>portal:service=JAASLoginModule</depends>
<depends>portal:service=Hibernate,type=CMS</depends>
<depends>portal:service=Module,type=IdentityServiceController</depends>
- <depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
- <!--<depends optional-attribute-name="UserModule" proxy-type="attribute">portal:service=Module,type=User</depends>-->
+ <!--depends optional-attribute-name="UserModule" proxy-type="attribute">portal:service=Module,type=User</depends-->
+ <!-- add this to activate publish/approval workflow integration -->
+ <depends optional-attribute-name="ApprovePublishWorkflow" proxy-type="attribute">portal:service=ApprovePublish,type=Workflow</depends>
+ <depends optional-attribute-name="StackFactory" proxy-type="attribute">portal:service=InterceptorStackFactory,type=Cms</depends>
<attribute name="DoChecking">true</attribute>
<attribute name="DefaultContentLocation">portal/cms/conf/default-content/default/</attribute>
<attribute name="DefaultLocale">en</attribute>
@@ -169,6 +171,7 @@
</Versioning>
</Repository>
</attribute>
+ <attribute name="JNDIName">java:portal/CMS</attribute>
</mbean>
<!--
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2006-12-22 20:15:42 UTC (rev 5929)
@@ -11,12 +11,16 @@
<%@ page import="java.util.List" %>
<%@ page import="java.util.StringTokenizer" %>
<%@ page import="java.util.Vector" %>
+<%@ page import="java.util.Collection" %>
+<%@ page import="java.util.Iterator" %>
<portlet:defineObjects/>
<%
String sCurrPath = (String)request.getAttribute("currpath");
Vector vContents = (Vector)request.getAttribute("contents");
+ Collection pendingQueue = (Collection)request.getAttribute("pendingQueue");
+
String sType = "";
if (vContents.size() > 0)
{
@@ -32,7 +36,7 @@
String createDate = "";
String modifiedDate = "";
- String rowClass = "portlet-section-body";
+ String rowClass = "portlet-section-body";
%>
<br>
@@ -182,7 +186,13 @@
<%
for (int i = 0; i < contentList.size(); i++) // cycle thru list of version nodes
{
- Content version = (Content)contentList.get(i);
+ Content version = (Content)contentList.get(i);
+
+ if(version.isWaitingForPublishApproval())
+ {
+ continue;
+ }
+
if (i % 2 == 0)
{
rowClass = "portlet-section-body";
@@ -275,3 +285,47 @@
}
%>
</table>
+
+<!-- the approval queue, content waiting for managers to signoff on -->
+<%if(pendingQueue!=null && !pendingQueue.isEmpty()){%>
+<br/><br/>
+
+<span class="portlet-table-text">Pending Approval Queue:</span>
+<br/>
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+<tr>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_TYPE")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_SIZE")}</b></td>
+ <td class="portlet-table-text"><b>${n:i18n("CMS_CREATED")}</b></td>
+ <td class="portlet-table-text"><b>User</b></td>
+</tr>
+<%int i=0;%>
+<%for(Iterator itr=pendingQueue.iterator();itr.hasNext();){%>
+ <%
+ org.jboss.portal.workflow.cms.Content cour = (org.jboss.portal.workflow.cms.Content)itr.next();
+ if (i % 2 == 0)
+ {
+ rowClass = "portlet-section-body";
+ }
+ else
+ {
+ rowClass = "portlet-section-alternate";
+ }
+ i++;
+ %>
+<tr onmouseover="this.className='portlet-section-selected';" onmouseout="this.className='<%= rowClass %>';"
+class="<%= rowClass %>">
+ <!-- Mime Type -->
+ <td><%= cour.getMimeType() %></td>
+ <!-- Size -->
+ <td><%= cour.getSizeStr() %></td>
+ <!-- Creation Date -->
+ <td>
+ <%= cour.getCreationDateStr() %>
+ </td>
+ <!-- User who requested approval -->
+ <td><%= cour.getUserName() %></td>
+</tr>
+<%}%>
+</table>
+<%}%>
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/tools/etc/buildfragments/modules.ent 2006-12-22 20:15:42 UTC (rev 5929)
@@ -129,6 +129,13 @@
<pathelement path="${jboss.portal-identity.lib}/portal-identity-lib.jar"/>
</path>
+ <!-- workflow -->
+ <property name="jboss.portal-workflow.root" value="${project.root}/workflow/output"/>
+ <property name="jboss.portal-workflow.lib" value="${jboss.portal-workflow.root}/lib"/>
+ <path id="jboss.portal-workflow.classpath">
+ <pathelement path="${jboss.portal-workflow.lib}/portal-workflow-lib.jar"/>
+ </path>
+
<!-- samples -->
<property name="jboss.portal-samples.root" value="${project.root}/samples/output"/>
<property name="jboss.portal-samples.lib" value="${jboss.portal-samples.root}/lib"/>
Added: trunk/workflow/build.bat
===================================================================
--- trunk/workflow/build.bat 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/build.bat 2006-12-22 20:15:42 UTC (rev 5929)
@@ -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
Added: trunk/workflow/build.log
===================================================================
--- trunk/workflow/build.log 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/build.log 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,72 @@
+
+configure:
+Overriding previous definition of reference to apache.ant.classpath
+
+configure-modules:
+
+configure-defaults:
+Overriding previous definition of reference to javac.classpath
+
+configure-tools:
+
+_configure:jbossaop:task:
+
+_configure:xdoclet:task:
+
+_configure:xdoclet:ejbdoclet:
+
+_configure:xdoclet:jmxdoclet:
+
+init:
+
+tests:
+ [echo]
+ build.reports=C:\projects\core-portal\jboss-portal-trunk\workflow/output/reports
+ test.reports=C:\projects\core-portal\jboss-portal-trunk\workflow/output/tests
+ module.output=C:\projects\core-portal\jboss-portal-trunk\workflow/output
+ driver.path=C:\projects\core-portal\jboss-portal-trunk/thirdparty/hsqldb/lib//hsqldb.jar
+ junit.printsummary=true
+ junit.batchtest.haltonerror=false
+ junit.batchtest.haltonfailure=false
+ junit.batchtest.fork=true
+ junit.timeout=600000
+ junit.jvm=java
+ junit.jvm.options=-Ddummy
+ junit.formatter.usefile=true
+
+ [mkdir] Created dir: C:\projects\core-portal\jboss-portal-trunk\workflow\output\reports
+ [mkdir] Created dir: C:\projects\core-portal\jboss-portal-trunk\workflow\output\tests
+ [junit_] Running org.jboss.portal.workflow.test.HelloWorldDbTest
+ [junit_] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 6.11 sec
+ [junit_] Testsuite: org.jboss.portal.workflow.test.HelloWorldDbTest
+ [junit_] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 6.11 sec
+ [junit_] ------------- Standard Error -----------------
+ [junit_] log4j:WARN No appenders could be found for logger (org.jbpm.JbpmConfiguration).
+ [junit_] log4j:WARN Please initialize the log4j system properly.
+ [junit_] ------------- ---------------- ---------------
+ [junit_]
+ [junit_] Testcase: testSimplePersistence took 6.079 sec
+ [junit_] Running org.jboss.portal.workflow.test.PortalCMSPublish
+ [junit_] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 6.828 sec
+ [junit_] Testsuite: org.jboss.portal.workflow.test.PortalCMSPublish
+ [junit_] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 6.828 sec
+ [junit_] ------------- Standard Output ---------------
+ [junit_] Assigning this task to the Managers
+ [junit_] Assigning this task to the Managers
+ [junit_] Manager=Admin(1)
+ [junit_] Manager=eric.brown(a)jboss.com(1)
+ [junit_] Manager=Admin(2)
+ [junit_] Manager=eric.brown(a)jboss.com(2)
+ [junit_] Manager=sohil.shah(a)jboss.com(1)
+ [junit_] Manager=sohil.shah(a)jboss.com(2)
+ [junit_] This publish request was approved...../default/index2.html
+ [junit_] This publish request was approved...../default/index.html
+ [junit_] ------------- ---------------- ---------------
+ [junit_] ------------- Standard Error -----------------
+ [junit_] log4j:WARN No appenders could be found for logger (org.jbpm.JbpmConfiguration).
+ [junit_] log4j:WARN Please initialize the log4j system properly.
+ [junit_] ------------- ---------------- ---------------
+ [junit_]
+ [junit_] Testcase: testCMSPublish took 6.812 sec
+
+BUILD SUCCESSFUL
Added: trunk/workflow/build.sh
===================================================================
--- trunk/workflow/build.sh 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/build.sh 2006-12-22 20:15:42 UTC (rev 5929)
@@ -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 "$@"
Added: trunk/workflow/build.xml
===================================================================
--- trunk/workflow/build.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/build.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,255 @@
+<?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 5868 2006-12-15 02:59:56Z sohil.shah(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">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="apache.logging.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="ehcache.ehcache.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
+ </path>
+
+
+
+ <path id="javac.classpath">
+ <pathelement location="${build.classes}"/>
+ </path>
+
+ <property name="javac.excludes" value="**/jdbc/**"/>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-jems.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-workflow-lib.jar" manifest="${build.etc}/portal-workflow-lib-jar.mf">
+ <fileset dir="${build.classes}"/>
+ <fileset dir="${build.resources}/portal-workflow-jar"/>
+ </jar>
+
+ <!-- create the war file -->
+ <copy todir="${build.lib}/portal-workflow.war">
+ <fileset dir="${build.resources}/portal-workflow-war"/>
+ </copy>
+ </target>
+
+ <!--
+ generates artifacts used for tests, requires output to be previously run
+ -->
+ <target name="package-tests" depends="init">
+ </target>
+
+ <target name="deploy-tests"
+ description="Deploy."
+ depends="output">
+ </target>
+
+ <target name="undeploy-tests"
+ description="UnDeploy."
+ depends="output">
+ </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"/>
+
+ <!-- ================================================================== -->
+ <!-- Test. -->
+ <!-- ================================================================== -->
+ <target name="tests" depends="init">
+ <execute-tests>
+ <x-test>
+ <!-- general jbpm unit tests -->
+ <test todir="${test.reports}" name="org.jboss.portal.workflow.test.HelloWorldDbTest"/>
+
+ <!-- cms workflow tests -->
+ <test todir="${test.reports}" name="org.jboss.portal.workflow.test.PortalCMSPublish"/>
+ </x-test>
+ <x-classpath>
+ <path refid="apache.logging.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="apache.collections.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="ehcache.ehcache.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
+ <pathelement location="${build.lib}/portal-workflow-lib.jar"/>
+ <pathelement location="${build.resources}/test"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+</project>
Added: trunk/workflow/src/etc/portal-workflow-lib-jar.mf
===================================================================
--- trunk/workflow/src/etc/portal-workflow-lib-jar.mf 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/etc/portal-workflow-lib-jar.mf 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Created-By: @java.vm.version@ (@java.vm.vendor@)
+Specification-Title: @specification.title@
+Specification-Version: @specification.version@
+Specification-Vendor: @specification.vendor@
+Implementation-Title: @implementation.title@
+Implementation-URL: @implementation.url@
+Implementation-Version: @implementation.version@
+Implementation-Vendor: @implementation.vendor@
+Implementation-Vendor-Id: @implementation.vendor.id@
Added: trunk/workflow/src/main/org/jboss/portal/workflow/WorkflowException.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/WorkflowException.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/WorkflowException.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * Created on : Dec 21, 2006
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public class WorkflowException extends Exception
+{
+ /**
+ *
+ *
+ */
+ public WorkflowException()
+ {
+ this("");
+ }
+
+ /**
+ *
+ * @param e
+ */
+ public WorkflowException(Exception e)
+ {
+ super(e);
+ }
+
+ /**
+ *
+ * @param e
+ */
+ public WorkflowException(String e)
+ {
+ super(e);
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublish.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.cms;
+
+import java.util.Collection;
+import org.jboss.portal.workflow.WorkflowException;
+
+/**
+ * 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;
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishImpl.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,503 @@
+/******************************************************************************
+ * 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.cms;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+import java.util.List;
+
+import javax.naming.CompositeName;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.log4j.Logger;
+
+import org.jboss.naming.NonSerializableFactory;
+import org.jboss.portal.workflow.service.WorkflowService;
+import org.jboss.portal.workflow.WorkflowException;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import org.jbpm.JbpmContext;
+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.jbpm.db.GraphSession;
+
+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 String process = null;
+ private String processName = null;
+ private String managerEmails = null;
+ private String[] managers = null;
+ private boolean overwrite = false;
+ private String from = null;
+ private String subject = null;
+ private String body = null;
+
+ private String jndiName = null;
+
+ /**
+ *
+ *
+ */
+ public ApprovePublishImpl()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public void startService() throws Exception
+ {
+ super.startService();
+
+ if (this.jndiName != null)
+ {
+ NonSerializableFactory.rebind(new CompositeName(this.jndiName), this, true);
+ }
+
+ 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 new RuntimeException(e);
+ }
+ finally
+ {
+ if(is!=null)
+ {
+ try{is.close();}catch(Exception e){}
+ }
+ if(jbpmContext!=null)
+ {
+ jbpmContext.close();
+ }
+ }
+
+ //process managers that can serve as approvers/rejecters
+ StringTokenizer st = new StringTokenizer(this.managerEmails,",");
+ this.managers = new String[st.countTokens()];
+ for(int i=0;i<managers.length;i++)
+ {
+ this.managers[i] = st.nextToken();
+ }
+ }
+
+ /**
+ *
+ */
+ public void stopService() throws Exception
+ {
+ super.stopService();
+
+ if (this.jndiName != null)
+ {
+ NonSerializableFactory.unbind(this.jndiName);
+ }
+ }
+
+ /**
+ *
+ * @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 getManagerEmails()
+ {
+ return managerEmails;
+ }
+
+ /**
+ * @param managerRoles the managerRoles to set
+ */
+ public void setManagerEmails(String managerEmails)
+ {
+ this.managerEmails = managerEmails;
+ }
+
+
+
+ /**
+ * @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;
+ }
+
+
+ /**
+ * @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();
+ }
+ if(jbpmContext!=null)
+ {
+ jbpmContext.close();
+ }
+ }
+ 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;
+ 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(cour.getActorId().equals(manager))
+ {
+ 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(jbpmContext!=null)
+ {
+ jbpmContext.close();
+ }
+ }
+ }
+
+ /**
+ * 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()))
+ {
+ pendingQueue.add(content);
+ }
+ }
+ }
+ }
+ }
+ }
+ finally
+ {
+ if(jbpmContext!=null)
+ {
+ jbpmContext.close();
+ }
+ }
+ return pendingQueue;
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishServlet.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishServlet.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/ApprovePublishServlet.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * 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.cms;
+
+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;
+import org.jboss.portal.workflow.cms.ApprovePublish;
+
+/**
+ * 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 = false;
+ if(request.getRequestURI().indexOf("approve")!=-1)
+ {
+ approve = true;
+ }
+
+ 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: trunk/workflow/src/main/org/jboss/portal/workflow/cms/Content.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/Content.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/Content.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,147 @@
+/******************************************************************************
+ * 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.cms;
+
+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;
+
+ /**
+ *
+ *
+ */
+ 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;
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/cms/TaskExceptionHandler.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/cms/TaskExceptionHandler.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/cms/TaskExceptionHandler.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -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.cms;
+
+import org.jbpm.graph.def.*;
+import org.jbpm.graph.exe.*;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+
+
+
+/**
+ *
+ * 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());
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowService.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowService.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowService.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.workflow.service;
+
+import org.jbpm.JbpmConfiguration;
+
+/**
+ * Created on : Dec 19, 2006
+ * @author Sohil Shah - sohil.shah(a)jboss.com
+ *
+ */
+public interface WorkflowService
+{
+ /**
+ *
+ * @return
+ */
+ public JbpmConfiguration getJbpmConfiguration();
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowServiceImpl.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowServiceImpl.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/service/WorkflowServiceImpl.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * 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.apache.log4j.Logger;
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jbpm.JbpmConfiguration;
+import org.jbpm.JbpmContext;
+import org.jbpm.graph.def.ProcessDefinition;
+
+import java.io.StringWriter;
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+
+/**
+ * @author sohil.shah(a)jboss.com
+ *
+ */
+public class WorkflowServiceImpl extends AbstractJBossService implements WorkflowService
+{
+ private static Logger log = Logger.getLogger(WorkflowServiceImpl.class);
+
+
+ private JbpmConfiguration jbpmConfiguration = null;
+ private String jbpmConfigurationXml = null;
+
+ /**
+ *
+ *
+ */
+ public WorkflowServiceImpl()
+ {
+
+ }
+
+ /**
+ *
+ */
+ public void startService()
+ {
+ try
+ {
+ log.debug("---------------------------------------------------");
+ log.debug("Workflow Service successfully started......");
+ log.debug("---------------------------------------------------");
+
+ //initialize the jbpm configuration
+ this.jbpmConfiguration = JbpmConfiguration.parseXmlString(this.jbpmConfigurationXml);
+ }
+ catch(Exception e)
+ {
+ this.stopService();
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ *
+ */
+ public void stopService()
+ {
+
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getJbpmConfigurationXml()
+ {
+ return this.jbpmConfigurationXml;
+ }
+
+ /**
+ *
+ * @param jbpmConfigurationXml
+ */
+ public void setJbpmConfigurationXml(String jbpmConfigurationXml)
+ {
+ this.jbpmConfigurationXml = jbpmConfigurationXml;
+ }
+ //---------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ * @return
+ */
+ public JbpmConfiguration getJbpmConfiguration()
+ {
+ return this.jbpmConfiguration;
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/test/Finalize.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/test/Finalize.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/test/Finalize.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.test;
+
+import org.jbpm.graph.def.*;
+import org.jbpm.graph.exe.*;
+
+// MyActionHandler represents a class that could execute
+// some user code during the execution of a jBPM process.
+/**
+ * @author sohil.shah(a)jboss.com
+ */
+public class Finalize implements ActionHandler
+{
+
+ private static final long serialVersionUID = 1L;
+
+ // Before each test (in the setUp), the isExecuted member
+ // will be set to false.
+ public static boolean isExecuted = false;
+
+ // The action will set the isExecuted to true so the
+ // unit test will be able to show when the action
+ // is being executed.
+ public void execute(ExecutionContext executionContext)
+ {
+ String path = (String)executionContext.getContextInstance().getVariable("path");
+
+ Object rejection = executionContext.getContextInstance().getVariable("rejection");
+
+ if(rejection!=null)
+ {
+ System.out.println("This publish request was rejected....."+path);
+ }
+ else
+ {
+ System.out.println("This publish request was approved....."+path);
+ }
+
+
+ isExecuted = true;
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/test/HelloWorldDbTest.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/test/HelloWorldDbTest.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/test/HelloWorldDbTest.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,232 @@
+/******************************************************************************
+ * 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.test;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jbpm.JbpmConfiguration;
+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;
+
+/**
+ *
+ * @author sohil.shah(a)jboss.com
+ *
+ */
+public class HelloWorldDbTest extends TestCase {
+
+ static JbpmConfiguration jbpmConfiguration = null;
+
+ static {
+ // An example configuration file such as this can be found in
+ // 'src/config.files'. Typically the configuration information is in the
+ // resource file 'jbpm.cfg.xml', but here we pass in the configuration
+ // information as an XML string.
+
+ // First we create a JbpmConfiguration statically. One JbpmConfiguration
+ // can be used for all threads in the system, that is why we can safely
+ // make it static.
+
+ jbpmConfiguration = JbpmConfiguration.parseXmlString(
+ "<jbpm-configuration>" +
+
+ // A jbpm-context mechanism separates the jbpm core
+ // engine from the services that jbpm uses from
+ // the environment.
+
+ " <jbpm-context>" +
+ " <service name='persistence' " +
+ " factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
+ " </jbpm-context>" +
+
+ // Also all the resource files that are used by jbpm are
+ // referenced from the jbpm.cfg.xml
+
+ " <string name='resource.hibernate.cfg.xml' " +
+ " value='conf/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>"
+ );
+ }
+
+ public void setUp() {
+ jbpmConfiguration.createSchema();
+ }
+
+ public void tearDown() {
+ jbpmConfiguration.dropSchema();
+ }
+
+ public void testSimplePersistence() {
+ // Between the 3 method calls below, all data is passed via the
+ // database. Here, in this unit test, these 3 methods are executed
+ // right after each other because we want to test a complete process
+ // scenario. But in reality, these methods represent different
+ // requests to a server.
+
+ // Since we start with a clean, empty in-memory database, we have to
+ // deploy the process first. In reality, this is done once by the
+ // process developer.
+ deployProcessDefinition();
+
+ // Suppose we want to start a process instance (=process execution)
+ // when a user submits a form in a web application...
+ processInstanceIsCreatedWhenUserSubmitsWebappForm();
+
+ // Then, later, upon the arrival of an asynchronous message the
+ // execution must continue.
+ theProcessInstanceContinuesWhenAnAsyncMessageIsReceived();
+ }
+
+ public void deployProcessDefinition() {
+ // This test shows a process definition and one execution
+ // of the process definition. The process definition has
+ // 3 nodes: an unnamed start-state, a state 's' and an
+ // end-state named 'end'.
+ ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition name='hello_world'>" +
+ " <start-state name='start'>" +
+ " <transition to='s' />" +
+ " </start-state>" +
+ " <state name='s'>" +
+ " <transition to='end' />" +
+ " </state>" +
+ " <end-state name='end' />" +
+ "</process-definition>"
+ );
+
+ // Lookup the pojo persistence context-builder that is configured above
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try {
+ // Deploy the process definition in the database
+ jbpmContext.deployProcessDefinition(processDefinition);
+
+ } finally {
+ // Tear down the pojo persistence context.
+ // This includes flush the SQL for inserting the process definition
+ // to the database.
+ jbpmContext.close();
+ }
+ }
+
+ public void processInstanceIsCreatedWhenUserSubmitsWebappForm() {
+ // The code in this method could be inside a struts-action
+ // or a JSF managed bean.
+
+ // Lookup the pojo persistence context-builder that is configured above
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try {
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+
+ ProcessDefinition processDefinition =
+ graphSession.findLatestProcessDefinition("hello_world");
+
+ // With the processDefinition that we retrieved from the database, we
+ // can create an execution of the process definition just like in the
+ // hello_world example (which was without persistence).
+ ProcessInstance processInstance =
+ new ProcessInstance(processDefinition);
+
+ Token token = processInstance.getRootToken();
+ assertEquals("start", token.getNode().getName());
+ // Let's start the process execution
+ token.signal();
+ // Now the process is in the state 's'.
+ assertEquals("s", token.getNode().getName());
+
+ // Now the processInstance is saved in the database. So the
+ // current state of the execution of the process is stored in the
+ // database.
+ jbpmContext.save(processInstance);
+ // The method below will get the process instance back out
+ // of the database and resume execution by providing another
+ // external signal.
+
+ } finally {
+ // Tear down the pojo persistence context.
+ jbpmContext.close();
+ }
+ }
+
+ public void theProcessInstanceContinuesWhenAnAsyncMessageIsReceived() {
+ // The code in this method could be the content of a message driven bean.
+
+ // Lookup the pojo persistence context-builder that is configured above
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try {
+
+ GraphSession graphSession = jbpmContext.getGraphSession();
+ // First, we need to get the process instance back out of the database.
+ // There are several options to know what process instance we are dealing
+ // with here. The easiest in this simple test case is just to look for
+ // the full list of process instances. That should give us only one
+ // result. So let's look up the process definition.
+
+ ProcessDefinition processDefinition =
+ graphSession.findLatestProcessDefinition("hello_world");
+
+ // Now, we search for all process instances of this process definition.
+ List processInstances =
+ graphSession.findProcessInstances(processDefinition.getId());
+
+ // Because we know that in the context of this unit test, there is
+ // only one execution. In real life, the processInstanceId can be
+ // extracted from the content of the message that arrived or from
+ // the user making a choice.
+ ProcessInstance processInstance =
+ (ProcessInstance) processInstances.get(0);
+
+ // Now we can continue the execution. Note that the processInstance
+ // delegates signals to the main path of execution (=the root token).
+ processInstance.signal();
+
+ // After this signal, we know the process execution should have
+ // arrived in the end-state.
+ assertTrue(processInstance.hasEnded());
+
+ // Now we can update the state of the execution in the database
+ jbpmContext.save(processInstance);
+
+ } finally {
+ // Tear down the pojo persistence context.
+ jbpmContext.close();
+ }
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/test/PortalCMSPublish.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/test/PortalCMSPublish.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/test/PortalCMSPublish.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,309 @@
+/******************************************************************************
+ * 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.test;
+
+import java.util.*;
+
+import org.jbpm.graph.exe.*;
+import org.jbpm.JbpmConfiguration;
+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.jbpm.JbpmContext;
+
+import junit.framework.TestCase;
+
+/**
+ *
+ * @author sohil.shah(a)jboss.com
+ *
+ */
+public class PortalCMSPublish extends TestCase
+{
+ static JbpmConfiguration jbpmConfiguration = null;
+ static ProcessDefinition processDefinition = null;
+
+ static
+ {
+ // An example configuration file such as this can be found in
+ // 'src/config.files'. Typically the configuration information is in the
+ // resource file 'jbpm.cfg.xml', but here we pass in the configuration
+ // information as an XML string.
+
+ // First we create a JbpmConfiguration statically. One JbpmConfiguration
+ // can be used for all threads in the system, that is why we can safely
+ // make it static.
+
+ jbpmConfiguration = JbpmConfiguration.parseXmlString(
+ "<jbpm-configuration>" +
+
+ // A jbpm-context mechanism separates the jbpm core
+ // engine from the services that jbpm uses from
+ // the environment.
+
+ " <jbpm-context>" +
+ " <service name='persistence' " +
+ " factory='org.jbpm.persistence.db.DbPersistenceServiceFactory' />" +
+ " </jbpm-context>" +
+
+ // Also all the resource files that are used by jbpm are
+ // referenced from the jbpm.cfg.xml
+
+ " <string name='resource.hibernate.cfg.xml' " +
+ " value='conf/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>"
+ );
+
+ processDefinition = ProcessDefinition.parseXmlString(
+ "<process-definition name='approval_workflow'>" +
+ " <start-state>" +
+ " <transition to='request_approval'/>" +
+ " </start-state>" +
+ " <task-node name='request_approval'>"+
+ " <task name='approve_publish'>" +
+ " <assignment class='org.jboss.portal.workflow.test.PublishAssignmentHandler'/>" +
+ " </task>" +
+ " <controller>" +
+ " <variable name='path' access='read'/>"+
+ " </controller>"+
+ " <transition name='approval' to='end'/>" +
+ " <transition name='rejection' to='end'>" +
+ " <script name='signalRejection'>"+
+ " <variable name='rejection'/>"+
+ " <expression>"+
+ " System.out.println(\"Running the rejection script....\");rejection=true;"+
+ " </expression>"+
+ " </script>"+
+ " </transition>"+
+ " </task-node>"+
+ " <end-state name='end'>" +
+ " <event type='node-enter'>"+
+ " <action class='org.jboss.portal.workflow.test.Finalize'/>"+
+ " </event>"+
+ " </end-state>"+
+ "</process-definition>"
+ );
+ }
+
+ /**
+ *
+ */
+ public void setUp()
+ {
+ jbpmConfiguration.createSchema();
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ try
+ {
+ jbpmContext.deployProcessDefinition(processDefinition);
+ }
+ finally
+ {
+ jbpmContext.close();
+ }
+ }
+
+ /**
+ *
+ */
+ protected void tearDown() throws Exception
+ {
+ jbpmConfiguration.dropSchema();
+ }
+
+ public void testCMSPublish() throws Exception
+ {
+ long processId1 = this.createTask("/default/index.html");
+ long processId2 = this.createTask("/default/index2.html");
+
+ ApprovalThread t1 = new ApprovalThread(processId1,"/default/index.html",true);
+ ApprovalThread t2 = new ApprovalThread(processId2,"/default/index2.html",false);
+ Thread thread1 = new Thread(t1);
+ Thread thread2 = new Thread(t2);
+
+ thread1.start();
+ thread2.start();
+
+ while(!t1.done || !t2.done)
+ {
+ //busy wait here
+ }
+ }
+
+ /**
+ *
+ * @param path
+ * @return
+ */
+ private long createTask(String path)
+ {
+ long processId = 0;
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = null;
+ try
+ {
+ //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("approval_workflow");
+
+ //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("path",path);
+
+ //start the workflow, starts the cms publish approval workflow
+ //this creates a task to approve/reject a cms publish for the Admins
+ token.signal();
+ }
+ finally
+ {
+ if(processInstance!=null)
+ {
+ jbpmContext.save(processInstance);
+ processId = processInstance.getId();
+ }
+ jbpmContext.close();
+ }
+ return processId;
+ }
+
+ /**
+ *
+ * @param path
+ * @param processId
+ * @param manager
+ * @param reject
+ * @throws Exception
+ */
+ private void executeTask(String path,long processId,String manager,boolean reject) throws Exception
+ {
+ JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
+ ProcessInstance processInstance = null;
+ try
+ {
+ // Now, we search for all process instances of this process definition.
+ processInstance = jbpmContext.loadProcessInstance(processId);
+
+ if(processInstance.hasEnded())
+ {
+ System.out.println("This process has already ended...");
+ return;
+ }
+
+ //here act as an Admin and approve/reject one of the tasks
+ Collection allTasks = processInstance.getTaskMgmtInstance().getTaskInstances();
+ String[] transitions = {"approval","rejection"};
+ java.util.Random random = new java.util.Random(12343);
+ boolean markedForRejection = false;
+ for(Iterator itr=allTasks.iterator();itr.hasNext();)
+ {
+ TaskInstance cour = (TaskInstance)itr.next();
+ if(markedForRejection)
+ {
+ cour.end(transitions[1]);
+ continue;
+ }
+ if(cour.getActorId().equals(manager))
+ {
+ System.out.println("Manager="+cour.getActorId()+"("+processId+")");
+ int randomIndex = Math.abs(random.nextInt()%2);
+ if(randomIndex == 1)
+ {
+ //kill this task
+ markedForRejection = true;
+ cour.end(transitions[randomIndex]);
+ }
+ else
+ {
+ cour.end(transitions[randomIndex]);
+ break;
+ }
+ }
+ }
+ }
+ finally
+ {
+ if(processInstance!=null)
+ {
+ jbpmContext.save(processInstance);
+ }
+ jbpmContext.close();
+ }
+ }
+
+
+ /**
+ *
+ * @author sshah
+ *
+ */
+ private class ApprovalThread implements Runnable
+ {
+ long processId = 0;
+ String path = null;
+ boolean reject = false;
+ boolean done = false;
+ private ApprovalThread(long processId,String path,boolean reject)
+ {
+ this.processId = processId;
+ this.path = path;
+ this.reject = reject;
+ }
+
+ public void run()
+ {
+ try
+ {
+ String[] managers = {"Admin","eric.brown(a)jboss.com","sohil.shah(a)jboss.com"};
+ for(int i=0;i<managers.length;i++)
+ {
+ executeTask(this.path,this.processId,managers[i],this.reject);
+ }
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ finally
+ {
+ done = true;
+ }
+ }
+ }
+}
Added: trunk/workflow/src/main/org/jboss/portal/workflow/test/PublishAssignmentHandler.java
===================================================================
--- trunk/workflow/src/main/org/jboss/portal/workflow/test/PublishAssignmentHandler.java 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/main/org/jboss/portal/workflow/test/PublishAssignmentHandler.java 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.test;
+
+import java.util.Collection;
+
+import org.jbpm.graph.exe.*;
+import org.jbpm.taskmgmt.def.*;
+import org.jbpm.taskmgmt.exe.Assignable;
+import org.jbpm.taskmgmt.exe.TaskInstance;
+
+/**
+ *
+ * @author sohil.shah(a)jboss.com
+ *
+ */
+public class PublishAssignmentHandler implements AssignmentHandler {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ public void assign(Assignable assignable,ExecutionContext executionContext)
+ {
+ int taskInstances = 0;
+ Collection assignedTasks = executionContext.getTaskMgmtInstance().getTaskInstances();
+ if(assignedTasks!=null)
+ {
+ taskInstances = assignedTasks.size();
+ }
+
+ if(taskInstances == 1)
+ {
+ System.out.println("Assigning this task to the Managers");
+ String[] managers = {"Admin","sohil.shah(a)jboss.com","eric.brown(a)jboss.com"};
+ assignable.setActorId(managers[0]);
+ for(int i=1;i<managers.length;i++)
+ {
+ TaskInstance t = executionContext.getTaskMgmtInstance().
+ createTaskInstance(((TaskInstance)assignable).getTask(),executionContext);
+ t.setActorId(managers[i]);
+ }
+ }
+ }
+}
Added: trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/resources/portal-workflow-sar/META-INF/jboss-service.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,147 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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.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.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>
+ <!-- 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.core.workflow.cms.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 email addresses of managers that can
+ approve/reject content publish requests
+
+ TODO: once a GUI is fully integrated with the workflow
+ this will be modified to be a list of roles and then
+ the corresponding users will be treated as managers
+ -->
+ <attribute name="ManagerEmails">sohil.shah@jboss.com,sshah(a)redhat.com</attribute>
+ <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>
+ <attribute name="JNDIName">java:portal/ApprovePublishWorkflow</attribute>
+ </mbean>
+</server>
Added: trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/resources/portal-workflow-sar/conf/hibernate.cfg.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,166 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <!-- jdbc connection properties -->
+ <property name="connection.datasource">java:@portal.datasource.name@</property>
+
+ <!-- other hibernate properties -->
+ <property name="show_sql">@portal.sql.show@</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="hibernate.use_sql_comments">true</property>
+
+ <!-- managed environment transaction configuration -->
+ <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+
+ <!--property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property-->
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity-{version}.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- comment out the following 3 lines if you don't-->
+ <!-- want to use the default jBPM identity mgmgt -->
+ <!-- component -->
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- msg.db mapping files -->
+ <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
+ <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- scheduler.exe mapping files -->
+ <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
Added: trunk/workflow/src/resources/portal-workflow-war/WEB-INF/jboss-web.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-war/WEB-INF/jboss-web.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/resources/portal-workflow-war/WEB-INF/jboss-web.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,27 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<jboss-web>
+ <context-root>workflow</context-root>
+</jboss-web>
Added: trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml
===================================================================
--- trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/resources/portal-workflow-war/WEB-INF/web.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +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>
Added: trunk/workflow/src/resources/test/conf/hibernate.cfg.xml
===================================================================
--- trunk/workflow/src/resources/test/conf/hibernate.cfg.xml 2006-12-22 14:04:02 UTC (rev 5928)
+++ trunk/workflow/src/resources/test/conf/hibernate.cfg.xml 2006-12-22 20:15:42 UTC (rev 5929)
@@ -0,0 +1,166 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <!-- jdbc connection properties -->
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.;sql.enforce_strict_size=true</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+
+ <!-- other hibernate properties -->
+ <property name="hibernate.show_sql">false</property>
+ <property name="hibernate.format_sql">true</property>
+ <property name="hibernate.use_sql_comments">true</property>
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity-{version}.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- comment out the following 3 lines if you don't-->
+ <!-- want to use the default jBPM identity mgmgt -->
+ <!-- component -->
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- msg.db mapping files -->
+ <mapping resource="org/jbpm/msg/Message.hbm.xml"/>
+ <mapping resource="org/jbpm/msg/db/TextMessage.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteActionCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/ExecuteNodeCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/SignalCommand.hbm.xml"/>
+ <mapping resource="org/jbpm/command/TaskInstanceEndCommand.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- scheduler.exe mapping files -->
+ <mapping resource="org/jbpm/scheduler/exe/Timer.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
19 years, 4 months
JBoss Portal SVN: r5928 - trunk/jems/src/main/org/jboss/portal/jems/hibernate
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-22 09:04:02 -0500 (Fri, 22 Dec 2006)
New Revision: 5928
Modified:
trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
Log:
use our mechanism back to enable innodb in the future
Modified: trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
===================================================================
--- trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2006-12-22 13:49:17 UTC (rev 5927)
+++ trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2006-12-22 14:04:02 UTC (rev 5928)
@@ -33,7 +33,6 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
-import org.hibernate.dialect.DialectFactory;
import org.hibernate.dialect.Dialect;
import org.jboss.portal.common.util.CLLoader;
import org.jboss.portal.common.util.LoaderResource;
@@ -232,8 +231,7 @@
DatabaseMetaData meta = conn.getMetaData();
String databaseName = meta.getDatabaseProductName();
int databaseMajorVersion = getDatabaseMajorVersion(meta);
- Dialect dialect = DialectFactory.determineDialect(databaseName, databaseMajorVersion);
- dialectName = dialect.getClass().getName();
+ dialectName = DialectFactory.determineDialect(databaseName, databaseMajorVersion);
config.setProperty(Environment.DIALECT, dialectName);
log.debug("Detected dialect " + dialectName + ", database is (" + databaseName + "," + databaseMajorVersion + ")");
}
19 years, 4 months
JBoss Portal SVN: r5927 - trunk/jems/src/main/org/jboss/portal/jems/hibernate
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-22 08:49:17 -0500 (Fri, 22 Dec 2006)
New Revision: 5927
Modified:
trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
Log:
use hibernate dialect factory to detect the dialect.
Modified: trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java
===================================================================
--- trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2006-12-21 19:15:13 UTC (rev 5926)
+++ trunk/jems/src/main/org/jboss/portal/jems/hibernate/SessionFactoryBinder.java 2006-12-22 13:49:17 UTC (rev 5927)
@@ -33,6 +33,8 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.hibernate.tool.hbm2ddl.SchemaUpdate;
+import org.hibernate.dialect.DialectFactory;
+import org.hibernate.dialect.Dialect;
import org.jboss.portal.common.util.CLLoader;
import org.jboss.portal.common.util.LoaderResource;
import org.jboss.portal.common.util.Tools;
@@ -230,7 +232,8 @@
DatabaseMetaData meta = conn.getMetaData();
String databaseName = meta.getDatabaseProductName();
int databaseMajorVersion = getDatabaseMajorVersion(meta);
- dialectName = DialectFactory.determineDialect(databaseName, databaseMajorVersion);
+ Dialect dialect = DialectFactory.determineDialect(databaseName, databaseMajorVersion);
+ dialectName = dialect.getClass().getName();
config.setProperty(Environment.DIALECT, dialectName);
log.debug("Detected dialect " + dialectName + ", database is (" + databaseName + "," + databaseMajorVersion + ")");
}
19 years, 4 months
JBoss Portal SVN: r5926 - in trunk/wsrp/src: main/org/jboss/portal/test/wsrp/framework main/org/jboss/portal/test/wsrp/v1/producer main/org/jboss/portal/wsrp main/org/jboss/portal/wsrp/consumer main/org/jboss/portal/wsrp/producer resources/tests/test-wsrp-producer-markup-sar/META-INF
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2006-12-21 14:15:13 -0500 (Thu, 21 Dec 2006)
New Revision: 5926
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml
Log:
- Implemented setPortletProperties on Consumer. NOT TESTED!!!
- Removed unused session management code.
- Integrated (with modifications) Matt's patch for session handling testing.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/TestWSRPProducerImpl.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -360,12 +360,6 @@
this.sessionExpirationTime = sessionExpirationTime;
}
- public boolean isSessionValid(String sessionId)
- {
- // todo: implement
- return true;
- }
-
public ProducerRegistrationRequirements getProducerRegistrationRequirements()
{
throw new UnsupportedOperationException("getProducerRegistrationRequirements not implemented");
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -39,6 +39,8 @@
import org.jboss.portal.wsrp.core.NamedString;
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
+import org.jboss.portal.wsrp.core.RuntimeContext;
+import org.jboss.portal.wsrp.core.SessionContext;
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UpdateResponse;
@@ -84,6 +86,28 @@
}
}
+ /**
+ * The consumer should never have access to or be able to set a sessionID. Sessions are handled by the Producer using
+ * cookies.
+ *
+ * @throws Exception
+ */
+ public void testGetMarkupWithSessionID() throws Exception
+ {
+ GetMarkup getMarkup = createMarkupRequest();
+ getMarkup.getRuntimeContext().setSessionID("Hello World");
+
+ try
+ {
+ markupService.getMarkup(getMarkup);
+ ExtendedAssert.fail("A sessionID should not be allowed to be passed in GetMarkup()");
+ }
+ catch (OperationFailedFault operationFailedFault)
+ {
+ // expected fault.
+ }
+ }
+
public void testGetMarkupEditNoSession() throws Exception
{
GetMarkup getMarkup = createMarkupRequest();
@@ -223,6 +247,32 @@
checkMarkupResponse(response, "<p>" + symbol + " stock value: 123.45</p>");
}
+ /**
+ * The consumer should never have access to or be able to set a sessionID. The sessions are handled by the producer
+ * using cookies.
+ *
+ * @throws Exception
+ */
+ public void testPBIWithSessionID() throws Exception
+ {
+ String portletHandle = getDefaultHandle();
+ PerformBlockingInteraction performBlockingInteraction = WSRPTypeFactory.createDefaultPerformBlockingInteraction(portletHandle);
+
+ RuntimeContext runtimeContext = performBlockingInteraction.getRuntimeContext();
+ //the sessionID should never be set by the consumer. Sessions are handled by cookies instead
+ runtimeContext.setSessionID("Hello World");
+
+ try
+ {
+ markupService.performBlockingInteraction(performBlockingInteraction);
+ ExtendedAssert.fail("Should not be able to pass a sessionID in a PerformBlockingInteraction()");
+ }
+ catch (OperationFailedFault operationFailedFault)
+ {
+ // expected failure
+ }
+ }
+
public void testMarkupCaching() throws Exception
{
GetMarkup getMarkup = createMarkupRequest();
@@ -426,6 +476,8 @@
ExtendedAssert.assertNotNull(updateResponse);
// request was readOnly so no updated portlet context
ExtendedAssert.assertNull(updateResponse.getPortletContext());
+ // check that no sessionId is getting passed.
+ ExtendedAssert.assertNull(updateResponse.getSessionContext());
String navigationalState = updateResponse.getNavigationalState();
ExtendedAssert.assertNotNull(navigationalState);
@@ -462,6 +514,11 @@
ExtendedAssert.assertTrue(markupContext.getRequiresUrlRewriting().booleanValue());
ExtendedAssert.assertEquals(markupString, markupContext.getMarkupString());
+ // Session context
+ SessionContext sessionContext = response.getSessionContext();
+ // The session information is should never be sent to the consumer, Cookies are used instead.
+ ExtendedAssert.assertNull(sessionContext);
+
return markupContext;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/NeedPortletHandleTest.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -34,6 +34,7 @@
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.PortletDescription;
import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.wsrp.core.SessionContext;
import org.jboss.portal.wsrp.handler.RequestHeaderClientHandler;
import java.rmi.RemoteException;
@@ -177,5 +178,9 @@
ProducerSessionInformation sessionInfo = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
ExtendedAssert.assertNotNull(sessionInfo);
ExtendedAssert.assertTrue(sessionInfo.getUserCookie().lastIndexOf("JSESSIONID") != -1);
+
+ // Check that we are not sending sessionID's
+ SessionContext sessionContext = response.getSessionContext();
+ ExtendedAssert.assertNull(sessionContext);
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/ReleaseSessionTestCase.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -26,17 +26,11 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.wsrp.WSRPTypeFactory;
-import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
-import org.jboss.portal.wsrp.core.GetMarkup;
-import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
-import org.jboss.portal.wsrp.core.MarkupResponse;
-import org.jboss.portal.wsrp.core.MissingParametersFault;
import org.jboss.portal.wsrp.core.OperationFailedFault;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.ReleaseSessions;
-import org.jboss.portal.wsrp.handler.RequestHeaderClientHandler;
-import java.rmi.RemoteException;
+import java.util.Arrays;
/**
* Tests the behavior of the ReleaseSession method.
@@ -70,232 +64,86 @@
log.debug("Instantiating ReleaseSessionTestCase");
}
- public void testNullRegistrationContextWithRegistration() throws Exception
- {
- RegistrationContext regContext = null;
-
- Class exceptionClass = InvalidRegistrationFault.class;
- String message = "A null RegistrationContext when a registration is required should produce an InvalidRegistrationFault";
-
- releaseSessionsWithRegistration(regContext, null, exceptionClass, message);
- }
-
- public void testNullRegistrationContext() throws Exception
+ public void testReleaseSession() throws Exception
{
- RegistrationContext regContext = null;
+ // possible registration contexts are: actual RegistrationContext, null, and a made up value
+ RegistrationContext fakeRegContext = WSRPTypeFactory.createRegistrationContext("Fake Registration Handle");
+ RegistrationContext[] regContexts = new RegistrationContext[]{getRegistrationContext(), null, fakeRegContext};
- GetMarkup getMarkup = createMarkupRequest();
- MarkupResponse response = markupService.getMarkup(getMarkup);
- checkSessionForCurrentlyDeployedPortlet(response);
+ // possible types of sessionIDs include null and a made up value.
+ // Note: a valid session id cannot be used since the sessionID should never be sent to the consumer
+ String nullSessionID = null;
+ String fakeSessionID = "Fake Session ID";
- // Since no registration is required, a null RegistrationContext should be acceptable
- releaseSessions(regContext, null, null, null);
- }
+ String[][] sessionIDs = new String[][]{{nullSessionID},
+ {nullSessionID, nullSessionID},
+ {fakeSessionID},
+ {fakeSessionID, fakeSessionID},
+ {fakeSessionID, nullSessionID},
+ {nullSessionID, fakeSessionID}};
- public void testNullSessionIDWithRegistration() throws Exception
- {
-
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = null;
-
- Class exceptionClass = MissingParametersFault.class;
- String message = "SessionIDs are required. Null SessionIDs should produce a MissingParameterFault";
-
- releaseSessionsWithRegistration(regContext, sessionIDs, exceptionClass, message);
+ for (int i = 0; i < regContexts.length; i++)
+ {
+ for (int j = 0; j < sessionIDs.length; j++)
+ {
+ ReleaseSessions releaseSession = new ReleaseSessions(regContexts[i], sessionIDs[j]);
+ releaseSessions(releaseSession, false);
+ releaseSessions(releaseSession, true);
+ }
+ }
}
- public void testNullSessionID() throws Exception
+ private RegistrationContext getRegistrationContext() throws Exception
{
-
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = null;
-
- Class exceptionClass = MissingParametersFault.class;
- String message = "SessionIDs are required. Null SessionIDs should produce a MissingParameterFault";
-
- releaseSessions(regContext, sessionIDs, exceptionClass, message);
+ return registerConsumer();
}
- public void testInvalidRegistrationContextWithRegistration() throws Exception
+ private void releaseSessions(ReleaseSessions releaseSessions, boolean useRegistration) throws Exception
{
- RegistrationContext regContext = WSRPTypeFactory.createRegistrationContext("Fake Registration Handle");
-
- Class exceptionClass = InvalidRegistrationFault.class;
- String message = "An invalid RegistrationContext when a registration is required should produce an InvalidRegistrationFault";
-
- releaseSessionsWithRegistration(regContext, getSessionIDs(), exceptionClass, message);
- }
-
- public void testInvalidRegistrationContext() throws Exception
- {
- RegistrationContext regContext = WSRPTypeFactory.createRegistrationContext("Fake Registration Handle");
-
- Class exceptionClass = InvalidRegistrationFault.class;
- String message = "An invalid RegistrationContext when a registration is not required should still produce an InvalidRegistrationFault";
-
- releaseSessions(regContext, getSessionIDs(), exceptionClass, message);
- }
-
- public void testInvalidSessionIDsWithRegistration() throws Exception
- {
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = new String[]
- {"fake session id"};
-
- Class exceptionClass = OperationFailedFault.class;
- String message = "An invalid SessionIDs should produce an OperationFailedFault";
-
- releaseSessionsWithRegistration(regContext, sessionIDs, exceptionClass, message);
- }
-
- public void testInvalidSessionIDs() throws Exception
- {
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = new String[]
- {"fake session id"};
-
- Class exceptionClass = OperationFailedFault.class;
- String message = "An invalid SessionIDs should produce an OperationFailedFault";
-
- releaseSessions(regContext, sessionIDs, exceptionClass, message);
- }
-
- public void testNullParametersWithRegistration() throws Exception
- {
- RegistrationContext regContext = null;
- String[] sessionIDs = null;
-
- // This method can potentially throw two different fault methods
- // (InvalidRegistration and MissingParameters) for the given parameters.
- Class exceptionClass = InvalidRegistrationFault.class;
- String message = "Null RegistrationContext when registration is reguired should produce an InvalidRegistrationFault";
-
- releaseSessionsWithRegistration(regContext, sessionIDs, exceptionClass, message);
- }
-
- public void testNullParameters() throws Exception
- {
- RegistrationContext regContext = null;
- String[] sessionIDs = null;
-
- Class exceptionClass = MissingParametersFault.class;
- String message = "Null SessionIDs should produce a MissingParameterFault";
-
- releaseSessions(regContext, sessionIDs, exceptionClass, message);
- }
-
- public void testValidParametersWithRegistration() throws Exception
- {
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = getSessionIDs();
- releaseSessionsWithRegistration(regContext, sessionIDs, null, null);
- }
-
- public void testValidParameters() throws Exception
- {
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = getSessionIDs();
- releaseSessions(regContext, sessionIDs, null, null);
- }
-
- public void testReleasedSession() throws Exception
- {
- RegistrationContext regContext = getRegistrationContext();
- String[] sessionIDs = getSessionIDs();
-
- ReleaseSessions relSession = new ReleaseSessions(regContext, sessionIDs);
-
- markupService.releaseSessions(relSession);
-
+ setUp();
try
{
- markupService.releaseSessions(relSession);
- ExtendedAssert.fail("Trying to release an already released session should produce an OperationFailedFault");
+ log.info(getSetupString(releaseSessions));
+ if (useRegistration)
+ {
+ configureRegistrationSettings(false);
+ }
+ markupService.releaseSessions(releaseSessions);
+ ExtendedAssert.fail("ReleaseSessions did not thrown an OperationFailed Fault." + getSetupString(releaseSessions));
}
catch (OperationFailedFault operationFailedFault)
{
- // expected failure
+ // expected error;
}
-
+ finally
+ {
+ tearDown();
+ }
}
- public void testReleasedSessionWithRegistration() throws Exception
+ private String getSetupString(ReleaseSessions releaseSessions)
{
- configureRegistrationSettings(false);
- testReleasedSession();
- registrationService.deregister(getRegistrationContext());
- }
+ String message = "ReleaseSessions Setup:\n";
- public void testNullReleaseSessions() throws Exception
- {
- ReleaseSessions relSession = null;
- try
+ if (releaseSessions == null)
{
- markupService.releaseSessions(relSession);
- ExtendedAssert.fail("A null ReleaseSessions should produce an OperationFailedFault");
+ message += " ReleaseSessions : null";
}
- catch (OperationFailedFault operationFailedFault)
+ else
{
- // expected
+ RegistrationContext regContext = releaseSessions.getRegistrationContext();
+ String[] sessionIDs = releaseSessions.getSessionIDs();
+ message += " RegistrationContext : " + (regContext != null ? regContext.getRegistrationHandle() : null);
+ message += " | SessionIDs : " + Arrays.toString(sessionIDs);
}
- }
- public void testNullReleaseSessionsWithRegistration() throws Exception
- {
- configureRegistrationSettings(false);
- testNullReleaseSessions();
- registrationService.deregister(getRegistrationContext());
- }
-
- //*************************************************************************************************
-
-
- private String[] getSessionIDs() throws RemoteException, InvalidRegistrationFault, OperationFailedFault
- {
- ProducerSessionInformation sessionInfo = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
- // session ids are portlet session, not portal session so we cannot rely on the JSESSIONID cookie
- String sessionID = sessionInfo.getSessionIdForPortlet(getDefaultHandle());
- return new String[]
- {sessionID};
- }
-
- private RegistrationContext getRegistrationContext() throws Exception
- {
- return registerConsumer();
- }
-
- private void releaseSessions(RegistrationContext regContext, String[] sessionIDs, Class exceptionClass,
- String message) throws Exception
- {
- ReleaseSessions relSession = new ReleaseSessions(regContext, sessionIDs);
- try
+ if (producer.getProducerRegistrationRequirements().requiresRegistration())
{
- markupService.releaseSessions(relSession);
- if (exceptionClass != null)
- {
- ExtendedAssert.fail(message);
- }
+ message += " | with registration required.";
}
- catch (Exception e)
- {
- if (e.getClass() == exceptionClass && exceptionClass != null)
- {
- //expected exception
- }
- else
- {
- throw e;
- }
- }
- }
- private void releaseSessionsWithRegistration(RegistrationContext regContext, String[] sessionIDs,
- Class exceptionClass, String message) throws Exception
- {
- configureRegistrationSettings(false);
- releaseSessions(regContext, sessionIDs, exceptionClass, message);
- registrationService.deregister(regContext);
+ return message;
}
-}
+}
\ No newline at end of file
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPProducer.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -90,14 +90,6 @@
*/
void setSessionExpirationTime(int sessionExpirationTime);
- /**
- * Checks that the session identified with the specified id is valid.
- *
- * @param sessionId
- * @return <code>true</code> if the session associated with the given id is valid, <code>false</code> otherwise.
- */
- boolean isSessionValid(String sessionId);
-
ProducerRegistrationRequirements getProducerRegistrationRequirements();
RegistrationManager getRegistrationManager();
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -62,6 +62,7 @@
import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.ResetProperty;
import org.jboss.portal.wsrp.core.RuntimeContext;
import org.jboss.portal.wsrp.core.ServiceDescription;
import org.jboss.portal.wsrp.core.SessionContext;
@@ -837,4 +838,18 @@
{
return new PropertyList();
}
+
+ /**
+ * EMPTY, @name(xsd:string)
+ *
+ * @param name
+ * @return
+ * @since 2.6
+ */
+ public static ResetProperty createResetProperty(String name)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Property name", "ResetProperty");
+
+ return new ResetProperty(name);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -62,8 +62,10 @@
import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.ResetProperty;
import org.jboss.portal.wsrp.core.RuntimeContext;
import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.wsrp.core.SetPortletProperties;
import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
@@ -318,9 +320,48 @@
return getProperties(portletContext, (String[])null);
}
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException,
+ PortletInvokerException, UnsupportedOperationException
{
- throw new UnsupportedOperationException("setProperties currently unsupported.");
+ ParameterValidation.throwIllegalArgExceptionIfNull(portletContext, "PortletContext");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(changes, "Property changes");
+
+ registerIfNeeded();
+
+ PropertyList propertyList = WSRPTypeFactory.createPropertyList();
+ int changesNumber = changes.length;
+ List updates = new ArrayList(changesNumber);
+ List resets = new ArrayList(changesNumber);
+ for (int i = 0; i < changesNumber; i++)
+ {
+ PropertyChange change = changes[i];
+ switch (change.getType())
+ {
+ case PropertyChange.PREF_RESET:
+ resets.add(WSRPTypeFactory.createResetProperty(change.getKey()));
+ break;
+
+ case PropertyChange.PREF_UPDATE:
+ updates.add(WSRPTypeFactory.createProperty(change.getKey(), null, change.getValue().asString())); // todo: deal with language
+ break;
+
+ default:
+ throw new IllegalArgumentException("Unexpected property change type: " + change.getType());
+ }
+ }
+ propertyList.setProperties((Property[])updates.toArray(new Property[0]));
+ propertyList.setResetProperties((ResetProperty[])resets.toArray(new ResetProperty[0]));
+ SetPortletProperties setPortletProperties =
+ WSRPTypeFactory.createSetPortletProperties(WSRPUtils.convertToWSRPPortletContext(portletContext), propertyList);
+
+ try
+ {
+ return WSRPUtils.convertToPortalPortletContext(getPortletManagementService().setPortletProperties(setPortletProperties));
+ }
+ catch (Exception e)
+ {
+ throw new PortletInvokerException("Unable to set properties for portlet '" + portletContext.getId() + "'", e);
+ }
}
// Accessors ********************************************************************************************************
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -77,7 +77,6 @@
import org.jboss.portal.wsrp.core.PortletContext;
import org.jboss.portal.wsrp.core.PortletDescription;
import org.jboss.portal.wsrp.core.PortletStateChangeRequiredFault;
-import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.ReleaseSessions;
import org.jboss.portal.wsrp.core.ReturnAny;
import org.jboss.portal.wsrp.core.RuntimeContext;
@@ -142,6 +141,8 @@
final RuntimeContext runtimeContext = getMarkup.getRuntimeContext();
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(runtimeContext, "RuntimeContext", GET_MARKUP);
+ checkForSessionIDs(runtimeContext);
+
// get markup parameters
final MarkupParams params = getMarkup.getMarkupParams();
WSRPUtils.throwMissingParametersFaultIfValueIsMissing(params, "MarkupParams", GET_MARKUP);
@@ -251,6 +252,20 @@
return new MarkupResponse(markupContext, null, null);
}
+ private void checkForSessionIDs(RuntimeContext runtimeContext) throws OperationFailedFault
+ {
+ if (runtimeContext.getSessionID() != null)
+ {
+ throwOperationFaultOnSessionOperation();
+ }
+ }
+
+ private void throwOperationFaultOnSessionOperation() throws OperationFailedFault
+ {
+ throw WSRPUtils.createOperationFailedFault(new IllegalArgumentException("JBoss Portal's Producer manages " +
+ "sessions completely on the server side, passing or trying to release sessionIDs is therefore an error."));
+ }
+
public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault, OperationFailedFault,
UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault, PortletStateChangeRequiredFault,
@@ -457,53 +472,10 @@
public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault, AccessDeniedFault, RemoteException
{
- WSRPUtils.throwOperationFailedFaultIfValueIsMissing(releaseSessions, "ReleaseSessions");
-
- RegistrationContext rc = releaseSessions.getRegistrationContext();
- producer.checkRegistration(rc);
-
- String regHandle;
- if (rc == null)
- {
- regHandle = null;
- }
- else
- {
- regHandle = rc.getRegistrationHandle();
- }
-
- String[] sessionIDs = releaseSessions.getSessionIDs();
- WSRPUtils.throwMissingParametersFaultIfValueIsMissing(sessionIDs, "session IDs", "ReleaseSessions");
-
- for (int i = 0; i < sessionIDs.length; i++)
- {
- String sessionID = sessionIDs[i];
- try
- {
- releaseSession(regHandle, sessionID);
- }
- catch (IllegalStateException e)
- {
- log.warn("session with id: " + sessionID + " had already been released.", e);
- }
- }
-
- return new ReturnAny();
+ throwOperationFaultOnSessionOperation();
+ return null;
}
- /**
- * Releases the resources associated to the specified session for the specified consumer.
- *
- * @param registrationHandle the registration handle identifying the consumer
- * @param sessionID the id of the session which resources are to be released
- * @throws IllegalStateException if the specified session had already been released
- */
- private void releaseSession(String registrationHandle, String sessionID) throws IllegalStateException, OperationFailedFault
- {
- //fix-me: do we need to pass registration handle?
- producer.releaseSession(sessionID);
- }
-
public ReturnAny initCookie(InitCookie initCookie)
throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault, RemoteException
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2006-12-21 19:15:13 UTC (rev 5926)
@@ -77,14 +77,10 @@
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
-import org.jboss.portal.wsrp.servlet.ServletAccess;
-import javax.servlet.http.HttpSession;
import java.rmi.RemoteException;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
/**
@@ -128,16 +124,12 @@
/** Supported locales. */
private String[] supportedLocales = new String[]{"en", "en-US"};
- /** Manages the sessions. */
- private SessionManager sessionManager;
-
public WSRPProducerImpl()
{
markupHandler = new MarkupHandler(this);
serviceDescriptionHandler = new ServiceDescriptionHandler(this);
registrationHandler = new RegistrationHandler(this);
portletManagementHandler = new PortletManagementHandler(this);
- sessionManager = new SessionManager();
}
public ProducerRegistrationRequirements getProducerRegistrationRequirements()
@@ -368,26 +360,6 @@
this.sessionExpirationTime = sessionExpirationTime;
}
- public boolean isSessionValid(String sessionId)
- {
- return sessionManager.isSessionValid(sessionId);
- }
-
- public void addSession(HttpSession session)
- {
- sessionManager.addSession(session);
- }
-
- HttpSession getSession()
- {
- return ServletAccess.getRequest().getSession(false);
- }
-
- public void releaseSession(String sessionID) throws IllegalStateException, OperationFailedFault
- {
- sessionManager.invalidateSession(sessionID);
- }
-
public PortletInvoker getInvoker()
{
return invoker;
@@ -503,78 +475,4 @@
return supportedLocales; // todo: avoid hardcoding this at some point...
}
- private class SessionManager
- {
- private Map sessions = new HashMap();
-
- void addSession(HttpSession session)
- {
- if (session != null)
- {
- log.debug("Storing session in SessionManager instance: " + session.getId());
- session.setMaxInactiveInterval(WSRPProducerImpl.this.getSessionExpirationTime());
- sessions.put(session.getId(), session);
- }
- }
-
- boolean isSessionValid(String sessionId)
- {
- log.debug("Getting HttpSession using provided Id: " + sessionId);
- HttpSession session = getSession(sessionId);
- if (session != null)
- {
- log.debug("Got the session");
- if (hasSessionExpired(session))
- {
- sessions.remove(session.getId());
- return false;
- }
-
- return true;
- }
- return false;
- }
-
- HttpSession getSession(String sessionId)
- {
- if (sessionId == null)
- {
- return null;
- }
-
- return (HttpSession)sessions.get(sessionId);
- }
-
- void invalidateSession(String sessionId) throws IllegalStateException, OperationFailedFault
- {
- HttpSession session = getSession(sessionId);
- if (session != null)
- {
- sessions.remove(sessionId);
- if (!hasSessionExpired(session))
- {
- session.invalidate();
- }
- }
- else
- {
- //the sessionID does not exist for any session
- throw WSRPUtils.createOperationFailedFault(new IllegalArgumentException("'" + sessionId + "' is not a valid session id!"));
- }
- }
-
- private boolean hasSessionExpired(HttpSession session)
- {
- try
- {
- // try to access info on the session if this throws an exception it means the session had expired
- session.getLastAccessedTime();
- }
- catch (Exception e)
- {
- return true;
- }
- return false;
- }
- }
}
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml 2006-12-21 16:07:08 UTC (rev 5925)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-markup-sar/META-INF/jboss-service.xml 2006-12-21 19:15:13 UTC (rev 5926)
@@ -34,7 +34,7 @@
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
</mbean>
- <!--<mbean
+ <mbean
code="org.jboss.portal.test.wsrp.v1.producer.ReleaseSessionTestCase"
name="portal.test:test=ReleaseSession"
xmbean-dd=""
@@ -44,5 +44,5 @@
<depends optional-attribute-name="ServiceFactory"
proxy-type="attribute">portal.wsrp:service=CachingServiceFactory</depends>
<depends optional-attribute-name="Producer" proxy-type="attribute">portal.wsrp:service=WSRPProducer</depends>
- </mbean>-->
+ </mbean>
</server>
19 years, 4 months
JBoss Portal SVN: r5925 - trunk/core/src/resources/portal-core-sar/META-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-21 11:07:08 -0500 (Thu, 21 Dec 2006)
New Revision: 5925
Modified:
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1168 : Wrong callback method in HA configuration for the portlet app deployer creating portlet instances at deployment
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-21 16:05:51 UTC (rev 5924)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-21 16:07:08 UTC (rev 5925)
@@ -1043,7 +1043,7 @@
<depends>portal:container=PortalObject</depends>
<attribute name="Target">portal:deploymentFactory=PortletApp</attribute>
<attribute name="OnStart">enableCreateInstances</attribute>
- <attribute name="OnStop">disableCreateInstance</attribute>
+ <attribute name="OnStop">disableCreateInstances</attribute>
</mbean>
@portal.single.xml.open@
-->
19 years, 4 months
JBoss Portal SVN: r5924 - branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-sar/META-INF
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-21 11:05:51 -0500 (Thu, 21 Dec 2006)
New Revision: 5924
Modified:
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
JBPORTAL-1168 : Wrong callback method in HA configuration for the portlet app deployer creating portlet instances at deployment
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-21 14:52:17 UTC (rev 5923)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2006-12-21 16:05:51 UTC (rev 5924)
@@ -786,7 +786,7 @@
<depends>portal:container=PortalObject</depends>
<attribute name="Target">portal:deploymentFactory=PortletApp</attribute>
<attribute name="OnStart">enableCreateInstances</attribute>
- <attribute name="OnStop">disableCreateInstance</attribute>
+ <attribute name="OnStop">disableCreateInstances</attribute>
</mbean>
@portal.single.xml.open@
-->
19 years, 4 months
JBoss Portal SVN: r5923 - trunk/core/src/resources/portal-core-war/WEB-INF/classes
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-21 09:52:17 -0500 (Thu, 21 Dec 2006)
New Revision: 5923
Added:
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_pt_BR.properties
Removed:
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_en.properties
Modified:
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties
Log:
- JBPORTAL-861 : Brazilian Portguese Portal localization
- cleanup in resource bundles files (removed english entries in non english files as the fallback mechanism makes the resolution automotically)
- removed the unnecessary and redundant Resource_en.properties
- Converted french resource bundle file using native2ascii
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2006-12-21 01:29:30 UTC (rev 5922)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2006-12-21 14:52:17 UTC (rev 5923)
@@ -21,7 +21,7 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
################################################################################
-_ASREGISTERED=Don't have an account yet? You can <a href\="index.html?module=user&op=getlogin">create one</a>.
+_ASREGISTERED=Don't have an account yet? You can create <a href\="">one</a>.
_BLOCKNICKNAME=Username
_BLOCKPASSWORD=Password
@@ -120,7 +120,7 @@
FakeEmail=Fake e-mail
NewUser=New user
SaveChanges=Save Changes
-SaveChange=Save Changes
+SaveChange=Save Change
TypeNewPassword=(type a new password twice to change it)
Search=Search
All=All
@@ -303,7 +303,7 @@
ROLE_TEXT_1=Use this portlet to create, edit, delete and add users to roles.
ROLE_TEXT_2=These roles are used in the Management Portlet to set access rights.
-// CMS ADMIN PORTLET
+# CMS ADMIN PORTLET
TITLE_HEAD=CMS Admin
TITLE_BROWSE=Directory Browser
TITLE_FILEBROWSE=File Browser
Deleted: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_en.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_en.properties 2006-12-21 01:29:30 UTC (rev 5922)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_en.properties 2006-12-21 14:52:17 UTC (rev 5923)
@@ -1,380 +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. #
-################################################################################
-
-_ASREGISTERED=Don't have an account yet? You can <a href\="index.html?module=user&op=getlogin">create one</a>.
-_BLOCKNICKNAME=Username
-_BLOCKPASSWORD=Password
-
-
-
-MessageOrder=Message order
-Ascending=Ascending
-Descending=Descending
-
-AIM=AIM Address
-ICQ=ICQ Number
-YIM=YIM Number
-MSNM=MSN Messenger
-
-YourAIM=Your AIM Address
-YourICQ=Your ICQ Number
-YourYIM=Your YIM Number
-YourMSNM=Your MSN Messenger
-
-MyEmail=My e-mail
-MyHomePage=My homepage
-
-Question=Secret question
-Answer=Secret answer
-Location=Location
-Occupation=Occupation
-Interests=Interests
-ExtraInfo=Extra Information
-YourLocation=Your location
-YourOccupation=Your occupation
-YourInterests=Your interests
-Signature=Signature
-
-LoginSite=Login.
-Register=Register.
-
-UserExist=Username already exists
-ToChangeInfo=to change your info
-EmailVerify=Activation link Emailed! Check your email and click the activation link to activate your account.
-AccountActivated=Account successfully activated!
-UnableActivate=Unable to validate new user.
-LoggingYou=Logging you in, hang tight\!
-YouAreLoggedOut=You are now logged out\!
-PassDifferent=The passwords are different. They need to be identical.
-YourPassMustBe=Sorry, your password must be at least
-CharLong=characters long
-UserNotExist=User doesn't exist\!
-UserRegLogin=User registration/login
-SelectOption=Please select an option from the menu below\:
-RetrievePass=Retrieve lost password.
-RegNewUser=New user registration
-PasswordAgain=Confirm your password
-Email=E-mail
-Options=Options
-AllowEmailView=Allow other users to view my e-mail address
-AsRegUser=As a registered user you can\:
-AsReg6=Select different themes
-AsReg5=Customize the comments
-AsReg4=Select how many news items to show on the homepage
-AsReg3=Have a personal box on the homepage
-AsReg2=Send news with your username
-AsReg1=Post comments with your username
-RegisterNow=Register now\! It's free\!
-WeDontGive=We won't sell/give others your personal info.
-WelcomeTo=Welcome to
-Registration=registration area.
-
-Over13_1=I am
-Over13_2=or over or I have parental consent
-MustBe_1=You must be
-MustBe_2=or over, or have parental permission to register here.
-Consent_1=(By clicking on the above link you certify that you are either<br>
-Consent_2=or over, or that you have parental consent to register here.)
-Under13_1=I am under
-Under13_2=and do not have parental consent.
-
-Sorry=Sorry.
-Click=Please click
-Here=here
-Return=to return to the main page.
-UserName=Username
-GoBack=Back
-Finish=Finish
-PersonalInfo=Personal information
-RealName=Real name
-Optional=(optional)
-CanKnowAbout=(255 characters max. Type what you'd like others to know about you)
-Language=Language
-255CharMax=(255 characters max. Type your signature with HTML coding)
-YourAvatar=Your avatar
-YourHomePage=Your website
-TimeZoneOffset=Time zone offset
-EmailNotPublic=(This e-mail will not be public but is required. It will be used to send your password if you lose it)
-EmailPublic=(This e-mail will be public. Type what you'd like. Spam proof)
-RealEmail=Real e-mail
-FakeEmail=Fake e-mail
-NewUser=New user
-SaveChanges=Save Changes
-SaveChange=Save Changes
-TypeNewPassword=(type a new password twice to change it)
-Search=Search
-All=All
-UsersFoundFor=users found for
-Pages=pages
-UsersShown=users shown
-Delete=Delete
-Edit=Edit
-Ok=Ok
-Cancel=Cancel
-AreYouSureToDeleteUser=Are you sure to delete user?
-UserDeleted=User deleted succesfully
-ReturnToMemberList=Return to member list
-Avatar=Avatar
-AdminFunctions=Admin functions
-URL=URL
-UpdateUser=Update user
-UserID=User ID
-ForChanges=(For changes only)
-MemberList=Member List
-SearchTip=Tip: choose a letter, display all or search for a user if you know its username
-
-ThemeText1=This option will change the look for the whole site.
-ThemeText2=The changes will be valid only to you.
-ThemeText3=Each user can view the site with a different theme.
-SelectTheme=Select a theme
-ThemeSelection=Theme selection
-
-CannotLogin=Cannot proceed to login
-
-LoginInvalidName=the user name is not valid
-LoginNoSuchUser=the user name does not exist
-LoginBadPassword=your password does not match
-LoginUnexpectedError=unexpected error
-LoginUserDisabled=your account has been blocked. Please contact an administrator.
-
-Enable=Enable
-Disable=Disable
-StatusChanged=The user status has been succesfully changed
-
-NotAuth=You\'re not authorized to perform this operation
-
-REMEMBERME=Remember me
-LOGIN=Login
-USERNAME=Username
-PASSWORD=Password
-USERLOGIN=User login
-
-OPTIONAL=Optional
-REQUIRED=Required
-
-255MAX=(Signature of 255 characters max)
-
-NAMENOTAVAILABLE=N/A
-
-# Registration
-REGISER_NOT_LOGGED_IN=You are currently not logged in.
-REGISTER_REGISTER=You can create an account.
-REGISTER_REGISTER_LINK=create one
-REGISTER_REGISTER_ADMIN_LINK=Create User account
-REGISTER_TY=Thank you for registering.
-REGISTER_BASICINFO=Basic User Information
-REGISTER_IM=Instant Message Identities
-REGISTER_ADDITIONAL=Additional Optional User Information
-REGISTER_NEWUSER=New user registration
-REGISTER_PASSWORDAGAIN=Confirm your password
-REGISTER_REALEMAIL=Real e-mail
-REGISTER_EMAILNOTPUBLIC=(This e-mail will not be public but is required. It will be used to send your password if you lose it)
-REGISTER_FAKEEMAIL=Fake e-mail
-REGISTER_EMAILPUBLIC=(This e-mail will be public. Type what you'd like. Spam proof)
-REGISTER_FAKEEMAIL_EXPLAIN=If this field is not empty, the real email will be used only to send notifications
-REGISTER_QUESTION=Secret question
-REGISTER_ANSWER=Secret answer
-REGISTER_ASREGUSER=As a registered user you can:
-REGISTER_ASREG6=Select different themes
-REGISTER_ASREG5=Customize the comments
-REGISTER_ASREG4=Select how many news items to show on the homepage
-REGISTER_ASREG3=Have a personal box on the homepage
-REGISTER_ASREG2=Send news with your username
-REGISTER_ASREG1=Post comments with your username
-REGISTER_REGISTERNOW=Register now! It's free!
-REGISTER_WEDONTGIVE=We won't sell/give others your personal info.
-REGISTER_ALREADYHAVEACCOUNT=You already have an account:
-REGISTER_SIGNIN=Sign in
-REGISTER_GIVENNAME=Firstname
-REGISTER_FAMILYNAME=Lastname
-REGISTER_PERSONALINFO=Personal information
-REGISTER_VIEWREALEMAIL=Allow other users to view my real e-mail address
-REGISTER_HOMEPAGE=Address of your personal website
-REGISTER_TIMEZONEOFFSET=Time zone offset
-REGISTER_THEME=Theme
-REGISTER_DEFAULT_THEME=Site Default
-REGISTER_ICQ=ICQ id
-REGISTER_AIM=AIM id
-REGISTER_YIM=Yahoo id
-REGISTER_MSNM=MSN messenger id
-REGISTER_SKYPE=Skype id
-REGISTER_LOCATION=Location
-REGISTER_LANGUAGE=Preferred language
-REGISTER_OCCUPATION=Occupation
-REGISTER_INTERESTS=Interests
-REGISTER_SIGNATURE=Signature
-REGISTER_EXTRAINFO=Extra information
-REGISTER_CANKNOWABOUT=(255 characters max. Type what you'd like others to know about you)
-REGISTER_SAVECHANGES=Save changes
-REGISTER_CONFIRMATIONEMAIL=Confirmation email
-
-REGISTER_SHOWMENU=Go back to the user menu
-
-REGISTER_ERROR_INVALIDUSERNAME=Username is not valid
-REGISTER_ERROR_EXISTINGUSERNAME=This username is already taken
-REGISTER_ERROR_INVALIDPASSWORD1=Password was not valid
-REGISTER_ERROR_INVALIDPASSWORD2=Password was not valid
-REGISTER_ERROR_PASSWORDMISMATCH=Passwords do not match
-REGISTER_ERROR_INVALIDREALEMAIL=Email address is not valid
-
-REGISTER_CONFIRM=User created successfully.
-REGISTER_ADMIN_SEARCH=View/Edit users
-
-MENU_LOGOUT=Logout
-MENU_EDITPROFILE=Edit your profile
-MENU_LISTUSERS=List of all the users
-
-LIST_FILTERS=Apply filters to the list
-LIST_USERSPERPAGE=Users per page
-LIST_USERNAMECONTAINS=Username contains
-LIST_FULLNAME=Fullname
-LIST_USERNAME=Username
-LIST_FIRSTNAME=Firstname
-LIST_LASTNAME=Lastname
-LIST_ROLES=Roles
-LIST_ACTIONS=Actions
-LIST_ACTIONSSHOWPROFILE=Profile
-LIST_ACTIONADDROLESTOUSER=Roles
-LIST_ACTIONEDITROLES=Edit Roles
-LIST_ACTIONDELETEUSER=Delete user
-LIST_SEARCHRESULTS=Search results for
-LIST_MATCHING=Matching Users
-FILTER=Filter
-
-NEXTPAGE=Next page
-PREVIOUSPAGE=Previous page
-
-ASSIGNROLES=Assign roles
-ROLESAVAILABLE=Available roles
-EDITROLESFORUSER=Edit roles for the user
-
-
-ROLE_THEREARE=There are
-ROLE_THEREIS=There is
-ROLE_ROLESDEFINED=roles defined
-ROLE_ROLEDEFINED=role defined
-
-ROLE_NAME=Name of the new role
-ROLE_DISPLAYNAME=Display name of the role
-ROLE_NEWDISPLAYNAME=New display name for the role
-ROLE_SELECTONETOMODIFY= Select the role to modify
-ROLE_SELECTONETODELETE= Select the role to delete
-ROLE_CREATE=Create user role
-ROLE_UPDATE=Update user role
-ROLE_EDIT=Edit user role
-ROLE_DELETE=Delete selected role
-ROLE_DELETED=The role has been deleted
-ROLE_EDIT_MEMBERS=Edit role members
-ROLE_MAINLIST=Back to Role Edit
-
-ROLE_ERROR_DISPLAYNAMEALREADYEXISTS=There is already a role with that display name
-ROLE_ERROR_NAMEALREADYEXISTS=There is already a role with that name
-ROLE_ERROR_NAMEEMPTY=The role name cannot be empty
-ROLE_ERROR_DISPLAYNAMEEMPTY=The role display name cannot be empty
-ROLE_ERROR_DELETE_FAILED=Could not delete the role
-ROLE_EDIT_USER=Editing users in Role
-
-MENU_CREATEROLE=Create new role
-MENU_EDITROLE=Edit existing role
-MENU_EDITROLEMEMBERS=Edit role members
-
-ROLE_TEXT_1=Use this portlet to create, edit, delete and add users to roles.
-ROLE_TEXT_2=These roles are used in the Management Portlet to set access rights.
-
-// CMS ADMIN PORTLET
-TITLE_HEAD=CMS Admin
-TITLE_BROWSE=Directory Browser
-TITLE_FILEBROWSE=File Browser
-TITLE_DELETECONFIRM=Confirm Delete
-TITLE_CREATECOLLCONFIRM=Confirm Directory Creation
-TITLE_COPYCONFIRM=Confirm Resource Copy
-TITLE_MOVECONFIRM=Confirm Resource Move
-TITLE_VIEWFILE=Viewing File Properties
-TITLE_EDIT=Edit File
-TITLE_CREATE=Create File
-TITLE_UPLOAD=Upload File
-TITLE_SECURECONFIRM=Secure Node
-
-CMS_MENU=Action Menu
-CMS_ACTION=Action
-CMS_NAME=Name
-CMS_TYPE=Type
-CMS_CREATED=Created
-CMS_MODIFIED=Modified
-CMS_DESCRIPTION=Description
-CMS_VIEW=View
-CMS_COPY=Copy
-CMS_MOVE=Move
-CMS_DELETE=Delete
-CMS_FOLDER=Folder
-CMS_FILE=File
-CMS_CREATE=Create
-CMS_EDIT=Edit
-CMS_UPLOAD=Upload
-CMS_MODIFY=Modify
-CMS_CREATEFOLDER= Create Folder
-CMS_CREATEFILE=Create File
-CMS_UPLOADARCHIVE=Upload Archive
-CMS_BACKTOBROWSER=Back to Directory Browser
-CMS_TRANSFER=Import/Export
-CMS_EXPORTARCHIVE=Export Folder
-CMS_SECURE=Secure
-
-CMS_CREATEFILEINDIR=Creating File in Directory
-CMS_FILENAME=FileName
-CMS_TITLE=Title
-CMS_LANGUAGE=Language
-
-CMS_DELETEPATH=Confirm Deletion of
-CMS_DELETEWARN1=WARNING! You will not be able to undo these change\!
-CMS_DELETEWARN2=Are you sure you want to delete this resource\?
-
-CMS_DESTINATION=Destination
-CMS_SOURCE=Source
-
-CMS_EDITING=Editing File
-CMS_LIVE=Make \"Live\"
-CMS_VERSION=Version
-
-CMS_LIVEVERSION=Live Version
-CMS_SIZE=Size
-
-CMS_CONTENT_DIR=Content Directory
-CMS_CONTENT_DIR_USE=Use the directory tree to navigate the portal folder structure.
-CMS_MAIN_USE=Use the CMS Administration portlet to manage the content of your portal.
-
-VALIDATIONEMAIL_1=A user with this email address has registered on our site.
-VALIDATIONEMAIL_2=Please keep this email for your records. Your account information is as follows
-VALIDATIONEMAIL_3=Your account is currently inactive. You cannot use it until you visit the following link
-VALIDATIONEMAIL_4=If you did not register for membership on our site, no further action is required.
-VALIDATIONEMAIL_5=Regards,\nThe staff.
-
-PERMISSION_PICKPORTLET=Portlet Permissions Administration
-PERMISSION_PERMISSIONS=Permissions to modify
-PERMISSION_TOP=Select a Component to Modify
-PERMISSION_FINERGRAIN=Select a sub-component to define its permissions
-PERMISSION_MODIFYROLES=Add/Remove roles
-PERMISSION_MODIFYINGROLES=Modifying roles for
-PERMISSION_DOMAIN=Domain
-PERMISSION_DOMAIN_MOD=Modify Domain
-
\ No newline at end of file
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties 2006-12-21 01:29:30 UTC (rev 5922)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties 2006-12-21 14:52:17 UTC (rev 5923)
@@ -21,7 +21,7 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
################################################################################
-_ASREGISTERED=�No tiene una cuenta todav�a? Puede <a href\="index.html?module=user&op=getlogin">crear una</a>.
+_ASREGISTERED=�No tiene una cuenta todav�a? Puede crear <a href\="">una</a>.
_BLOCKNICKNAME=Usuario
_BLOCKPASSWORD=Clave
@@ -120,7 +120,7 @@
FakeEmail=E-mail de pega
NewUser=Nuevo usuario
SaveChanges=Guardar cambios
-SaveChange=Guardar cambios
+SaveChange=Guardar cambio
TypeNewPassword=(escriba una clave dos veces para cambiarla)
Search=Buscar
All=Todos
@@ -177,14 +177,14 @@
NAMENOTAVAILABLE=N/A
# Registration
-REGISER_NOT_LOGGED_IN=You are currently not logged in.
+REGISER_NOT_LOGGED_IN=
REGISTER_REGISTER=Puedes crear una cuenta.
REGISTER_REGISTER_LINK=crear una
REGISTER_REGISTER_ADMIN_LINK=Crear una cuenta
-REGISTER_TY=Thank you for registering.
-REGISTER_BASICINFO=Basic User Information
-REGISTER_IM=Instant Message Identities
-REGISTER_ADDITIONAL=Additional Optional User Information
+REGISTER_TY=
+REGISTER_BASICINFO=
+REGISTER_IM=
+REGISTER_ADDITIONAL=
REGISTER_NEWUSER=Registro de nuevo usuario
REGISTER_PASSWORDAGAIN=Confirme su clave
REGISTER_REALEMAIL=E-mail real
@@ -237,9 +237,6 @@
REGISTER_ERROR_PASSWORDMISMATCH=Las Claves no coincide
REGISTER_ERROR_INVALIDREALEMAIL=La direcci�n de E-mail no es v�lida
-REGISTER_CONFIRM=User created successfully.
-REGISTER_ADMIN_SEARCH=View/Edit users
-
MENU_LOGOUT=Desconectarse
MENU_EDITPROFILE=Editar su perfil
MENU_LISTUSERS=Listar todos los usuarios
@@ -249,16 +246,16 @@
LIST_USERNAMECONTAINS=Usuario contiene
LIST_FULLNAME=Nombre completo
LIST_USERNAME=Nombre de usuario
-LIST_FIRSTNAME=Firstname
-LIST_LASTNAME=Lastname
+LIST_FIRSTNAME=
+LIST_LASTNAME=
LIST_ROLES=Roles
LIST_ACTIONS=Acciones
LIST_ACTIONSSHOWPROFILE=Perfil
LIST_ACTIONADDROLESTOUSER=Roles
LIST_ACTIONEDITROLES=Editar Roles
LIST_ACTIONDELETEUSER=Borrar el usario
-LIST_SEARCHRESULTS=Search results for
-LIST_MATCHING=Matching Users
+LIST_SEARCHRESULTS=
+LIST_MATCHING=
FILTER=Filtro
NEXTPAGE=P�gina siguiente
@@ -298,10 +295,7 @@
MENU_EDITROLE=Editar un rol existente
MENU_EDITROLEMEMBERS=Editar los miembros de un rol
-ROLE_TEXT_1=Use this portlet to create, edit, delete and add users to roles.
-ROLE_TEXT_2=These roles are used in the Management Portlet to set access rights.
-
-// CMS ADMIN PORTLET
+# CMS ADMIN PORTLET
TITLE_HEAD=Administraci�n de CMS
TITLE_BROWSE=Explorador de directorios
TITLE_DELETECONFIRM=Confirmar el borrado
@@ -312,56 +306,7 @@
TITLE_EDIT=Editar fichero
TITLE_CREATE=Crear fichero
TITLE_UPLOAD=Subir fichero
-TITLE_SECURECONFIRM=Secure Node
-CMS_MENU=Action Menu
-CMS_ACTION=Action
-CMS_NAME=Name
-CMS_TYPE=Type
-CMS_CREATED=Created
-CMS_MODIFIED=Modified
-CMS_DESCRIPTION=Description
-CMS_VIEW=View
-CMS_COPY=Copy
-CMS_MOVE=Move
-CMS_DELETE=Delete
-CMS_FOLDER=Folder
-CMS_FILE=File
-CMS_CREATE=Create
-CMS_EDIT=Edit
-CMS_UPLOAD=Upload
-CMS_MODIFY=Modify
-CMS_CREATEFOLDER= Create Folder
-CMS_CREATEFILE=Create File
-CMS_UPLOADARCHIVE=Upload Archive
-CMS_BACKTOBROWSER=Back to Directory Browser
-CMS_TRANSFER=Import/Export
-CMS_EXPORTARCHIVE=Export Folder
-CMS_SECURE=Secure
-
-CMS_CREATEFILEINDIR=Creating File in Directory
-CMS_FILENAME=FileName
-CMS_TITLE=Title
-CMS_LANGUAGE=Language
-
-CMS_DELETEPATH=Confirm Deletion of
-CMS_DELETEWARN1=WARNING! You will not be able to undo these change\!
-CMS_DELETEWARN2=Are you sure you want to delete this resource\?
-
-CMS_DESTINATION=Destination
-CMS_SOURCE=Source
-
-CMS_EDITING=Editing File
-CMS_LIVE=Make \"Live\"
-CMS_VERSION=Version
-
-CMS_LIVEVERSION=Live Version
-CMS_SIZE=Size
-
-CMS_CONTENT_DIR=Content Directory
-CMS_CONTENT_DIR_USE=Use the directory tree to navigate the portal folder structure.
-CMS_MAIN_USE=Use the CMS Administration portlet to manage the content of your portal.
-
VALIDATIONEMAIL_1=Un usuario con esta direcci�n de email se ha registado en nuestro sitio.
VALIDATIONEMAIL_2=Por favor, mantenga este correo para su registro. La informaci�n de su cuenta es la siguiente
VALIDATIONEMAIL_3=Su cuenta est� actualmente inactiva. No puede usarla hasta que visite el siguiente enlace
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties 2006-12-21 01:29:30 UTC (rev 5922)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties 2006-12-21 14:52:17 UTC (rev 5923)
@@ -29,37 +29,36 @@
Descending=Descendant
AIM=Addresse AIM
-ICQ=ICQ Number
-YIM=YIM Number
-MSNM=MSN Messenger
+ICQ=num\u00E9ro ICQ
+YIM=num\u00E9ro YIM
+MSNM=identifiant MSN
YourAIM=Votre Addresse AIM
-YourICQ=Votre ICQ Number
-YourYIM=Votre YIM Number
-YourMSNM=Votre MSN Messenger
+YourICQ=Votre num\u00E9ro ICQ
+YourYIM=Votre identifiant YIM
+YourMSNM=Votre identifiant MSN
MyEmail=Mon e-mail
MyHomePage=Ma homepage
-Location=Position
+Location=R\u00E9sidence
Occupation=Occupation
-Interests=Centres d'int�r�ts
-ExtraInfo=Informations compl�mentaires
-YourLocation=Votre lieu de r�sidence
-YourOccupation=Votre m�tier
-YourInterests=Vos centres d'int�r�ts
-UserLogin=Pseudo utilisateur
+Interests=Centres d'int\u00E9r\u00EAts
+ExtraInfo=Informations compl\u00E9mentaires
+YourLocation=Votre lieu de r\u00E9sidence
+YourOccupation=Votre m\u00E9tier
+YourInterests=Vos centres d'int\u00E9r\u00EAts
Signature=Signature
LoginSite=Login.
-Register=Enregistrement
+Register=Enregistrement.
-UserExist=Cet identifiant existe d�j�
+UserExist=Cet identifiant existe d\u00E9j\u00E0
ToChangeInfo=Pour changer vos informations personnelles
LoggingYou=Bienvenue, connexion en cours ...
-YouAreLoggedOut=Deconnexion en cours ... � bient�t \!
-PassDifferent=Les passwords sont diff�rents, ils doivent �tre identiques
-YourPassMustBe=D�sol� votre password doit comporter au moins
+YouAreLoggedOut=Deconnexion en cours ... \u00E9 bient\u00F4t \!
+PassDifferent=Les mots de passe sont diff\u00E9rents, ils doivent etre identiques
+YourPassMustBe=D\u00E9sol\u00E9 votre mot de passe doit comporter au moins
CharLong=caracteres
UserNotExist=Cet identifiant n\'existe pas \!
UserRegLogin=Enregistrement/login
@@ -67,67 +66,66 @@
RetrievePass=Mot de passe perdu
Email=E-mail
Options=Options
-AllowEmailView=Autoriser les autres utilisateurs � voir mon adresse e-mail
+AllowEmailView=Autoriser les autres utilisateurs \u00E9 voir mon adresse e-mail
WelcomeTo=Bienvenue sur
-Registration=Enregistrement
+Registration=enregistrement
Over13_1=J'ai
Over13_2=ou plus ou j'ai l'autorisation de mes parents
MustBe_1=Vous devez avoir
MustBe_2=ou plus ou avoir l'autorisation de vos parents
-Consent_1=(En cliquant sur le lien ci-dessus vous d�clarez �tre majeur<br>
+Consent_1=(En cliquant sur le lien ci-dessus vous d\u00E9clarez \u00EAtre majeur<br>
Consent_2=ou avoir l'autorisation de vos parents)
Under13_1=Je ne suis pas majeur
Under13_2=et je n'ai pas l'autorisation de mes parents
-Sorry=D�sol�.
+Sorry=D\u00E9sol\u00E9.
Click=Cliquez
Here=ici
-Return=pour revenir � la page d'accueil
+Return=pour revenir \u00EA la page d'accueil
UserName=Identifiant
GoBack=Back
Finish=Terminer
PersonalInfo=Informations personnelles
-RealName=Nom r�el
+RealName=Nom r\u00E9el
Optional=(optionel)
-CanKnowAbout=(255 caracteres max. Pr�cisez ce que les autres peuvent savoir de vous)
+CanKnowAbout=(255 caracteres max. Pr\u00E9cisez ce que les autres peuvent savoir de vous)
Language=Langage
-255CharMax=(255 caracteres max. Signature with HTML coding)
+255CharMax=
YourAvatar=Votre avatar
YourHomePage=Votre site web
-TimeZoneOffset=D�calage GMT
-EmailNotPublic=(e-mail obligatoire mais non publi�. Utilis� pour vous envoyer votre mot de passe)
-EmailPublic=(e-mail public.)
-#Required=Obligatoire
+TimeZoneOffset=D\u00E9calage GMT
+EmailNotPublic=(Email obligatoire mais non publique. Utilis\u00E9 pour vous envoyer votre mot de passe)
+EmailPublic=(Eail public.)
SaveChanges=Enregistrer les modifications
-SaveChange=Enregistrer les modifications
+SaveChange=Enregistrer la modification
TypeNewPassword=(saisissez un nouveau mot de passe 2 fois pour valider)
Search=Chercher
All=Tous
-UsersFoundFor=utilisateurs trouv�s
+UsersFoundFor=utilisateurs trouv\u00E9s
Pages=pages
-UsersShown=utilisateurs visualis�s
+UsersShown=utilisateurs montr\u00E9s
Delete=Supprimer
Edit=Editer
Ok=Ok
-Cancel=Cancel
+Cancel=Annuler
AreYouSureToDeleteUser=Voulez-vous vraiment supprimer l\'utilisateur \?
-UserDeleted=Utilisateur supprim�
-ReturnToMemberList=Revenir � la liste des membres
+UserDeleted=Utilisateur supprim\u00E9
+ReturnToMemberList=Revenir \u00EA la liste des membres
Avatar=Avatar
AdminFunctions=Fonctions d\'administration
URL=URL
-UpdateUser=Mise � jour
-UserID=ID Utilisateur
+UpdateUser=Mise \u00EA jour
+UserID=Identifiant Utilisateur
ForChanges=(modifications seulement)
MemberList=Liste des membres
SearchTip=Choisir une lettre, cliquer sur Tous ou entrez un nom de membre
ThemeText1=Cette option change le style pour tout le site
ThemeText2=Les changement ne concernent que vous
-ThemeText3=Chaque utilisateur peut consulter le site avec le th�me de son choix
-SelectTheme=Selectionner un th�me
-ThemeSelection=Selection d\'un th�me
+ThemeText3=Chaque utilisateur peut consulter le site avec le theme de son choix
+SelectTheme=Selectionner un theme
+ThemeSelection=Selection d\'un theme
CannotLogin=Connexion impossible
@@ -135,18 +133,18 @@
LoginNoSuchUser=L\'utilisateur n\'existe pas
LoginBadPassword=Le mot de passe n\'est pas valide
LoginUnexpectedError=Erreur inconnue
-LoginUserDisabled=Votre compte est bloqu�. Consultez un aministrateur
+LoginUserDisabled=Votre compte est bloqu\u00E9. Consultez un aministrateur
Enable=Permettre
Disable=Interdire
-StatusChanged=Le status de l\'utilisateur a �t� chang�
+StatusChanged=Le status de l\'utilisateur a \u00E9t\u00E9 chang\u00E9
-NotAuth=Op�ration non autoris�e
+NotAuth=Op\u00E9ration non autoris\u00E9e
REMEMBERME=Enregistrer
-LOGIN=Login
+LOGIN=Login
USERNAME=Identifiant
-PASSWORD=Password
+PASSWORD=Mot de passe
USERLOGIN=Pseudo utilisateur
OPTIONAL=Facultatif
@@ -157,40 +155,35 @@
NAMENOTAVAILABLE=N/D
# Registration
-REGISER_NOT_LOGGED_IN=You are currently not logged in.
-REGISTER_REGISTER=Cr�er un compte
-REGISTER_REGISTER_LINK=Cr�er un compte
-REGISTER_REGISTER_ADMIN_LINK=Cr�er un compte
-REGISTER_TY=Thank you for registering.
-REGISTER_BASICINFO=Basic User Information
-REGISTER_IM=Instant Message Identities
-REGISTER_ADDITIONAL=Additional Optional User Information
+REGISER_NOT_LOGGED_IN=
+REGISTER_REGISTER=Cr\u00E9er un compte
+REGISTER_REGISTER_ADMIN_LINK=Cr\u00E9er un compte
REGISTER_NEWUSER=Enregistrement d'un nouvel utilisateur
REGISTER_PASSWORDAGAIN=Comfirmer votre mot de passe
-REGISTER_REALEMAIL=e-mail r�el
-REGISTER_FAKEEMAIL=e-mail public
-REGISTER_FAKEEMAIL_EXPLAIN=Si ce champ n'est pas vide, l'email r�el ne sera utilis� que pour envoyer des notifications
-REGISTER_QUESTION=Question secr�te
-REGISTER_ANSWER=R�ponse secr�te
-REGISTER_ASREGUSER=En �tant enregistr� vous pouvez:
-REGISTER_ASREG6=Choisir parmi plusieurs th�mes
+REGISTER_REALEMAIL=e-mail r\u00E9el
+REGISTER_FAKEEMAIL=E-mail public
+REGISTER_FAKEEMAIL_EXPLAIN=Si ce champ n'est pas vide, l'email r\u00E9el ne sera utilis\u00E9 que pour envoyer des notifications
+REGISTER_QUESTION=Question secr\u00E8te
+REGISTER_ANSWER=R\u00E9ponse secr\u00E8te
+REGISTER_ASREGUSER=En \u00E9tant enregistr\u00E9 vous pouvez:
+REGISTER_ASREG6=Choisir parmi plusieurs th\u00E8mes
REGISTER_ASREG5=Personnaliser les commentaires
REGISTER_ASREG4=Personnaliser la page d'accueil
REGISTER_ASREG3=Avoir une boite de saisie de mot de passe sur la page d'accueil
REGISTER_ASREG2=Poster des news
REGISTER_ASREG1=Poster des commentaires
REGISTER_REGISTERNOW=Enregistrez-vous! C'est gratuit!
-REGISTER_WEDONTGIVE=Nous ne communiquons pas les donn�es personnelles
+REGISTER_WEDONTGIVE=Nous ne communiquons pas les donn\u00E9es personnelles
REGISTER_ALREADYHAVEACCOUNT=Vous avex deja un compte:
REGISTER_SIGNIN=Se connecter
-REGISTER_GIVENNAME=Prenom
+REGISTER_GIVENNAME=Pr\u00E9nom
REGISTER_FAMILYNAME=Nom
-REGISTER_PERSONALINFO=INformation personelles
+REGISTER_PERSONALINFO=Information personelles
REGISTER_VIEWREALEMAIL=Permet aux autres utilisateurs de voir ma vraie adresse e-mail.
REGISTER_HOMEPAGE=Addresse de votre site web
REGISTER_TIMEZONEOFFSET=Time zone
-REGISTER_THEME=Th�me
+REGISTER_THEME=Th\u00E8me
REGISTER_DEFAULT_THEME=Site Default
REGISTER_ICQ=Numero ICQ
REGISTER_AIM=Identifiant AIM
@@ -210,15 +203,12 @@
REGISTER_SHOWMENU=Retour au menu utilisateur
REGISTER_ERROR_INVALIDUSERNAME=L'identifiant n'est pas valide
-REGISTER_ERROR_EXISTINGUSERNAME=Cet identifiant est deja pris
+REGISTER_ERROR_EXISTINGUSERNAME=Cet identifiant est d\u00E9j\u00E0 pris
REGISTER_ERROR_INVALIDPASSWORD1=Le mot de passe n'est pas valide
REGISTER_ERROR_INVALIDPASSWORD2=Le mot de passe n'est pas valide
-REGISTER_ERROR_PASSWORDMISMATCH=les mots de passe sont differents
+REGISTER_ERROR_PASSWORDMISMATCH=les mots de passe sont diff\u00E9rents
REGISTER_ERROR_INVALIDREALEMAIL=Adresse email invalide
-REGISTER_CONFIRM=User created successfully.
-REGISTER_ADMIN_SEARCH=View/Edit users
-
MENU_LOGOUT=Deconnection
MENU_EDITPROFILE=Editer votre profile
MENU_LISTUSERS=Liste des utilisateurs
@@ -228,15 +218,11 @@
LIST_USERNAMECONTAINS=Identifiant contient
LIST_FULLNAME=Nom complet
LIST_USERNAME=Identifiant
-LIST_FIRSTNAME=Firstname
-LIST_LASTNAME=Lastname
LIST_ROLES=Roles
LIST_ACTIONS=Actions
LIST_ACTIONSSHOWPROFILE=Profil
LIST_ACTIONADDROLESTOUSER=Roles
-LIST_ACTIONDELETEUSER=Delete user
-LIST_SEARCHRESULTS=Search results for
-LIST_MATCHING=Matching Users
+LIST_ACTIONDELETEUSER=Supprimer un utilisateur
FILTER=Filtre
NEXTPAGE=Page suivante
@@ -268,10 +254,7 @@
MENU_CREATEROLE=Creer nouveau role
MENU_EDITROLE=Editer un role existant
-ROLE_TEXT_1=Use this portlet to create, edit, delete and add users to roles.
-ROLE_TEXT_2=These roles are used in the Management Portlet to set access rights.
-
-// CMS ADMIN PORTLET
+# CMS ADMIN PORTLET
TITLE_HEAD=Administration CMS
TITLE_BROWSE=Navigation repertoires
TITLE_DELETECONFIRM=Confirmer la suppression
@@ -282,58 +265,38 @@
TITLE_EDIT=Editer le fichier
TITLE_CREATE=Creer le fichier
TITLE_UPLOAD=Charger le fichier
-TITLE_SECURECONFIRM=Secure Node
+TITLE_SECURECONFIRM=S\u00E9curiser le noeud
-CMS_MENU=Action Menu
-CMS_ACTION=Action
-CMS_NAME=Name
-CMS_TYPE=Type
-CMS_CREATED=Created
-CMS_MODIFIED=Modified
-CMS_DESCRIPTION=Description
-CMS_VIEW=View
-CMS_COPY=Copy
-CMS_MOVE=Move
-CMS_DELETE=Delete
-CMS_FOLDER=Folder
-CMS_FILE=File
-CMS_CREATE=Create
-CMS_EDIT=Edit
-CMS_UPLOAD=Upload
-CMS_MODIFY=Modify
-CMS_CREATEFOLDER= Create Folder
-CMS_CREATEFILE=Create File
-CMS_UPLOADARCHIVE=Upload Archive
-CMS_BACKTOBROWSER=Back to Directory Browser
-CMS_TRANSFER=Import/Export
-CMS_EXPORTARCHIVE=Export Folder
-CMS_SECURE=Secure
-
-CMS_CREATEFILEINDIR=Creating File in Directory
-CMS_FILENAME=FileName
-CMS_TITLE=Title
-CMS_LANGUAGE=Language
-
-CMS_DELETEPATH=Confirm Deletion of
-CMS_DELETEWARN1=WARNING! You will not be able to undo these change\!
-CMS_DELETEWARN2=Are you sure you want to delete this resource\?
-
-CMS_DESTINATION=Destination
-CMS_SOURCE=Source
-
-CMS_EDITING=Editing File
-CMS_LIVE=Make \"Live\"
-CMS_VERSION=Version
-
-CMS_LIVEVERSION=Live Version
-CMS_SIZE=Size
-
-CMS_CONTENT_DIR=Content Directory
-CMS_CONTENT_DIR_USE=Use the directory tree to navigate the portal folder structure.
-CMS_MAIN_USE=Use the CMS Administration portlet to manage the content of your portal.
-
VALIDATIONEMAIL_1=Un utilisateur s'est enregistre avec cette adresse email.
VALIDATIONEMAIL_2=Merci de garder cet email. Vos informations sont les suivantes
VALIDATIONEMAIL_3=Votre compte est desactive pour le moment. Vous en pouvez pas l'utiliser tant que vous n'aurez pas clique sur le lien suivant
VALIDATIONEMAIL_4=Si vous n'avez pas demande a etre membre, ne faite rien.
VALIDATIONEMAIL_5=Cordialement.
+TITLE_FILEBROWSE=Explorateur de fichier
+_ASREGISTERED=Vous n'avez pas de compte? vous pouvez en cr\u00E9er <a href\="">un</a>.
+Question=Question secr\u00E8te
+Answer=R\u00E9ponse secr\u00E8te
+EmailVerify=Liens d'activation envoy\u00E9 par email! Consultez vos emails et clickez sur le client d'activation pour activer votre compte.
+AccountActivated=Compte activ\u00E9
+UnableActivate=Impossible de v\u00E9rifier l'utilisateur
+RegNewUser=Enregistrement d'un nouvel utilisateur
+PasswordAgain=Confirmez votre mot de passe
+AsRegUser=En tant qu'utilisateur enregistr\u00E9 vous pouvez\:
+AsReg6=Selectionnez parmis les diff\u00E9rents th\u00E8mes
+AsReg5=Pesonnalizez les commentaires
+AsReg4=Choisissez combien d'items vous voulez afficher sur votre page
+AsReg2=Envoyez une news avec votre nom d'utilisateur
+AsReg1=Soumettre un commentaire avec votre nom
+RegisterNow=Enregistrez vous\! c'est gratuit\!
+WeDontGive=Nous ne donnons ni ne vendons vos informations personelles.
+REGISTER_EMAILNOTPUBLIC=(Cet e-mail ne sera pas public mais est obligatoire. Il sera utilis\u00E9 pour vous envoyer votre mot de passe)
+REGISTER_EMAILPUBLIC=(Cet e-mail sera public. Mettez ce que vous d\u00E9sirez)
+LIST_ACTIONEDITROLES=Editer les roles
+ROLE_SELECTONETODELETE=Selectionnez un role \u00EA supprimer
+ROLE_DELETE=Supprimer le role selectionn\u00E9
+ROLE_DELETED=Le role a \u00E9t\u00E9 supprim\u00E9
+ROLE_EDIT_MEMBERS=Edit les roles
+ROLE_MAINLIST=Retour \u00E0 l'\u00E9dition de roles
+ROLE_EDIT_USER=Editez les utilisateurs pour un role donn\u00E9
+ROLE_ERROR_DELETE_FAILED=Le role n'a pu etre supprim\u00E9
+MENU_EDITROLEMEMBERS=Editer les roles
Added: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_pt_BR.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_pt_BR.properties 2006-12-21 01:29:30 UTC (rev 5922)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_pt_BR.properties 2006-12-21 14:52:17 UTC (rev 5923)
@@ -0,0 +1,355 @@
+################################################################################
+# 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. #
+################################################################################
+
+_ASREGISTERED=Ainda n�o possu� uma conta? Voc� pode <a href\="">criar uma</a>.
+_BLOCKNICKNAME=Usu�rio
+_BLOCKPASSWORD=Senha
+
+MessageOrder=Ordem
+Ascending=Crescente
+Descending=Decrescente
+
+AIM=AIM
+ICQ=ICQ
+YIM=YIM
+MSNM=MSN
+
+YourAIM=AIM
+YourICQ=ICQ
+YourYIM=YIM
+YourMSNM=MSN
+
+MyEmail=Meu e-mail
+MyHomePage=Minha homepage
+
+Question=Pergunta secreta
+Answer=Resposta secreta
+Location=Localidade
+Occupation=Profiss�o
+Interests=Interesses
+ExtraInfo=Informa��o Extra
+YourLocation=Sua localidade
+YourOccupation=Sua profiss�o
+YourInterests=Seus interesses
+Signature=Assinatura
+
+LoginSite=Entrar.
+Register=Registrar.
+
+UserExist=Usu�rio j� existe
+ToChangeInfo=para mudar seus dados
+EmailVerify=Endere�o de ativa��o enviado! Verifique seu email e clique no link de ativa��o para ativar sua conta.
+AccountActivated=Conta ativada com sucesso!
+UnableActivate=N�o foi possivel v�lidar usu�rio.
+LoggingYou=Entrando, aguarde\!
+YouAreLoggedOut=Voc� n�o est� deslogado\!
+PassDifferent=As senhas s�o diferentes. Devem ser id�nticas.
+YourPassMustBe=Desculpe, sua senha deve ter pelo menos
+CharLong=d�gitos
+UserNotExist=Usu�rio n�o encontrado\!
+UserRegLogin=User registration/login
+SelectOption=Selecione uma op��o do menu abaixo\:
+RetrievePass=Recuperar senha.
+RegNewUser=New user registration
+PasswordAgain=Confirme sua senha
+Email=E-mail
+Options=Op��es
+AllowEmailView=Permitir outros usu�rios visualizarem meu endere�o e-mail
+AsRegUser=Como usu�rio registrado voc� pode\:
+AsReg6=Selecionar temas diferentes
+AsReg5=Personalizar os coment�rios
+AsReg4=Seleciona quantos items devem ser mostrados na p�gina principal
+AsReg3=
+AsReg2=Enviar not�cias com seu nome de usu�rio
+AsReg1=Postar coment�rios com seu nome de usu�rio
+RegisterNow=Registre agora\! � de gra�a\!
+WeDontGive=N�s n�o vendemos/distribu�mos suas informa��es pessoais.
+WelcomeTo=Bem-vido �
+Registration=�rea de registro.
+
+Over13_1=Eu sou
+Over13_2=de maior ou tenho consentimento de respons�veis
+MustBe_1=Voc� deve ser
+MustBe_2=de maior, ou permiss�o de respons�veis para me registrar aqui.
+Consent_1=(Ao clicar no link acima voc� garante que voc� �<br>
+Consent_2=de maior, ou possu� permiss�o de respons�veis para se registrar.)
+Under13_1=Eu sou de menor
+Under13_2=e n�o tenho permiss�o de respons�veis.
+
+Sorry=Desculpe.
+Click=Por favor, clique
+Here=aqui
+Return=para retornar � p�gina principal.
+UserName=Usu�rio
+GoBack=Voltar
+Finish=Terminar
+PersonalInfo=Informa��o Pessoal
+RealName=Nome Real
+Optional=(opcional)
+CanKnowAbout=(255 letras no m�x. Digite o que voc� gostaria que os outros soubessem sobre voc�)
+Language=L�ngua
+255CharMax=(255 letras no m�x. Digite sua assinatura com c�digos HMTL)
+YourAvatar=Seu avatar
+YourHomePage=Seu website
+TimeZoneOffset=Fuso hor�rio
+EmailNotPublic=(Esse email n�o ser� mostrado, mas � necess�rio. Ser� usado para enviar sua senha em caso de perda.)
+EmailPublic=(Esse email ser� mostrado. Entre o que desejar.)
+RealEmail=E-mail real
+FakeEmail=E-mail falso
+Required=(necess�rio)
+NewUser=Novo usu�rio
+SaveChanges=Salvar Mudan�as
+SaveChange=Salvar Mudan�a
+TypeNewPassword=(digite uma senha nova duas vezes para alter�-la)
+Search=Procurar
+All=Todos
+UsersFoundFor=usu�rios encontrados para
+Pages=p�ginas
+UsersShown=usu�rios mostrados
+Delete=Remover
+Edit=Editar
+Ok=Ok
+Cancel=Cancelar
+AreYouSureToDeleteUser=Voc� tem certeza que deseja remover o usu�rio?
+UserDeleted=Usu�rio removido
+ReturnToMemberList=Voltar � lista de usu�rios
+Avatar=Avatar
+AdminFunctions=Opera��es Admin
+URL=URL
+UpdateUser=Atualizar usu�rio
+UserID=ID do Usu�rio
+ForChanges=(Para altera��es apenas)
+MemberList=Lista de membros
+SearchTip=Dica: escolha uma letra, mostre todos ou procure por um usu�rio se voc� sabe seu nome.
+
+ThemeText1=Essa op��o vai alterar o visual de todo o site.
+ThemeText2=Essas mudan�as ser�o v�lidas apenas para voc�.
+ThemeText3=Cada usu�rio pode ver o site com um tema diferente.
+SelectTheme=Selecione um tema
+ThemeSelection=Sele��o de Tema
+
+CannotLogin=N�o foi poss�vel efetuar o login
+
+LoginInvalidName=o nome do usu�rio n�o � v�lido
+LoginNoSuchUser=o nome do usu�rio n�o existe
+LoginBadPassword=sua senha n�o est� correta
+LoginUnexpectedError=unexpected error
+LoginUserDisabled=sua conta foi bloqueada. Favor entrar em contato com o administrador.
+
+Enable=Habilitar
+Disable=Desabilitar
+StatusChanged=O estatus do usu�rio foi alterado com sucesso
+
+NotAuth=Voc� n�o tem permiss�o para realizar essa opera��o
+
+# Used by JBoss Portal
+
+REMEMBERME=Lembre-me
+LOGIN=Login
+USERNAME=Usu�rio
+PASSWORD=Senha
+USERLOGIN=Login de Usu�rio
+
+OPTIONAL=Opcional
+REQUIRED=Requerido
+
+255MAX=(M�ximo de 255 caracteres)
+
+NAMENOTAVAILABLE=N/A
+
+#Registration
+REGISTER_REGISTER=N�o possu� conta ainda? Voc� pode
+REGISTER_REGISTER_LINK=criar uma\!
+REGISTER_NEWUSER=Registro de novo usu�rio
+REGISTER_PASSWORDAGAIN=Confirme sua senha
+REGISTER_REALEMAIL=E-mail real
+REGISTER_EMAILNOTPUBLIC=(Esse email n�o ser� mostrado, mas � necess�rio. Ser� usado para enviar sua senha em caso de perda.)
+REGISTER_FAKEEMAIL=E-mail falso
+REGISTER_EMAILPUBLIC=(Esse email ser� mostrado. Entre o que desejar.)
+REGISTER_FAKEEMAIL_EXPLAIN=Se este campo n�o estiver vazio, o email real ser� utilizado apenas para enviar notifica��es
+REGISTER_QUESTION=Pergunta secreta
+REGISTER_ANSWER=Resposta secreta
+REGISTER_ASREGUSER=Como usu�rio registrado voc� pode:
+REGISTER_ASREG6=Selecione temas diferentes
+REGISTER_ASREG5=Personalizar os coment�rios
+REGISTER_ASREG4=Selecionar quantos items ser�o mostrados na p�gina inicial
+REGISTER_ASREG3=Possuir uma janela pessoal na p�gina inicial
+REGISTER_ASREG2=Enviar not�cias com o seu nome
+REGISTER_ASREG1=Postar coment�rios com o seu nome
+REGISTER_REGISTERNOW=Registre agora, � gr�tis!
+REGISTER_WEDONTGIVE=N�s n�o vendemos/distribuimos suas informa��es pessoais.
+REGISTER_ALREADYHAVEACCOUNT=Se voce j� possu� uma conta:
+REGISTER_SIGNIN=Entrar
+REGISTER_GIVENNAME=Primeiro nome
+REGISTER_FAMILYNAME=�ltimo nome
+REGISTER_PERSONALINFO=Informa��es Pessoais
+REGISTER_VIEWREALEMAIL=Permitir que outros usu�rios vejam meu email verdadeiro
+REGISTER_HOMEPAGE=Endere�o de seu site pessoal
+REGISTER_TIMEZONEOFFSET=Fuso hor�rio
+REGISTER_ICQ=ICQ
+REGISTER_AIM=AIM
+REGISTER_YIM=Yahoo
+REGISTER_MSNM=MSN
+REGISTER_SKYPE=Skype
+REGISTER_LOCATION=Localidade
+REGISTER_LANGUAGE=L�ngua preferida
+REGISTER_OCCUPATION=Trabalho
+REGISTER_INTERESTS=Interesses
+REGISTER_SIGNATURE=Assinatura
+REGISTER_EXTRAINFO=Informa��es extras
+REGISTER_CANKNOWABOUT=(255 letras no m�x. Digite o que voc� gostaria que os outros soubessem sobre voc�)
+REGISTER_SAVECHANGES=Salvar atualiza��es
+REGISTER_CONFIRMATIONEMAIL=Email de confirma��o
+
+REGISTER_SHOWMENU=Voltar ao menu de usu�rio
+
+REGISTER_ERROR_INVALIDUSERNAME=Usu�rio inv�lido
+REGISTER_ERROR_EXISTINGUSERNAME=Esse usu�rio j� est� em uso
+REGISTER_ERROR_INVALIDPASSWORD1=Senha inv�lida
+REGISTER_ERROR_INVALIDPASSWORD2=Senha inv�lida
+REGISTER_ERROR_PASSWORDMISMATCH=Senhas n�o conferem
+REGISTER_ERROR_INVALIDREALEMAIL=Email inv�lido
+
+
+MENU_LOGOUT=Sair
+MENU_EDITPROFILE=Editar seu perfil
+MENU_LISTUSERS=Listar todos os usu�rios
+
+LIST_FILTERS=Aplicar filtro
+LIST_USERSPERPAGE=Usu�rios por p�gina
+LIST_USERNAMECONTAINS=Nome cont�m
+LIST_FULLNAME=Nome completo
+LIST_USERNAME=Usu�rio
+LIST_ROLES=Grupos
+LIST_ACTIONS=A��es
+LIST_ACTIONSSHOWPROFILE=Perfil
+LIST_ACTIONADDROLESTOUSER=Grupos
+LIST_ACTIONEDITROLES=Editar Grupos
+FILTER=Filtro
+
+NEXTPAGE=Pr�xima p�gina
+PREVIOUSPAGE=P�gina anterior
+
+ASSIGNROLES=Atribuir grupo
+ROLESAVAILABLE=Grupos dispon�veis
+EDITROLESFORUSER=Editar grupos do usu�rio
+
+
+ROLE_THEREARE=Existem
+ROLE_THEREIS=Existe
+ROLE_ROLESDEFINED=grupos definidos
+ROLE_ROLEDEFINED=grupo definido
+
+ROLE_NAME=Nome do novo grupo
+ROLE_DISPLAYNAME=Nome vis�vel do grupo
+ROLE_NEWDISPLAYNAME=Novo nome vis�vel do grupo
+ROLE_SELECTONETOMODIFY= Selecione o grupo para alterar
+ROLE_SELECTONETODELETE= Selecione o grupo para remover
+ROLE_CREATE=Criar grupo
+ROLE_UPDATE=Atualizar grupo
+ROLE_EDIT=Editar grupo
+ROLE_DELETE=Remover grupo selecionado
+ROLE_DELETED=O grupo foi removido
+ROLE_EDIT_MEMBERS=Editar membros do grupo
+ROLE_MAINLIST=Voltar
+
+ROLE_ERROR_DISPLAYNAMEALREADYEXISTS=J� existe um grupo com esse nome (vis�vel)
+ROLE_ERROR_NAMEALREADYEXISTS=J� existe um grupo com esse nome
+ROLE_ERROR_NAMEEMPTY=O nome n�o pode ser vazio
+ROLE_ERROR_DISPLAYNAMEEMPTY=O nome vis�vel nao pode ser vazio
+ROLE_ERROR_DELETE_FAILED=N�o � poss�vel remover o grupo
+ROLE_EDIT_USER=Editando usu�rios do grupo
+
+MENU_CREATEROLE=Criar novo grupo
+MENU_EDITROLE=Editar grupo
+MENU_EDITROLEMEMBERS=Editar membros do grupo
+
+# CMS ADMIN PORTLET
+TITLE_HEAD=CMS Admin
+TITLE_BROWSE=Navegador de Diret�rios
+TITLE_FILEBROWSE=Navegador de Arquivos
+TITLE_DELETECONFIRM=Confirmar remo��o
+TITLE_CREATECOLLCONFIRM=Confirmar cria��o de diret�rio
+TITLE_COPYCONFIRM=Confirm Resource Copy
+TITLE_MOVECONFIRM=Confirm Resource Move
+TITLE_VIEWFILE=Visualizando Propriedades de Arquivo
+TITLE_EDIT=Editar Arquivo
+TITLE_CREATE=Criar Arquivo
+TITLE_UPLOAD=Enviar Arquivo
+
+CMS_MENU=Menu de A��es
+CMS_ACTION=A��o
+CMS_NAME=Nome
+CMS_TYPE=Tipo
+CMS_CREATED=Criado
+CMS_MODIFIED=Modificado
+CMS_DESCRIPTION=Descri��o
+CMS_VIEW=Visualizar
+CMS_COPY=Copiar
+CMS_MOVE=Mover
+CMS_DELETE=Remover
+CMS_FOLDER=Pasta
+CMS_FILE=Arquivo
+CMS_CREATE=Criar
+CMS_RESET=Resetar
+CMS_EDIT=Editar
+CMS_UPLOAD=Enviar
+CMS_MODIFY=Modificar
+CMS_CREATEFOLDER=Criar Pasta
+CMS_CREATEFILE=Criar Diret�rio
+CMS_UPLOADARCHIVE=Enviar Arquivo
+CMS_BACKTOBROWSER=Voltar ao Navegador de Diret�rios
+
+CMS_CREATEFILEINDIR=Criando Arquivo em Diret�rio
+CMS_FILENAME=Nome do Arquivo
+CMS_TITLE=T�tulo
+CMS_LANGUAGE=L�ngua
+
+CMS_DELETEPATH=Confirmar remo��o de
+CMS_DELETEWARN1=ATEN��O\! Voc� n�o poderar desfazer estas altera��es\!
+CMS_DELETEWARN2=Voc� tem certeza que deseja remover\?
+
+CMS_DESTINATION=Destino
+CMS_SOURCE=Fonte
+
+CMS_EDITING=Editando Arquivo
+CMS_LIVE=Tornar \"Ativo\"
+CMS_VERSION=Vers�o
+
+CMS_LIVEVERSION=Vers�o \"Ativa\"
+CMS_SIZE=Tamanho
+
+VALIDATIONEMAIL_1=Um usu�rio com este endere�o de email j� existe em nosso sistema.
+VALIDATIONEMAIL_2=Mantenha esse email salvo. As informa��es de sua conta est�o a seguir
+VALIDATIONEMAIL_3=Sua conta esta atualmente inativa. Voc� n�o pode utiliz�-la at� visitar o link
+VALIDATIONEMAIL_4=Se voc� n�o se cadastrar em nosso site, nenhuma outra a��o � necess�ria.
+VALIDATIONEMAIL_5=Atenciosamente,\nA Ger�ncia.
+
+PERMISSION_PICKPORTLET=Administra��o de Permiss�es de Portlet
+PERMISSION_PERMISSIONS=Permiss�es para modificar
+PERMISSION_TOP=Selecione um Componente para Modificar
+PERMISSION_FINERGRAIN=Selecione um sub-componente para definir suar permiss�es
+PERMISSION_MODIFYROLES=Adicionar/Remover roles
+PERMISSION_MODIFYINGROLES=Modificando roles para
+PERMISSION_DOMAIN=Dominio
+PERMISSION_DOMAIN_MOD=Modificar Dominio
\ No newline at end of file
19 years, 4 months
JBoss Portal SVN: r5922 - trunk/core/src/main/org/jboss/portal/core/aspects/controller
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-20 20:29:30 -0500 (Wed, 20 Dec 2006)
New Revision: 5922
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
Log:
fix minor bug introduced in previous commit (show edit content on non dashboard page)
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-12-21 01:26:34 UTC (rev 5921)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-12-21 01:29:30 UTC (rev 5922)
@@ -164,10 +164,13 @@
dashboard = rpc.isDashboard();
//
- ParametersStateString navState = new ParametersStateString();
- navState.setValue("editPageSelect", rpc.getPage().getName());
- InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", navState);
- configureURL = cc.getControllerContext().renderURL(command, null, null);
+ if (dashboard)
+ {
+ ParametersStateString navState = new ParametersStateString();
+ navState.setValue("editPageSelect", rpc.getPage().getName());
+ InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", navState);
+ configureURL = cc.getControllerContext().renderURL(command, null, null);
+ }
}
String pageURL;
String label;
19 years, 4 months
JBoss Portal SVN: r5921 - trunk/core/src/main/org/jboss/portal/core/aspects/controller
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2006-12-20 20:26:34 -0500 (Wed, 20 Dec 2006)
New Revision: 5921
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
Log:
- "Edit Content" really edit the current dashboard page
- renammed "Pages" to "Portal"
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-12-21 01:12:34 UTC (rev 5920)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2006-12-21 01:26:34 UTC (rev 5921)
@@ -41,6 +41,7 @@
import org.jboss.portal.core.model.portal.command.ViewDashboardCommand;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.server.request.URLContext;
@@ -154,11 +155,19 @@
}
else
{
+ String configureURL = null;
+
boolean dashboard = false;
if (cc instanceof RenderPageCommand)
{
RenderPageCommand rpc = (RenderPageCommand)cc;
dashboard = rpc.isDashboard();
+
+ //
+ ParametersStateString navState = new ParametersStateString();
+ navState.setValue("editPageSelect", rpc.getPage().getName());
+ InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", navState);
+ configureURL = cc.getControllerContext().renderURL(command, null, null);
}
String pageURL;
String label;
@@ -166,7 +175,7 @@
{
RenderPageCommand _rpc = new RenderPageCommand(new PortalObjectId(new String[]{"default", "default"}));
pageURL = cc.getControllerContext().renderURL(_rpc, null, null);
- label = "Pages";
+ label = "Portal";
}
else
{
@@ -242,20 +251,15 @@
}
}
- if (dashboard)
+ //
+ if (configureURL != null)
{
- PortletRequestDecoder decoder = new PortletRequestDecoder();
- decoder.decode(cc.getControllerContext().getServerInvocation().getServerContext().getQueryParameterMap(), cc.getControllerContext().getServerInvocation().getServerContext().getBodyParameterMap());
-
- InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", decoder.getNavigationalstate());
- String configureURL = cc.getControllerContext().renderURL(command, null, null);
-
sb.append(" | ");
sb.append("<a href=\"").append(configureURL).append("\">Edit Content</a>");
}
+ //
sb.append(" | ");
-
sb.append("<a href=\"").append(logoutURL).append("\">Logout</a>");
}
return sb;
19 years, 4 months