[opencms-dev] RE : RE : New OpenCms 7 Workflow Module
David Trattnig
david.trattnig at gmail.com
Thu Nov 29 08:58:19 CET 2007
Hi Marc,
You're welcome. I've attached it to the other mail before. Here it is
again...
Rgds
David
-----------------
readme.txt
######################################################
## opencmsmodule-com.bearingpoint.opencms.workflow2 ##
## BearingPoint Infonova, 2007 ##
######################################################
BearingPoint OpenCms Workflow2 Module
----------------------------------------------------------------
This module extends OpenCms by adding basic workflow related
features as:
- Definition of worklow states (defined as common
OpenCms projects)
- Assignment of VFS resources to specific workflow states
- Integrated user/role management
- Additional Interfaces for attaching a workflow engine
The Workflow2 module works by overlapping several OpenCms projects.
Each of these projects represents one workflow state:
project "Offline", assigned to root folder
project "REVIEW", assigned to root folder
project "APPROVAL", assigned to root folder
As you see the Workflow2 module you can simply create n-eye workflow
mechanisms.
When creating a new resource in e.g. project one it's also visible
from project two. Indeed OpenCms is showing an icon that the resource
belongs to project1, but the main functionalities (context menu) are
also available from the other projects.
This packages is solving that issue by adding certain behaviours and
rules. The transformation to other workflow states is done by moving
resources between the projects.
When attaching a workflow engine like JBPM following additional
features are available:
- Assignment of Tasks to VFS resources
- Dedicated task view
For details see chapter "Workflow Engine Interface".
System Requirements
----------------------------------------------------------------
- OpenCms 7.0.2 or later
- bearingpoint commons modules:
opencmsmodule-com.bearingpoint.opencms.commons
opencmsmodule-com.bearingpoint.opencms.commons.springmanager
Installation
----------------------------------------------------------------
1. Build the workflow2 module
2. Deploy to OpenCms via module import mechanism
3. Create a database where to store the workflow states.
4. Declare your new database inside the workflow2 spring configuration:
a) Inside the OpenCms workbench switch to the root ("/") view
b) Edit
/system/modules/com.bearingpoint.opencms.workflow2/config/spring/DataSource.xml
c) Configure the database connection section (URL, user, password):
<bean id="workflow.dataSource"
class="
org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>com.mysql.jdbc.Driver
</value></property>
<property
name="url"><value>jdbc:mysql://localhost:3306/workflow2?useServerPrepStmts=false&jdbcCompliantTruncation=false</value></property>
<property name="username"><value>root</value></property>
<property name="password"><value>rootx</value></property>
</bean>
d) In some cases you also have to change the Hibernate settings
within
this file (Especially when you are using an database other than
MySQL)
e) Save and quit the editor. Publish the VFS resource.
5. Configure the opencms-workplace.xml for new context menu entries to
approve/reject resources
respectively to create tasks if an workflow engine is attached. Inside
the folder <patches>
you can find an example opencms-workplace.xml. There is also a patch to
modify your OpenCms
sources within Eclipse. If you have a zipped OpenCms distrubution and/or
a customized
workplace configuration it is recommended to do it manually:
a) To approve/reject resources/task this packages offers a new
context menu entry.
To add the context menu action you have to add following definiton
to your
workplace-config.xml:
<!-- WORKFLOW2 ITEM -->
<entry key="GUI_EXPLORER_CONTEXT_COPYTOPROJECT_0"
uri="commons/movetoproject.jsp" rule="movetoproject"/>
Note: Unfortunately workflow for folder doesn't work at the
moment. For that
reason bypass the entry at the folder-section.
b) The workflow2 packages introduces a new menu item rule (MIR)
which is called
"
com.bearingpoint.opencms.workflow2.cms.CmsMirPrBelongsToOtherInvisible"
This rule deactives the regarding context menu items if the
refering resource
doesn't belong to the current project.
For example this type of rule would be
applied to the "Publish" functionality if the current user
is just an author
and no publisher.
Insert the new rule at the menu rules section:
<menurule name="movetoproject">
<menuitemrule class="
com.bearingpoint.opencms.workflow2.cms.CmsMirPrBelongsToOtherInvisible" />
</menurule>
c) Furthermore all other context menu actions should not be
available if the
resource belongs to another project. For that reason we
have to insert the
"CmsMirPrBelongsToOtherInvisible" rule to all menu rule
definitions
(note: it has to be at the first position if there are
other MIRs).
6. Restart your OpenCms Server
Configuration
----------------------------------------------------------------
As an example workflow we create three workflow stages:
* Authoring (Default offline project)
* Review
* Approval
Each workflow stage needs a related OpenCms project.
This means you have to move to the OpenCms Administration View
and create those projects. Afterwards the Workflow has to be
defined:
1. Inside the CMS administration select workflow2 --> Show Project Flow
2. Here you click "New Workflow Stage"
3. Select Project "Authoring" and stage 0. Confirm by clicking Ok.
4. Go on the same way with the other projects. The stage number represents
the position of the project within flow.
5. When you are finished you should have following configuration:
Offline ----> Review ----> Approval
Stage 0 Stage 1 Stage 2
6. Now you can start pushing resources between the projects.
Just right-click on a resource within the explorer view and
select "Approve/Reject".
Note: It's recommended that the resource is unlocked when you
are moving it.
Workflow Engine Interface
----------------------------------------------------------------
Task functionalities are just available if an 3rd party
workflow engine or an self implmented engine is attached.
To attach a third party workflow engine (e.g. JBoss JBPM)
the workflow2 module provides an interface to be implemented:
com.bearingpoint.opencms.workflow2.engine.I_WorkflowEngine.java
The implementation of that interface should contain simple delegation
methods to the engine.
2. Add the Workflow Engine Beans declaration to your spring-config.xml
a) Inside the OpenCms workbench switch to the root ("/") view
b) Edit
/system/modules/com.bearingpoint.opencms.workflow2/config/spring/spring-
config.xml
c) Add following line to the other Spring Config Locations:
<SpringConfigFileLocation>opencms:WorkflowEngineBeans.xml
</SpringConfigFileLocation>
d) Save & Exit editor + publish VFS resource.
3. Set the correct Workflow Engine Connector Class:
a) Inside the OpenCms workbench switch to the root ("/") view
b) Edit
/system/modules/com.bearingpoint.opencms.workflow2/config/spring/WorkflowEngineBeans.xml.xml
c) Update the class attribute with your desired class file:
<bean id="workflow.workflowEngine"
class="
com.bearingpoint.opencms.workflow2.engine.jbpm.JBPMEngineFacade">
</bean>
d) Save & Exit editor + publish VFS resource.
4. Restart OpenCms Server
FAQ
----------------------------------------------------------------
Q: When importing any of these OpenCms Modules I receive an error
message like "Caused by: com.mysql.jdbc.PacketTooBigException:
Packet for query is too large (1980691 > 1048576)."
A: The packet size of your database is to small! =) For example in
case of an MySQL database you have to change this value inside
the my.ini file. E.g. insert "max_allowed_packet = 16M" at the end
of your MySQL configuration.
--
Q: When switching to the Workflow2 Administration Panel I get an
error message saying: "java.lang.NullPointerException
at com.bearingpoint.opencms.commons.springmanager.SpringManager
.getBean(SpringManager.java:160)"
or "ERROR initializing SpringManager: Error creating bean.."
A: Possibly the configuration for your Workflow Engine connector is
not valid respectively the configured class file is not available.
If you don't have any engine implementation you have to avoid the
loading of your engine bean definition (!) inside the spring-config.xml
For details see chapter "Workflow Engine Interface".
Legal / License
----------------------------------------------------------------
This package is distributed under the LGPL and without any
warranty. For details see license.txt
Contact
----------------------------------------------------------------
If you have any concerns, questions or contributions contact
me at "david.trattnig (at) gmail (dot) com"
On Nov 28, 2007 8:55 PM, Marc Fiévet <marc at fievet.be> wrote:
> Hi,
>
> Thanks for you clear explanations but, in attachment I dont's see a
> readme.txt. I only see opencms-workplace.xml and
> opencms7_workplace-patch_workflow2.txt
>
> Kind regards,
> MARC
>
> -----Message d'origine-----
> *De :* opencms-dev-bounces at opencms.org [mailto:
> opencms-dev-bounces at opencms.org] *De la part de* David Trattnig
> *Envoyé :* mercredi 28 novembre 2007 9:29
> *À :* The OpenCms mailing list
> *Objet :* Re: [opencms-dev] RE : New OpenCms 7 Workflow Module
>
> Another note: If you don't want to customize the opencms-workplace.xmlmanually the modified one can be found in the patches folder inside SVN.
> I've also attached it plus an eclipse patch file.
>
> If anything is unclear just ask ;-)
>
> cheers
> david
>
>
> On Nov 28, 2007 9:16 AM, David Trattnig <david.trattnig at gmail.com> wrote:
>
> > Right, installation is nearly as simple:
> >
> > 1) import following modules:
> > bearingpoint commons (http://downloads.sourceforge.net/bp-cms-commons/com.bearingpoint.opencms.commons_0.9.5.zip?use_mirror=heanet
> > )
> > bearingpoint commons springmanager (http://downloads.sourceforge.net/bp-cms-commons/com.bearingpoint.opencms.commons.springmanager_0.9.5.zip?use_mirror=heanet
> > )
> > bearingpoint workflow2 (http://downloads.sourceforge.net/bp-cms-commons/com.bearingpoint.opencms.workflow2_0.3.8.zip?use_mirror=osdn
> > )
> >
> > 2) set your database URL/user/password for workflow related things (-->
> > see attached readme.txt), if the target database doesn't exist you have
> > to create it.
> >
> > 3) add some context menu entries to your "opencms-workplace.xml" or
> > replace with the provided one (--> see attached readme.txt)
> >
> > 4) restart your tomcat / OpenCms server
> >
> > all framework libraries as Spring, Hibernate and so on are included.
> >
> > rgds
> > david
> >
> >
> >
> > On Nov 27, 2007 8:18 PM, Marc Fiévet <marc at fievet.be> wrote:
> >
> > > Hi list,
> > >
> > > The installation is managed by the import/ module function? Any other
> > > file / Framework is mandatory to use it?
> > >
> > > Thanks
> > >
> > > Regards
> > > MARC
> > >
> > > -----Message d'origine-----
> > > *De :* opencms-dev-bounces at opencms.org [mailto:
> > > opencms-dev-bounces at opencms.org] *De la part de* David Trattnig
> > > *Envoyé :* mardi 27 novembre 2007 9:38
> > > *À :* The OpenCms mailing list
> > > *Objet :* Re: [opencms-dev] New OpenCms 7 Workflow Module
> > >
> > > Okay :) Here you go - Featurelist:
> > >
> > > * Administration panel for setting up workflows: Workflows are defined
> > > as a specific order of OpenCms projects. So you can easily configure 4 to N
> > > eyes workflows within OpenCms. The main advantage of this implementation is
> > > that it utilizes exiting OpenCms functionalities.
> > >
> > > * Within the OpenCms Explorer you can move resources between the
> > > projects with a new context menu entry "Approve/Reject" which means changing
> > > the workflow state. Here the different projects (workflow states) should be
> > > overlapping. So you can see within e.g. workflow state "Offline" which
> > > resources are in e.g workflow state/project "Review" but you can't
> > > edit them until you switch to project "Review". Precondition is that you
> > > have the proper rights for this project.
> > >
> > > * This is another pro: As the OpenCms Groups/Permissions can be
> > > applied to projects they are also affecting workflow states.
> > >
> > > * By using the Project List functionalities within the OpenCms
> > > administration panel you can get a quick overview which resources are in an
> > > specific workflow state.
> > >
> > > * The module offers a Java Interface for implementing a connection to
> > > your favourite workflow engine. For example I'm using it to access JBPM. If
> > > you have implemented this interface you can attach it to the workflow module
> > > via a given Spring configuration file. From now on the workflow module
> > > features are extended by an Taskview (GUI not finished yet) inside the
> > > OpenCms view dropdown box (Explorer / Administration / Tasks). This taskview
> > > lists all personal task / your groups tasks. In case of an Administrator it
> > > lists all available tasks.
> > >
> > > * Events: It's possible to catch workflow state change events.
> > >
> > > As I have not much time at the moment I can't give details on
> > > development plans. But bugs should be fixed as soon as possible and I'm open
> > > for improvement discussions. For a list of things which would be nice for a
> > > final release check out the " todo.txt" within the SVN.
> > >
> > > Cheers,
> > > David
> > >
> > > On Nov 26, 2007 6:03 PM, Roedel, Mark <MarkRoedel at letu.edu> wrote:
> > >
> > > > Congratulations on the release! Is there anything you'd like to
> > > > tell us about its features, capabilities, your goals for development, etc.?
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Mark Roedel
> > > >
> > > > Senior Programmer / Analyst
> > > >
> > > > LeTourneau University
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > *From:* opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org]
> > > > *On Behalf Of *David Trattnig
> > > > *Sent:* Monday, November 26, 2007 7:59 AM
> > > > *To:* The OpenCms mailing list
> > > > *Subject:* [opencms-dev] New OpenCms 7 Workflow Module
> > > >
> > > >
> > > >
> > > > Here you can find the first release of my OpenCms Workflow package:
> > > > https://sourceforge.net/project/showfiles.php?group_id=180314&package_id=245006&release_id=557034
> > > >
> > > >
> > > > cheers
> > > > David
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > This mail is sent to you from the opencms-dev mailing list
> > > > To change your list options, or to unsubscribe from the list, please
> > > > visit
> > > > http://lists.opencms.org/mailman/listinfo/opencms-dev
> > > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > This mail is sent to you from the opencms-dev mailing list
> > > To change your list options, or to unsubscribe from the list, please
> > > visit
> > > http://lists.opencms.org/mailman/listinfo/opencms-dev
> > >
> >
> >
> >
> >
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
--
David Trattnig
tel | +43 650 8855388
w1 | www.bearingpoint.com
w2 | www.bitfusion.org
px | www.flickr.com/photos/david-trattnig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20071129/2459400c/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: readme.txt
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20071129/2459400c/attachment.txt>
More information about the opencms-dev
mailing list