summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-07-17 04:01:08 (EDT)
committerManik Kishore2012-07-19 01:37:49 (EDT)
commit6bf148dc5a14b4f2def28d3ffd9d14e83ff3888c (patch)
tree9172408b89b857487fcdbbd388d6245163d4adcb
parentd5b628dbb3e2752f939cd16db06d8b765b39cf7b (diff)
downloadorg.eclipse.stardust.ide-6bf148dc5a14b4f2def28d3ffd9d14e83ff3888c.zip
org.eclipse.stardust.ide-6bf148dc5a14b4f2def28d3ffd9d14e83ff3888c.tar.gz
org.eclipse.stardust.ide-6bf148dc5a14b4f2def28d3ffd9d14e83ff3888c.tar.bz2
CRNT-25176 Create Cross Modeling testcases
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@57700 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/strategy/SimpleManagementStrategy.java165
1 files changed, 0 insertions, 165 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/strategy/SimpleManagementStrategy.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/strategy/SimpleManagementStrategy.java
deleted file mode 100644
index 586983f..0000000
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/strategy/SimpleManagementStrategy.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 SunGard CSA LLC and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SunGard CSA LLC - initial API and implementation and/or initial documentation
- *******************************************************************************/
-
-package org.eclipse.stardust.model.xpdl.builder.strategy;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.stardust.engine.api.runtime.DmsUtils;
-import org.eclipse.stardust.engine.api.runtime.Document;
-import org.eclipse.stardust.engine.api.runtime.DocumentInfo;
-import org.eclipse.stardust.engine.api.runtime.DocumentManagementService;
-import org.eclipse.stardust.engine.api.runtime.Folder;
-import org.eclipse.stardust.engine.api.runtime.ServiceFactory;
-import org.eclipse.stardust.engine.api.runtime.ServiceFactoryLocator;
-import org.eclipse.stardust.model.xpdl.builder.strategy.AbstractModelManagementStrategy;
-import org.eclipse.stardust.model.xpdl.builder.utils.XpdlModelIoUtils;
-import org.eclipse.stardust.model.xpdl.carnot.ModelType;
-
-/**
- *
- * @author Marc.Gille
- *
- */
-public class SimpleManagementStrategy extends
- AbstractModelManagementStrategy {
-
- private static final String MODELS_DIR = "/process-models/";
-
- private ServiceFactory serviceFactory;
- private DocumentManagementService documentManagementService;
- private List<ModelType> models = new ArrayList<ModelType>();
-
-
- public Map<String, ModelType> getModels()
- {
- return getModels(true);
- }
- /**
- *
- */
- public List<ModelType> loadModels() {
- return models;
- }
-
- /**
- *
- */
- public ModelType loadModel(String id) {
- for (Iterator<ModelType> i = models.iterator(); i.hasNext();) {
- ModelType model = i.next();
- if (model.getId().equalsIgnoreCase(id)) {
- return model;
- }
- }
- return null;
- }
-
-
-
- /**
- *
- */
- public ModelType attachModel(String id) {
- ModelType model = this.loadModel(id);
- models.add(model);
- return model;
- }
-
- /**
- *
- */
- public void saveModel(ModelType model) {
- String modelContent = new String(XpdlModelIoUtils.saveModel(model));
- Document modelDocument;
-
- modelDocument = getDocumentManagementService().getDocument(
- MODELS_DIR + model.getName() + ".xpdl");
-
- if (null == modelDocument) {
- DocumentInfo docInfo = DmsUtils.createDocumentInfo(model.getName()
- + ".xpdl");
-
- docInfo.setOwner(getServiceFactory().getWorkflowService().getUser()
- .getAccount());
- docInfo.setContentType("text/xhtml");
-
- modelDocument = getDocumentManagementService().createDocument(
- MODELS_DIR, docInfo, modelContent.getBytes(), null);
-
- // Create initial version
-
- getDocumentManagementService().versionDocument(
- modelDocument.getId(), null);
- } else {
- getDocumentManagementService().updateDocument(modelDocument,
- modelContent.getBytes(), null, false, null, false);
- }
- }
-
- /**
- *
- * @param model
- */
- public void deleteModel(ModelType model) {
- Document modelDocument = getDocumentManagementService().getDocument(
- MODELS_DIR + model.getName() + ".xpdl");
-
- if (modelDocument != null)
- {
- getDocumentManagementService().removeDocument(modelDocument.getId());
- }
-
- getModels().remove(model.getId());
- }
-
- /**
- *
- */
- public void versionizeModel(ModelType model) {
- }
-
- /**
- *
- * @return
- */
- private DocumentManagementService getDocumentManagementService() {
- if (documentManagementService == null) {
- documentManagementService = getServiceFactory()
- .getDocumentManagementService();
- }
-
- return documentManagementService;
- }
-
- private ServiceFactory getServiceFactory() {
- // TODO Replace
-
- if (serviceFactory == null) {
- serviceFactory = ServiceFactoryLocator.get("motu", "motu");
- }
-
- return serviceFactory;
- }
-
- /**
- *
- * @param modelDocument
- * @return
- */
- private byte[] readModelContext(Document modelDocument) {
- return getDocumentManagementService().retrieveDocumentContent(
- modelDocument.getId());
- }
-}