summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2012-09-10 11:08:26 (EDT)
committer Stephan Born2012-09-28 06:32:21 (EDT)
commitf9a0a050628aaf2b37f785ff39afb4e8b6fea618 (patch)
treee1e96bb89744e604f81a3d8cf22dbab757c062cb
parent131d56e9f86baf2aad22fdb6d6630bb17b2f2bed (diff)
downloadorg.eclipse.stardust.ide-f9a0a050628aaf2b37f785ff39afb4e8b6fea618.zip
org.eclipse.stardust.ide-f9a0a050628aaf2b37f785ff39afb4e8b6fea618.tar.gz
org.eclipse.stardust.ide-f9a0a050628aaf2b37f785ff39afb4e8b6fea618.tar.bz2
CRNT-26125 Pepper: ModelBuilder API - Create accesspoints for MTA / UI Mashup (Create application by using the facade)
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ide@59052 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java96
1 files changed, 77 insertions, 19 deletions
diff --git a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
index fbadfb3..209bbb1 100644
--- a/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
+++ b/model/org.eclipse.stardust.model.xpdl.builder/src/main/java/org/eclipse/stardust/model/xpdl/builder/utils/ModelBuilderFacade.java
@@ -867,12 +867,62 @@ public class ModelBuilderFacade
* @param applicationTypeID id of the application type to be set
* @return application created
*/
+// /*public ApplicationType createApplication(ModelType model, String applicationID,
+// String applicationName, String applicationTypeID)
+// {
+// ApplicationType application = AbstractElementBuilder.F_CWM.createApplicationType();
+// application.setId(applicationID);
+// application.setName(applicationName);
+// ApplicationTypeType applicationTypeType = null;
+// try
+// {
+// applicationTypeType = findApplicationTypeType(model, applicationTypeID);
+// }
+// catch (Throwable t)
+// {
+// if (applicationTypeID
+// .equalsIgnoreCase(ModelerConstants.MESSAGE_TRANSFORMATION_APPLICATION_TYPE_ID))
+// {
+// applicationTypeType = AbstractElementBuilder.F_CWM
+// .createApplicationTypeType();
+// applicationTypeType.setId(applicationTypeID);
+// applicationTypeType.setName(applicationName);
+// applicationTypeType.setIsPredefined(true);
+// long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
+// applicationTypeType.setElementOid(++maxElementOid);
+// model.getApplicationType().add(applicationTypeType);
+// }
+// if (applicationTypeID.equalsIgnoreCase(ModelerConstants.EXTERNAL_WEB_APP_CONTEXT_TYPE_KEY)) {
+// applicationTypeType = AbstractElementBuilder.F_CWM.createApplicationTypeType();
+// applicationTypeType.setId(applicationTypeID);
+// applicationTypeType.setName(applicationName);
+// //applicationTypeType.setIsPredefined(true);
+// /*long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
+// applicationTypeType.setElementOid(++maxElementOid);
+// model.getApplicationType().add(applicationTypeType);
+// //application.setInteractive(true);
+// CarnotWorkflowModelFactory factory = CarnotWorkflowModelFactory.eINSTANCE;
+// ContextType context = factory.createContextType();
+// ApplicationContextTypeType contextTypeType = AbstractElementBuilder.F_CWM.createApplicationContextTypeType();
+// contextTypeType.setName("External Web Application");
+// contextTypeType.setId("externalWebApp");
+// contextTypeType.setIsPredefined(true);
+// XpdlModelUtils.getMaxUsedOid(model);
+// contextTypeType.setElementOid(++maxElementOid);
+// model.getApplicationContextType().add(contextTypeType);
+// context.setType(contextTypeType); //TODO Add this context type to the model
+// application.getContext().add(context);*/
+// }
+// }
+// application.setType(applicationTypeType);
+// model.getApplication().add(application);
+// return application;
+// }
+
public ApplicationType createApplication(ModelType model, String applicationID,
String applicationName, String applicationTypeID)
{
ApplicationType application = AbstractElementBuilder.F_CWM.createApplicationType();
- application.setId(applicationID);
- application.setName(applicationName);
ApplicationTypeType applicationTypeType = null;
try
{
@@ -886,35 +936,43 @@ public class ModelBuilderFacade
applicationTypeType = AbstractElementBuilder.F_CWM
.createApplicationTypeType();
applicationTypeType.setId(applicationTypeID);
- applicationTypeType.setName(applicationName);
+ applicationTypeType.setName("Message Transformation Bean");
applicationTypeType.setIsPredefined(true);
long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
applicationTypeType.setElementOid(++maxElementOid);
model.getApplicationType().add(applicationTypeType);
}
- if (applicationTypeID.equalsIgnoreCase(ModelerConstants.EXTERNAL_WEB_APP_CONTEXT_TYPE_KEY)) {
- applicationTypeType = AbstractElementBuilder.F_CWM.createApplicationTypeType();
- applicationTypeType.setId(applicationTypeID);
- applicationTypeType.setName(applicationName);
- applicationTypeType.setIsPredefined(true);
- long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
- applicationTypeType.setElementOid(++maxElementOid);
- model.getApplicationType().add(applicationTypeType);
+ if (applicationTypeID
+ .equalsIgnoreCase(ModelerConstants.EXTERNAL_WEB_APP_CONTEXT_TYPE_KEY))
+ {
application.setInteractive(true);
CarnotWorkflowModelFactory factory = CarnotWorkflowModelFactory.eINSTANCE;
ContextType context = factory.createContextType();
- ApplicationContextTypeType contextTypeType = AbstractElementBuilder.F_CWM.createApplicationContextTypeType();
- contextTypeType.setName("External Web Application");
- contextTypeType.setId("externalWebApp");
- contextTypeType.setIsPredefined(true);
- XpdlModelUtils.getMaxUsedOid(model);
- contextTypeType.setElementOid(++maxElementOid);
- model.getApplicationContextType().add(contextTypeType);
- context.setType(contextTypeType); //TODO Add this context type to the model
+
+ ApplicationContextTypeType contextTypeType = null;
+ try
+ {
+ contextTypeType = findApplicationContextTypeType(model,
+ ModelerConstants.EXTERNAL_WEB_APP_CONTEXT_TYPE_KEY);
+ }
+ catch (Throwable e)
+ {
+ contextTypeType = AbstractElementBuilder.F_CWM
+ .createApplicationContextTypeType();
+ contextTypeType.setName("External Web Application");
+ contextTypeType.setId("externalWebApp");
+ contextTypeType.setIsPredefined(true);
+ long maxElementOid = XpdlModelUtils.getMaxUsedOid(model);
+ contextTypeType.setElementOid(++maxElementOid);
+ model.getApplicationContextType().add(contextTypeType);
+ }
+ context.setType(contextTypeType); // TODO Add this context type to the model
application.getContext().add(context);
}
}
application.setType(applicationTypeType);
+ application.setName(applicationName);
+ application.setId(applicationID);
model.getApplication().add(application);
return application;
}