mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
This is a very rudimentary version of a WCM Workflow that uses
Workflow packages. It's hooked up to the sumbit single file action in the top level website screen in an exceedingly awkard way. The UI doesn't complain about anything, nor does it display the contents of the package. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4099 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -79,17 +79,24 @@
|
|||||||
<property-sheet>
|
<property-sheet>
|
||||||
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
|
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
|
||||||
<show-property name="wcmwf:description" ignore-if-missing="false" />
|
<show-property name="wcmwf:description" ignore-if-missing="false" />
|
||||||
<show-property name="wcmwf:sourcePath" ignore-if-missing="false" />
|
<!-- <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
|
||||||
<separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
|
<show-association name="wcmwf:assignee" ignore-if-missing="false" /> -->
|
||||||
<show-association name="wcmwf:assignee" ignore-if-missing="false" />
|
|
||||||
</property-sheet>
|
</property-sheet>
|
||||||
</config>
|
</config>
|
||||||
|
|
||||||
|
<config evaluator="node-type" condition="wcmwf:setupSubmit">
|
||||||
|
<property-sheet>
|
||||||
|
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator"/>
|
||||||
|
<show-property name="wcmwf:description" ignore-if-missing="false"/>
|
||||||
|
<separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator"/>
|
||||||
|
<show-association name="wcmwf:assignee" ignore-if-missing="false"/>
|
||||||
|
</property-sheet>
|
||||||
|
</config>
|
||||||
|
|
||||||
<config evaluator="node-type" condition="wcmwf:review">
|
<config evaluator="node-type" condition="wcmwf:review">
|
||||||
<property-sheet>
|
<property-sheet>
|
||||||
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
|
<separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
|
||||||
<show-property name="wcmwf:description" ignore-if-missing="false" />
|
<show-property name="wcmwf:description" ignore-if-missing="false" />
|
||||||
<show-property name="wcmwf:sourcePath" ignore-if-missing="false" />
|
|
||||||
</property-sheet>
|
</property-sheet>
|
||||||
</config>
|
</config>
|
||||||
|
|
||||||
|
@@ -33,6 +33,7 @@ import javax.transaction.UserTransaction;
|
|||||||
|
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
import org.alfresco.repo.avm.AVMNodeConverter;
|
import org.alfresco.repo.avm.AVMNodeConverter;
|
||||||
|
import org.alfresco.repo.avm.actions.StartAVMWorkflowAction;
|
||||||
import org.alfresco.service.cmr.action.Action;
|
import org.alfresco.service.cmr.action.Action;
|
||||||
import org.alfresco.service.cmr.action.ActionService;
|
import org.alfresco.service.cmr.action.ActionService;
|
||||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||||
@@ -43,8 +44,10 @@ import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
|||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
import org.alfresco.service.cmr.search.SearchService;
|
||||||
|
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
|
import org.alfresco.util.GUID;
|
||||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.context.IContextListener;
|
import org.alfresco.web.app.context.IContextListener;
|
||||||
@@ -87,6 +90,7 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
|
|
||||||
/** Action bean Id for the AVM Submit action*/
|
/** Action bean Id for the AVM Submit action*/
|
||||||
private static final String ACTION_AVM_SUBMIT = "simple-avm-submit";
|
private static final String ACTION_AVM_SUBMIT = "simple-avm-submit";
|
||||||
|
private static final String ACTION_AVM_WORKFLOW = "start-avm-workflow";
|
||||||
|
|
||||||
/** Content Manager role name */
|
/** Content Manager role name */
|
||||||
private static final String ROLE_CONTENT_MANAGER = "ContentManager";
|
private static final String ROLE_CONTENT_MANAGER = "ContentManager";
|
||||||
@@ -127,6 +131,9 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
/** The NamespaceService bean reference. */
|
/** The NamespaceService bean reference. */
|
||||||
protected NamespaceService namespaceService;
|
protected NamespaceService namespaceService;
|
||||||
|
|
||||||
|
/** The WorkflowService bean reference. */
|
||||||
|
protected WorkflowService workflowService;
|
||||||
|
|
||||||
/** The browse bean */
|
/** The browse bean */
|
||||||
protected BrowseBean browseBean;
|
protected BrowseBean browseBean;
|
||||||
|
|
||||||
@@ -172,6 +179,15 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
this.nodeService = nodeService;
|
this.nodeService = nodeService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the workflow service
|
||||||
|
* @param service The workflow service instance.
|
||||||
|
*/
|
||||||
|
public void setWorkflowService(WorkflowService service)
|
||||||
|
{
|
||||||
|
workflowService = service;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter used by the Inline Edit XML JSP
|
* Getter used by the Inline Edit XML JSP
|
||||||
*
|
*
|
||||||
@@ -713,11 +729,28 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
FacesContext context = FacesContext.getCurrentInstance();
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
tx = Repository.getUserTransaction(context, true);
|
tx = Repository.getUserTransaction(context, false);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
Action action = this.actionService.createAction(ACTION_AVM_SUBMIT);
|
NodeRef nodeRef = getAvmActionNode().getNodeRef();
|
||||||
this.actionService.executeAction(action, getAvmActionNode().getNodeRef());
|
String name = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
|
||||||
|
NodeRef workflowPackage = this.workflowService.createPackage(null);
|
||||||
|
ChildAssociationRef childRef =
|
||||||
|
this.nodeService.createNode(workflowPackage, ContentModel.ASSOC_CONTAINS,
|
||||||
|
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||||
|
name), ContentModel.TYPE_CMOBJECT);
|
||||||
|
Map<QName, Serializable> aspectProperties = new HashMap<QName, Serializable>(1);
|
||||||
|
aspectProperties.put(ContentModel.PROP_NODE_REF, nodeRef);
|
||||||
|
NodeRef childNodeRef = childRef.getChildRef();
|
||||||
|
this.nodeService.addAspect(childNodeRef, ContentModel.ASPECT_REFERENCES_NODE, aspectProperties);
|
||||||
|
|
||||||
|
Map<String, Serializable> actionParams = new HashMap<String, Serializable>();
|
||||||
|
actionParams.put(StartAVMWorkflowAction.PARAM_WORKFLOW_NAME, "jbpm$wcmwf:submit");
|
||||||
|
Action action = this.actionService.createAction(ACTION_AVM_WORKFLOW, actionParams);
|
||||||
|
this.actionService.executeAction(action, workflowPackage);
|
||||||
|
|
||||||
|
// Action action = this.actionService.createAction(ACTION_AVM_SUBMIT);
|
||||||
|
// this.actionService.executeAction(action, getAvmActionNode().getNodeRef());
|
||||||
|
|
||||||
// commit the transaction
|
// commit the transaction
|
||||||
tx.commit();
|
tx.commit();
|
||||||
@@ -731,6 +764,7 @@ public class AVMBrowseBean implements IContextListener
|
|||||||
}
|
}
|
||||||
catch (Throwable err)
|
catch (Throwable err)
|
||||||
{
|
{
|
||||||
|
err.printStackTrace(System.err);
|
||||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||||
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), err.getMessage()), err);
|
||||||
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
|
||||||
|
@@ -53,7 +53,7 @@ body
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="/note/body">
|
<xsl:template match="/note/body">
|
||||||
<div style="width: 50%; height: 250px; border: solid 1px black; margin-top: 15px;">
|
<div style="width: 50%; height: 250px; border: solid 1px black; margin-top: 15px;">
|
||||||
<tt><xsl:value-of select="/note/subject"/></tt>
|
<tt><xsl:value-of select="/note/body"/></tt>
|
||||||
</div>
|
</div>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="/note/important">
|
<xsl:template match="/note/important">
|
||||||
|
@@ -2273,6 +2273,10 @@
|
|||||||
<property-name>actionService</property-name>
|
<property-name>actionService</property-name>
|
||||||
<value>#{ActionService}</value>
|
<value>#{ActionService}</value>
|
||||||
</managed-property>
|
</managed-property>
|
||||||
|
<managed-property>
|
||||||
|
<property-name>workflowService</property-name>
|
||||||
|
<value>#{WorkflowService}</value>
|
||||||
|
</managed-property>
|
||||||
</managed-bean>
|
</managed-bean>
|
||||||
|
|
||||||
<managed-bean>
|
<managed-bean>
|
||||||
|
Reference in New Issue
Block a user