org.jboss.portal.cms.workflow
Class ApprovePublishImpl

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.portal.jems.as.system.AbstractJBossService
              extended by org.jboss.portal.cms.workflow.ApprovePublishImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ApprovePublish, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class ApprovePublishImpl
extends AbstractJBossService
implements ApprovePublish

Created on : Dec 19, 2006

Author:
Sohil Shah - sohil.shah@jboss.com

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
ApprovePublishImpl()
           
 
Method Summary
 java.util.Collection getAllPendingInQueue()
          Retrieves a queue of unapproved content for everything in the CMS.
 java.lang.String getBody()
           
 java.lang.String getFrom()
           
 IdentityServiceController getIdentityServiceController()
           
 java.lang.String getJNDIName()
           
 java.lang.String getManagerRoles()
           
 java.util.Set getManagers()
          Returns role names of Roles that are designated to be Managers in this workflow.
 java.util.Collection getPendingQueue(java.lang.String filePath)
          Retrieves a queue of unapproved content associated with the specified file in the CMS
 java.lang.String getProcess()
           
 java.lang.String getSubject()
           
 WorkflowService getWorkflowService()
           
 boolean isOverwrite()
           
 void processManagerResponse(long processId, java.lang.String manager, boolean approved)
          Called when a manager either approves or rejects the publishing of a specific content to go live
 long requestApproval(Content content)
          Called when content is added to the CMS, and needs to be approved by the managers before it can be published to go live
 void setBody(java.lang.String body)
           
 void setFrom(java.lang.String from)
           
 void setIdentityServiceController(IdentityServiceController identityServiceController)
           
 void setJNDIName(java.lang.String jndiName)
           
 void setManagerRoles(java.lang.String managerRoles)
           
 void setOverwrite(boolean overwrite)
           
 void setProcess(java.lang.String process)
           
 void setSubject(java.lang.String subject)
           
 void setWorkflowService(WorkflowService workflowService)
           
 void startService()
           
 void stopService()
           
 
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService
create, destroy, getState, getStateString, start, stop
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
createService, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApprovePublishImpl

public ApprovePublishImpl()
Method Detail

startService

public void startService()
                  throws java.lang.Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

stopService

public void stopService()
                 throws java.lang.Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

getWorkflowService

public WorkflowService getWorkflowService()
Returns:

setWorkflowService

public void setWorkflowService(WorkflowService workflowService)
Parameters:
workflowService -

getProcess

public java.lang.String getProcess()
Returns:

setProcess

public void setProcess(java.lang.String process)
Parameters:
process -

getManagerRoles

public java.lang.String getManagerRoles()
Returns:
the managerRoles

setManagerRoles

public void setManagerRoles(java.lang.String managerRoles)
Parameters:
managerRoles - the manager managerRoles to set

isOverwrite

public boolean isOverwrite()
Returns:
the overwrite

setOverwrite

public void setOverwrite(boolean overwrite)
Parameters:
overwrite - the overwrite to set

getJNDIName

public java.lang.String getJNDIName()
Returns:

setJNDIName

public void setJNDIName(java.lang.String jndiName)
Parameters:
jndiName -

getIdentityServiceController

public IdentityServiceController getIdentityServiceController()

setIdentityServiceController

public void setIdentityServiceController(IdentityServiceController identityServiceController)
Parameters:
identityServiceController -

getBody

public java.lang.String getBody()
Returns:
the body

setBody

public void setBody(java.lang.String body)
Parameters:
body - the body to set

getFrom

public java.lang.String getFrom()
Returns:
the from

setFrom

public void setFrom(java.lang.String from)
Parameters:
from - the from to set

getSubject

public java.lang.String getSubject()
Returns:
the subject

setSubject

public void setSubject(java.lang.String subject)
Parameters:
subject - the subject to set

requestApproval

public long requestApproval(Content content)
                     throws WorkflowException
Called when content is added to the CMS, and needs to be approved by the managers before it can be published to go live

Specified by:
requestApproval in interface ApprovePublish
Parameters:
content -
Returns:
returns the process id of the workflow process set in motion
Throws:
WorkflowException

processManagerResponse

public void processManagerResponse(long processId,
                                   java.lang.String manager,
                                   boolean approved)
                            throws WorkflowException
Called when a manager either approves or rejects the publishing of a specific content to go live

Specified by:
processManagerResponse in interface ApprovePublish
Parameters:
processId -
manager - userId of the manager
approved - true if approved, false if rejected
Throws:
WorkflowException

getPendingQueue

public java.util.Collection getPendingQueue(java.lang.String filePath)
                                     throws WorkflowException
Retrieves a queue of unapproved content associated with the specified file in the CMS

Specified by:
getPendingQueue in interface ApprovePublish
Parameters:
filePath -
Returns:
Throws:
WorkflowException

getAllPendingInQueue

public java.util.Collection getAllPendingInQueue()
                                          throws WorkflowException
Retrieves a queue of unapproved content for everything in the CMS.

Specified by:
getAllPendingInQueue in interface ApprovePublish
Returns:
Throws:
WorkflowException

getManagers

public java.util.Set getManagers()
Description copied from interface: ApprovePublish
Returns role names of Roles that are designated to be Managers in this workflow. Managers approve/deny all content publish requests before the content goes live in the CMS

Specified by:
getManagers in interface ApprovePublish
Returns: