JBoss JBPM SVN: r4905 - jbpm4/trunk/modules/userguide/src/main/docbook/en/modules.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-27 03:30:08 -0400 (Wed, 27 May 2009)
New Revision: 4905
Modified:
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
doc updates based on burr's feedback
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-05-26 18:11:12 UTC (rev 4904)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-05-27 07:30:08 UTC (rev 4905)
@@ -27,12 +27,9 @@
<para>The <emphasis role="bold">demo setup</emphasis> is the simplest way to get started.
This section describes the steps to complete the demo setup.
</para>
- <para>If you have jboss-5.0.0.GA on locally on your machine, create a directory
- called <literal>downloads</literal> in your jBPM home directory and copy
- the jboss distribution zip file in there. Same for an Eclipse Ganymede SR2 JEE distribution
- (eclipse-jee-ganymede-SR2-win32.zip). If you have it already locally, copy it to
- the downloads directory. If you don't have those files in that place, they will be downloaded
- automatically by the demo setup ant script.
+ <para>If you have previously downloaded jboss-5.0.0.GA.zip, create a downloads directory
+ in your jBPM home directory and place the zip file in there. Otherwise the script will download
+ it for you. the same is true for eclipse-jee-ganymede-SR2-win32.zip
</para>
<para>Open a command prompt and go do directory <literal>${jbpm.home}/jboss</literal>. Then
run
@@ -44,15 +41,15 @@
<listitem>Install jBPM into that JBoss installation. By default, this includes a hypersonic
database that is accessable over TCP/IP.
</listitem>
- <listitem>Start JBoss. This will also start the hypersonic DB.</listitem>
+ <listitem>Start JBoss in the background. This will also start the hypersonic DB.</listitem>
<listitem>Create the DB Schema</listitem>
<listitem>Create an examples.bar business archive from the examples and deploy it to the jBPM DB.</listitem>
<listitem>Load the example users and groups from <literal>${jbpm.home}/db/example.identities.sql</literal> </listitem>
<listitem>Install eclipse into <literal>${jbpm.home}/eclipse</literal></listitem>
<listitem>Start eclipse</listitem>
</itemizedlist>
- <para>Once this is done and eclipse has started, you can continue to follow the instructions
- of <xref linkend="graphicalprocessdesigner" />
+ <para>After this is done JBoss will be running in the background. Once eclipse has started, you can continue
+ to follow the instructions of <xref linkend="graphicalprocessdesigner" />
</para>
<para>And you can surf to <ulink url="http://localhost:8080/gwt-console">the jBPM console</ulink>
You can login as one of the following users:
@@ -104,6 +101,8 @@
want to customize:
</para>
<itemizedlist>
+ <listitem><literal>jbpm.home</literal> : Default value is <literal>${user.home}/jbpm-${jbpm-version}</literal>.
+ You should set it to the location where you unzipped the distribution.</listitem>
<listitem><literal>database</literal> : Default value is <literal>hsqldb</literal>. Alternative values
are <literal>mysql</literal>, <literal>oracle</literal> and <literal>postgresql</literal></listitem>
<listitem><literal>jboss.version</literal> : Default value is <literal>5.0.0.GA</literal>. Alternative
@@ -197,7 +196,7 @@
<mediaobject><imageobject><imagedata align="center" fileref="images/gpd.install.gpd.site.png"/></imageobject></mediaobject>
</figure>
</section>
- <section>
+ <section id="definejbpmuserlibraries">
<title>Define the jBPM User Library</title>
<para>This section shows how to define a user library for your workspace
that is a placeholder for the jBPM library as well as its dependencies.
@@ -266,6 +265,10 @@
<listitem>The <literal>examples</literal> project is automatically found and selected</listitem>
<listitem>Click <literal>Finish</literal> </listitem>
</itemizedlist>
+ <para>After setting the <link linkend="definejbpmuserlibraries">jBPM User Libraries</link>
+ and importing the examples, all the examples can be run as JUnit tests. Right click
+ on a test and select 'Run As' --> 'JUnit Test'.
+ </para>
<para>You're all set to start playing with the coolest Java process technology!</para>
</section>
15 years, 1 month
JBoss JBPM SVN: r4904 - in jbpm4/trunk: modules/distro and 16 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-26 14:11:12 -0400 (Tue, 26 May 2009)
New Revision: 4904
Added:
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.jboss.idm.cfg.xml
Removed:
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml
Modified:
jbpm4/trunk/modules/distro/pom.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
jbpm4/trunk/modules/enterprise/pom.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/pvm/pom.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionResource.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionFactoryDescriptor.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
jbpm4/trunk/pom.xml
jbpm4/trunk/qa/build.xml
Log:
JBPM-2172 integrate jboss identity component, fixed JTA transaction wiring problem and fixed mail templates
Modified: jbpm4/trunk/modules/distro/pom.xml
===================================================================
--- jbpm4/trunk/modules/distro/pom.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/distro/pom.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -121,9 +121,13 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity</groupId>
- <artifactId>idm</artifactId>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ </dependency>
<!-- Please sort by groupid -->
<dependency>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/build.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -7,6 +7,7 @@
<!-- DEFAULT PROPERTY VALUES -->
<property name="database" value="hsqldb" />
+ <property name="identity.component" value="jbpm-built-in" />
<property name="jbpm.version" value="4.0.0-SNAPSHOT" />
<property name="jbpm.parent.dir" value="../.." />
<property name="jbpm.home" value="${jbpm.parent.dir}/jbpm-${jbpm.version}" /> <!-- jbpm.home should not be configured. change jbpm.parent.dir instead -->
@@ -20,6 +21,11 @@
<property name="jboss.distro.path" value="${jboss.distro.dir}/${jboss.filename}" />
<property name="jboss.server.configuration" value="default" />
<property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
+
+ <property name="jbossidm.version" value="1.0.0.Alpha7" />
+ <property name="jbossidm.home" value="${jboss.parent.dir}/jbossidm-${jbossidm.version}" />
+ <property name="jbossidm.distro.url" value="http://repository.jboss.com/maven2/org/jboss/identity/idm/idm-assembly/${..." />
+ <property name="jbossidm.distro.path" value="${jboss.distro.dir}/idm-assembly-${jbossidm.version}.zip" />
<!-- JDBC PROPERTIES -->
<property file="${user.home}/.jbpm4/jdbc/${database}.properties" />
@@ -28,6 +34,7 @@
<!-- ### LOG PROPERTIES ################################################# -->
<target name="log.properties">
<echo message="database.................... ${database}" />
+ <echo message="identity.component.......... ${identity.component}" />
<echo message="jbpm.home................... ${jbpm.home}" />
<echo message="jboss.version............... ${jboss.version}" />
<echo message="jboss.filename.............. ${jboss.filename}" />
@@ -46,6 +53,10 @@
<equals arg1="${jboss.version}" arg2="5.1.0.CR1" />
</or>
</condition>
+
+ <condition property="jbpm.identity.idm">
+ <equals arg1="${identity.component}" arg2="jboss.idm"/>
+ </condition>
<!-- ### DEMO SETUP ##################################################### -->
<target name="demo.setup"
@@ -95,6 +106,17 @@
<mkdir dir="${jboss.distro.dir}" />
<get src="${jboss.distro.url}" dest="${jboss.distro.path}" />
</target>
+
+ <!-- ### GET JBOSS IDM ###################################################### -->
+ <condition property="is.jbossidm.distro.available">
+ <available file="${jbossidm.distro.path}" />
+ </condition>
+ <target name="get.jbossidm"
+ unless="is.jbossidm.distro.available"
+ description="downloads jboss idm into ${jbossidm.distro.path}">
+ <mkdir dir="${jboss.distro.dir}" />
+ <get src="${jbossidm.distro.url}" dest="${jbossidm.distro.path}" />
+ </target>
<!-- ### MAIN TARGET TO INSTALL JBPM INTO JBOSS ######################### -->
<target name="install.jbpm.into.jboss"
@@ -102,6 +124,8 @@
description="installs jbpm into jboss">
<antcall target="internal.install.jbpm.into.jboss.common" />
<antcall target="internal.install.jbpm.into.jboss.500specifics" />
+ <antcall target="internal.install.idm.into.jboss" />
+ <antcall target="internal.install.jbpm.into.jboss.identity" />
<antcall target="internal.install.jbpm.into.jboss.db.${database}" />
</target>
@@ -185,17 +209,40 @@
</fileset>
</copy>
</target>
+
+ <target name="internal.install.idm.into.jboss" depends="get.jbossidm" if="jbpm.identity.idm">
+ <unzip src="${jbossidm.distro.path}" dest="${jbossidm.home}/.." />
+ <ant antfile="${jbossidm.home}/jboss/build.xml" target="install.jbossidm.into.jboss">
+ <property name="jboss.home" value="${jboss.home}" />
+ <property name="jboss.server.configuration" value="${jboss.server.configuration}" />
+ <property name="database" value="${database}" />
+ <property name="jbossidm.home" value="${jbossidm.home}" />
+ </ant>
+ </target>
+ <target name="internal.install.jbpm.into.jboss.identity" if="jbpm.identity.idm">
+ <copy file="${jbpm.home}/jboss/jbpm.cfg.idm/jbpm.cfg.xml"
+ tofile="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml"
+ overwrite="true" />
+ </target>
+
<!-- ### THE JBOSS INTEGRATION TEST SPECIFICS ####################### -->
<target name="internal.install.jbpm.into.jboss.integrationtestspecifics">
<copy todir="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar" overwrite="true">
<fileset dir="${jbpm.home}/jboss/jbpm.cfg.integration.tests" />
</copy>
+ <antcall target="internal.install.idm.into.jboss.integrationtestspecifics" />
<ant antfile="${jbpm.home}/examples/build.xml" target="examples.jar" />
<mkdir dir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
<copy file="${jbpm.home}/examples/target/examples.jar"
todir="${jboss.server.config.dir}/deploy/jbpm/userlibs" />
</target>
+
+ <target name="internal.install.idm.into.jboss.integrationtestspecifics" if="jbpm.identity.idm">
+ <copy file="${jbpm.home}/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml"
+ tofile="${jboss.server.config.dir}/deploy/jbpm/jbpm-service.sar/jbpm.cfg.xml"
+ overwrite="true" />
+ </target>
<!-- ### THE HSQLDB SPECIFIC PART ####################################### -->
<target name="internal.install.jbpm.into.jboss.db.hsqldb" />
Copied: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm (from rev 4758, jbpm4/branches/idm/modules/distro/src/main/files/jboss/jbpm.cfg.idm)
Deleted: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/idm/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml 2009-05-07 10:14:21 UTC (rev 4758)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.default.cfg.xml" />
- <import resource="jbpm.tx.jta.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.jboss.idm.cfg.xml" />
-
- <!-- Job executor is excluded for running the example test cases.
- To enable timers and messages in production use, this should be included.
- import resource="jbpm.jobexecutor.cfg.xml" / -->
-
- <process-engine-context>
-
- <mail-template name="MemoTemplate">
- <to addresses='dilbert@office, alice@work, dogbert@house' />
- <subject>bureaucracy</subject>
- <text>Order http://example.com/order/#{orderId} is stalled.</text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
Copied: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml (from rev 4758, jbpm4/branches/idm/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.jboss.idm.cfg.xml" />
+
+ <!-- Job executor is excluded for running the example test cases.
+ To enable timers and messages in production use, this should be included.
+ import resource="jbpm.jobexecutor.cfg.xml" / -->
+
+ <process-engine-context>
+
+ <mail-template name="MemoTemplate">
+ <to addresses='dilbert@office, alice@work, dogbert@house' />
+ <subject>bureaucracy</subject>
+ <text>Order http://example.com/order/#{orderId} is stalled.</text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
Copied: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml (from rev 4897, jbpm4/branches/idm/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.idm/jbpm.integration.test.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.tx.jta.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.jboss.idm.cfg.xml" />
+
+ <import resource="jbpm.mail.templates.examples.xml" />
+
+ <!-- Job executor is excluded for running the example test cases.
+ To enable timers and messages in production use, this should be included.
+ import resource="jbpm.jobexecutor.cfg.xml" / -->
+
+</jbpm-configuration>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -6,7 +6,6 @@
<import resource="jbpm.tx.jta.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
- <import resource="jbpm.mail.templates.cfg.xml" />
<import resource="jbpm.mail.templates.examples.xml" />
Modified: jbpm4/trunk/modules/enterprise/pom.xml
===================================================================
--- jbpm4/trunk/modules/enterprise/pom.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/enterprise/pom.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -43,39 +43,25 @@
<artifactId>jbpm-test-base</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.bpm</groupId>
- <artifactId>gwt-console-server-integration</artifactId>
- <scope>compile</scope>
- </dependency>
- <dependency>
<groupId>jboss</groupId>
<artifactId>jboss-j2ee</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
</dependency>
-
- <!-- Test Dependencies -->
<dependency>
<groupId>cactus</groupId>
<artifactId>cactus</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-client</artifactId>
- <type>pom</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-javaee</artifactId>
- <scope>runtime</scope>
- </dependency>
</dependencies>
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity (from rev 4897, jbpm4/branches/idm/modules/examples/src/test/java/org/jbpm/examples/identity)
Deleted: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java
===================================================================
--- jbpm4/branches/idm/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java 2009-05-26 12:57:40 UTC (rev 4897)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jbpm.examples.identity;
-
-import java.util.List;
-
-import org.jbpm.api.identity.Group;
-import org.jbpm.api.identity.User;
-import org.jbpm.test.JbpmTestCase;
-
-/**
- * @author Tom Baeyens
- * @author Jeff Yu
- */
-public class IdentityTest extends JbpmTestCase {
-
- private String johndoe = "johndoe";
- private String redhatGroupId ;
-
- public void setUp() throws Exception {
- super.setUp();
-
- identityService.createUser("johndoe", "John", "Doe");
- redhatGroupId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
- identityService.createMembership(johndoe, redhatGroupId, "Developer");
- }
-
-
- public void tearDown() throws Exception {
- super.tearDown();
-
- identityService.deleteUser(johndoe);
- identityService.deleteGroup(redhatGroupId);
- }
-
-
- public void testSingleUser() throws Exception {
- User user = identityService.findUserById(johndoe);
-
- assertEquals("johndoe", user.getId());
- assertEquals("John", user.getGivenName());
- assertEquals("Doe", user.getFamilyName());
-
- }
-
-
- public void testCreateGroup() throws Exception {
- String testGroupId = identityService.createGroup("testGroup", Group.TYPE_UNIT, null);
- Group group = identityService.findGroupById(testGroupId);
- assertEquals("testGroup", group.getName());
- assertEquals(Group.TYPE_UNIT, group.getType());
-
- identityService.deleteGroup(testGroupId);
- }
-
- public void testFindGroupsByUser() throws Exception {
-
- identityService.createUser("jeffyu", "Jeff", "Yu");
- identityService.createMembership("jeffyu", redhatGroupId);
-
- List<Group> groups = identityService.findGroupsByUser("jeffyu");
- assertTrue(groups.size() > 0);
-
- for (Group group : groups) {
- if (redhatGroupId.equals(group.getId())) {
- assertTrue(true);
- return;
- }
- }
-
- identityService.deleteUser("jeffyu");
-
- fail("Can't find the group by userid: " + johndoe);
- }
-
- public void testFindGroupByUserAndGroupType() throws Exception {
- List<Group> groups = identityService.findGroupsByUserAndGroupType(johndoe, Group.TYPE_UNIT);
- assertTrue(groups.size() > 0);
-
- for (Group group : groups) {
- if (redhatGroupId.equals(group.getId())) {
- assertTrue(true);
- return;
- }
- }
- fail("Can't find the groups by userid " + johndoe + " and group type :" + Group.TYPE_UNIT);
- }
-
- public void testSingleGroup() throws Exception {
-
- identityService.createUser("joesmoe", "Joe", "Smoe");
- identityService.createUser("jackblack", "Jack", "Black");
-
- String jbossId = identityService.createGroup("jboss", Group.TYPE_UNIT, redhatGroupId);
- String jbpmId = identityService.createGroup("jbpm", Group.TYPE_UNIT, jbossId);
-
- identityService.createMembership("joesmoe", jbpmId, "developer");
- identityService.createMembership("jackblack", jbossId, "manager");
-
- List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", Group.TYPE_UNIT);
-
- assertEquals(1, groups.size());
- Group group = groups.get(0);
- System.out.println(group.getName());
-
- identityService.deleteGroup(jbpmId);
- identityService.deleteGroup(jbossId);
-
- identityService.deleteUser("joesmoe");
- identityService.deleteUser("jackblack");
- }
-}
Copied: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java (from rev 4897, jbpm4/branches/idm/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java)
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java (rev 0)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/identity/IdentityTest.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., 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.jbpm.examples.identity;
+
+import java.util.List;
+
+import org.jbpm.api.identity.Group;
+import org.jbpm.api.identity.User;
+import org.jbpm.test.JbpmTestCase;
+
+/**
+ * @author Tom Baeyens
+ * @author Jeff Yu
+ */
+public class IdentityTest extends JbpmTestCase {
+
+ private String redhatGroupId;
+
+ public void setUp() throws Exception {
+ super.setUp();
+
+ identityService.createUser("johndoe", "John", "Doe");
+ redhatGroupId = identityService.createGroup("redhat", Group.TYPE_UNIT, null);
+ identityService.createMembership("johndoe", redhatGroupId, "Developer");
+ }
+
+
+ public void tearDown() throws Exception {
+ identityService.deleteUser("johndoe");
+ identityService.deleteGroup(redhatGroupId);
+
+ super.tearDown();
+ }
+
+
+ public void testSingleUser() throws Exception {
+ User user = identityService.findUserById("johndoe");
+
+ assertEquals("johndoe", user.getId());
+ assertEquals("John", user.getGivenName());
+ assertEquals("Doe", user.getFamilyName());
+
+ }
+
+
+ public void testCreateGroup() throws Exception {
+ String testGroupId = identityService.createGroup("testGroup", Group.TYPE_UNIT, null);
+ Group group = identityService.findGroupById(testGroupId);
+ assertEquals("testGroup", group.getName());
+ assertEquals(Group.TYPE_UNIT, group.getType());
+
+ identityService.deleteGroup(testGroupId);
+ }
+
+ public void testFindGroupsByUser() throws Exception {
+
+ identityService.createUser("jeffyu", "Jeff", "Yu");
+ identityService.createMembership("jeffyu", redhatGroupId);
+
+ List<Group> groups = identityService.findGroupsByUser("jeffyu");
+ assertTrue(groups.size() > 0);
+
+ for (Group group : groups) {
+ if (redhatGroupId.equals(group.getId())) {
+ assertTrue(true);
+ return;
+ }
+ }
+
+ identityService.deleteUser("jeffyu");
+
+ fail("Can't find the group by userid: johndoe");
+ }
+
+ public void testFindGroupByUserAndGroupType() throws Exception {
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", Group.TYPE_UNIT);
+ assertTrue(groups.size() > 0);
+
+ for (Group group : groups) {
+ if (redhatGroupId.equals(group.getId())) {
+ assertTrue(true);
+ return;
+ }
+ }
+ fail("Can't find the groups by userid johndoe and group type :" + Group.TYPE_UNIT);
+ }
+
+ public void testSingleGroup() throws Exception {
+
+ identityService.createUser("joesmoe", "Joe", "Smoe");
+ identityService.createUser("jackblack", "Jack", "Black");
+
+ String jbossId = identityService.createGroup("jboss", Group.TYPE_UNIT, redhatGroupId);
+ String jbpmId = identityService.createGroup("jbpm", Group.TYPE_UNIT, jbossId);
+
+ identityService.createMembership("joesmoe", jbpmId, "developer");
+ identityService.createMembership("jackblack", jbossId, "manager");
+
+ List<Group> groups = identityService.findGroupsByUserAndGroupType("johndoe", Group.TYPE_UNIT);
+
+ assertEquals(1, groups.size());
+ Group group = groups.get(0);
+ System.out.println(group.getName());
+
+ identityService.deleteGroup(jbpmId);
+ identityService.deleteGroup(jbossId);
+
+ identityService.deleteUser("joesmoe");
+ identityService.deleteUser("jackblack");
+ }
+}
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -6,7 +6,6 @@
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
- <import resource="jbpm.mail.templates.cfg.xml" />
<!-- Job executor is excluded for running the example test cases. -->
<!-- To enable timers and messages in production use, this should be included. -->
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -14,4 +14,4 @@
</process-engine-context>
-</jbpm-configuration>
\ No newline at end of file
+</jbpm-configuration>
Modified: jbpm4/trunk/modules/pvm/pom.xml
===================================================================
--- jbpm4/trunk/modules/pvm/pom.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/pom.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -85,8 +85,12 @@
<artifactId>slf4j-jdk14</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.identity</groupId>
- <artifactId>idm</artifactId>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
<exclusions>
<exclusion>
<groupId>javax.persistence</groupId>
@@ -209,4 +213,4 @@
</profile>
</profiles>
-</project>
\ No newline at end of file
+</project>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JbpmConfigurationParser.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -71,41 +71,34 @@
.execute();
parse.addProblems(importParse.getProblems());
- JbpmConfiguration importedConfiguration = (JbpmConfiguration) importParse.getDocumentObject();
-
- WireDefinition importedProcessEngineWireDefinition = importedConfiguration.getProcessEngineWireContext().getWireDefinition();
- jbpmConfiguration.addProcessEngineWireDefinition(importedProcessEngineWireDefinition);
-
- WireDefinition importedTransactionWireDefinition = importedConfiguration.getTransactionWireDefinition();
- jbpmConfiguration.addTransactionWireDefinition(importedTransactionWireDefinition);
}
}
- WireDefinition processEngineWireDefinition = getProcessEngineWireDefinition(documentElement, parse);
- jbpmConfiguration.addProcessEngineWireDefinition(processEngineWireDefinition);
-
- WireDefinition transactionWireDefinition = getTransactionWireDefinition(documentElement, parse);
- jbpmConfiguration.addTransactionWireDefinition(transactionWireDefinition);
-
- parse.setDocumentObject(jbpmConfiguration);
-
- return jbpmConfiguration;
- }
-
- WireDefinition getProcessEngineWireDefinition(Element documentElement, Parse parse) {
Element processEngineElement = XmlUtil.element(documentElement, "process-engine-context");
if (processEngineElement != null) {
- return (WireDefinition) processEngineContextParser.parseDocumentElement(processEngineElement, parse);
+ WireDefinition processEngineContextDefinition = jbpmConfiguration.getProcessEngineWireContext().getWireDefinition();
+ parse.pushObject(processEngineContextDefinition);
+ try {
+ processEngineContextParser.parseDocumentElement(processEngineElement, parse);
+ } finally {
+ parse.popObject();
+ }
}
- return null;
- }
- WireDefinition getTransactionWireDefinition(Element documentElement, Parse parse) {
Element txCtxElement = XmlUtil.element(documentElement, "transaction-context");
if (txCtxElement != null) {
- return (WireDefinition) transactionContextParser.parseDocumentElement(txCtxElement, parse);
+ WireDefinition transactionContextDefinition = jbpmConfiguration.getTransactionWireDefinition();
+ parse.pushObject(transactionContextDefinition);
+ try {
+ transactionContextParser.parseDocumentElement(txCtxElement, parse);
+ } finally {
+ parse.popObject();
+ }
}
- return null;
+
+ parse.setDocumentObject(jbpmConfiguration);
+
+ return jbpmConfiguration;
}
public Parser getProcessEngineContextParser() {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionResource.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionResource.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/IdentitySessionResource.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -23,7 +23,7 @@
import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.Transaction;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.tx.StandardResource;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JBossIdmIdentitySessionImpl.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -23,21 +23,16 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import org.jboss.identity.idm.api.Attribute;
import org.jboss.identity.idm.api.AttributesManager;
-import org.jboss.identity.idm.api.GroupType;
-import org.jboss.identity.idm.api.Identity;
-import org.jboss.identity.idm.api.IdentitySearchControl;
+import org.jboss.identity.idm.api.IdentitySearchCriteria;
import org.jboss.identity.idm.api.IdentitySession;
import org.jboss.identity.idm.api.RoleType;
-import org.jboss.identity.idm.exception.IdentityException;
-import org.jboss.identity.idm.impl.api.NameFilterSearchControl;
+import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jboss.identity.idm.common.p3p.P3PConstants;
import org.jboss.identity.idm.impl.api.SimpleAttribute;
-import org.jboss.identity.idm.impl.api.model.SimpleGroupType;
-import org.jboss.identity.idm.p3p.P3PConstants;
import org.jbpm.api.JbpmException;
import org.jbpm.api.env.Environment;
import org.jbpm.api.identity.Group;
@@ -46,6 +41,7 @@
/**
* @author Tom Baeyens
+ * @author Jeff Yu
*/
public class JBossIdmIdentitySessionImpl implements org.jbpm.pvm.internal.identity.spi.IdentitySession {
@@ -61,37 +57,41 @@
public String createUser(String userName, String givenName, String familyName, String businessEmail) {
try {
- Identity identity = identitySession.getPersistenceManager().createIdentity(userName);
+
+ org.jboss.identity.idm.api.User idUser= identitySession.getPersistenceManager().createUser(userName);
- // TODO add the password
- // identitySession.getAttributesManager().updateCredential(identity, new PasswordCredential(password));
-
- Attribute[] attributes = new Attribute[] {
- new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, givenName),
- new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, familyName),
- new SimpleAttribute(P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, businessEmail)
- };
- identitySession.getAttributesManager().addAttributes(identity, attributes);
+ List<Attribute> attrs = new ArrayList<Attribute>();
+ if (givenName != null) {
+ attrs.add(new SimpleAttribute(P3PConstants.INFO_USER_NAME_GIVEN, givenName));
+ }
+ if (familyName != null) {
+ attrs.add(new SimpleAttribute(P3PConstants.INFO_USER_NAME_FAMILY, familyName));
+ }
+ if (businessEmail != null) {
+ attrs.add(new SimpleAttribute(P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, businessEmail));
+ }
+
+
+ identitySession.getAttributesManager().addAttributes(idUser, attrs.toArray(new Attribute[attrs.size()]));
+ return idUser.getId();
+
} catch (IdentityException e) {
throw new JbpmException("couldn't create user "+userName, e);
}
- throw new RuntimeException("Not yet implemented");
- // TODO: create and return user
}
public List<User> findUsers() {
try {
- Collection<Identity> identities = identitySession
- .getPersistenceManager()
- .findIdentity((IdentitySearchControl[])null);
-
+ Collection<org.jboss.identity.idm.api.User> idUsers =
+ identitySession.getPersistenceManager().findUser((IdentitySearchCriteria)null);
+
List<User> users = new ArrayList<User>();
- for (Identity identity : identities) {
- String name = identity.getName();
- String givenName = getAttributeString(identity, null, P3PConstants.INFO_USER_NAME_GIVEN);
- String familyName = getAttributeString(identity, P3PConstants.INFO_USER_NAME_FAMILY);
+ for (org.jboss.identity.idm.api.User idUser : idUsers) {
+ String name = idUser.getId();
+ String givenName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_GIVEN);
+ String familyName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_FAMILY);
UserImpl user = new UserImpl(name, givenName, familyName);
users.add(user);
@@ -105,43 +105,66 @@
}
public User findUserById(String userId) {
- throw new UnsupportedOperationException("please implement me");
+ try {
+ org.jboss.identity.idm.api.User idUser = identitySession.getPersistenceManager().findUser(userId);
+ if (idUser != null) {
+ String name = idUser.getId();
+ String givenName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_GIVEN);
+ String familyName = getAttributeString(idUser, P3PConstants.INFO_USER_NAME_FAMILY);
+
+ User user = new UserImpl(name, givenName, familyName);
+ return user;
+ }
+ return null;
+ } catch (IdentityException e) {
+ throw new JbpmException("couldn't get user from id of " + userId, e);
+ }
}
public List<User> findUsersById(String... userIds) {
- // TODO Auto-generated method stub
- return null;
+ List<User> users = new ArrayList<User>();
+ for (String userId : userIds){
+ User user = findUserById(userId);
+ if (user != null) {
+ users.add(user);
+ }
+ }
+
+ return users;
}
public List<User> findUsersByGroup(String groupId) {
- // TODO Auto-generated method stub
- return null;
+ try {
+ org.jboss.identity.idm.api.Group idGroup = findIdmGroupById(groupId);
+ Collection<org.jboss.identity.idm.api.User> idusers =
+ identitySession.getRelationshipManager().findAssociatedUsers(idGroup, false);
+ List<User> users = new ArrayList<User>();
+
+ for (org.jboss.identity.idm.api.User iduser : idusers) {
+ users.add(findUserById(iduser.getId()));
+ }
+
+ return users;
+ } catch (IdentityException e) {
+ throw new JbpmException("couldn't find users by groupid: " + groupId, e);
+ }
+
}
public void deleteUser(String userName) {
- try {
- org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
-
- if (identity==null) {
- return;
- }
-
- identitySession
- .getPersistenceManager()
- .removeIdentity(identity, true);
-
+ try {
+ identitySession.getPersistenceManager().removeUser(userName, true);
} catch (IdentityException e) {
- throw new JbpmException("couldn't delete group "+userName, e);
+ throw new JbpmException("couldn't delete user ["+userName + "]", e);
}
}
public String createGroup(String groupName, String groupType, String parentGroupId) {
- String groupId = null;
try {
- GroupType simpleGroupType = new SimpleGroupType(groupType);
- org.jboss.identity.idm.api.Group group = identitySession.getPersistenceManager().createGroup(groupName, simpleGroupType);
- groupId = group.getId();
+
+ org.jboss.identity.idm.api.Group group = identitySession.getPersistenceManager().createGroup(groupName, groupType);
+ String groupId = group.getId();
if (parentGroupId!=null) {
org.jboss.identity.idm.api.Group parentGroup = findIdmGroupById(parentGroupId);
@@ -150,66 +173,88 @@
}
identitySession.getRelationshipManager().associateGroups(parentGroup, group);
}
-
+ return groupId;
+
} catch (IdentityException e) {
throw new JbpmException("couldn't create group "+groupName, e);
}
- return groupId;
}
public Group findGroupById(String groupId) {
- throw new UnsupportedOperationException("please implement me");
+ try {
+ org.jboss.identity.idm.api.Group idGroup = findIdmGroupById(groupId);
+ GroupImpl group = new GroupImpl();
+ group.setId(idGroup.getId());
+ group.setType(idGroup.getGroupType());
+ group.setName(idGroup.getName());
+
+ Collection<org.jboss.identity.idm.api.Group> idParentGroups =
+ identitySession.getRelationshipManager().findAssociatedGroups(idGroup, null, false, false);
+
+ if (idParentGroups.size() > 0) {
+ org.jboss.identity.idm.api.Group idParent = idParentGroups.iterator().next();
+ GroupImpl parentGroup = new GroupImpl();
+ parentGroup.setId(idParent.getId());
+ parentGroup.setType(idParent.getGroupType());
+ parentGroup.setName(idParent.getName());
+
+ group.setParent(parentGroup);
+ }
+
+ return group;
+
+ } catch (IdentityException e) {
+ throw new JbpmException("couldn't find group by id [" + groupId + "]", e);
+ }
}
public List<Group> findGroupsByGroupType(String groupType) {
try {
- GroupType simpleGroupType = new SimpleGroupType(groupType);
- Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession
- .getPersistenceManager()
- .findGroup(simpleGroupType);
+ Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession.getPersistenceManager().
+ findGroup(groupType);
List<Group> groups = new ArrayList<Group>();
for (org.jboss.identity.idm.api.Group idGroup: idGroups) {
- String groupName = idGroup.getName();
-
- GroupImpl group = new GroupImpl(groupName);
- groups.add(group);
+ groups.add(findGroupById(idGroup.getId()));
}
return groups;
} catch (IdentityException e) {
- throw new JbpmException("couldn't get users from identity component", e);
+ throw new JbpmException("couldn't get groups from identity component, groupType [" + groupType + "]", e);
}
}
public List<Group> findGroupsByUser(String userId) {
- throw new UnsupportedOperationException("please implement me");
+
+ try {
+ Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession.getRelationshipManager().
+ findAssociatedGroups(userId, null);
+
+ List<Group> groups = new ArrayList<Group>();
+ for (org.jboss.identity.idm.api.Group idGroup : idGroups) {
+ groups.add(findGroupById(idGroup.getId()));
+ }
+ return groups;
+ } catch (IdentityException e) {
+ throw new JbpmException("Couldn't get Groups by userId [" + userId + "]", e);
+
+ }
}
public List<Group> findGroupsByUserAndGroupType(String userName, String groupType) {
try {
- org.jboss.identity.idm.api.Identity identity = findIdentity(userName);
- if (identity==null) {
- return Collections.emptyList();
- }
+ org.jboss.identity.idm.api.User idUser = identitySession.getPersistenceManager().findUser(userName);
+ Collection<org.jboss.identity.idm.api.Group> idGroups = identitySession.getRoleManager()
+ .findGroupsWithRelatedRole(idUser, groupType, null);
List<Group> groups = new ArrayList<Group>();
-
- GroupType identityGroupType = new SimpleGroupType(groupType);
- Collection<org.jboss.identity.idm.api.Group> identityGroups = identitySession
- .getRoleManager()
- .findGroupsWithRelatedRole(identity, identityGroupType, null);
- for (org.jboss.identity.idm.api.Group identityGroup: identityGroups) {
- String groupName = identityGroup.getName();
- GroupImpl group = new GroupImpl(groupName);
- groups.add(group);
+ for (org.jboss.identity.idm.api.Group idGroup : idGroups) {
+ groups.add(findGroupById(idGroup.getId()));
}
-
return groups;
-
} catch (Exception e) {
throw new JbpmException("couldn't get groups for user "+userName+" and groupType "+groupType, e);
}
@@ -223,9 +268,7 @@
return;
}
- identitySession
- .getPersistenceManager()
- .removeGroup(group, true);
+ identitySession.getPersistenceManager().removeGroup(group, true);
} catch (IdentityException e) {
throw new JbpmException("couldn't delete group "+groupId, e);
@@ -239,8 +282,8 @@
throw new JbpmException("group "+groupId+" doesn't exist");
}
- org.jboss.identity.idm.api.Identity identity = findIdentity(userId);
- if (identity==null) {
+ org.jboss.identity.idm.api.User idUser = identitySession.getPersistenceManager().findUser(userId);
+ if (idUser==null) {
throw new JbpmException("user "+userId+" doesn't exist");
}
@@ -251,10 +294,10 @@
roleType = identitySession.getRoleManager().createRoleType(role);
}
- identitySession.getRoleManager().createRole(roleType, identity, group);
+ identitySession.getRoleManager().createRole(roleType, idUser, group);
} else {
- identitySession.getRelationshipManager().associateIdentities(group, identity);
+ identitySession.getRelationshipManager().associateUser(group, idUser);
}
} catch (Exception e) {
@@ -263,40 +306,42 @@
}
public void deleteMembership(String userId, String groupId, String role) {
- throw new UnsupportedOperationException("please implement me");
+ try {
+ RoleType rtype = identitySession.getRoleManager().getRoleType(role);
+ identitySession.getRoleManager().removeRole(rtype.getName(), userId, groupId);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't delete the membership [" + userId + "," + groupId + "," + role + "]", e);
+ }
+
}
-
- protected org.jboss.identity.idm.api.Identity findIdentity(String userName) throws IdentityException {
- Collection<org.jboss.identity.idm.api.Identity> identities = identitySession
- .getPersistenceManager()
- .findIdentity(new IdentitySearchControl[]{
- new NameFilterSearchControl(userName)
- } );
-
- if ( (identities==null) || (identities.size()==0) ) {
- return null;
- }
-
- return identities.iterator().next();
- }
protected org.jboss.identity.idm.api.Group findIdmGroupById(String groupId) {
- throw new UnsupportedOperationException("please implement me");
+ try {
+ Collection<org.jboss.identity.idm.api.Group> groups = identitySession.getPersistenceManager().findGroup(Group.TYPE_UNIT);
+ for (org.jboss.identity.idm.api.Group group : groups) {
+ if (groupId.equals(group.getId())) {
+ return group;
+ }
+ }
+ return null;
+ } catch (IdentityException e) {
+ throw new JbpmException("couldn't find the group by groupId: " + groupId, e);
+ }
}
- protected String getAttributeString(Identity identity, String attributeName) throws IdentityException {
- return getAttributeString(identity, null, attributeName);
+ protected String getAttributeString(org.jboss.identity.idm.api.User idUser, String attributeName) throws IdentityException {
+ return getAttributeString(idUser, null, attributeName);
}
protected String getAttributeString(org.jboss.identity.idm.api.Group idGroup, String attributeName) throws IdentityException {
return getAttributeString(null, idGroup, attributeName);
}
- protected String getAttributeString(Identity identity, org.jboss.identity.idm.api.Group idGroup, String attributeName) throws IdentityException {
+ protected String getAttributeString(org.jboss.identity.idm.api.User idUser, org.jboss.identity.idm.api.Group idGroup, String attributeName) throws IdentityException {
AttributesManager attributesManager = identitySession.getAttributesManager();
Attribute attribute = null;
- if (identity!=null) {
- attribute = attributesManager.getAttribute(identity, attributeName);
+ if (idUser !=null) {
+ attribute = attributesManager.getAttribute(idUser, attributeName);
} else {
attribute = attributesManager.getAttribute(idGroup, attributeName);
}
@@ -316,5 +361,4 @@
}
-
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.identity.impl;
import org.hibernate.ejb.HibernateEntityManager;
-import org.jboss.identity.idm.exception.IdentityException;
+import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
import org.jbpm.api.env.Environment;
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/MailTemplateBinding.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -52,13 +52,12 @@
MailTemplateRegistry templateRegistry;
WireDefinition wireDefinition = parse.findObject(WireDefinition.class);
- String templateRegistryDescriptorName = wireDefinition != null ? wireDefinition.getDescriptorName(MailTemplateRegistry.class)
- : null;
+ String templateRegistryDescriptorName = (wireDefinition != null ? wireDefinition.getDescriptorName(MailTemplateRegistry.class) : null);
+
if (templateRegistryDescriptorName != null) {
templateRegistryDescriptor = (ProvidedObjectDescriptor) wireDefinition.getDescriptor(templateRegistryDescriptorName);
templateRegistry = (MailTemplateRegistry) templateRegistryDescriptor.getProvidedObject();
- }
- else {
+ } else {
templateRegistry = new MailTemplateRegistry();
templateRegistryDescriptor = new ProvidedObjectDescriptor(templateRegistry, true);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -22,6 +22,8 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jboss.identity.idm.api.IdentitySessionFactory;
+import org.jboss.identity.idm.common.exception.IdentityException;
+import org.jbpm.api.JbpmException;
import org.jbpm.api.env.Environment;
import org.jbpm.pvm.internal.identity.impl.JBossIdmIdentitySessionImpl;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -39,7 +41,11 @@
public Object construct(WireContext wireContext) {
IdentitySessionFactory identitySessionFactory = Environment.getFromCurrent(IdentitySessionFactory.class);
- return new JBossIdmIdentitySessionImpl(identitySessionFactory.createIdentitySession(realmName));
+ try {
+ return new JBossIdmIdentitySessionImpl(identitySessionFactory.createIdentitySession(realmName));
+ } catch (IdentityException e) {
+ throw new JbpmException("couldn't create the identity session for realm [" + realmName + "]");
+ }
}
public Class< ? > getType(WireDefinition wireDefinition) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionFactoryDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionFactoryDescriptor.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionFactoryDescriptor.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -24,7 +24,7 @@
import javax.naming.InitialContext;
import org.jboss.identity.idm.api.IdentitySessionFactory;
-import org.jboss.identity.idm.impl.api.IdentitySessionFactoryImpl;
+import org.jboss.identity.idm.impl.configuration.IdentityConfigurationImpl;
import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -32,6 +32,7 @@
/**
* @author Tom Baeyens
+ * @author Jeff Yu
*/
public class JbossIdmIdentitySessionFactoryDescriptor extends AbstractDescriptor {
@@ -52,7 +53,7 @@
}
try {
- return new IdentitySessionFactoryImpl(resource);
+ return new IdentityConfigurationImpl().configure(resource).buildIdentitySessionFactory();
} catch (Exception e) {
throw new JbpmException("couldn't instanatiate identity session factory: "+e.getMessage(), e);
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/xml/WireParser.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -188,13 +188,24 @@
public Object parseDocumentElement(Element documentElement, Parse parse) {
List<Element> elements = XmlUtil.elements(documentElement);
- WireDefinition wireDefinition = new WireDefinition();
+
+ WireDefinition wireDefinition = parse.findObject(WireDefinition.class);
+ if (wireDefinition==null) {
+ wireDefinition = new WireDefinition();
+ }
wireDefinition.setClassLoader(classLoader);
parse.pushObject(wireDefinition);
try {
for (Element descriptorElement: elements) {
- parseElement(descriptorElement, parse, CATEGORY_DESCRIPTOR);
+ Descriptor descriptor = (Descriptor) parseElement(descriptorElement, parse, CATEGORY_DESCRIPTOR);
+
+ // add the descriptor
+ if ( (wireDefinition!=null)
+ && (descriptor!=null)
+ ) {
+ wireDefinition.addDescriptor(descriptor);
+ }
}
} finally {
parse.popObject();
@@ -247,12 +258,6 @@
}
}
}
-
- // add the descriptor
- WireDefinition wireDefinition = parse.findObject(WireDefinition.class);
- if (wireDefinition!=null) {
- wireDefinition.addDescriptor(descriptor);
- }
}
return object;
}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.default.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -41,11 +41,28 @@
<holiday period="01/07/2008 - 31/08/2008"/>
</business-calendar>
- <!--mail-template name="TaskNotification"
- -->
- <!--mail-template name="TaskReminder"
- -->
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
</process-engine-context>
<transaction-context>
Copied: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.jboss.idm.cfg.xml (from rev 4758, jbpm4/branches/idm/modules/pvm/src/main/resources/jbpm.jboss.idm.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.jboss.idm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.jboss.idm.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+ <jboss-idm-identity-session-factory jndi="java:/IdentitySessionFactory" />
+ </process-engine-context>
+
+ <transaction-context>
+ <jboss-idm-identity-session realm="realm://JBossIdentity" />
+ </transaction-context>
+
+</jbpm-configuration>
Deleted: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name='task-notification'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hi ${task.assignee},
-Task "${task.name}" has been assigned to you.
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- <mail-template name='task-reminder'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hey ${task.assignee},
-Do not forget about task "${task.name}".
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -4,9 +4,8 @@
<process-engine-context>
<command-service>
- <retry-interceptor />
- <environment-interceptor />
<jta-transaction-interceptor />
+ <environment-interceptor />
</command-service>
</process-engine-context>
Modified: jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-05-26 18:11:12 UTC (rev 4904)
@@ -454,7 +454,7 @@
Environment environment = environmentFactory.openEnvironment();
try {
- WireContext contextBlockContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
+ WireContext transactionContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
assertNotNull(environment.get("a"));
// The recorder object will be subscribed to the environment WireContext
@@ -473,15 +473,10 @@
assertEquals("a", ((WireObjectEventInfo)events.get(2).info).getObjectName());
assertEquals("set", events.get(3).eventName);
assertEquals("a", ((WireObjectEventInfo)events.get(3).info).getObjectName());
- contextBlockContext.fire("interestingevent", null);
+ transactionContext.fire("interestingevent", null);
assertEquals(events.toString(), 5, events.size());
assertEquals("interestingevent", events.get(4).eventName);
- Descriptor descriptor = contextBlockContext.getWireDefinition().getDescriptor("recorder");
- // this event is fired directly on the descriptor and should therefore not be received
- descriptor.fire("descriptorEvent", null);
- assertEquals(events.toString(), 5, events.size());
-
} finally {
environment.close();
}
@@ -548,11 +543,6 @@
assertEquals(events.toString(), 7, events.size());
assertEquals("interestingevent", events.get(6).eventName);
- Descriptor descriptor = contextBlockContext.getWireDefinition().getDescriptor("recorder");
- // this event is fired directly on the descriptor and should therefore not be received
- descriptor.fire("descriptorEvent", null);
- assertEquals(events.toString(), 7, events.size());
-
} finally {
environment.close();
}
Modified: jbpm4/trunk/pom.xml
===================================================================
--- jbpm4/trunk/pom.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/pom.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -53,7 +53,7 @@
<slf4j.version>1.5.2</slf4j.version>
<hsqldb.version>1.8.0.7</hsqldb.version>
<izpack.version>4.2.1</izpack.version>
- <jboss.identity.version>1.0.0.Alpha2</jboss.identity.version>
+ <jboss.identity.version>1.0.0.Alpha7</jboss.identity.version>
<jboss.j2ee.version>4.2.2.GA</jboss.j2ee.version>
<jbossesb.version>4.4.0.GA</jbossesb.version>
<jboss.client.version>5.0.1.GA</jboss.client.version>
@@ -223,11 +223,16 @@
<version>${slf4j.version}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity</groupId>
- <artifactId>idm</artifactId>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-core</artifactId>
<version>${jboss.identity.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.identity.idm</groupId>
+ <artifactId>idm-hibernate</artifactId>
+ <version>${jboss.identity.version}</version>
+ </dependency>
+ <dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>${hsqldb.version}</version>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-05-26 15:38:21 UTC (rev 4903)
+++ jbpm4/trunk/qa/build.xml 2009-05-26 18:11:12 UTC (rev 4904)
@@ -58,7 +58,7 @@
<ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" />
</target>
- <target name="enable.jboss.debug" unless="jbpm.debug">
+ <target name="enable.jboss.debug" if="jbpm.debug">
<replace file="${jboss.home}/bin/run.bat"
token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
15 years, 1 month
JBoss JBPM SVN: r4903 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 11:38:21 -0400 (Tue, 26 May 2009)
New Revision: 4903
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
More work on reports templates
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-26 15:38:01 UTC (rev 4902)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-26 15:38:21 UTC (rev 4903)
@@ -840,7 +840,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Most active process</Value>
+ <Value>Most active</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
@@ -2422,7 +2422,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Long running processes</Value>
+ <Value>Long running</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
15 years, 1 month
JBoss JBPM SVN: r4902 - jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 11:38:01 -0400 (Tue, 26 May 2009)
New Revision: 4902
Modified:
jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
Log:
Prevent NPE in ModelAdapter
Modified: jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java
===================================================================
--- jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-05-26 15:37:22 UTC (rev 4901)
+++ jbpm4/trunk/modules/integration/console/src/main/java/org/jbpm/integration/console/ModelAdaptor.java 2009-05-26 15:38:01 UTC (rev 4902)
@@ -96,13 +96,16 @@
List<String> availableSignals = new ArrayList<String>();
OpenExecution openTopLevelExecution = (OpenExecution) topLevelExecution;
- for(Transition t : openTopLevelExecution.getActivity().getOutgoingTransitions())
+ List<Transition> outTransitions = openTopLevelExecution.getActivity().getOutgoingTransitions();
+ if(outTransitions!=null) // crappy jBPM API
{
- // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
- String transitionName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
- availableSignals.add(transitionName);
+ for(Transition t : outTransitions)
+ {
+ // TODO: Fix when https://jira.jboss.org/jira/browse/JBPM-2220 is done
+ String transitionName = t.getName()!=null ? t.getName() : "to_"+t.getDestination().getName();
+ availableSignals.add(transitionName);
+ }
}
-
tok.setAvailableSignals(availableSignals);
return tok;
}
15 years, 1 month
JBoss JBPM SVN: r4901 - in projects/gwt-console/trunk/gui: war/src/main/java/org/jboss/bpm/console/client/icons and 6 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 11:37:22 -0400 (Tue, 26 May 2009)
New Revision: 4901
Added:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
Removed:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/31.png
Modified:
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
Log:
Started work on ReportEditor
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/SettingsEditor.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -122,11 +122,6 @@
return "Settings";
}
- public String getIconCSS()
- {
- return "bpm-settings-editor";
- }
-
public MenuSection provideMenuSection()
{
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
Deleted: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/31.png
===================================================================
(Binary files differ)
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/ConsoleIconBundle.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -108,4 +108,9 @@
* @gwt.resource reload_small.png
*/
AbstractImagePrototype reloadSmallIcon();
+
+ /**
+ * @gwt.resource report.png
+ */
+ AbstractImagePrototype reportIcon();
}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
===================================================================
(Binary files differ)
Property changes on: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/icons/report.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/process/ProcessEditor.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -146,11 +146,6 @@
return "Processes";
}
- public String getIconCSS()
- {
- return "bpm-process-icon";
- }
-
public MenuSection provideMenuSection()
{
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/OverviewReportView.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,134 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.console.client.report;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Widget;
+import com.mvc4g.client.Controller;
+import org.gwt.mosaic.ui.client.ToolBar;
+import org.gwt.mosaic.ui.client.ToolButton;
+import org.gwt.mosaic.ui.client.layout.BoxLayout;
+import org.gwt.mosaic.ui.client.layout.BoxLayoutData;
+import org.gwt.mosaic.ui.client.layout.LayoutPanel;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class OverviewReportView extends AbstractView
+{
+ public final static String ID = OverviewReportView.class.getName();
+
+ private Controller controller;
+
+ private boolean isInitialized;
+
+ private ApplicationContext appContext;
+
+ private LayoutPanel layout;
+
+ private Frame frame;
+
+ public OverviewReportView(ApplicationContext appContext)
+ {
+ super();
+ this.appContext = appContext;
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+ setTitle("Process Activity");
+ setIcon(icons.reportIcon());
+ }
+
+ public boolean isInitialized()
+ {
+ return isInitialized;
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized)
+ {
+
+ // layout
+ layout = new LayoutPanel( new BoxLayout(BoxLayout.Orientation.VERTICAL));
+ layout.setPadding(0);
+ layout.setWidgetSpacing(0);
+
+ // report frame
+ frame = new Frame();
+ DOM.setStyleAttribute(frame.getElement(), "border", "none");
+
+ setFrameUrl(appContext.getUrlBuilder().getOverviewReportUrl());
+
+
+ // toolbar
+ final LayoutPanel toolBox = new LayoutPanel();
+ toolBox.setPadding(0);
+ toolBox.setWidgetSpacing(5);
+ //toolBox.setLayout(new BoxLayout(BoxLayout.Orientation.VERTICAL));
+
+ final ToolBar toolBar = new ToolBar();
+ toolBar.add(
+ new ToolButton("Refresh", new ClickListener() {
+ public void onClick(Widget sender) {
+ setFrameUrl(appContext.getUrlBuilder().getOverviewReportUrl());
+ }
+ }
+ )
+ );
+
+ toolBar.addSeparator();
+
+ toolBox.add(toolBar, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+
+ // assembly
+ layout.add(toolBox, new BoxLayoutData(BoxLayoutData.FillStyle.HORIZONTAL));
+ layout.add(frame, new BoxLayoutData(BoxLayoutData.FillStyle.BOTH));
+
+ this.add(layout);
+ this.isInitialized = true;
+ }
+ }
+
+ public void setController(Controller controller)
+ {
+ this.controller = controller;
+ }
+
+ private void setFrameUrl(String url)
+ {
+ // https://jira.jboss.org/jira/browse/JBPM-2244
+ frame.getElement().setId(
+ String.valueOf( new Date().getTime())
+ );
+
+ frame.setUrl(url);
+
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditor.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.console.client.report;
+
+import org.jboss.bpm.console.client.Editor;
+import org.jboss.bpm.console.client.MenuSection;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.LazyPanel;
+import org.jboss.bpm.console.client.common.AbstractView;
+import org.jboss.bpm.console.client.process.*;
+import org.jboss.bpm.console.client.util.ConsoleLog;
+import org.jboss.bpm.console.client.icons.ConsoleIconBundle;
+import org.gwt.mosaic.ui.client.DecoratedTabLayoutPanel;
+import org.gwt.mosaic.ui.client.MessageBox;
+import org.gwt.mosaic.ui.client.layout.BorderLayoutData;
+import org.gwt.mosaic.ui.client.layout.BorderLayout;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.TabListener;
+import com.google.gwt.user.client.ui.SourcesTabEvents;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.DOM;
+import com.mvc4g.client.Event;
+import com.mvc4g.client.ActionInterface;
+
+import java.util.Date;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class ReportEditor extends Editor
+{
+ public final static String ID = ReportEditor.class.getName();
+
+ private DecoratedTabLayoutPanel tabPanel;
+
+ public ReportEditor(ApplicationContext appContext)
+ {
+ super(appContext);
+ }
+
+ public void initialize()
+ {
+ if(!isInitialized())
+ {
+ tabPanel = new DecoratedTabLayoutPanel();
+ tabPanel.setPadding(5);
+ tabPanel.addTabListener(
+ new TabListener()
+ {
+ public boolean onBeforeTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ boolean showTab = true;
+
+ if(i!=0)
+ {
+ /*DefinitionListView view = ((DefinitionListView) controller.getView(DefinitionListView.ID));
+ boolean hasSelection = view.getSelection() != null;
+ if(!hasSelection)
+ {
+ MessageBox.alert("Missing selection", "Please select a process");
+ showTab=false;
+ } */
+ }
+
+ return showTab;
+ }
+
+ public void onTabSelected(SourcesTabEvents sourcesTabEvents, int i)
+ {
+ LazyPanel lazyPanel = (LazyPanel) tabPanel.getWidget(i);
+ if(!lazyPanel.isInitialized())
+ {
+ lazyPanel.initialize();
+ appContext.refreshView(); // TODO: hack around rendering problems
+ }
+ }
+ }
+ );
+
+ this.add(tabPanel, new BorderLayoutData(BorderLayout.Region.CENTER));
+
+ // create and register views
+ registerView(OverviewReportView.ID, new OverviewReportView(appContext));
+
+ // create and register actions
+ //registerAction(LoadDefinitionsAction.ID, new LoadDefinitionsAction(appContext));
+
+ // display tab, needs to visible for correct rendering
+ tabPanel.selectTab(0);
+
+ appContext.refreshView();
+ this.isInitialized = true;
+ }
+ }
+
+ private void registerView(String id, AbstractView view)
+ {
+ // register view with controller
+ super.controller.addView(id, view);
+
+ // add to tab layout
+ this.tabPanel.add(view, view.getIconTitle(), true);
+ }
+
+ private void registerAction(String name, ActionInterface action)
+ {
+ super.controller.addAction(name, action);
+ }
+
+ public String getEditorId()
+ {
+ return ID;
+ }
+
+ public String getTitle()
+ {
+ return "Reporting";
+ }
+
+ public MenuSection provideMenuSection()
+ {
+ ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
+
+ return new MenuSection(
+ "Reporting",
+ icons.reportIcon(),
+ new ReportEditorNavigation(appContext)
+ );
+ }
+}
Added: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java (rev 0)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/report/ReportEditorNavigation.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.console.client.report;
+
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.TreeListener;
+import org.jboss.bpm.console.client.ApplicationContext;
+import org.jboss.bpm.console.client.Workspace;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+class ReportEditorNavigation extends Tree
+{
+ public ReportEditorNavigation(final ApplicationContext appContext)
+ {
+ super.setTitle("Reporting");
+
+ TreeItem root = addItem("Processes");
+ TreeItem definitions = root.addItem("Overview");
+
+ addTreeListener(
+ new TreeListener()
+ {
+ public void onTreeItemSelected(TreeItem treeItem)
+ {
+ if("Overview".equals(treeItem.getText()))
+ {
+ Workspace workspace = appContext.getWorkpace();
+ workspace.showEditor(ReportEditor.ID);
+ }
+ }
+
+ public void onTreeItemStateChanged(TreeItem treeItem)
+ {
+
+ }
+ }
+ );
+ }
+}
Modified: projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/java/org/jboss/bpm/console/client/task/TaskEditor.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -140,11 +140,6 @@
return "Task Management";
}
- public String getIconCSS()
- {
- return "bpm-task-icon";
- }
-
public MenuSection provideMenuSection()
{
ConsoleIconBundle icons = GWT.create(ConsoleIconBundle.class);
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/jmaki/xhp/xhp.json 2009-05-26 15:37:22 UTC (rev 4901)
@@ -8,7 +8,7 @@
"password":"password"
},
{"id": "birt",
- "url":"http://localhost:8080/report",
+ "url":"http://localhost:8080/gwt-console-server",
"passthrough":true,
"contentType":"text/html"
}
Modified: projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg
===================================================================
--- projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/war/src/main/resources/org/jboss/bpm/console/workspace-default.cfg 2009-05-26 15:37:22 UTC (rev 4901)
@@ -1,6 +1,4 @@
org.jboss.bpm.console.client.SettingsEditor
org.jboss.bpm.console.client.process.ProcessEditor
org.jboss.bpm.console.client.task.TaskEditor
-
-# not yet implemented in jBPM4
-#org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
+org.jboss.bpm.console.client.report.ReportEditor
\ No newline at end of file
Modified: projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java
===================================================================
--- projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-05-26 13:46:39 UTC (rev 4900)
+++ projects/gwt-console/trunk/gui/workspace-api/src/main/java/org/jboss/bpm/console/client/Editor.java 2009-05-26 15:37:22 UTC (rev 4901)
@@ -76,8 +76,6 @@
public abstract String getEditorId();
public abstract String getTitle();
-
- public abstract String getIconCSS();
public abstract MenuSection provideMenuSection();
15 years, 1 month
JBoss JBPM SVN: r4900 - in projects/gwt-console/trunk: server/server-core and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 09:46:39 -0400 (Tue, 26 May 2009)
New Revision: 4900
Modified:
projects/gwt-console/trunk/pom.xml
projects/gwt-console/trunk/server/server-core/pom.xml
projects/gwt-console/trunk/server/server-core/server-core.iml
projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
projects/gwt-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml
Log:
Integrate report facade with console server
Modified: projects/gwt-console/trunk/pom.xml
===================================================================
--- projects/gwt-console/trunk/pom.xml 2009-05-26 13:45:43 UTC (rev 4899)
+++ projects/gwt-console/trunk/pom.xml 2009-05-26 13:46:39 UTC (rev 4900)
@@ -34,6 +34,7 @@
<mvc4g.version>1.0.0-jboss</mvc4g.version>
<resteasy.version>1.0.2.GA</resteasy.version>
<stax-api.version>1.0-2</stax-api.version>
+ <report.server.version>1.0.0-SNAPSHOT</report.server.version>
</properties>
<modules>
@@ -171,7 +172,11 @@
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-core</artifactId>
+ <version>${report.server.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: projects/gwt-console/trunk/server/server-core/pom.xml
===================================================================
--- projects/gwt-console/trunk/server/server-core/pom.xml 2009-05-26 13:45:43 UTC (rev 4899)
+++ projects/gwt-console/trunk/server/server-core/pom.xml 2009-05-26 13:46:39 UTC (rev 4900)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.jboss.bpm</groupId>
<artifactId>gwt-console-servermodule</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -98,7 +98,7 @@
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-multipart-provider</artifactId>
- <exclusions>
+ <exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -162,6 +162,13 @@
<artifactId>jboss-common-core</artifactId>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-core</artifactId>
+
+ </dependency>
+
</dependencies>
<build>
Modified: projects/gwt-console/trunk/server/server-core/server-core.iml
===================================================================
--- projects/gwt-console/trunk/server/server-core/server-core.iml 2009-05-26 13:45:43 UTC (rev 4899)
+++ projects/gwt-console/trunk/server/server-core/server-core.iml 2009-05-26 13:46:39 UTC (rev 4900)
@@ -253,6 +253,7 @@
</SOURCES>
</library>
</orderEntry>
+ <orderEntry type="module" module-name="report-server" />
<orderEntryProperties />
</component>
</module>
Modified: projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-05-26 13:45:43 UTC (rev 4899)
+++ projects/gwt-console/trunk/server/server-core/src/main/java/org/jboss/bpm/console/server/ConsoleServerApplication.java 2009-05-26 13:46:39 UTC (rev 4900)
@@ -21,6 +21,8 @@
*/
package org.jboss.bpm.console.server;
+import org.jboss.bpm.report.ReportFacade;
+
import javax.ws.rs.core.Application;
import java.util.HashSet;
import java.util.Set;
@@ -42,6 +44,8 @@
singletons.add(new TaskMgmtFacade());
singletons.add(new UserMgmtFacade());
singletons.add(new TestFacade());
+
+ singletons.add( new ReportFacade() );
}
@Override
Modified: projects/gwt-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/gwt-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml 2009-05-26 13:45:43 UTC (rev 4899)
+++ projects/gwt-console/trunk/server/server-core/src/main/webapp/WEB-INF/web.xml 2009-05-26 13:46:39 UTC (rev 4900)
@@ -15,6 +15,11 @@
<param-value>/rs</param-value>
</context-param>
+ <context-param>
+ <param-name>resteasy.providers</param-name>
+ <param-value>org.jboss.bpm.report.FileWriter</param-value>
+ </context-param>
+
<filter>
<filter-name>gwtJSON</filter-name>
<filter-class>org.jboss.bpm.console.server.util.GWTJsonFilter</filter-class>
@@ -48,7 +53,7 @@
<url-pattern>/rs/process/*</url-pattern>
<!--url-pattern>/rs/task/*</url-pattern https://jira.jboss.org/jira/browse/JBPM-2229 -->
<url-pattern>/rs/tasks/*</url-pattern>
- <url-pattern>/rs/identity/*</url-pattern>
+ <url-pattern>/rs/identity/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>administrator</role-name>
@@ -62,7 +67,7 @@
<realm-name>GWT Console Server</realm-name>
</login-config>
- <security-role>
+ <security-role>
<role-name>administrator</role-name>
</security-role>
<security-role>
15 years, 1 month
JBoss JBPM SVN: r4899 - in projects/report-server/trunk: core and 2 other directories.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 09:45:43 -0400 (Tue, 26 May 2009)
New Revision: 4899
Added:
projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/FileWriter.java
projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/JMXServerConfig.java
projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/ReportFacade.java
Removed:
projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/FileWriter.java
projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/JMXServerConfig.java
projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/ReportFacade.java
Modified:
projects/report-server/trunk/core/pom.xml
projects/report-server/trunk/report-server.iws
Log:
Move REST facade to core module for easier consumption
Modified: projects/report-server/trunk/core/pom.xml
===================================================================
--- projects/report-server/trunk/core/pom.xml 2009-05-26 13:35:58 UTC (rev 4898)
+++ projects/report-server/trunk/core/pom.xml 2009-05-26 13:45:43 UTC (rev 4899)
@@ -1,176 +1,187 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <name>JBoss BPM - Report Core</name>
- <groupId>org.jboss.bpm</groupId>
- <artifactId>report-core</artifactId>
- <packaging>jar</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <name>JBoss BPM - Report Core</name>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-core</artifactId>
+ <packaging>jar</packaging>
- <!-- Parent -->
- <parent>
- <groupId>org.jboss.bpm</groupId>
- <artifactId>report-parent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <!-- Parent -->
+ <parent>
+ <groupId>org.jboss.bpm</groupId>
+ <artifactId>report-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <properties>
- <birt.version>2.3.2</birt.version>
- </properties>
+ <properties>
+ <birt.version>2.3.2</birt.version>
+ </properties>
- <dependencies>
- <!-- Other -->
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
+ <dependencies>
+ <!-- Other -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>engineapi</artifactId>
- <version>${birt.version}</version>
- <exclusions>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>engineapi</artifactId>
+ <version>${birt.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>chartengineapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>chartengineapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>coreapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>coreapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>dataadapterapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>dataadapterapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>modelapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>modelapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>scriptapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>scriptapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.birt</groupId>
- <artifactId>dteapi</artifactId>
- <version>${birt.version}</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.birt</groupId>
+ <artifactId>dteapi</artifactId>
+ <version>${birt.version}</version>
+ </dependency>
- <!-- EMF (Eclipse Modeling Framework ) -->
+ <!-- EMF (Eclipse Modeling Framework ) -->
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>ecore</artifactId>
- <version>2.4.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>ecore</artifactId>
+ <version>2.4.2</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>ecore-xmi</artifactId>
- <version>2.4.1</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>ecore-xmi</artifactId>
+ <version>2.4.1</version>
+ </dependency>
- <dependency>
- <groupId>org.eclipse.emf</groupId>
- <artifactId>common</artifactId>
- <version>2.4.0</version>
- </dependency>
+ <dependency>
+ <groupId>org.eclipse.emf</groupId>
+ <artifactId>common</artifactId>
+ <version>2.4.0</version>
+ </dependency>
- <!-- W3C -->
+ <!-- W3C -->
- <dependency>
- <groupId>org.w3c</groupId>
- <artifactId>flute</artifactId>
- <version>1.2</version>
- </dependency>
+ <dependency>
+ <groupId>org.w3c</groupId>
+ <artifactId>flute</artifactId>
+ <version>1.2</version>
+ </dependency>
- <dependency>
- <groupId>org.w3c</groupId>
- <artifactId>sac</artifactId>
- <version>1.3</version>
- </dependency>
+ <dependency>
+ <groupId>org.w3c</groupId>
+ <artifactId>sac</artifactId>
+ <version>1.3</version>
+ </dependency>
- <!-- Commons -->
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- <!-- removing unwanted transitive dependencies -->
- <exclusions>
- <exclusion>
- <artifactId>junit</artifactId>
- <groupId>junit</groupId>
- </exclusion>
- </exclusions>
- </dependency>
+ <!-- Commons -->
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <!-- removing unwanted transitive dependencies -->
+ <exclusions>
+ <exclusion>
+ <artifactId>junit</artifactId>
+ <groupId>junit</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.0</version>
- <!-- removing unwanted transitive dependencies -->
- <exclusions>
- <exclusion>
- <artifactId>commons-lang</artifactId>
- <groupId>commons-lang</groupId>
- </exclusion>
- <exclusion>
- <artifactId>commons-logging</artifactId>
- <groupId>commons-logging</groupId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>1.0</version>
+ <!-- removing unwanted transitive dependencies -->
+ <exclusions>
+ <exclusion>
+ <artifactId>commons-lang</artifactId>
+ <groupId>commons-lang</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-logging</artifactId>
+ <groupId>commons-logging</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>commons-discovery</groupId>
- <artifactId>commons-discovery</artifactId>
- <version>0.2</version>
- </dependency>
+ <dependency>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <version>0.2</version>
+ </dependency>
- <!-- misc -->
- <dependency>
- <groupId>com.lowagie</groupId>
- <artifactId>itext</artifactId>
- <version>1.3</version>
- </dependency>
+ <!-- misc -->
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ <version>1.3</version>
+ </dependency>
- <dependency>
- <groupId>com.ibm.icu</groupId>
- <artifactId>icu4j</artifactId>
- <version>3.8.1</version>
- </dependency>
+ <dependency>
+ <groupId>com.ibm.icu</groupId>
+ <artifactId>icu4j</artifactId>
+ <version>3.8.1</version>
+ </dependency>
- <dependency>
- <groupId>rhino</groupId>
- <artifactId>js</artifactId>
- <version>1.6R2</version>
- </dependency>
+ <dependency>
+ <groupId>rhino</groupId>
+ <artifactId>js</artifactId>
+ <version>1.6R2</version>
+ </dependency>
- </dependencies>
+ <dependency>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>resteasy-jaxrs</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+
+
</project>
Copied: projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/FileWriter.java (from rev 4817, projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/FileWriter.java)
===================================================================
--- projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/FileWriter.java (rev 0)
+++ projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/FileWriter.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
+
+import javax.ws.rs.ext.Provider;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import java.lang.reflect.Type;
+import java.lang.annotation.Annotation;
+import java.io.OutputStream;
+import java.io.IOException;
+import java.io.FileInputStream;
+import java.io.File;
+
+/**
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@Provider
+@Produces({"text/html", "image/*"})
+public class FileWriter implements MessageBodyWriter
+{
+
+ public boolean isWriteable(Class aClass, Type type, Annotation[] annotations, MediaType mediaType)
+ {
+ return aClass.equals(java.io.File.class);
+ }
+
+ public long getSize(Object o, Class aClass, Type type, Annotation[] annotations, MediaType mediaType)
+ {
+ return ((File)o).length();
+ }
+
+ public void writeTo(Object o, Class aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap multivaluedMap, OutputStream outputStream) throws IOException, WebApplicationException
+ {
+ FileInputStream fin = new FileInputStream((File)o);
+ int c;
+ while ((c = fin.read()) != -1)
+ {
+ outputStream.write(c);
+ }
+
+ fin.close();
+
+ }
+}
Copied: projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/JMXServerConfig.java (from rev 4817, projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/JMXServerConfig.java)
===================================================================
--- projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/JMXServerConfig.java (rev 0)
+++ projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/JMXServerConfig.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
+
+import javax.management.*;
+import java.io.File;
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ * Hooks into JMX to get the JBoss AS configuration.
+ * (temp directories, etc)
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+public class JMXServerConfig
+{
+ // The MBeanServer
+ private MBeanServer mbeanServer;
+
+ public JMXServerConfig()
+ {
+ this.mbeanServer = getDefaultMBeanServer();
+ }
+
+ public MBeanServer getMbeanServer()
+ {
+ return mbeanServer;
+ }
+
+ public void setMbeanServer(MBeanServer mbeanServer)
+ {
+ this.mbeanServer = mbeanServer;
+ }
+
+ public File getServerTempDir()
+ {
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getHomeDir()
+ {
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public File getServerDataDir()
+ {
+ try
+ {
+ ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
+ return dir;
+ }
+ catch (JMException e)
+ {
+ return null;
+ }
+ }
+
+ public static MBeanServer getDefaultMBeanServer() {
+ return findMBeanServer("jboss");
+ }
+
+ private static MBeanServer findMBeanServer(String agentId) {
+ List servers = MBeanServerFactory.findMBeanServer(null);
+ if (servers != null && servers.size() > 0) {
+ for (Object object : servers) {
+ MBeanServer server = (MBeanServer) object;
+ if (server.getDefaultDomain().equals(agentId)) {
+ return server;
+ }
+ }
+ }
+ return null;
+ }
+
+ public static class ObjectNameFactory
+ {
+ public static ObjectName create(String name)
+ {
+ try
+ {
+ return new ObjectName(name);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + name + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, String key, String value)
+ {
+ try
+ {
+ return new ObjectName(domain, key, value);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
+ }
+ }
+
+ public static ObjectName create(String domain, Hashtable table)
+ {
+ try
+ {
+ return new ObjectName(domain, table);
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
+ }
+ }
+ }
+}
Copied: projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/ReportFacade.java (from rev 4817, projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/ReportFacade.java)
===================================================================
--- projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/ReportFacade.java (rev 0)
+++ projects/report-server/trunk/core/src/main/java/org/jboss/bpm/report/ReportFacade.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.*;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import java.io.*;
+import java.util.HashMap;
+import java.util.Enumeration;
+import java.util.Map;
+
+/**
+ * BIRT integration facade.<p>
+ *
+ * Uses the server data directory (i.e. <code>$JBOSS_HOME/server/default/data/birt</code>)
+ * as it's work directory (referred to as $WORK_DIR in the subsequent sections):
+ *
+ * <ul>
+ * <li>report template location: $WORK_DIR/
+ * <li>output directory: $WORK_DIR/output
+ * </ul>
+ *
+ * NOTE: It requires a BIRT report engine to be installed in the work directory:
+ * (<code>$WORK_DIR/ReportEngine</code>.
+ *
+ * @see org.jboss.bpm.report.JMXServerConfig
+ *
+ * @author Heiko.Braun <heiko.braun(a)jboss.com>
+ */
+@Path("report")
+public class ReportFacade
+{
+ private static final Log log = LogFactory.getLog(ReportFacade.class);
+ private BirtService birtService;
+ private boolean isInitialized;
+
+ public void lazyInitialize(HttpServletRequest request)
+ {
+ if(!isInitialized)
+ {
+ JMXServerConfig jmxConfig = new JMXServerConfig();
+ IntegrationConfig iConfig = new IntegrationConfig();
+
+ File severDataDir = jmxConfig.getServerDataDir();
+ String absServerDataDir = severDataDir.getAbsolutePath();
+
+ String birtDataDir = absServerDataDir + "/birt";
+ String defaultBirtHome = birtDataDir + "/ReportEngine";
+ String birtOutputDir = birtDataDir + "/output";
+
+ File birtOutput = new File(birtOutputDir);
+ birtOutput.mkdirs(); // will create parent directoy as well
+
+ // check dependency on ReportEngine
+ if(! new File(defaultBirtHome).exists())
+ throw new IllegalStateException("The BIRT report engine doesn't seem to be installed:" +defaultBirtHome);
+
+ // --
+
+ iConfig.setBirtHome(defaultBirtHome);
+ iConfig.setOutputDir( birtOutputDir );
+ iConfig.setReportDir( birtDataDir );
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("http://");
+ sb.append(request.getServerName()).append(":");
+ sb.append(request.getServerPort());
+ sb.append(request.getContextPath());
+ sb.append(request.getServletPath());
+ sb.append("/report/view/image");
+
+ iConfig.setImageBaseUrl(sb.toString());
+
+ log.info("BIRT home: " +iConfig.getBirtHome());
+ log.info("Output dir: " +iConfig.getOutputDir());
+ log.info("Report dir: " +iConfig.getReportDir());
+
+ this.birtService = new BirtService(iConfig);
+ this.birtService.create();
+
+ isInitialized = true;
+ }
+ }
+
+ @GET
+ @Path("view/{fileName}")
+ @Produces("text/html")
+ public Response viewReportHtml(
+ @PathParam("fileName")
+ String fileName,
+ @Context HttpServletRequest
+ request
+ )
+ {
+ lazyInitialize(request);
+
+ Map queryParams = convertRequestParametersToMap(request);
+
+ RenderMetaData renderMeta = new RenderMetaData();
+ renderMeta.setReportName(fileName);
+ renderMeta.setFormat(RenderMetaData.Format.HTML);
+ renderMeta.setClassloader(Thread.currentThread().getContextClassLoader());
+ renderMeta.getParameters().putAll(queryParams);
+
+ String outputFileName = birtService.render(renderMeta);
+ String absoluteFile = birtService.getIntegrationConfig().getOutputDir() + outputFileName;
+ log.info("Render " + absoluteFile);
+
+ File reportFile = new File(absoluteFile);
+ return Response.ok(reportFile).type("text/html").build();
+ }
+
+ @GET
+ @Path("view/image/{fileName}")
+ public Response getImage(
+ @PathParam("fileName")
+ String fileName,
+ @Context HttpServletRequest
+ request
+ )
+ {
+ lazyInitialize(request);
+
+ String imageDir = birtService.getIntegrationConfig().getImageDirectory();
+ String absName = imageDir + fileName;
+ File imageFile = new File(absName);
+ if(!imageFile.exists())
+ throw new IllegalArgumentException("Image " +absName+" doesn't exist");
+ return Response.ok(imageFile).build();
+ }
+
+ static public Map<String, String> convertRequestParametersToMap(HttpServletRequest request){
+ Enumeration<?> initParameters=request.getParameterNames();
+ HashMap<String, String> parameterMap = new HashMap<String, String>();
+ while (initParameters.hasMoreElements()) {
+ String param = (String) initParameters.nextElement();
+ String value = request.getParameter(param);
+ if (param != null & value != null)
+ parameterMap.put(param, value);
+ }
+ return parameterMap;
+ }
+}
Modified: projects/report-server/trunk/report-server.iws
===================================================================
--- projects/report-server/trunk/report-server.iws 2009-05-26 13:35:58 UTC (rev 4898)
+++ projects/report-server/trunk/report-server.iws 2009-05-26 13:45:43 UTC (rev 4899)
@@ -17,12 +17,7 @@
</component>
<component name="ChangeListManager">
<list default="true" name="Default" comment="">
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/report-server.iws" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/report-server.iml" afterPath="$PROJECT_DIR$/report-server.iml" />
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/report-server.ipr" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/server/pom.xml" afterPath="$PROJECT_DIR$/server/pom.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/server/src/main/webapp/WEB-INF/web.xml" afterPath="$PROJECT_DIR$/server/src/main/webapp/WEB-INF/web.xml" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/core/pom.xml" afterPath="$PROJECT_DIR$/core/pom.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/report-server.iws" afterPath="$PROJECT_DIR$/report-server.iws" />
</list>
</component>
<component name="ChangeListSynchronizer" />
@@ -346,7 +341,7 @@
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
- <showStructure PackagesPane="false" ProjectPane="false" />
+ <showStructure PackagesPane="false" Scope="false" ProjectPane="false" />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
@@ -366,13 +361,6 @@
<component name="RecentsManager" />
<component name="RestoreUpdateTree" />
<component name="RunManager">
- <configuration default="true" type="Remote" factoryName="Remote">
- <option name="USE_SOCKET_TRANSPORT" value="true" />
- <option name="SERVER_MODE" value="false" />
- <option name="SHMEM_ADDRESS" value="javadebug" />
- <option name="HOST" value="localhost" />
- <option name="PORT" value="5005" />
- </configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<module name="" />
<option name="MAIN_CLASS_NAME" />
@@ -385,6 +373,23 @@
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
</configuration>
+ <configuration default="true" type="Remote" factoryName="Remote">
+ <option name="USE_SOCKET_TRANSPORT" value="true" />
+ <option name="SERVER_MODE" value="false" />
+ <option name="SHMEM_ADDRESS" value="javadebug" />
+ <option name="HOST" value="localhost" />
+ <option name="PORT" value="5005" />
+ </configuration>
+ <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
+ <option name="MAIN_CLASS_NAME" />
+ <option name="VM_PARAMETERS" />
+ <option name="PROGRAM_PARAMETERS" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
+ <option name="ALTERNATIVE_JRE_PATH" />
+ <option name="ENABLE_SWING_INSPECTOR" value="false" />
+ <module name="" />
+ </configuration>
<configuration default="true" type="JUnit" factoryName="JUnit" enabled="false" merge="false">
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
@@ -401,22 +406,21 @@
<value defaultName="wholeProject" />
</option>
</configuration>
- <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false">
- <option name="MAIN_CLASS_NAME" />
- <option name="VM_PARAMETERS" />
- <option name="PROGRAM_PARAMETERS" />
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
- <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
- <option name="ALTERNATIVE_JRE_PATH" />
- <option name="ENABLE_SWING_INSPECTOR" value="false" />
- <module name="" />
- </configuration>
<configuration name="<template>" type="WebApp" default="true" selected="false">
<Host>localhost</Host>
<Port>5050</Port>
</configuration>
</component>
- <component name="ScopeViewComponent" />
+ <component name="ScopeViewComponent">
+ <subPane subId="Project">
+ <PATH>
+ <PATH_ELEMENT USER_OBJECT="Root">
+ <option name="myItemId" value="" />
+ <option name="myItemType" value="" />
+ </PATH_ELEMENT>
+ </PATH>
+ </subPane>
+ </component>
<component name="SelectInManager" />
<component name="StarteamConfiguration">
<option name="SERVER" value="" />
@@ -482,33 +486,33 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
- <frame x="501" y="63" width="1144" height="882" extended-state="0" />
- <editor active="true" />
+ <frame x="0" y="22" width="1280" height="774" extended-state="6" />
+ <editor active="false" />
<layout>
- <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
- <window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
- <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
+ <window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
+ <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="7" />
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32968035" order="0" />
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3290008" order="0" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3299363" order="1" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
- <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" />
- <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
- <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
- <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
+ <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
+ <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" />
- <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="2" />
- <window_info id="Maven" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="Maven" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
- <window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="4" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="0" />
- <window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
- <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="-1" />
+ <window_info id="IDEtalk Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
+ <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" />
+ <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="0" />
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" />
- <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="0" />
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="3" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="5" />
</layout>
Deleted: projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/FileWriter.java
===================================================================
--- projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/FileWriter.java 2009-05-26 13:35:58 UTC (rev 4898)
+++ projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/FileWriter.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
-
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import java.lang.reflect.Type;
-import java.lang.annotation.Annotation;
-import java.io.OutputStream;
-import java.io.IOException;
-import java.io.FileInputStream;
-import java.io.File;
-
-/**
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-@Provider
-@Produces({"text/html", "image/*"})
-public class FileWriter implements MessageBodyWriter
-{
-
- public boolean isWriteable(Class aClass, Type type, Annotation[] annotations, MediaType mediaType)
- {
- return aClass.equals(java.io.File.class);
- }
-
- public long getSize(Object o, Class aClass, Type type, Annotation[] annotations, MediaType mediaType)
- {
- return ((File)o).length();
- }
-
- public void writeTo(Object o, Class aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap multivaluedMap, OutputStream outputStream) throws IOException, WebApplicationException
- {
- FileInputStream fin = new FileInputStream((File)o);
- int c;
- while ((c = fin.read()) != -1)
- {
- outputStream.write(c);
- }
-
- fin.close();
-
- }
-}
Deleted: projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/JMXServerConfig.java
===================================================================
--- projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/JMXServerConfig.java 2009-05-26 13:35:58 UTC (rev 4898)
+++ projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/JMXServerConfig.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -1,152 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
-
-import javax.management.*;
-import java.io.File;
-import java.util.Hashtable;
-import java.util.List;
-
-/**
- * Hooks into JMX to get the JBoss AS configuration.
- * (temp directories, etc)
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-public class JMXServerConfig
-{
- // The MBeanServer
- private MBeanServer mbeanServer;
-
- public JMXServerConfig()
- {
- this.mbeanServer = getDefaultMBeanServer();
- }
-
- public MBeanServer getMbeanServer()
- {
- return mbeanServer;
- }
-
- public void setMbeanServer(MBeanServer mbeanServer)
- {
- this.mbeanServer = mbeanServer;
- }
-
- public File getServerTempDir()
- {
- try
- {
- ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getHomeDir()
- {
- try
- {
- ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public File getServerDataDir()
- {
- try
- {
- ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
- File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
- return dir;
- }
- catch (JMException e)
- {
- return null;
- }
- }
-
- public static MBeanServer getDefaultMBeanServer() {
- return findMBeanServer("jboss");
- }
-
- private static MBeanServer findMBeanServer(String agentId) {
- List servers = MBeanServerFactory.findMBeanServer(null);
- if (servers != null && servers.size() > 0) {
- for (Object object : servers) {
- MBeanServer server = (MBeanServer) object;
- if (server.getDefaultDomain().equals(agentId)) {
- return server;
- }
- }
- }
- return null;
- }
-
- public static class ObjectNameFactory
- {
- public static ObjectName create(String name)
- {
- try
- {
- return new ObjectName(name);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + name + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, String key, String value)
- {
- try
- {
- return new ObjectName(domain, key, value);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + key + "," + value + "; " + e);
- }
- }
-
- public static ObjectName create(String domain, Hashtable table)
- {
- try
- {
- return new ObjectName(domain, table);
- }
- catch (MalformedObjectNameException e)
- {
- throw new Error("Invalid ObjectName: " + domain + "," + table + "; " + e);
- }
- }
- }
-}
Deleted: projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/ReportFacade.java
===================================================================
--- projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/ReportFacade.java 2009-05-26 13:35:58 UTC (rev 4898)
+++ projects/report-server/trunk/server/src/main/java/org/jboss/bpm/report/ReportFacade.java 2009-05-26 13:45:43 UTC (rev 4899)
@@ -1,167 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.bpm.report;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import java.io.*;
-import java.util.HashMap;
-import java.util.Enumeration;
-import java.util.Map;
-
-/**
- * BIRT integration facade.<p>
- *
- * Uses the server data directory (i.e. <code>$JBOSS_HOME/server/default/data/birt</code>)
- * as it's work directory (referred to as $WORK_DIR in the subsequent sections):
- *
- * <ul>
- * <li>report template location: $WORK_DIR/
- * <li>output directory: $WORK_DIR/output
- * </ul>
- *
- * NOTE: It requires a BIRT report engine to be installed in the work directory:
- * (<code>$WORK_DIR/ReportEngine</code>.
- *
- * @see org.jboss.bpm.report.JMXServerConfig
- *
- * @author Heiko.Braun <heiko.braun(a)jboss.com>
- */
-@Path("report")
-public class ReportFacade
-{
- private static final Log log = LogFactory.getLog(ReportFacade.class);
- private BirtService birtService;
- private boolean isInitialized;
-
- public void lazyInitialize(HttpServletRequest request)
- {
- if(!isInitialized)
- {
- JMXServerConfig jmxConfig = new JMXServerConfig();
- IntegrationConfig iConfig = new IntegrationConfig();
-
- File severDataDir = jmxConfig.getServerDataDir();
- String absServerDataDir = severDataDir.getAbsolutePath();
-
- String birtDataDir = absServerDataDir + "/birt";
- String defaultBirtHome = birtDataDir + "/ReportEngine";
- String birtOutputDir = birtDataDir + "/output";
-
- File birtOutput = new File(birtOutputDir);
- birtOutput.mkdirs(); // will create parent directoy as well
-
- // check dependency on ReportEngine
- if(! new File(defaultBirtHome).exists())
- throw new IllegalStateException("The BIRT report engine doesn't seem to be installed:" +defaultBirtHome);
-
- // --
-
- iConfig.setBirtHome(defaultBirtHome);
- iConfig.setOutputDir( birtOutputDir );
- iConfig.setReportDir( birtDataDir );
-
- StringBuffer sb = new StringBuffer();
- sb.append("http://");
- sb.append(request.getServerName()).append(":");
- sb.append(request.getServerPort());
- sb.append(request.getContextPath());
- sb.append(request.getServletPath());
- sb.append("/report/view/image");
-
- iConfig.setImageBaseUrl(sb.toString());
-
- log.info("BIRT home: " +iConfig.getBirtHome());
- log.info("Output dir: " +iConfig.getOutputDir());
- log.info("Report dir: " +iConfig.getReportDir());
-
- this.birtService = new BirtService(iConfig);
- this.birtService.create();
-
- isInitialized = true;
- }
- }
-
- @GET
- @Path("view/{fileName}")
- @Produces("text/html")
- public Response viewReportHtml(
- @PathParam("fileName")
- String fileName,
- @Context HttpServletRequest
- request
- )
- {
- lazyInitialize(request);
-
- Map queryParams = convertRequestParametersToMap(request);
-
- RenderMetaData renderMeta = new RenderMetaData();
- renderMeta.setReportName(fileName);
- renderMeta.setFormat(RenderMetaData.Format.HTML);
- renderMeta.setClassloader(Thread.currentThread().getContextClassLoader());
- renderMeta.getParameters().putAll(queryParams);
-
- String outputFileName = birtService.render(renderMeta);
- String absoluteFile = birtService.getIntegrationConfig().getOutputDir() + outputFileName;
- log.info("Render " + absoluteFile);
-
- File reportFile = new File(absoluteFile);
- return Response.ok(reportFile).type("text/html").build();
- }
-
- @GET
- @Path("view/image/{fileName}")
- public Response getImage(
- @PathParam("fileName")
- String fileName,
- @Context HttpServletRequest
- request
- )
- {
- lazyInitialize(request);
-
- String imageDir = birtService.getIntegrationConfig().getImageDirectory();
- String absName = imageDir + fileName;
- File imageFile = new File(absName);
- if(!imageFile.exists())
- throw new IllegalArgumentException("Image " +absName+" doesn't exist");
- return Response.ok(imageFile).build();
- }
-
- static public Map<String, String> convertRequestParametersToMap(HttpServletRequest request){
- Enumeration<?> initParameters=request.getParameterNames();
- HashMap<String, String> parameterMap = new HashMap<String, String>();
- while (initParameters.hasMoreElements()) {
- String param = (String) initParameters.nextElement();
- String value = request.getParameter(param);
- if (param != null & value != null)
- parameterMap.put(param, value);
- }
- return parameterMap;
- }
-}
15 years, 1 month
JBoss JBPM SVN: r4898 - in jbpm4/trunk/modules: pvm/src/main/resources and 1 other directory.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-26 09:35:58 -0400 (Tue, 26 May 2009)
New Revision: 4898
Added:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml
Removed:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
Log:
fixed integration test suite: removed use of synchronization for process instance end deletion and refactored example email templates
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 12:57:40 UTC (rev 4897)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 13:35:58 UTC (rev 4898)
@@ -6,7 +6,7 @@
<import resource="jbpm.tx.jta.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
- <import resource="jbpm.mail.templates.xml" />
+ <import resource="jbpm.mail.templates.cfg.xml" />
<import resource="jbpm.mail.templates.examples.xml" />
Copied: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml (from rev 4897, jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml)
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml 2009-05-26 13:35:58 UTC (rev 4898)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml 2009-05-26 12:57:40 UTC (rev 4897)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml 2009-05-26 13:35:58 UTC (rev 4898)
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
-
- <mail-template name='task-notification'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hi ${task.assignee},
-Task "${task.name}" has been assigned to you.
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- <mail-template name='task-reminder'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hey ${task.assignee},
-Do not forget about task "${task.name}".
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- </process-engine-context>
-
-</jbpm-configuration>
15 years, 1 month
JBoss JBPM SVN: r4897 - in jbpm4/trunk: modules/enterprise/src/main/java/org/jbpm/enterprise/internal/jta and 10 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-05-26 08:57:40 -0400 (Tue, 26 May 2009)
New Revision: 4897
Added:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml
jbpm4/trunk/qa/jboss/
jbpm4/trunk/qa/jboss/jboss-log4j.xml
Removed:
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java
Modified:
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/jta/JtaTransactionInterceptor.java
jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JobContext.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
jbpm4/trunk/qa/build.xml
jbpm4/trunk/qa/hudson-jbpm4-jboss.bat
Log:
fixed integration test suite: removed use of synchronization for process instance end deletion and refactored example email templates
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.cfg.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -6,11 +6,8 @@
<import resource="jbpm.tx.jta.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.mail.templates.xml" />
<import resource="jbpm.mail.templates.examples.xml" />
- <!-- Job executor is excluded for running the example test cases.
- To enable timers and messages in production use, this should be included.
- import resource="jbpm.jobexecutor.cfg.xml" / -->
-
</jbpm-configuration>
Modified: jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/distro/src/main/files/jboss/jbpm.cfg.integration.tests/jbpm.mail.templates.examples.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -4,7 +4,7 @@
<process-engine-context>
- <mail-template name="rectify template">
+ <mail-template name="rectify-template">
<to addresses="${addressee}" />
<cc users="bb" groups="innerparty" />
<bcc groups="thinkpol" />
Modified: jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/jta/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/jta/JtaTransactionInterceptor.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/jta/JtaTransactionInterceptor.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -28,10 +28,13 @@
import javax.naming.NamingException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
+import javax.transaction.InvalidTransactionException;
import javax.transaction.NotSupportedException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
import org.hibernate.StaleStateException;
@@ -45,20 +48,25 @@
*/
public class JtaTransactionInterceptor extends Interceptor {
- protected String userTransactionName = "UserTransaction";
+ protected String userTransactionJndiName = "UserTransaction";
+ protected String transactionManagerJndiName = "java:/TransactionManager";
+
protected Properties jndiProperties;
int retries = 3;
long delay = 50;
long delayFactor = 4;
- private UserTransaction userTransaction;
private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
public <T> T execute(Command<T> command) {
UserTransaction userTransaction = getUserTransaction();
try {
T result;
- if (userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION) {
+ int status = userTransaction.getStatus();
+ if ( (status == Status.STATUS_NO_TRANSACTION)
+ || (status == Status.STATUS_COMMITTED)
+ || (status == Status.STATUS_ROLLEDBACK)
+ ) {
result = executeCmdInNewJtaTx(command, userTransaction);
} else {
// transaction already underway, just call next interceptor
@@ -71,68 +79,92 @@
}
protected UserTransaction getUserTransaction() {
- if (userTransaction == null) {
- try {
- Context initialContext = new InitialContext(jndiProperties);
- userTransaction = (UserTransaction) initialContext.lookup(userTransactionName);
- initialContext.close();
- } catch (NamingException e) {
- throw new JbpmException("failed to retrieve user transaction: " + userTransactionName);
- }
+ try {
+ Context initialContext = new InitialContext(jndiProperties);
+ return (UserTransaction) initialContext.lookup(userTransactionJndiName);
+ } catch (NamingException e) {
+ throw new JbpmException("failed to retrieve user transaction: " + userTransactionJndiName, e);
}
- return userTransaction;
}
+ protected TransactionManager getTransactionManager() {
+ try {
+ Context initialContext = new InitialContext(jndiProperties);
+ return (TransactionManager) initialContext.lookup(transactionManagerJndiName);
+ } catch (NamingException e) {
+ throw new JbpmException("failed to retrieve transaction manager: "+transactionManagerJndiName, e);
+ }
+ }
+
protected <T> T executeCmdInNewJtaTx(Command<T> command, UserTransaction userTransaction) throws SystemException {
- // TODO JBPM-2196 unify the retry code with the RetryInterceptor
-
int attempt = 1;
long sleepTime = delay;
- while (attempt<=retries) {
- if (attempt>1) {
- log.trace("retrying...");
+ int status = userTransaction.getStatus();
+ boolean suspend = (status == Status.STATUS_COMMITTED) || (status == Status.STATUS_ROLLEDBACK);
+ TransactionManager transactionManager = null;
+ Transaction suspendedTransaction = null;
+ if (suspend) {
+ transactionManager = getTransactionManager();
+ suspendedTransaction = transactionManager.suspend();
+ }
+
+ try {
+ // TODO JBPM-2196 unify the retry code with the RetryInterceptor
+
+ while (attempt<=retries) {
+ if (attempt>1) {
+ log.trace("retrying...");
+ }
+ try {
+ userTransaction.begin();
+ T result = getNext().execute(command);
+ userTransaction.commit();
+ return result;
+
+ } catch (StaleStateException e) {
+ rollback(userTransaction);
+ attempt++;
+ log.trace("optimistic locking failed: "+e);
+ log.trace("waiting "+sleepTime+" millis");
+ try {
+ Thread.sleep(sleepTime);
+ } catch (InterruptedException e1) {
+ log.trace("retry sleeping got interrupted");
+ }
+ sleepTime *= delayFactor;
+
+ } catch (RuntimeException e) {
+ // attempt rollback
+ rollback(userTransaction);
+ // rethrow original exception
+ throw e;
+
+ } catch (NotSupportedException e) {
+ // thrown by begin() call
+ // no need to rollback since transaction has not begun
+ throw new JbpmException("cannot begin transaction at this point", e);
+
+ } catch (RollbackException e) {
+ // transaction rolled back already, no need to rollback again
+ throw new JbpmException("transaction has been rolled back", e);
+
+ } catch (HeuristicRollbackException e) {
+ // transaction rolled back already, no need to rollback again
+ throw new JbpmException("transaction rolled back by heuristic decision", e);
+
+ } catch (HeuristicMixedException e) {
+ throw new JbpmException("transaction had mixed outcome, possible data inconsistency", e);
+ }
}
- try {
- userTransaction.begin();
- T result = getNext().execute(command);
- userTransaction.commit();
- return result;
-
- } catch (StaleStateException e) {
- rollback(userTransaction);
- attempt++;
- log.trace("optimistic locking failed: "+e);
- log.trace("waiting "+sleepTime+" millis");
+ } finally {
+ if (suspendedTransaction!=null) {
try {
- Thread.sleep(sleepTime);
- } catch (InterruptedException e1) {
- log.trace("retry sleeping got interrupted");
+ transactionManager.resume(suspendedTransaction);
+ } catch (Exception e) {
+ throw new JbpmException("couldn't resume suspended transaction "+suspendedTransaction, e);
}
- sleepTime *= delayFactor;
-
- } catch (RuntimeException e) {
- // attempt rollback
- rollback(userTransaction);
- // rethrow original exception
- throw e;
-
- } catch (NotSupportedException e) {
- // thrown by begin() call
- // no need to rollback since transaction has not begun
- throw new JbpmException("cannot begin transaction at this point", e);
-
- } catch (RollbackException e) {
- // transaction rolled back already, no need to rollback again
- throw new JbpmException("transaction has been rolled back", e);
-
- } catch (HeuristicRollbackException e) {
- // transaction rolled back already, no need to rollback again
- throw new JbpmException("transaction rolled back by heuristic decision", e);
-
- } catch (HeuristicMixedException e) {
- throw new JbpmException("transaction had mixed outcome, possible data inconsistency", e);
}
}
throw new JbpmException("gave up after "+attempt+" attempts");
Modified: jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java
===================================================================
--- jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/examples/src/test/java/org/jbpm/examples/async/activity/AsyncActivityTest.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -48,7 +48,7 @@
super.tearDown();
}
- public void testJavaInstantiate() {
+ public void testAsyncActivity() {
ProcessInstance processInstance = executionService.startProcessInstanceByKey("AsyncActivity");
String processInstanceId = processInstance.getId();
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.cfg.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -6,6 +6,7 @@
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
+ <import resource="jbpm.mail.templates.cfg.xml" />
<!-- Job executor is excluded for running the example test cases. -->
<!-- To enable timers and messages in production use, this should be included. -->
Modified: jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml
===================================================================
--- jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/examples/src/test/resources/jbpm.mail.templates.examples.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -4,28 +4,6 @@
<process-engine-context>
- <mail-template name='task-notification'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hi ${task.assignee},
-Task "${task.name}" has been assigned to you.
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- <mail-template name='task-reminder'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hey ${task.assignee},
-Do not forget about task "${task.name}".
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
<mail-template name="rectify-template">
<to addresses="${addressee}" />
<cc users="bb" groups="innerparty" />
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -30,6 +30,7 @@
import org.jbpm.api.env.Transaction;
import org.jbpm.api.job.Job;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.JobContext;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobDbSession;
import org.jbpm.pvm.internal.jobexecutor.JobExceptionHandler;
@@ -61,6 +62,8 @@
// in case of decision jobs, the job might have been deleted
// before we execute it (they are in a list)
if (job != null) {
+ JobContext jobContext = new JobContext(job);
+ environment.addContext(jobContext);
try {
log.debug("executing job "+job+"...");
job.execute(environment);
@@ -80,6 +83,8 @@
} catch (Throwable exception) {
log.error("exception while executing '"+job+"'", exception);
handleJobExecutionException(environment, job, exception);
+ } finally {
+ environment.removeContext(jobContext);
}
} else {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -59,10 +59,12 @@
ClientProcessInstance processInstance = processDefinition.createProcessInstance(executionKey);
processInstance.setVariables(variables);
processInstance.start();
-
- Session session = Environment.getFromCurrent(Session.class);
- session.save(processInstance);
+ if (!processInstance.isEnded()) {
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(processInstance);
+ }
+
return processInstance;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -63,8 +63,11 @@
processInstance.setVariables(variables);
processInstance.start();
- Session session = Environment.getFromCurrent(Session.class);
- session.save(processInstance);
+ if (!processInstance.isEnded()) {
+ Session session = Environment.getFromCurrent(Session.class);
+ session.save(processInstance);
+ }
+
return processInstance;
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JobContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JobContext.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/JobContext.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -26,32 +26,35 @@
import java.util.Set;
import org.jbpm.api.env.Context;
+import org.jbpm.api.job.Job;
import org.jbpm.pvm.internal.job.JobImpl;
public class JobContext implements Context {
+ private static final String KEY_JOB = "job";
+
static final Set<String> keys = Collections.unmodifiableSet(getKeys());
static Set<String> getKeys() {
Set<String> keys = new HashSet<String>();
- keys.add("jobImpl");
+ keys.add(KEY_JOB);
return keys;
}
- JobImpl<?> jobImpl;
+ JobImpl<?> job;
public JobContext(JobImpl<?> job) {
- this.jobImpl = job;
+ this.job = job;
}
public Object get(String key) {
- if ("jobImpl".equals(key)) {
- return jobImpl;
+ if (KEY_JOB.equals(key)) {
+ return job;
}
return null;
}
public boolean has(String key) {
- return "jobImpl".equals(key);
+ return KEY_JOB.equals(key);
}
public Set<String> keys() {
@@ -63,10 +66,13 @@
}
public <T> T get(Class<T> type) {
+ if (Job.class.isAssignableFrom(type)) {
+ return (T) job;
+ }
return null;
}
public String getName() {
- return null;
+ return "job";
}
}
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/SpringContext.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -67,7 +67,7 @@
* @see org.jbpm.api.env.Context#getName()
*/
public String getName() {
- return "SpringContext";
+ return "spring";
}
/*
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/HibernatePvmDbSession.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -258,7 +258,6 @@
}
// delete remaining jobs for this process instance
- // TODO JBPM-
List<JobImpl> jobs = findJobs(processInstanceId);
for (JobImpl job: jobs) {
session.delete(job);
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -102,24 +102,17 @@
throw new JbpmException("environment is null");
}
- JobContext jobContext = new JobContext(this);
- environment.addContext(jobContext);
- try {
- if (signalName!=null) {
- if (log.isDebugEnabled()) log.debug("feeding timer signal "+signalName+" into "+execution);
- execution.signal(signalName);
- }
-
- if (eventName!=null) {
- ObservableElement eventSource = execution.getActivity();
- if (log.isDebugEnabled()) log.debug("firing event "+signalName+" into "+eventSource);
- execution.fire(eventName, eventSource);
- }
-
- } finally {
- environment.removeContext(jobContext);
+ if (signalName!=null) {
+ if (log.isDebugEnabled()) log.debug("feeding timer signal "+signalName+" into "+execution);
+ execution.signal(signalName);
}
+ if (eventName!=null) {
+ ObservableElement eventSource = execution.getActivity();
+ if (log.isDebugEnabled()) log.debug("firing event "+signalName+" into "+eventSource);
+ execution.fire(eventName, eventSource);
+ }
+
boolean deleteThisJob = true;
// if there is no repeat on this timer
if (repeat==null) {
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -52,9 +52,11 @@
import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.model.Transition;
import org.jbpm.api.session.MessageSession;
+import org.jbpm.api.session.PvmDbSession;
import org.jbpm.api.session.RepositorySession;
import org.jbpm.api.session.TimerSession;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.hibernate.HibernatePvmDbSession;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
@@ -364,15 +366,9 @@
superProcessExecution.signal();
}
- Environment environment = Environment.getCurrent();
- if (environment!=null) {
- Transaction transaction = environment.get(Transaction.class);
- CommandService commandService = environment.get(CommandService.class);
- if ( (transaction!=null)
- && (commandService!=null)
- ) {
- transaction.registerSynchronization(new ProcessInstanceEndedSynchronization(this.getId(), commandService));
- }
+ PvmDbSession pvmDbSession = Environment.getFromCurrent(PvmDbSession.class, false);
+ if (pvmDbSession!=null) {
+ pvmDbSession.deleteProcessInstance(id, false);
}
}
}
Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessInstanceEndedSynchronization.java 2009-05-26 12:57:40 UTC (rev 4897)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., 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.jbpm.pvm.internal.model;
-
-import java.io.ObjectStreamException;
-
-import javax.transaction.Status;
-import javax.transaction.Synchronization;
-
-import org.hibernate.Session;
-import org.jbpm.api.ExecutionService;
-import org.jbpm.api.cmd.Command;
-import org.jbpm.api.cmd.CommandService;
-import org.jbpm.api.env.Environment;
-import org.jbpm.api.session.PvmDbSession;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ProcessInstanceEndedSynchronization implements Synchronization, Command<Void> {
-
- private static final long serialVersionUID = 1L;
-
- String processInstanceId;
- CommandService commandService;
-
- public ProcessInstanceEndedSynchronization(String processInstanceId, CommandService commandService) {
- this.processInstanceId = processInstanceId;
- this.commandService = commandService;
- }
-
- public void afterCompletion(int status) {
- if (status==Status.STATUS_COMMITTED) {
- commandService.execute(this);
- }
- }
-
- public void beforeCompletion() {
- }
-
- public Void execute(Environment environment) {
- PvmDbSession pvmDbSession = environment.get(PvmDbSession.class);
- pvmDbSession.deleteProcessInstance(processInstanceId, false);
- return null;
- }
-
- protected Object writeReplace() throws ObjectStreamException {
- this.commandService = null;
- return this;
- }
-
-}
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -214,14 +214,14 @@
class="org.jbpm.pvm.internal.model.ExecutionImpl"
column="PROCESSINSTANCE_"
cascade="none"
- foreign-key="FK_JOB_PRINST"
+ foreign-key="none"
index="IDX_JOB_PRINST"/>
<many-to-one name="execution"
class="org.jbpm.pvm.internal.model.ExecutionImpl"
column="EXECUTION_"
cascade="none"
- foreign-key="FK_JOB_EXE"
+ foreign-key="none"
index="IDX_JOB_EXE"/>
<many-to-one name="configurationBytes"
Added: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml (rev 0)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.mail.templates.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.tx.jta.cfg.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -11,7 +11,7 @@
</process-engine-context>
<transaction-context>
- <transaction />
+ <transaction type="jta" />
<hibernate-session current="true" />
</transaction-context>
Modified: jbpm4/trunk/qa/build.xml
===================================================================
--- jbpm4/trunk/qa/build.xml 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/qa/build.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -14,6 +14,9 @@
<property name="jboss.version" value="5.0.0.GA" />
<property name="jboss.distro.dir" value="${jbpm.home}/downloads" />
<property name="jboss.parent.dir" value="${jbpm.home}" />
+ <property name="jboss.home" value="${jboss.parent.dir}/jboss-${jboss.version}" />
+ <property name="jboss.server.configuration" value="default" />
+ <property name="jboss.server.config.dir" value="${jboss.home}/server/${jboss.server.configuration}" />
<!-- DERIVED PROPERTIES -->
<property name="jbpm.filename" value="jbpm-distro-${jbpm.version}.zip" />
@@ -50,10 +53,18 @@
<ant antfile="${jbpm.home}/jboss/build.xml" target="reinstall.jboss" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="install.jbpm.into.jboss" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="internal.install.jbpm.into.jboss.integrationtestspecifics" />
+ <antcall target="enable.jboss.debug" />
<ant antfile="${jbpm.home}/jboss/build.xml" target="start.jboss" />
<ant antfile="${jbpm.home}/db/build.xml" target="create.jbpm.schema" />
</target>
-
+
+ <target name="enable.jboss.debug" unless="jbpm.debug">
+ <replace file="${jboss.home}/bin/run.bat"
+ token="rem set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
+ value="set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
+ <copy file="jboss/jboss-log4j.xml" todir="${jboss.server.config.dir}/conf" overwrite="true" />
+ </target>
+
<target name="post.install">
<!-- overwrite the default jdbc properties in the distro with those specified in the qa jdbc directory -->
<copy file="jdbc/${database}.properties"
Modified: jbpm4/trunk/qa/hudson-jbpm4-jboss.bat
===================================================================
--- jbpm4/trunk/qa/hudson-jbpm4-jboss.bat 2009-05-26 12:51:01 UTC (rev 4896)
+++ jbpm4/trunk/qa/hudson-jbpm4-jboss.bat 2009-05-26 12:57:40 UTC (rev 4897)
@@ -3,7 +3,7 @@
cmd /C mvn -U -Pdistro -Pschemadocs clean install
-cmd /C ant -f qa/build.xml integration.testrun.setup
+cmd /C ant -f qa/build.xml -Djbpm.debug=true integration.testrun.setup
cmd /C mvn -U -Djboss.bind.address=localhost test
Added: jbpm4/trunk/qa/jboss/jboss-log4j.xml
===================================================================
--- jbpm4/trunk/qa/jboss/jboss-log4j.xml (rev 0)
+++ jbpm4/trunk/qa/jboss/jboss-log4j.xml 2009-05-26 12:57:40 UTC (rev 4897)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 64096 2007-07-17 14:36:23Z stan.silvert(a)jboss.com $ -->
+
+<!--
+ | For more configuration information and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A time/date based rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="${jboss.server.log.dir}/server.log"/>
+ <param name="Append" value="false"/>
+ <!--
+ Set the threshold via a system property. Note this is parsed by log4j,
+ so the full JBoss system property format is not supported; e.g.
+ setting a default via ${jboss.server.log.threshold:WARN} will not work.
+ -->
+ <param name="Threshold" value="${jboss.server.log.threshold}"/>
+
+ <!-- Rollover at midnight each day -->
+ <param name="DatePattern" value="'.'yyyy-MM-dd"/>
+
+ <!-- Rollover at the top of each hour
+ <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
+ -->
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
+ <param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>
+
+ <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
+ <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
+ -->
+ </layout>
+ </appender>
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+ <param name="Threshold" value="DEBUG"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+ <category name="org.apache">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+ <category name="jacorb">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Set the logging level of the JSF implementation -->
+ <category name="javax.enterprise.resource.webcontainer.jsf">
+ <priority value="INFO" />
+ </category>
+
+ <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+ <category name="org.jgroups">
+ <priority value="WARN"/>
+ </category>
+
+ <!-- Limit the org.quartz category to INFO as its DEBUG is verbose -->
+ <category name="org.quartz">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- Limit JBoss categories -->
+ <category name="org.jboss">
+ <priority value="INFO"/>
+ </category>
+
+ <category name="org.hibernate">
+ <priority value="INFO"/>
+ </category>
+
+ <!-- category name="org.hibernate.SQL">
+ <priority value="DEBUG"/>
+ </category -->
+
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Property changes on: jbpm4/trunk/qa/jboss/jboss-log4j.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss JBPM SVN: r4896 - jbpm4/trunk/modules/integration/report/src/main/resources.
by do-not-reply@jboss.org
Author: heiko.braun(a)jboss.com
Date: 2009-05-26 08:51:01 -0400 (Tue, 26 May 2009)
New Revision: 4896
Modified:
jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
Log:
More work on process quartiles
Modified: jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign
===================================================================
--- jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-26 12:09:01 UTC (rev 4895)
+++ jbpm4/trunk/modules/integration/report/src/main/resources/process_activity.rptdesign 2009-05-26 12:51:01 UTC (rev 4896)
@@ -570,7 +570,8 @@
</list-property>
<property name="queryText">SELECT *
FROM JBPM4_HIST_PROCINST J
- WHERE DURATION_ > 0</property>
+ WHERE DURATION_ > 0
+ ORDER BY DURATION_ DESC</property>
</oda-data-set>
</data-sets>
<styles>
@@ -2421,7 +2422,7 @@
<Visible>true</Visible>
<Label>
<Caption>
- <Value>Process Completion Quartile</Value>
+ <Value>Long running processes</Value>
<Font>
<Name>SansSerif</Name>
<Size>12.0</Size>
@@ -2537,7 +2538,7 @@
</Color>
<Visible>false</Visible>
</Outline>
- <Visible>false</Visible>
+ <Visible>true</Visible>
<ClientArea>
<Outline>
<Style>Solid</Style>
@@ -2561,6 +2562,7 @@
<Value></Value>
<Font>
<Alignment/>
+ <Rotation>0.0</Rotation>
</Font>
</Text>
<Orientation>Vertical</Orientation>
@@ -2611,6 +2613,7 @@
<Visible>false</Visible>
</Title>
<TitlePosition>Above</TitlePosition>
+ <ShowValue>false</ShowValue>
</Children>
<Bounds>
<Left>0.0</Left>
@@ -2675,7 +2678,9 @@
<SeriesDefinitionIndex>0</SeriesDefinitionIndex>
</OrthogonalSampleData>
</SampleData>
- <Interactivity/>
+ <Interactivity>
+ <LegendBehavior>None</LegendBehavior>
+ </Interactivity>
<Axes>
<Type>Text</Type>
<Title>
@@ -2758,6 +2763,12 @@
<SeriesDefinitions>
<Query>
<Definition>row["PROCDEFID_"]</Definition>
+ <Grouping>
+ <Enabled>false</Enabled>
+ <GroupingInterval>1.0</GroupingInterval>
+ <GroupType>Text</GroupType>
+ <AggregateExpression>Sum</AggregateExpression>
+ </Grouping>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
@@ -3007,6 +3018,10 @@
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
+ <Sorting>Ascending</Sorting>
+ <SortKey>
+ <Definition>row["DURATION_"]</Definition>
+ </SortKey>
</SeriesDefinitions>
<Orientation>Vertical</Orientation>
<LineAttributes>
@@ -3347,7 +3362,7 @@
<Visible>false</Visible>
</Label>
<DataDefinition>
- <Definition>row["PROCDEFID_"]</Definition>
+ <Definition>row.__rownum</Definition>
</DataDefinition>
<SeriesIdentifier></SeriesIdentifier>
<DataPoint>
@@ -3407,7 +3422,7 @@
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
- <Visible>true</Visible>
+ <Visible>false</Visible>
<Ellipsis>45</Ellipsis>
</Label>
<LabelPosition>Below</LabelPosition>
@@ -3491,6 +3506,15 @@
</model:ChartWithAxes>
]]></xml-property>
<property name="outputFormat">SVG</property>
+ <list-property name="filter">
+ <structure>
+ <property name="operator">ge</property>
+ <expression name="expr">row["DURATION_"]</expression>
+ <simple-property-list name="value1">
+ <value>row["q3"]</value>
+ </simple-property-list>
+ </structure>
+ </list-property>
<property name="marginTop">10pt</property>
<property name="marginLeft">10pt</property>
<property name="height">200pt</property>
15 years, 1 month