You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2012/05/19 23:06:59 UTC
svn commit: r1340567 [1/2] - in /incubator/airavata/trunk/modules:
workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/
xbaya-gui/src/main/java/org/apache/airavata/workflow/
xbaya-gui/src/main/java/org/apache/airavata/wor...
Author: samindaw
Date: Sat May 19 21:06:56 2012
New Revision: 1340567
URL: http://svn.apache.org/viewvc?rev=1340567&view=rev
Log:
https://issues.apache.org/jira/browse/AIRAVATA-414: xbaya refactor- workflow controller/view refactoring step 2 [package rearranging, class rearranging, adding compoenent registry controller class]
Added:
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/AmazonComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentOperationReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentRegistry.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentReference.java
incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/workflow/
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/workflow/model/
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionAdvancedOptionDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ApplicationDescriptionHostAdvancedOptionDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/DescriptorEditorDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/HostDescriptionDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
- copied, changed from r1340140, incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/ServiceDescriptionDialog.java
Removed:
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/appwrapper/
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/AmazonComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentOperationReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryException.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/JCRComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/LocalComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/LocalComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/SystemComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/SystemComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/URLComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WSComponentRegistry.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WebComponentReference.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/WebComponentRegistry.java
Modified:
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/JCRRegistryWindow.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/NewJCRRegistryUserDialog.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvas.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/EditMenuItem.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/JCRBrowserPanel.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelector.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSourceTransferable.java
incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeNode.java
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/AmazonComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/AmazonComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/AmazonComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/AmazonComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.amazon.InstanceComponent;
+import org.apache.airavata.workflow.model.component.amazon.TerminateInstanceComponent;
+
+public class AmazonComponentRegistry extends ComponentRegistry {
+
+ private static final String NAME = "Amazon Components";
+
+ private Map<String, Component> componentMap;
+
+ /**
+ *
+ * Constructs a AmazonComponentRegistry.
+ *
+ */
+ public AmazonComponentRegistry() {
+ this.componentMap = new LinkedHashMap<String, Component>();
+ this.componentMap.put(InstanceComponent.NAME, new InstanceComponent());
+ this.componentMap.put(TerminateInstanceComponent.NAME, new TerminateInstanceComponent());
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getComponentReferenceList()
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() {
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ for (String name : this.componentMap.keySet()) {
+ Component component = this.componentMap.get(name);
+ SystemComponentReference componentReference = new SystemComponentReference(name, component);
+ tree.add(componentReference);
+ }
+ return tree;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentOperationReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentOperationReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentOperationReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentOperationReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,64 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+
+public class ComponentOperationReference extends ComponentReference {
+
+ private Component component;
+
+ private List<Component> components;
+
+ /**
+ * Constructs a BasicComponentReference.
+ *
+ * @param name
+ * @param component
+ */
+ public ComponentOperationReference(String name, Component component) {
+ super(name);
+ this.component = component;
+ this.components = Collections.singletonList(component);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ public Component getComponent() {
+ return this.component;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<? extends Component> getComponents() {
+ return this.components;
+ }
+
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/ComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+
+public abstract class ComponentRegistry {
+
+ /**
+ * Returns a List of hirarchical Component References. This method should refresh the list even if subclass uses the cache.
+ *
+ * @return The ComponentTreeR
+ * @throws ComponentRegistryException
+ */
+ public abstract List<ComponentReference> getComponentReferenceList() throws ComponentRegistryException;
+
+ /**
+ * Used by the ComponentTreeViewer to display a node.
+ *
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return getName();
+ }
+
+ /**
+ * @return The name to show in the tree.
+ */
+ public abstract String getName();
+
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
+
+public class JCRComponentReference extends ComponentReference {
+
+ private String wsdl;
+
+ private List<WSComponent> components;
+
+ public JCRComponentReference(String name, String wsdl) {
+ super(name);
+ this.wsdl = wsdl;
+ }
+
+ /**
+ * @throws ComponentException
+ * @throws ComponentRegistryException
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ @Deprecated
+ public Component getComponent() throws ComponentException, ComponentRegistryException {
+ return getComponents().get(0);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<WSComponent> getComponents() throws ComponentRegistryException, ComponentException {
+ if (this.components == null) {
+ this.components = WSComponentFactory.createComponents(wsdl);
+ }
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+
+import org.apache.airavata.common.registry.api.exception.RegistryException;
+import org.apache.airavata.common.registry.api.user.UserManager;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.registry.api.impl.AiravataJCRRegistry;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JCRComponentRegistry extends ComponentRegistry {
+
+ private static final Logger log = LoggerFactory.getLogger(JCRComponentRegistry.class);
+ private static final String NAME = "Application Services";
+
+ private AiravataJCRRegistry registry;
+
+ public JCRComponentRegistry(URI url, String username, String password) throws RepositoryException {
+ HashMap<String, String> map = new HashMap<String, String>();
+ map.put("org.apache.jackrabbit.repository.uri", url.toString());
+ try {
+ this.registry = new AiravataJCRRegistry(url, "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory", username,
+ password, map);
+ } catch (RepositoryException e) {
+ throw e;
+ }
+ }
+
+ static {
+ registerUserManagers();
+ }
+
+ /**
+ * to manually trigger user manager registrations
+ */
+ private static void registerUserManagers() {
+ try {
+ Class.forName("org.apache.airavata.xbaya.component.registry.jackrabbit.user.JackRabbitUserManagerWrap");
+ } catch (ClassNotFoundException e) {
+ // error in registering user managers
+ }
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getComponentReferenceList()
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() {
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ try {
+ List<ServiceDescription> services = this.registry.searchServiceDescription("");
+ for (ServiceDescription serviceDescription : services) {
+ String serviceName = serviceDescription.getType().getName();
+ JCRComponentReference jcr = new JCRComponentReference(serviceName, registry.getWSDL(serviceName));
+ tree.add(jcr);
+ }
+ } catch (RegistryException e) {
+ log.error(e.getMessage(), e);
+ } catch (Exception e) {
+ log.error(e.getMessage(), e);
+ }
+
+ return tree;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ public UserManager getUserManager() {
+ return registry.getUserManager();
+ }
+
+// public String saveDeploymentDescription(String service, String host, ApplicationDeploymentDescription app) {
+// // deploy the service on host
+// registry.deployServiceOnHost(service, host);
+//
+// // save deployment description
+// return registry.saveDeploymentDescription(service, host, app);
+// }
+
+ public AiravataRegistry getRegistry() {
+ return registry;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,75 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+
+public class LocalComponentReference extends ComponentReference {
+
+ private LocalComponentRegistry registry;
+
+ private File file;
+
+ private List<WSComponent> components;
+
+ /**
+ * Constructs a LocalComponentNode.
+ *
+ * @param name
+ * @param file
+ * @param registry
+ */
+ public LocalComponentReference(String name, File file, LocalComponentRegistry registry) {
+ super(name);
+ this.file = file;
+ this.registry = registry;
+ }
+
+ /**
+ * @throws ComponentException
+ * @throws ComponentRegistryException
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ @Deprecated
+ public Component getComponent() throws ComponentException, ComponentRegistryException {
+ return getComponents().get(0);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<WSComponent> getComponents() throws ComponentRegistryException, ComponentException {
+ if (this.components == null) {
+ this.components = this.registry.getComponents(this.file);
+ }
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/LocalComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,151 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.utils.FileConstants;
+
+public class LocalComponentRegistry extends ComponentRegistry {
+
+ private File directory;
+
+ /**
+ * Creates a LocalComponentRegistryClient
+ *
+ * @param directory
+ */
+ public LocalComponentRegistry(String directory) {
+ this(new File(directory));
+ }
+
+ /**
+ * Creates a WebComponentRegistryClient
+ *
+ * @param directory
+ * The path of the directory that contains the component files.
+ */
+ public LocalComponentRegistry(File directory) {
+ this.directory = directory;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return this.directory.toString();
+ }
+
+ /**
+ * Returns a ComponentTree.
+ *
+ * @return The ComponentTree
+ * @throws ComponentRegistryException
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() throws ComponentRegistryException {
+ try {
+ List<ComponentReference> componentTree = getComponentTree(this.directory);
+ return componentTree;
+ } catch (RuntimeException e) {
+ throw new ComponentRegistryException(e);
+ }
+ }
+
+ /**
+ * Returns a component of a specified name.
+ *
+ * @param name
+ * The name of the component. The name here is a file path
+ * relative to the directory.
+ * @return The component of a specified name
+ * @throws ComponentException
+ * @throws ComponentRegistryException
+ */
+ public WSComponent getComponent(String name) throws ComponentException,
+ ComponentRegistryException {
+ // This method is used only by unit tests.
+ File file = new File(this.directory, name);
+ return getComponents(file).get(0);
+ }
+
+ /**
+ * @param file
+ * @return The list of components defined in the specified file.
+ * @throws ComponentException
+ * @throws ComponentRegistryException
+ */
+ public List<WSComponent> getComponents(File file)
+ throws ComponentException, ComponentRegistryException {
+ try {
+ String compString = IOUtil.readFileToString(file);
+ List<WSComponent> components = WSComponentFactory
+ .createComponents(compString);
+ return components;
+ } catch (IOException e) {
+ throw new ComponentRegistryException(e);
+ }
+ }
+
+ private List<ComponentReference> getComponentTree(File dir) {
+ if (!dir.isDirectory()) {
+ throw new WorkflowRuntimeException(dir + "is not a directory.");
+ }
+
+ boolean found = false;
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ for (File file : dir.listFiles()) {
+ String fileName = file.getName();
+ if (file.isDirectory()) {
+ List<ComponentReference> subTree = getComponentTree(file);
+ if (subTree != null) {
+ found = true;
+ LocalComponentReference componentRef = new LocalComponentReference(file.getName(), file, this);
+ componentRef.getChildComponentReferences().addAll(subTree);
+ tree.add(componentRef);
+ }
+ } else if (fileName.endsWith(FileConstants.XML_SUFFIX)
+ || fileName.endsWith(FileConstants.WSDL_SUFFIX)
+ || fileName.endsWith(FileConstants.WSDL_SUFFIX2)) {
+ found = true;
+ LocalComponentReference componentReference = new LocalComponentReference(file.getName(), file, this);
+ tree.add(componentReference);
+ }
+ }
+ if (!found) {
+ // Doesn't show a directory that doesn't have any components.
+ tree = null;
+ }
+ return tree;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,63 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+
+public class SystemComponentReference extends ComponentReference {
+
+ private Component component;
+
+ private List<Component> components;
+
+ /**
+ * Constructs a SystemComponentNode.
+ *
+ * @param name
+ * @param component
+ */
+ public SystemComponentReference(String name, Component component) {
+ super(name);
+ this.component = component;
+ this.components = Collections.singletonList(component);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ public Component getComponent() {
+ return this.component;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<? extends Component> getComponents() {
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/SystemComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ExitComponent;
+import org.apache.airavata.workflow.model.component.StreamSourceComponent;
+import org.apache.airavata.workflow.model.component.SubWorkflowComponent;
+import org.apache.airavata.workflow.model.component.dynamic.DynamicComponent;
+import org.apache.airavata.workflow.model.component.system.BlockComponent;
+import org.apache.airavata.workflow.model.component.system.ConstantComponent;
+import org.apache.airavata.workflow.model.component.system.DifferedInputComponent;
+import org.apache.airavata.workflow.model.component.system.EndBlockComponent;
+import org.apache.airavata.workflow.model.component.system.EndForEachComponent;
+import org.apache.airavata.workflow.model.component.system.EndifComponent;
+import org.apache.airavata.workflow.model.component.system.ForEachComponent;
+import org.apache.airavata.workflow.model.component.system.IfComponent;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.MemoComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.component.system.ReceiveComponent;
+import org.apache.airavata.workflow.model.component.system.S3InputComponent;
+
+public class SystemComponentRegistry extends ComponentRegistry {
+
+ private static final String NAME = "System Components";
+
+ private Map<String, Component> componentMap;
+
+ /**
+ * Creates a SystemComponentRegistry.
+ */
+ public SystemComponentRegistry() {
+ // Use LinkedHashMap to preserve the order.
+ this.componentMap = new LinkedHashMap<String, Component>();
+ this.componentMap.put(InputComponent.NAME, new InputComponent());
+ this.componentMap.put(DifferedInputComponent.NAME, new DifferedInputComponent());
+ this.componentMap.put(S3InputComponent.NAME, new S3InputComponent());
+ this.componentMap.put(OutputComponent.NAME, new OutputComponent());
+ this.componentMap.put(ConstantComponent.NAME, new ConstantComponent());
+ this.componentMap.put(MemoComponent.NAME, new MemoComponent());
+ this.componentMap.put(IfComponent.NAME, new IfComponent());
+ this.componentMap.put(EndifComponent.NAME, new EndifComponent());
+ this.componentMap.put(ReceiveComponent.NAME, new ReceiveComponent());
+ this.componentMap.put(ForEachComponent.NAME, new ForEachComponent());
+ this.componentMap.put(EndForEachComponent.NAME, new EndForEachComponent());
+ this.componentMap.put(BlockComponent.NAME, new BlockComponent());
+ this.componentMap.put(EndBlockComponent.NAME, new EndBlockComponent());
+ this.componentMap.put(DynamicComponent.NAME, new DynamicComponent());
+ this.componentMap.put(StreamSourceComponent.NAME, new StreamSourceComponent());
+ this.componentMap.put(ExitComponent.NAME, new ExitComponent());
+
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ /**
+ * Returns a ComponentTree.
+ *
+ * @return The ComponentTree
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() {
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ for (String name : this.componentMap.keySet()) {
+ Component component = this.componentMap.get(name);
+ SystemComponentReference componentReference = new SystemComponentReference(name, component);
+ tree.add(componentReference);
+ }
+ return tree;
+ }
+
+ /**
+ * @param name2
+ * @param workflowComponent
+ */
+ public void addComponent(String name2, SubWorkflowComponent workflowComponent) {
+
+ this.componentMap.put(name2, workflowComponent);
+ }
+
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+
+public class URLComponentReference extends ComponentReference {
+
+ private List<WSComponent> components;
+
+ /**
+ * Constructs a URLComponentReference.
+ *
+ * @param name
+ * @param components
+ */
+ public URLComponentReference(String name, List<WSComponent> components) {
+ super(name);
+ this.components = components;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ public Component getComponent() {
+ return this.components.get(0);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<? extends Component> getComponents() {
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/URLComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,89 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlResolver;
+
+public class URLComponentRegistry extends ComponentRegistry {
+
+ private URI url;
+
+ /**
+ * Creates a URLComponentRegistry
+ *
+ * @param url
+ */
+ public URLComponentRegistry(URI url) {
+ this.url = url;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return "" + this.url;
+ }
+
+ /**
+ * @throws ComponentRegistryException
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getComponentReferenceList()
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() throws ComponentRegistryException {
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ try {
+ loadComponents(tree);
+ return tree;
+ } catch (ComponentException e) {
+ throw new ComponentRegistryException(e);
+ }
+ }
+
+ /**
+ * @throws ComponentException
+ */
+ private void loadComponents(List<ComponentReference> tree) throws ComponentException {
+ // XXX need to use wsdlResolver from xsul, not xsul5, to handle
+ // security.
+ WsdlResolver wsdlResolver = WsdlResolver.getInstance();
+ WsdlDefinitions definitions = wsdlResolver.loadWsdl(this.url);
+ List<WSComponent> components = WSComponentFactory.createComponents(WSDLUtil
+ .wsdlDefinitions3ToWsdlDefintions5(definitions));
+ String urlString = this.url.toString();
+ String name = urlString.substring(urlString.lastIndexOf('/') + 1);
+ URLComponentReference componentReference = new URLComponentReference(name, components);
+ tree.add(componentReference);
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,63 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+
+public class WSComponentReference extends ComponentReference {
+
+ private Component component;
+
+ private List<Component> components;
+
+ /**
+ * Constructs a SystemComponentNode.
+ *
+ * @param name
+ * @param component
+ */
+ public WSComponentReference(String name, Component component) {
+ super(name);
+ this.component = component;
+ this.components = Collections.singletonList(component);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ public Component getComponent() {
+ return this.component;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<? extends Component> getComponents() {
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WSComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.SubWorkflowComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlException;
+import xsul.wsdl.WsdlResolver;
+
+public class WSComponentRegistry extends ComponentRegistry {
+
+ private static final String NAME = "Web Service Components";
+
+ private Map<String, Component> componentMap;
+
+ private ComponentReference treeLeaf;
+
+ /**
+ * Create a WSComponentRegistry
+ */
+ public WSComponentRegistry() {
+
+ try {
+ URI url = new URI("http://129.79.49.210:8080/axis2/services/AmazonEC2Webservice?wsdl");
+ WsdlResolver wsdlResolver = WsdlResolver.getInstance();
+ WsdlDefinitions definitions = wsdlResolver.loadWsdl(url);
+ List<WSComponent> components = WSComponentFactory.createComponents(WSDLUtil
+ .wsdlDefinitions3ToWsdlDefintions5(definitions));
+
+ this.componentMap = new LinkedHashMap<String, Component>();
+
+ for (Component component : components) {
+ this.componentMap.put(component.getName(), component);
+ }
+
+ String urlString = url.toString();
+ String name = urlString.substring(urlString.lastIndexOf('/') + 1);
+ treeLeaf = new URLComponentReference(name, components);
+
+ } catch (ComponentException e) {
+ e.printStackTrace();
+ } catch (WsdlException e) {
+ e.printStackTrace();
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ /**
+ * Returns a ComponentTree.
+ *
+ * @return The ComponentTree
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() throws ComponentRegistryException {
+ List<ComponentReference> tree = new ArrayList<ComponentReference>();
+ tree.add(this.treeLeaf);
+ return tree;
+ }
+
+ /**
+ * @param name2
+ * @param workflowComponent
+ */
+ public void addComponent(String name2, SubWorkflowComponent workflowComponent) {
+
+ this.componentMap.put(name2, workflowComponent);
+ }
+
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentReference.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentReference.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentReference.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentReference.java Sat May 19 21:06:56 2012
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+
+public class WebComponentReference extends ComponentReference {
+
+ private List<WSComponent> components;
+
+ /**
+ * Constructs a WebComponentNode.
+ *
+ * @param name
+ * @param components
+ */
+ public WebComponentReference(String name, List<WSComponent> components) {
+ super(name);
+ this.components = components;
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
+ */
+ @Override
+ public Component getComponent() {
+ return this.components.get(0);
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
+ */
+ @Override
+ public List<? extends Component> getComponents() {
+ return this.components;
+ }
+}
\ No newline at end of file
Added: incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentRegistry.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentRegistry.java?rev=1340567&view=auto
==============================================================================
--- incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentRegistry.java (added)
+++ incubator/airavata/trunk/modules/workflow-model/src/main/java/org/apache/airavata/workflow/model/component/registry/WebComponentRegistry.java Sat May 19 21:06:56 2012
@@ -0,0 +1,190 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.apache.airavata.workflow.model.component.registry;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.text.MutableAttributeSet;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTML.Tag;
+import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.parser.ParserDelegator;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WebComponentRegistry extends ComponentRegistry {
+
+ private static final Logger logger = LoggerFactory.getLogger(WebComponentRegistry.class);
+
+ private URL url;
+
+ private List<ComponentReference> tree;
+
+ private Map<String, List<WSComponent>> componentsMap;
+
+ /**
+ * Creates a WebComponentRegistryClient
+ *
+ * @param urlString
+ * @throws MalformedURLException
+ * @throws IOException
+ */
+ public WebComponentRegistry(String urlString) throws MalformedURLException, IOException {
+ this(new URL(urlString));
+ }
+
+ /**
+ * Creates a WebComponentRegistryClient
+ *
+ * @param url
+ * The URL of the web page.
+ */
+ public WebComponentRegistry(URL url) {
+ this.url = url;
+ this.componentsMap = new HashMap<String, List<WSComponent>>();
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
+ */
+ @Override
+ public String getName() {
+ return this.url.toString();
+ }
+
+ /**
+ * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getComponentReferenceList()
+ */
+ @Override
+ public List<ComponentReference> getComponentReferenceList() throws ComponentRegistryException {
+ tree = new ArrayList<ComponentReference>();
+ parse();
+ return this.tree;
+ }
+
+ /**
+ * Returns a list of component of a specified name.
+ *
+ * @param name
+ * The name of the component. The name here is a relative URL specified in <a href="name"> tag, and is
+ * same as the name of a corresponding ComponentTree.
+ * @return The list of components of the specified name
+ */
+ public List<WSComponent> getComponents(String name) {
+ // This method is only used from a test.
+ List<WSComponent> components = this.componentsMap.get(name);
+ return components;
+ }
+
+ private void parse() throws ComponentRegistryException {
+ try {
+
+ HttpURLConnection connection = (HttpURLConnection) this.url.openConnection();
+ connection.setInstanceFollowRedirects(false);
+ connection.connect();
+
+ int count = 0;
+ // TODO checking 3 is not enough
+ while (String.valueOf(connection.getResponseCode()).startsWith("3")) {
+ String location = connection.getHeaderField("Location");
+ logger.info("Redirecting to " + location);
+ connection.disconnect();
+ this.url = new URL(location);
+ connection = (HttpURLConnection) this.url.openConnection();
+ connection.setInstanceFollowRedirects(false);
+ connection.connect();
+
+ count++;
+ if (count > 10) {
+ throw new ComponentRegistryException("Too many redirect");
+ }
+ }
+
+ InputStream inputStream = connection.getInputStream();
+ InputStreamReader reader = new InputStreamReader(inputStream);
+ HtmlRegistryParserCallback callback = new HtmlRegistryParserCallback();
+ ParserDelegator parser = new ParserDelegator();
+ parser.parse(reader, callback, false);
+ } catch (IOException e) {
+ throw new ComponentRegistryException(e);
+ }
+ }
+
+ private void addComponents(String name) {
+ try {
+ URL wsdlUrl = new URL(this.url, name);
+ logger.info("WSDL URL: " + wsdlUrl);
+ String wsdlString = IOUtil.readToString(wsdlUrl.openStream());
+ logger.info("WSDL: " + wsdlString);
+ List<WSComponent> components = WSComponentFactory.createComponents(wsdlString);
+ addComponents(name, components);
+ } catch (MalformedURLException e) {
+ // Ignore
+ logger.error(e.getMessage(), e);
+ } catch (IOException e) {
+ // Ignore
+ logger.error(e.getMessage(), e);
+ } catch (ComponentException e) {
+ // Malformed WSDL.
+ logger.error(e.getMessage(), e);
+ } catch (RuntimeException e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ private void addComponents(String name, List<WSComponent> components) {
+ this.componentsMap.put(name, components);
+ WebComponentReference componentReference = new WebComponentReference(name, components);
+ this.tree.add(componentReference);
+ }
+
+ private class HtmlRegistryParserCallback extends HTMLEditorKit.ParserCallback {
+
+ /**
+ * @see javax.swing.text.html.HTMLEditorKit.ParserCallback#handleStartTag(javax.swing.text.html.HTML.Tag,
+ * javax.swing.text.MutableAttributeSet, int)
+ */
+ @Override
+ public void handleStartTag(Tag tag, MutableAttributeSet attrSet, int pos) {
+ if (tag == HTML.Tag.A) {
+ String name = (String) attrSet.getAttribute(HTML.Attribute.HREF);
+ addComponents(name);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java Sat May 19 21:06:56 2012
@@ -24,9 +24,9 @@ package org.apache.airavata.xbaya;
import java.net.URI;
import java.net.URISyntaxException;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.workflow.model.exceptions.WorkflowException;
import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
-import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java Sat May 19 21:06:56 2012
@@ -28,7 +28,7 @@ import java.util.List;
import java.util.Observable;
import java.util.Observer;
-import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
import org.apache.airavata.xbaya.file.XBayaPathConstants;
import org.slf4j.Logger;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java Sat May 19 21:06:56 2012
@@ -25,15 +25,26 @@ import java.io.File;
import java.io.IOException;
import java.util.List;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.xml.namespace.QName;
+
import org.apache.airavata.common.registry.api.exception.RegistryException;
import org.apache.airavata.common.utils.XMLUtil;
import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
import org.apache.airavata.workflow.model.component.SubWorkflowComponent;
+import org.apache.airavata.workflow.model.component.registry.AmazonComponentRegistry;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
+import org.apache.airavata.workflow.model.component.registry.LocalComponentRegistry;
+import org.apache.airavata.workflow.model.component.registry.SystemComponentReference;
+import org.apache.airavata.workflow.model.component.registry.SystemComponentRegistry;
import org.apache.airavata.workflow.model.exceptions.WorkflowException;
import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
import org.apache.airavata.workflow.model.graph.GraphException;
import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.component.registry.*;
+import org.apache.airavata.xbaya.component.registry.ComponentController;
import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
import org.apache.airavata.xbaya.monitor.Monitor;
import org.apache.airavata.xbaya.monitor.MonitorConfiguration;
@@ -51,11 +62,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmlpull.infoset.XmlElement;
-import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
-import javax.xml.namespace.QName;
-
public class XBayaEngine {
private static final Logger logger = LoggerFactory.getLogger(XBayaEngine.class);
@@ -255,16 +261,19 @@ public class XBayaEngine {
try {
this.componentRegistry = new SystemComponentRegistry();
// This does not take time, so we can do it in the same thread.
- this.systemComponentTree = this.componentRegistry.getComponentTree();
+ this.systemComponentTree = ComponentController.getComponentTree(this.componentRegistry);
componentTreeViewer.addComponentTree(0, this.systemComponentTree);
- componentTreeViewer.addComponentTree(1, new AmazonComponentRegistry().getComponentTree());
+ componentTreeViewer.addComponentTree(1, ComponentController.getComponentTree(new AmazonComponentRegistry()));
} catch (RuntimeException e) {
// This should not happen
e.printStackTrace();
getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
- }
+ } catch (ComponentRegistryException e) {
+ e.printStackTrace();
+ getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+ }
List<String> localRegistryPaths = this.configuration.getLocalRegistry();
for (String path : localRegistryPaths) {
@@ -272,7 +281,7 @@ public class XBayaEngine {
LocalComponentRegistry registry = new LocalComponentRegistry(path);
// XXX This might take time, so it's better to move to another
// thread.
- ComponentTreeNode componentTree = registry.getComponentTree();
+ ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
componentTreeViewer.addComponentTree(componentTree);
} catch (ComponentRegistryException e) {
getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java Sat May 19 21:06:56 2012
@@ -27,6 +27,9 @@ import java.util.Observable;
import java.util.Observer;
import org.apache.airavata.registry.api.AiravataRegistry;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.registry.ComponentRegistry;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.XBayaConfiguration;
import org.apache.airavata.xbaya.XBayaEngine;
import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
@@ -107,7 +110,7 @@ public class ComponentRegistryLoader imp
this.getEngine().getGUI().getComponentSelector().removeComponentTree(getComponentTreeNodesMap().get(registry.getName()));
getComponentTreeNodesMap().remove(registry.getName());
}
- componentTree = registry.getComponentTree();
+ componentTree = ComponentController.getComponentTree(registry);
if (this.canceled) {
return;
}
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java Sat May 19 21:06:56 2012
@@ -25,7 +25,7 @@ import java.net.URI;
import java.util.ArrayList;
import java.util.Iterator;
-import org.apache.airavata.xbaya.component.registry.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
import org.xmlpull.v1.builder.Iterable;
import org.xmlpull.v1.builder.XmlElement;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java Sat May 19 21:06:56 2012
@@ -25,7 +25,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
-import org.apache.airavata.xbaya.component.registry.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmlpull.v1.builder.XmlElement;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java Sat May 19 21:06:56 2012
@@ -35,6 +35,7 @@ import org.apache.airavata.schemas.gfac.
import org.apache.airavata.schemas.gfac.HostDescriptionType;
import org.apache.airavata.schemas.wec.ContextHeaderDocument;
import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.workflow.model.exceptions.WorkflowException;
import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
import org.apache.airavata.workflow.model.graph.GraphException;
@@ -43,7 +44,6 @@ import org.apache.airavata.workflow.mode
import org.apache.airavata.workflow.model.wf.Workflow;
import org.apache.airavata.xbaya.XBayaConfiguration;
import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
import org.apache.airavata.xbaya.monitor.MonitorException;
import org.apache.airavata.xbaya.workflow.proxy.WorkflowContext;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java Sat May 19 21:06:56 2012
@@ -34,12 +34,12 @@ import org.apache.airavata.common.utils.
import org.apache.airavata.common.utils.XMLUtil;
import org.apache.airavata.registry.api.AiravataRegistry;
import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
import org.apache.airavata.workflow.model.graph.GraphException;
import org.apache.airavata.workflow.model.wf.Workflow;
import org.apache.airavata.xbaya.XBayaConfiguration;
import org.apache.airavata.xbaya.XBayaConstants;
import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.component.registry.JCRComponentRegistry;
import org.apache.airavata.xbaya.jython.script.JythonScript;
import org.apache.airavata.xbaya.ui.experiment.RegistryWorkflowPublisherWindow;
import org.apache.airavata.xbaya.util.XBayaUtil;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java Sat May 19 21:06:56 2012
@@ -29,11 +29,11 @@ import javax.swing.JTree;
import javax.swing.tree.TreeNode;
import org.apache.airavata.common.registry.api.exception.RegistryException;
-import org.apache.airavata.xbaya.appwrapper.ApplicationDescriptionDialog;
import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
public class ApplicationDeploymentDescriptionNode extends AbstractAiravataTreeNode {
private ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap;
Modified: incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
URL: http://svn.apache.org/viewvc/incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java?rev=1340567&r1=1340566&r2=1340567&view=diff
==============================================================================
--- incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java (original)
+++ incubator/airavata/trunk/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java Sat May 19 21:06:56 2012
@@ -30,13 +30,13 @@ import javax.swing.tree.TreeNode;
import org.apache.airavata.common.registry.api.exception.RegistryException;
import org.apache.airavata.registry.api.AiravataRegistry;
-import org.apache.airavata.xbaya.appwrapper.ApplicationDescriptionDialog;
import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
public class ApplicationDeploymentDescriptionsNode extends AbstractAiravataTreeNode {
private ApplicationDeploymentDescriptions applicationDeploymentDescriptions;