mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
A pair of aspect definitions for tagging XForms templates and
related transformers. Should be enough to get rid of current configuration file. Minor checkpoint of WCM workflow work. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4011 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -422,6 +422,7 @@
|
||||
<value>alfresco/model/recordsModel.xml</value>
|
||||
<value>alfresco/model/bpmModel.xml</value>
|
||||
<value>alfresco/model/workflowModel.xml</value>
|
||||
<value>alfresco/model/wcmModel.xml</value>
|
||||
|
||||
<!-- Implementation models -->
|
||||
<value>org/alfresco/repo/security/authentication/userModel.xml</value>
|
||||
|
70
config/alfresco/model/wcmModel.xml
Normal file
70
config/alfresco/model/wcmModel.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<model name="wcm:wcmmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
||||
|
||||
<description>WCM Specific Types</description>
|
||||
<author>Alfresco</author>
|
||||
<published>2006-10-06</published>
|
||||
<version>1.0</version>
|
||||
|
||||
<imports>
|
||||
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
|
||||
</imports>
|
||||
|
||||
<namespaces>
|
||||
<namespace uri="http://www.alfresco.org/model/wcmmodel/1.0" prefix="wcm"/>
|
||||
</namespaces>
|
||||
|
||||
<types>
|
||||
</types>
|
||||
|
||||
<aspects>
|
||||
|
||||
<!-- An XForms capture template aspect. -->
|
||||
|
||||
<aspect name="wcm:template">
|
||||
<title>XForms Template</title>
|
||||
<properties>
|
||||
<property name="wcm:roottagname">
|
||||
<title>Root Tag Name</title>
|
||||
<type>d:text</type>
|
||||
<mandatory>true</mandatory>
|
||||
</property>
|
||||
</properties>
|
||||
<associations>
|
||||
<association name="wcm:templateoutputmethods">
|
||||
<title>Template Output Methods</title>
|
||||
<source>
|
||||
<role>wcm:capture</role>
|
||||
<mandatory>false</mandatory>
|
||||
<many>false</many>
|
||||
</source>
|
||||
<target>
|
||||
<class>wcm:templateoutputmethod</class>
|
||||
<role>wcm:presentation</role>
|
||||
<mandatory>false</mandatory>
|
||||
<many>true</many>
|
||||
</target>
|
||||
</association>
|
||||
</associations>
|
||||
</aspect>
|
||||
|
||||
<!-- An XML to something else transformer. -->
|
||||
|
||||
<aspect name="wcm:templateoutputmethod">
|
||||
<title>XML Transformer</title>
|
||||
<properties>
|
||||
<property name="wcm:outputtype">
|
||||
<title>Type</title>
|
||||
<type>d:text</type>
|
||||
<mandatory>true</mandatory>
|
||||
</property>
|
||||
<property name="wcm:templatesource">
|
||||
<title>Template Source</title>
|
||||
<type>d:noderef</type>
|
||||
<mandatory>true</mandatory>
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
</aspects>
|
||||
|
||||
</model>
|
26
source/java/org/alfresco/model/WCMModel.java
Normal file
26
source/java/org/alfresco/model/WCMModel.java
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.alfresco.model;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* QName definitions for WCM.
|
||||
* @author britt
|
||||
*/
|
||||
public interface WCMModel
|
||||
{
|
||||
public static final String WCM_MODEL_URI = "http://www.alfresco.org/model/wcmmodel/1.0";
|
||||
public static final String WCM_MODEL_PREFIX = "wcm";
|
||||
|
||||
// The XForms data capture template aspect.
|
||||
public static final QName ASPECT_TEMPLATE = QName.createQName(WCM_MODEL_URI, "template");
|
||||
public static final QName PROP_ROOT_TAG_NAME = QName.createQName(WCM_MODEL_URI, "roottagname");
|
||||
public static final QName ASSOC_TEMPLATE_OUTPUT_METHODS = QName.createQName(WCM_MODEL_URI, "templateoutputmethods");
|
||||
|
||||
// An XML to something else tranformer aspect.
|
||||
public static final QName ASPECT_TEMPLATE_OUTPUT_METHOD = QName.createQName(WCM_MODEL_URI, "templateoutputmethod");
|
||||
public static final QName PROP_OUTPUT_TYPE = QName.createQName(WCM_MODEL_URI, "outputtype");
|
||||
public static final QName PROP_TEMPLATE_SOURCE = QName.createQName(WCM_MODEL_URI, "templatesource");
|
||||
}
|
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package org.alfresco.repo.avm.actions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.action.ParameterDefinitionImpl;
|
||||
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.action.Action;
|
||||
import org.alfresco.service.cmr.action.ParameterDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* This action knows how to start an AVM specific workflow.
|
||||
* @author britt
|
||||
*/
|
||||
public class StartAVMWorkflowAction extends ActionExecuterAbstractBase
|
||||
{
|
||||
public static final String NAME = "start-avm-workflow";
|
||||
public static final String PARAM_STORE_NAME = "store-name";
|
||||
public static final String PARAM_WORKFLOW_NAME = "workflow-name";
|
||||
|
||||
/**
|
||||
* Reference to workflow service.
|
||||
*/
|
||||
private WorkflowService fWorkflowService;
|
||||
|
||||
/**
|
||||
* Set the workflow service.
|
||||
* @param service The workflow service.
|
||||
*/
|
||||
public void setWorkflowService(WorkflowService service)
|
||||
{
|
||||
fWorkflowService = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public StartAVMWorkflowAction()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Start an AVM specific workflow.
|
||||
* @param action The action instance.
|
||||
* @param actionedUponNodeRef This should be an AVM folder that contains
|
||||
* the nodes to be flowed.
|
||||
*/
|
||||
@Override
|
||||
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
|
||||
{
|
||||
String workflowName = (String)action.getParameterValue(PARAM_WORKFLOW_NAME);
|
||||
String storeName = (String)action.getParameterValue(PARAM_STORE_NAME);
|
||||
WorkflowDefinition def = fWorkflowService.getDefinitionByName(name);
|
||||
NodeRef workflowPackage = fWorkflowService.createPackage(actionedUponNodeRef);
|
||||
Map<QName, Serializable> wfParams = new HashMap<QName, Serializable>();
|
||||
wfParams.put(WorkflowModel.ASSOC_PACKAGE, workflowPackage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup any parameters for this action.
|
||||
* @param paramList The list of parameters to add to.
|
||||
*/
|
||||
@Override
|
||||
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
|
||||
{
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_STORE_NAME,
|
||||
DataTypeDefinition.TEXT,
|
||||
true,
|
||||
getParamDisplayLabel(PARAM_STORE_NAME)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_WORKFLOW_NAME,
|
||||
DataTypeDefinition.TEXT,
|
||||
true,
|
||||
getParamDisplayLabel(PARAM_WORKFLOW_NAME)));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user