summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Pielmann2013-03-05 09:28:10 (EST)
committerSven Rottstock2013-03-11 06:39:06 (EDT)
commit1e4fbeea0897975e6dbb803b89e02192c6391992 (patch)
tree79689720b72e5fc629a77702f82e1670094024f9
parente9b9e3d15f83fcb846170b5f03e7a69e86e69161 (diff)
downloadorg.eclipse.stardust.ui.web-1e4fbeea0897975e6dbb803b89e02192c6391992.zip
org.eclipse.stardust.ui.web-1e4fbeea0897975e6dbb803b89e02192c6391992.tar.gz
org.eclipse.stardust.ui.web-1e4fbeea0897975e6dbb803b89e02192c6391992.tar.bz2
CRNT-26029 Pepper: 'Style', 'Protocol' and 'Use' field remains blank after loading WSDL url.
git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@63503 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java161
1 files changed, 87 insertions, 74 deletions
diff --git a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
index de26abd..f8cdf91 100644
--- a/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
+++ b/web-modeler/src/main/java/org/eclipse/stardust/ui/web/modeler/service/ModelService.java
@@ -70,6 +70,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
+import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import org.eclipse.stardust.common.Predicate;
@@ -149,9 +150,9 @@ import org.eclipse.stardust.ui.web.modeler.portal.JaxWSResource;
import org.eclipse.stardust.ui.web.modeler.spi.ModelBinding;
/**
- *
+ *
* @author Shrikant.Gangal, Marc.Gille
- *
+ *
*/
public class ModelService
{
@@ -379,7 +380,7 @@ public class ModelService
/**
* Removes the modeling session from cached list when user session ends. TODO -
* commented pending review by Robert S
- *
+ *
*/
@PreDestroy
public void destroyModelingSession()
@@ -391,7 +392,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
public ModelManagementStrategy getModelManagementStrategy()
@@ -406,7 +407,7 @@ public class ModelService
/**
* Only used for ORION integration
- *
+ *
* @param modelManagementStrategy
*/
public void setModelManagementStrategy(ModelManagementStrategy modelManagementStrategy)
@@ -420,7 +421,7 @@ public class ModelService
}
/**
- *
+ *
* @param attrs
* @param attrType
*/
@@ -437,7 +438,7 @@ public class ModelService
}
/**
- *
+ *
* @param json
* @param element
* @throws JSONException
@@ -472,7 +473,7 @@ public class ModelService
}
/**
- *
+ *
* @param model
* @param processDefinition
* @return
@@ -483,7 +484,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
public List<User> getNotInvitedUsers()
@@ -537,7 +538,7 @@ public class ModelService
}
/**
- *
+ *
* @param account
* @return
*/
@@ -581,12 +582,12 @@ public class ModelService
/**
* Invite Mechanism works the following:
- *
+ *
* When the user is logged in any messages can be broadcasted directly to him. The user
* recives a broadcast about a notification that he was in invited. He can decide now
* if he really wants to join the session or not. It broadcasts a JsonObject to every
* user online directly.
- *
+ *
* @param userAccountList
* A list of all invited users provided by the icefaces backing bean
* @param sessionOwnerId
@@ -718,9 +719,9 @@ public class ModelService
* Uses the ModelingSessionManager to check whether a given user was invited to session
* while he was offline. Broadcasts a REQUEST_JOIN_JSON Object back to the requester
* specified through the username.
- *
+ *
* @param username
- *
+ *
*/
public void getOfflineInvites(String username)
{
@@ -783,7 +784,7 @@ public class ModelService
/**
* Retrieves all the stored models and returns a json array of references of these
* getModelManagementStrategy().getModels().
- *
+ *
* @return
*/
public String getAllModels(boolean reload)
@@ -820,7 +821,7 @@ public class ModelService
}
/**
- *
+ *
* @param httpRequest
* @param modelId
* @return
@@ -847,7 +848,7 @@ public class ModelService
* changedModels) { ModelType model =
* getModelManagementStrategy().getModels().get(modelId); if (null != model) {
* getModelManagementStrategy().saveModel(model); } }
- *
+ *
* //Clear the unsaved models' list.
* UnsavedModelsTracker.getInstance().notifyAllModelsSaved();
*/
@@ -871,7 +872,7 @@ public class ModelService
}
/**
- *
+ *
* @param id
* @return
*/
@@ -882,7 +883,7 @@ public class ModelService
/**
* TODO - This should probably be delegated to the model management strategy?
- *
+ *
* @param id
* @return
*/
@@ -893,7 +894,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @param id
* @param postedData
@@ -928,7 +929,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @param processId
* @param activityId
@@ -963,7 +964,7 @@ public class ModelService
}
/**
- *
+ *
* @param gatewaySymbol
* @param gatewaySymbolJson
* @return
@@ -1022,7 +1023,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelElementJson
* @param element
*/
@@ -1041,7 +1042,7 @@ public class ModelService
}
/**
- *
+ *
* @param orientation
* @return
*/
@@ -1068,9 +1069,9 @@ public class ModelService
}
/**
- *
+ *
* TODO From DynamicConnectionCommand. Refactor?
- *
+ *
* @param activity
* @return
*/
@@ -1112,7 +1113,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @param processId
* @param connectionId
@@ -1188,7 +1189,7 @@ public class ModelService
}
/**
- *
+ *
* @param poolSymbol
* @param poolSymbolJson
* @return
@@ -1224,7 +1225,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @param processId
* @param postedData
@@ -1254,7 +1255,7 @@ public class ModelService
}
/**
- *
+ *
* @param laneSymbol
* @param laneSymbolJson
* @return
@@ -1447,7 +1448,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @param processId
* @param postedData
@@ -1479,7 +1480,7 @@ public class ModelService
public void createWrapperProcess(String modelId, JsonObject json)
{
ModelType model = findModel(modelId);
-
+
// Create process definition
ProcessDefinitionType processDefinition = getModelBuilderFacade().createProcess(
@@ -1487,32 +1488,32 @@ public class ModelService
"Default");
// TODO Correct flags
-
+
if (extractBoolean(json, "createWebService"))
{
if (extractBoolean(json, "createRestService"))
{
getModelBuilderFacade().setAttribute(processDefinition,
- "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
+ "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
}
else
{
getModelBuilderFacade().setAttribute(processDefinition,
- "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
+ "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
}
}
else
{
getModelBuilderFacade().setAttribute(processDefinition,
- "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
+ "carnot:engine:externalInvocationType", PredefinedConstants.PROCESSINTERFACE_INVOCATION_BOTH);
}
// TODO Find out flag
-
+
if (extractBoolean(json, "transientProcess"))
{
getModelBuilderFacade().setAttribute(processDefinition,
- "????", "????");
+ "????", "????");
}
LaneSymbol parentLaneSymbol = getModelBuilderFacade().findLaneInProcess(
@@ -1866,7 +1867,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
DocumentManagementService getDocumentManagementService()
@@ -1880,7 +1881,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
private UserService getUserService()
@@ -1894,7 +1895,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
private QueryService getQueryService()
@@ -1928,7 +1929,7 @@ public class ModelService
}
/**
- *
+ *
* @param modelId
* @return
*/
@@ -2031,7 +2032,7 @@ public class ModelService
* </ul>
* </li>
* </ul>
- *
+ *
* @param postedData
* a JsonObject that contains a primitive (String) member with the name
* "wsdlUrl" that specifies the URL from where the WSDL should be loaded.
@@ -2057,7 +2058,7 @@ public class ModelService
/**
* Adds the service definitions to the parent json object.
- *
+ *
* @param webServiceJson
* the parent json object.
* @param services
@@ -2096,7 +2097,7 @@ public class ModelService
/**
* Adds port or binding definitions to the service json.
- *
+ *
* @param serviceJson
* the json object representing the parent service.
* @param ports
@@ -2149,7 +2150,7 @@ public class ModelService
/**
* Adds operation definitions to the port json.
- *
+ *
* @param portJson
* the json object representing the parent port.
* @param operations
@@ -2175,7 +2176,15 @@ public class ModelService
operationJson.addProperty("name", name);
operationJson.addProperty(WSConstants.WS_OPERATION_NAME_ATT, operation.getName());
- operationJson.addProperty("style", JaxWSResource.getOperationStyle(operation));
+ String style = JaxWSResource.getOperationStyle(operation);
+ if (style == null)
+ {
+ if ( !(portJson.get("style") instanceof JsonNull))
+ {
+ style = portJson.get("style").getAsString();
+ }
+ }
+ operationJson.addProperty("style", style);
operationJson.addProperty("use", JaxWSResource.getOperationUse(operation));
operationJson.addProperty(WS_OPERATION_INPUT_NAME_ATT, inputName);
operationJson.addProperty(WS_OPERATION_OUTPUT_NAME_ATT, outputName);
@@ -2191,13 +2200,17 @@ public class ModelService
: output.getMessage()));
operationsJson.add(name, operationJson);
+ if (portJson.get("style") instanceof JsonNull)
+ {
+ portJson.addProperty("style", style);
+ }
}
}
/**
* Computes a string containing a comma separated list of the parts composing the
* message.
- *
+ *
* @param message
* the Message
* @return the computed list of parts
@@ -2234,7 +2247,7 @@ public class ModelService
/**
* Computes a unique label for the operation by appending the input and output names to
* the operation name.
- *
+ *
* @param operation
* the BindingOperation
* @return the computed label
@@ -2339,10 +2352,10 @@ public class ModelService
* <li><code>classifier</code> a string identifying the type of the facet, i.e.
* <code>enumeration</code>, <code>pattern</code>, etc.</li>
* </ul>
- *
+ *
* Each item described above has a member <code>icon</code> that specifies the
* corresponding icon.
- *
+ *
* @param postedData
* a JsonObject that contains a primitive (String) member with the name "url"
* that specifies the URL from where the XSD should be loaded.
@@ -2653,7 +2666,7 @@ public class ModelService
}
/**
- *
+ *
* @return
*/
public JsonObject getPreferences()
@@ -2710,11 +2723,11 @@ public class ModelService
* ); postedData.addProperty("url",
* "file:/development/wks/trunk/runtime-blank/testprj/src/xsd/anf/security_master_update.xsd"
* );
- *
+ *
* //ModelService ms = new ModelService(); JsonMarshaller m = new JsonMarshaller();
* //System.out.println(m.writeJsonObject(ms.getWebServiceStructure(postedData)));
* //System.out.println(m.writeJsonObject(ms.getXsdStructure(postedData)));
- *
+ *
* org.eclipse.stardust.model.xpdl.carnot.util.WorkflowModelManager wmm = new
* org.eclipse.stardust.model.xpdl.carnot.util.WorkflowModelManager(); try {
* wmm.load(new java.io.File(
@@ -2722,26 +2735,26 @@ public class ModelService
* catch (IOException e) { e.printStackTrace(); } ModelType model = wmm.getModel();
* ModelElementMarshaller mem = new ModelElementMarshaller() { EObjectUUIDMapper mapper
* = new EObjectUUIDMapper();
- *
+ *
* @Override protected EObjectUUIDMapper eObjectUUIDMapper() { return mapper; }
- *
+ *
* @Override protected ModelManagementStrategy modelManagementStrategy() { // TODO
* Auto-generated method stub return null; } };
- *
+ *
* System.out.println(m.writeJsonObject(mem.toJson(model.getTypeDeclarations().
* getTypeDeclaration("Pattern1"))));
- *
+ *
* TypeDeclarationType typeDeclaration =
* model.getTypeDeclarations().getTypeDeclaration("Composite1"); JsonObject json =
* mem.toJson(typeDeclaration); System.out.println(m.writeJsonObject(json));
- *
+ *
* //typeDeclaration = model.getTypeDeclarations().getTypeDeclaration("Enumeration1");
* //json = mem.toJson(typeDeclaration); //System.out.println(m.writeJsonObject(json));
- *
+ *
* modifyComplexType(json); //modifyEnumType(json);
- *
+ *
* ModelElementUnmarshaller um = new ModelElementUnmarshaller() {
- *
+ *
* @Override protected ModelManagementStrategy modelManagementStrategy() { // TODO
* Auto-generated method stub return null; } }; um.populateFromJson(typeDeclaration,
* json); System.out.println(typeDeclaration); }
@@ -2753,7 +2766,7 @@ public class ModelService
* tds.getAsJsonObject("schema"); JsonObject ts = ss.getAsJsonObject("types");
* JsonObject cs = ts.getAsJsonObject("Enumeration1"); JsonObject es =
* cs.getAsJsonObject("facets");
- *
+ *
* JsonObject d = new JsonObject(); d.addProperty("name", "4"); d.addProperty("icon",
* "XSDEnumerationFacet.gif"); d.addProperty("classifier", "enumeration"); es.add("4",
* d); }
@@ -2765,11 +2778,11 @@ public class ModelService
* tds.getAsJsonObject("schema"); JsonObject ts = ss.getAsJsonObject("types");
* JsonObject cs = ts.getAsJsonObject("Composite1"); JsonObject bs =
* cs.getAsJsonObject("body"); JsonObject es = bs.getAsJsonObject("elements");
- *
+ *
* es.remove("b");
- *
+ *
* JsonObject c = es.getAsJsonObject("c"); c.addProperty("name", "NewC");
- *
+ *
* JsonObject d = new JsonObject(); d.addProperty("name", "NewD");
* d.addProperty("icon", "XSDElementDeclaration.gif"); d.addProperty("type",
* "xsd:string"); d.addProperty("cardinality", "required"); es.add("NewD", d); }
@@ -2778,27 +2791,27 @@ public class ModelService
/*
* public static void testTD() { DataChangeCommandHandler handler = new
* DataChangeCommandHandler();
- *
+ *
* org.eclipse.stardust.model.xpdl.carnot.util.WorkflowModelManager wmm = new
* org.eclipse.stardust.model.xpdl.carnot.util.WorkflowModelManager(); try {
* wmm.load(new
* java.io.File("C:\\development\\New_configuration_TRUNK\\portal5\\Test.xpdl")); }
* catch (IOException e) { e.printStackTrace(); } ModelType model = wmm.getModel();
- *
+ *
* String structId = "Composite3", structName = "Composite3";
- *
+ *
* JsonObject structJson = new JsonObject();
* structJson.addProperty(ModelerConstants.ID_PROPERTY, structId);
* structJson.addProperty(ModelerConstants.NAME_PROPERTY, structName); JsonObject
* typeDeclarationJson = new JsonObject();
* structJson.add(ModelerConstants.TYPE_DECLARATION_PROPERTY, typeDeclarationJson);
- *
+ *
* JsonObject type = new JsonObject(); typeDeclarationJson.add("type", type);
* type.addProperty("classifier", "SchemaType"); JsonObject schema = new JsonObject();
* typeDeclarationJson.add("schema", schema); JsonObject types = new JsonObject();
* schema.add("types", types); JsonObject typesType = new JsonObject();
* types.add(structId, typesType); typesType.addProperty("name", structId);
- *
+ *
* JsonObject facets = new JsonObject(); typesType.add("facets", facets); JsonObject
* facet = new JsonObject(); facet.addProperty("name", "abceee");
* facet.addProperty("classifier", "enumeration"); facets.add("facet", facet);
@@ -2814,9 +2827,9 @@ public class ModelService
* "at least one");
*/
/*
- *
+ *
* handler.createTypeDeclaration(model, structJson);
- *
+ *
* try { wmm.save(URI.createFileURI(new
* java.io.File("C:\\development\\New_configuration_TRUNK\\portal5\\Test.xpdl"
* ).getAbsolutePath())); } catch (IOException e) { // TODO Auto-generated catch block
@@ -2825,7 +2838,7 @@ public class ModelService
/**
* @return
- *
+ *
*/
public void deleteConfigurationVariable(String modelId, String variableName,
JsonObject json)