[opencms-dev] User management - accept before publish

Steve Bryan steve at bright-interactive.com
Tue Apr 6 11:40:41 CEST 2010


Hi Kareem

You can do two things to implement a simple workflow like this:

1. Have two groups, editors and publishers. Editors are given read and write
but not publish permission on the relevant folders.

2. Implement an EditNotifier module.
a) You could have it notify when ever edits are made to files in the folder,
however I think this will send too many emails!

To do this implement a class like this, and register as the module startup
class. This registers the resource modified listener code that will get run
whenever a resource is modified.

class NotifyModuleAction extends A_CmsModuleAction
{
	public void cmsEvent(CmsEvent a_event)
	{
		int iEventType = a_event.getType();
     	Map map = a_event.getData();
     	
		switch (iEventType) 
		{
         case I_CmsEventListener.EVENT_RESOURCE_MODIFIED:
         	CmsResource res = (CmsResource) map.get("resource");
         	String sName = res.getName();
         	
		// code to email publishers that resource is edited
            break;
		}
     
		super.cmsEvent(a_event);
	}
}

b) I found it better to implement a scheduled task eg EditedResourceNotifer,
which runs periodically and checks for resources modified in the last
period, aggregates into a report and emails this to the publishers. This
could run every few hours or so. 

There is code you can use or adapt in org.opencms.notification to do this -
check out the source code. By default this supports notifications to
'responsibles' of old or expiring content, but you can adapt it to search
over content that has recently been edited, then send emails to a publisher
group. See the following for a very rough manual on how to use this feature
(which imho is a bit rubbish as it stands :-)).
http://opencms-wiki.org/Workflow_in_core_OpenCms

Steve

 


-----Original Message-----

Date: Sun, 4 Apr 2010 15:05:51 +0300
From: "Kareem Jabr" <KareemJ at git.ae>
Subject: [opencms-dev] User management - accept before publish
To: <opencms-dev at opencms.org>
Message-ID: <003301cad3ef$2df1b460$89d51d20$@ae>
Content-Type: text/plain; charset="us-ascii"

Hi List,

 

Suppose I have a group of users, I don't want to let these users to PUBLISH
their changes directly. The project manager should be notified first someway
and he/she will accept whether the change should go online or not.

 

Thanks,

Kareem





More information about the opencms-dev mailing list