From adb1b17c1eeb184e7910383e5fff13aa98d73e3a Mon Sep 17 00:00:00 2001 From: Britt Park Date: Wed, 20 Sep 2006 22:01:37 +0000 Subject: [PATCH] Here's a skeletal workflow for the Gartner demo. Doesn't do anything besides printing a log message and showing up appropriately in task lists. The task screens aren't quite delectable but they show up. Fixed a misplaced store level property and added a new one ".website.name" to user sandbox stores so that the corresponding staging sandbox can be determined efficiently from a user sandbox. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3870 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/core-services-context.xml | 2 + .../extension/wcmwf-model-context.xml | 15 ++++ config/alfresco/workflow-context.xml | 6 ++ config/alfresco/workflow/wcmSubmit.xml | 41 +++++++++++ config/alfresco/workflow/wcmSubmitModel.xml | 63 +++++++++++++++++ .../repo/avm/wf/AVMSubmitHandler.java | 68 +++++++++++++++++++ 6 files changed, 195 insertions(+) create mode 100644 config/alfresco/extension/wcmwf-model-context.xml create mode 100644 config/alfresco/workflow/wcmSubmit.xml create mode 100644 config/alfresco/workflow/wcmSubmitModel.xml create mode 100644 source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java diff --git a/config/alfresco/core-services-context.xml b/config/alfresco/core-services-context.xml index e2df751357..fd2cb481b5 100644 --- a/config/alfresco/core-services-context.xml +++ b/config/alfresco/core-services-context.xml @@ -420,6 +420,8 @@ alfresco/model/applicationModel.xml alfresco/model/forumModel.xml alfresco/model/recordsModel.xml + alfresco/model/bpmModel.xml + alfresco/model/workflowModel.xml org/alfresco/repo/security/authentication/userModel.xml diff --git a/config/alfresco/extension/wcmwf-model-context.xml b/config/alfresco/extension/wcmwf-model-context.xml new file mode 100644 index 0000000000..8454147ec9 --- /dev/null +++ b/config/alfresco/extension/wcmwf-model-context.xml @@ -0,0 +1,15 @@ + + + + + + + + + + alfresco/workflow/wcmSubmitModel.xml + + + + + diff --git a/config/alfresco/workflow-context.xml b/config/alfresco/workflow-context.xml index 097521554a..1c61ca621e 100644 --- a/config/alfresco/workflow-context.xml +++ b/config/alfresco/workflow-context.xml @@ -22,6 +22,12 @@ text/xml false + + jbpm + alfresco/workflow/wcmSubmit.xml + text/xml + false + diff --git a/config/alfresco/workflow/wcmSubmit.xml b/config/alfresco/workflow/wcmSubmit.xml new file mode 100644 index 0000000000..d2f502a958 --- /dev/null +++ b/config/alfresco/workflow/wcmSubmit.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/config/alfresco/workflow/wcmSubmitModel.xml b/config/alfresco/workflow/wcmSubmitModel.xml new file mode 100644 index 0000000000..4255c4f718 --- /dev/null +++ b/config/alfresco/workflow/wcmSubmitModel.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + bpm:workflowTask + + + + Description + d:text + + + + Source Sandbox Path + d:text + + + + + + wcmwf:baseSubmitTask + + + + Due Date + d:date + + + + + + Assignee + + false + false + + + cm:person + true + false + + + + + + + Review + wcmwf:baseSubmitTask + + + \ No newline at end of file diff --git a/source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java b/source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java new file mode 100644 index 0000000000..9e7a5fa86e --- /dev/null +++ b/source/java/org/alfresco/repo/avm/wf/AVMSubmitHandler.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2006 Alfresco, Inc. + * + * Licensed under the Mozilla Public License version 1.1 + * with a permitted attribution clause. You may obtain a + * copy of the License at + * + * http://www.alfresco.org/legal/license.txt + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the + * License. + */ + +package org.alfresco.repo.avm.wf; + +import org.alfresco.repo.workflow.jbpm.JBPMSpringActionHandler; +import org.alfresco.service.cmr.avm.AVMService; +import org.alfresco.service.cmr.avmsync.AVMSyncService; +import org.apache.log4j.Logger; +import org.jbpm.graph.exe.ExecutionContext; +import org.springframework.beans.factory.BeanFactory; + +/** + * Performs a 'submit' operation: update from one sandbox layer to + * its corresponding staging sandbox. + * @author britt + */ +public class AVMSubmitHandler extends JBPMSpringActionHandler +{ + private static final long serialVersionUID = 7561005904505181493L; + + private static Logger fgLogger = Logger.getLogger(AVMSubmitHandler.class); + + /** + * The AVMSyncService. + */ + private AVMSyncService fAVMSyncService; + + /** + * The AVMService. + */ + private AVMService fAVMService; + + /** + * Set any bean references necessary. + * @param factory The BeanFactory from which to get beans. + */ + @Override + protected void initialiseHandler(BeanFactory factory) + { + fAVMSyncService = (AVMSyncService)factory.getBean("AVMSyncService"); + fAVMService = (AVMService)factory.getBean("AVMService"); + } + + /** + * Do the actual submit work. + * @param executionContext The jBPM context. + */ + public void execute(ExecutionContext executionContext) throws Exception + { + String avmSource = (String)executionContext.getContextInstance().getVariable("sourcePath"); + fgLogger.error("Would be submittting: " + avmSource); + } +}