JBoss Tools SVN: r29439 - trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-03-02 03:34:19 -0500 (Wed, 02 Mar 2011)
New Revision: 29439
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, code refactoring, unused import has been removed.
Modified: trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java 2011-03-02 08:28:12 UTC (rev 29438)
+++ trunk/jsf/tests/org.jboss.tools.jsf.test/src/org/jboss/tools/jsf/test/validation/I18nValidatorTest.java 2011-03-02 08:34:19 UTC (rev 29439)
@@ -11,9 +11,7 @@
package org.jboss.tools.jsf.test.validation;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Comparator;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
13 years, 10 months
JBoss Tools SVN: r29438 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd and 10 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-03-02 03:28:12 -0500 (Wed, 02 Mar 2011)
New Revision: 29438
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/FlasherData.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/selection/
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/selection/jbide-8115-test-case.html
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3127Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4037Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectWholeElement_JBIDE4713.java
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8115, multiple selection has been added
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -102,7 +102,7 @@
for (int i=0;i<10;i++) {
- nsIDOMNode domNode = vpeController.getXulRunnerEditor().getLastSelectedNode();
+ nsIDOMNode domNode = vpeController.getXulRunnerEditor().getSelectedElement();
assertNotNull(domNode);
//we process selections only with reasons, but when we select programticly,
@@ -140,7 +140,7 @@
for (int i=0;i<10;i++) {
- nsIDOMNode domNode = vpeController.getXulRunnerEditor().getLastSelectedNode();
+ nsIDOMNode domNode = vpeController.getXulRunnerEditor().getSelectedElement();
assertNotNull(domNode);
vpeController.visualRefresh();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2582Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -172,7 +172,7 @@
SelectionUtil.setSourceSelection(controller.getPageContext(), elementNode, 1, 0);
- nsIDOMNode node = SelectionUtil.getLastSelectedNode(controller.getPageContext());
+ nsIDOMNode node = SelectionUtil.getSelectedNode(controller.getPageContext());
assertEquals("Node names should be equals", "Hello", node.getFirstChild().getNodeValue()); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3127Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3127Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3127Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -42,7 +42,7 @@
int offcet = TestUtil.getLinePositionOffcet(editor.getSourceEditor().getTextViewer(), 13, 78);
editor.getSourceEditor().getTextViewer().setSelectedRange(offcet, 1);
assertTrue("VE sould be visible", vpeController.isVisualEditorVisible()); //$NON-NLS-1$
- assertTrue("It's should be a div","DIV".equalsIgnoreCase(vpeController.getXulRunnerEditor().getLastSelectedNode().getNodeName())); //$NON-NLS-1$//$NON-NLS-2$
+ assertTrue("It's should be a div","DIV".equalsIgnoreCase(vpeController.getXulRunnerEditor().getSelectedElement().getNodeName())); //$NON-NLS-1$//$NON-NLS-2$
VpeEditorPart editorPart = ((VpeEditorPart)editor.getVisualEditor());
editorPart.maximizeSource();
assertFalse("Visual part shouldn't be visible",vpeController.isVisualEditorVisible()); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -41,22 +41,22 @@
XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 6);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Show be selected Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Show be selected Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 7);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Element Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Element Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 15);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 20);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 25);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 26);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Element Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Element Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -67,7 +67,7 @@
int focusOffcetInSourceDocument = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), srcLine, srcLinePos);
part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(focusOffcetInSourceDocument);
vpeController.getPageContext().getSourceBuilder().getStructuredTextViewer().setSelectedRange(focusOffcetInSourceDocument, 0);
- nsIDOMNode lastSelectedNode = vpeController.getXulRunnerEditor().getLastSelectedNode();
+ nsIDOMNode lastSelectedNode = vpeController.getXulRunnerEditor().getSelectedElement();
NodeImpl sourceSelectedNode=null;
//was selected source el
if(attributeName!=null) {
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4037Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4037Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4037Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -43,7 +43,7 @@
TestUtil.waitForJobs();
nsIDOMElement rootElement = TestUtil.getVpeController(part)
.getXulRunnerEditor()
- .getLastSelectedElement();
+ .getSelectedElement();
//check if something selected
assertNotNull(rootElement);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -167,7 +167,7 @@
node, 1, 0);
assertEquals(domMapping.getNearNodeMapping(node)
- .getVisualNode(), xulRunnerEditor.getLastSelectedNode());
+ .getVisualNode(), xulRunnerEditor.getSelectedElement());
String insertedString = null;
int offset;
@@ -188,7 +188,7 @@
// wait
TestUtil.delay(700);
// wait
- assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertNotNull(xulRunnerEditor.getSelectedElement());
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectWholeElement_JBIDE4713.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectWholeElement_JBIDE4713.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/SelectWholeElement_JBIDE4713.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -60,7 +60,7 @@
selectionEndOffset - selectionStartOffset);
TestUtil.waitForIdle();
- nsIDOMNode selectedNode = SelectionUtil.getLastSelectedNode(
+ nsIDOMNode selectedNode = SelectionUtil.getSelectedNode(
vpeController.getPageContext());
assertTrue(selectedNode.getNodeType() == nsIDOMNode.ELEMENT_NODE);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -134,7 +134,7 @@
}
private nsIDOMElement getSelectedElement() {
- return vpeController.getXulRunnerEditor().getLastSelectedElement();
+ return vpeController.getXulRunnerEditor().getSelectedElement();
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -984,7 +984,7 @@
toggleLookup = "true".equals(toggleLookupAttr.getNodeValue()); //$NON-NLS-1$
}
- nsIDOMElement selectedElem = getLastSelectedElement();
+ nsIDOMElement selectedElem = getSelectedElement();
// Fixes JBIDE-1823 author dmaliarevich
if (null == selectedElem) {
return null;
@@ -1087,9 +1087,12 @@
return visualEditor.getContentArea();
}
- public void setSelectionRectangle(/* nsIDOMElement */nsIDOMNode visualElement) {
- int resizerConstrains = getResizerConstrains(visualElement);
- visualEditor.setSelectionRectangle(visualElement, resizerConstrains);
+ public void setSelectionRectangle(/* nsIDOMElement */List<nsIDOMNode> visualNodes) {
+ int resizerConstrains = VpeTagDescription.RESIZE_CONSTRAINS_NONE;
+ if(visualNodes.size()==1){
+ resizerConstrains = getResizerConstrains(visualNodes.get(0));
+ }
+ visualEditor.setSelectionRectangle(visualNodes, resizerConstrains);
}
/**
@@ -1478,9 +1481,8 @@
return null;
}
- nsIDOMElement getLastSelectedElement() {
-
- return xulRunnerEditor.getLastSelectedElement();
+ private nsIDOMElement getSelectedElement() {
+ return xulRunnerEditor.getSelectedElement();
}
public void pushIncludeStack(VpeIncludeInfo includeInfo) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualKeyHandler.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -1759,7 +1759,7 @@
}
private nsIDOMElement getSelectedNode() {
- return pageContext.getEditPart().getController().getXulRunnerEditor().getLastSelectedElement();
+ return pageContext.getEditPart().getController().getXulRunnerEditor().getSelectedElement();
}
}
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -956,8 +956,8 @@
// getContentAreaEventListener().setVisualEditor(null);
}
- public void setSelectionRectangle(/*nsIDOMElement*/nsIDOMNode element, int resizerConstrains) {
- xulRunnerEditor.setSelectionRectangle(element, resizerConstrains);
+ public void setSelectionRectangle(/*nsIDOMElement*/List<nsIDOMNode> nodes, int resizerConstrains) {
+ xulRunnerEditor.setSelectionRectangle(nodes, resizerConstrains);
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/KeyEventManager.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -169,7 +169,7 @@
VpeTemplate template = elementMapping.getTemplate();
nsIDOMNode visualNode = SelectionUtil
- .getLastSelectedNode(getPageContext());
+ .getSelectedNode(getPageContext());
NodeData nodeData = template.getNodeData(visualNode, elementData,
domMapping);
@@ -254,7 +254,7 @@
VpeTemplate template = elementMapping.getTemplate();
nsIDOMNode visualNode = SelectionUtil
- .getLastSelectedNode(getPageContext());
+ .getSelectedNode(getPageContext());
NodeData nodeData = template.getNodeData(visualNode, elementData,
domMapping);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/SelectionManager.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -11,6 +11,9 @@
package org.jboss.tools.vpe.editor.template;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.swt.graphics.Point;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.xml.core.internal.document.NodeImpl;
@@ -70,7 +73,7 @@
}
if (selectionData.getVisualNode().getNodeType() != nsIDOMNode.TEXT_NODE
- && SelectionUtil.getLastSelectedNode(getPageContext())
+ && SelectionUtil.getSelectedNode(getPageContext())
== selectionData.getVisualNode()) {
return;
}
@@ -158,24 +161,26 @@
return;
}
- VpeNodeMapping nodeMapping = SelectionUtil
- .getNodeMappingBySourceSelection(getSourceEditor(), getDomMapping());
- if (nodeMapping == null) {
+ List<VpeNodeMapping> nodeMappings = SelectionUtil
+ .getNodeMappingsBySourceSelection(getSourceEditor(), getDomMapping());
+ if (nodeMappings == null) {
return;
}
// visual node which will be selected
- nsIDOMNode targetVisualNode;
- if (nodeMapping instanceof VpeElementMapping) {
- VpeElementMapping elementMapping = (VpeElementMapping) nodeMapping;
- targetVisualNode = elementMapping.getTemplate()
- .getVisualNodeBySourcePosition(elementMapping,
- range, getDomMapping());
- } else {
- targetVisualNode = nodeMapping.getVisualNode();
+ List<nsIDOMNode> targetVisualNodes = new ArrayList<nsIDOMNode>();
+ for (VpeNodeMapping nodeMapping : nodeMappings) {
+ if (nodeMapping instanceof VpeElementMapping) {
+ VpeElementMapping elementMapping = (VpeElementMapping) nodeMapping;
+ targetVisualNodes.add(elementMapping.getTemplate()
+ .getVisualNodeBySourcePosition(elementMapping,
+ range, getDomMapping()));
+ } else {
+ targetVisualNodes.add(nodeMapping.getVisualNode());
+ }
}
getPageContext().getVisualBuilder().setSelectionRectangle(
- targetVisualNode);
+ targetVisualNodes);
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -252,7 +252,6 @@
nodeMappings.add(nodeMapping);
}
}
-
return nodeMappings;
}
@@ -344,9 +343,14 @@
* VpePageContext object
* @return nsIDOMNode the last selected node
*/
- public static nsIDOMNode getLastSelectedNode(VpePageContext pageContext) {
- return pageContext.getVisualBuilder().getXulRunnerEditor()
- .getLastSelectedNode();
+ public static nsIDOMNode getSelectedNode(VpePageContext pageContext) {
+ nsIDOMNode domNode=null;
+ List<nsIDOMNode> selectedNodes = pageContext.getVisualBuilder().getXulRunnerEditor()
+ .getLastSelectedNodes();
+ if(selectedNodes!=null&&selectedNodes.size()>0){
+ domNode=selectedNodes.get(0);
+ }
+ return domNode;
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -379,7 +379,7 @@
TestUtil.delay(50);
- assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertNotNull(xulRunnerEditor.getSelectedElement());
nsIDOMNode sample;
if (nodeMapping.getSourceNode().getNodeType() == Node.TEXT_NODE
@@ -391,7 +391,7 @@
sample = nodeMapping.getVisualNode();
}
- assertEquals(sample, xulRunnerEditor.getLastSelectedNode());
+ assertEquals(sample, xulRunnerEditor.getSelectedElement());
}
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/Flasher.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -1,5 +1,7 @@
package org.jboss.tools.vpe.xulrunner.editor;
+import java.util.List;
+
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.vpe.xulrunner.util.XPCOM;
import org.mozilla.interfaces.inIFlasher;
@@ -36,40 +38,55 @@
||IS_OPEN_JDK
||IS_LINUX) {
drawOutline = new DrawOutlineInterface() {
- private nsIDOMElement lastBorderedElement = null;
- public void drawElementOutline(nsIDOMElement domElement) {
- if (this.lastBorderedElement != null
- && this.lastBorderedElement.getAttribute(XulRunnerEditor.STYLE_ATTR) != null) {
- String style = this.lastBorderedElement
- .getAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
- this.lastBorderedElement.setAttribute(XulRunnerEditor.STYLE_ATTR, style);
- }
-
+ private List<FlasherData> previouslyBorderedElements = null;
+ public void drawElementOutline(List<FlasherData> flasherData) {
+ clearPreviouslySelectedElements();
// save style for early bordered element
- String oldstyle = domElement.getAttribute(XulRunnerEditor.STYLE_ATTR);
- domElement.setAttribute(XulRunnerEditor.STYLE_ATTR,
- domElement.getAttribute(XulRunnerEditor.STYLE_ATTR) + ';'
- + String.format(ELEMENT_BORDER_PATTERN, iFlasher.getColor()));
-
- this.lastBorderedElement = domElement;
- this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME,
- oldstyle);
-
+ saveOldStyle(flasherData);
+ this.previouslyBorderedElements = flasherData;
}
+ private void clearPreviouslySelectedElements(){
+ if(previouslyBorderedElements!=null){
+ for (FlasherData borderedData : previouslyBorderedElements) {
+ nsIDOMElement lastBorderedElement = borderedData.getElement();
+ if (lastBorderedElement != null
+ && lastBorderedElement.getAttribute(XulRunnerEditor.STYLE_ATTR) != null) {
+ String style = lastBorderedElement
+ .getAttribute(PREV_STYLE_ATTR_NAME);
+ lastBorderedElement.removeAttribute(PREV_STYLE_ATTR_NAME);
+ lastBorderedElement.setAttribute(XulRunnerEditor.STYLE_ATTR, style);
+ }
+ }
+ }
+ }
+
+ private void saveOldStyle(List<FlasherData> flasherData){
+ for (FlasherData flasherData2 : flasherData) {
+ nsIDOMElement domElement = flasherData2.getElement();
+ String oldstyle = domElement.getAttribute(XulRunnerEditor.STYLE_ATTR);
+ domElement.setAttribute(XulRunnerEditor.STYLE_ATTR,
+ domElement.getAttribute(XulRunnerEditor.STYLE_ATTR) + ';'
+ + String.format(ELEMENT_BORDER_PATTERN, flasherData2.getSelectionColor()));
+ domElement.setAttribute(PREV_STYLE_ATTR_NAME, oldstyle);
+ }
+ }
+
};
} else {
drawOutline = new DrawOutlineInterface() {
- public void drawElementOutline(nsIDOMElement domElement) {
- iFlasher.drawElementOutline(domElement);
+ public void drawElementOutline(List<FlasherData> flasherData) {
+ for (FlasherData flasherData2 : flasherData) {
+ iFlasher.setColor(flasherData2.getSelectionColor());
+ iFlasher.drawElementOutline(flasherData2.getElement());
+ }
}
};
}
}
- public void drawElementOutline(nsIDOMElement domElement) {
+ public void drawElementOutline(List<FlasherData> flasherData) {
- drawOutline.drawElementOutline(domElement);
+ drawOutline.drawElementOutline(flasherData);
}
public void scrollElementIntoView(nsIDOMElement element) {
@@ -94,6 +111,6 @@
*
*/
interface DrawOutlineInterface{
- public void drawElementOutline(nsIDOMElement domElement);
+ public void drawElementOutline(List<FlasherData> flasherData);
};
Added: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/FlasherData.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/FlasherData.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/FlasherData.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.xulrunner.editor;
+
+import org.mozilla.interfaces.nsIDOMElement;
+
+/**
+ *
+ * Transfer object which contains flasher
+ *
+ * @author mareshkau
+ *
+ */
+public class FlasherData {
+
+ private nsIDOMElement element;
+ private String selectionColor;
+
+ public FlasherData(String drawColor,nsIDOMElement element){
+ this.selectionColor=drawColor;
+ this.element=element;
+ }
+
+ protected nsIDOMElement getElement() {
+ return element;
+ }
+ protected String getSelectionColor() {
+ return selectionColor;
+ }
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -12,6 +12,7 @@
package org.jboss.tools.vpe.xulrunner.editor;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
@@ -95,7 +96,7 @@
public static final String STYLE_ATTR = "style"; //$NON-NLS-1$
// private nsIDOMElement lastSelectedElement;
- private nsIDOMNode lastSelectedNode;
+ private List<nsIDOMNode> selectedNodes;
private int lastResizerConstrains;
private Listener eventListenet = new Listener() {
@@ -242,17 +243,20 @@
return domWindow.getDocument();
}
- /**
- * Function created to restore functionality of MozillaBrowser
- *
- * @return
- */
- public nsIDOMElement getLastSelectedElement() {
- return getSelectedElementForNode(lastSelectedNode);
- }
+// /**
+// * Function created to restore functionality of MozillaBrowser
+// *
+// * @return
+// */
+// public nsIDOMElement getLastSelectedElement() {
+// return getElementForNode(lastSelectedNode);
+// }
- public nsIDOMNode getLastSelectedNode() {
- return lastSelectedNode;
+ public List<nsIDOMNode> getLastSelectedNodes() {
+ if(selectedNodes==null){
+ selectedNodes=Collections.<nsIDOMNode>emptyList();
+ }
+ return selectedNodes;
}
/**
@@ -262,26 +266,27 @@
* @param resizerConstrains
* @param scroll
*/
- public void setSelectionRectangle(nsIDOMNode node, int resizerConstrains) {
+ public void setSelectionRectangle(List<nsIDOMNode> nodes, int resizerConstrains) {
if (getFlasher() == null) {
return;
}
- this.lastSelectedNode = node;
+ this.selectedNodes = nodes;
- nsIDOMElement element = getLastSelectedElement();
- if (element != null) {
- repaint();
- scrollToElement(element);
- }
- redrawSelectionRectangle();
+ nsIDOMElement element = getSelectedElement();
+ if (element != null) {
+ repaint();
+ scrollToElement(element);
+ }
+ redrawSelectionRectangle();
- if (xulRunnerVpeResizer != null) {
- if (element != null && resizerConstrains != 0) {
- xulRunnerVpeResizer.show(element, resizerConstrains);
- } else {
- xulRunnerVpeResizer.hide();
+ if (xulRunnerVpeResizer != null) {
+ if (element != null && resizerConstrains != 0) {
+ xulRunnerVpeResizer.show(element, resizerConstrains);
+ } else {
+ xulRunnerVpeResizer.hide();
+ }
}
- }
+
lastResizerConstrains = resizerConstrains;
@@ -392,9 +397,9 @@
*
*/
public void showResizer() {
- if (xulRunnerVpeResizer != null && getLastSelectedElement() != null
+ if (xulRunnerVpeResizer != null && getSelectedElement() != null
&& lastResizerConstrains != 0) {
- xulRunnerVpeResizer.show(getLastSelectedElement(),
+ xulRunnerVpeResizer.show(getSelectedElement(),
lastResizerConstrains);
}
}
@@ -409,28 +414,54 @@
}
public void redrawSelectionRectangle() {
- nsIDOMElement element = getLastSelectedElement();
- if (element != null) {
- if (isVisible(element)) {
- if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
- || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
+// nsIDOMElement element = get SelectedElement();
+// if (element != null) {
+// if (isVisible(element)) {
+// if (element.getAttribute(VPE_INVISIBLE_ELEMENT) == null
+// || (!element.getAttribute(VPE_INVISIBLE_ELEMENT)
+// .equals(Boolean.TRUE.toString()))) {
+// getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
+// } else {
+// getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
+// }
+// drawElementOutline(element);
+// } else {
+// getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
+// nsIDOMElement domElement = findVisibleParentElement(element);
+// if (domElement != null) {
+// drawElementOutline(domElement);
+// }
+// }
+// }
+ List<FlasherData> flasherDatas = new ArrayList<FlasherData>();
+ for (nsIDOMNode domNode : getLastSelectedNodes()) {
+ flasherDatas.add(prepareFlasherData(domNode));
+ }
+ drawElementOutline(flasherDatas);
+ }
+
+ private FlasherData prepareFlasherData(nsIDOMNode domNode){
+ nsIDOMElement domElement = getElementForNode(domNode);
+ String selectionBorderColor = FLASHER_VISUAL_ELEMENT_COLOR;
+ if (domElement != null) {
+ if (isVisible(domElement)) {
+ if (domElement.getAttribute(VPE_INVISIBLE_ELEMENT) == null
+ || (!domElement.getAttribute(VPE_INVISIBLE_ELEMENT)
.equals(Boolean.TRUE.toString()))) {
- getFlasher().setColor(FLASHER_VISUAL_ELEMENT_COLOR);
+ selectionBorderColor = FLASHER_VISUAL_ELEMENT_COLOR;
} else {
- getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- }
-
- drawElementOutline(element);
+ selectionBorderColor = FLASHER_HIDDEN_ELEMENT_COLOR;
+ }
} else {
- getFlasher().setColor(FLASHER_HIDDEN_ELEMENT_COLOR);
- nsIDOMElement domElement = findVisibleParentElement(element);
-
- if (domElement != null) {
- drawElementOutline(domElement);
- }
+ selectionBorderColor = FLASHER_HIDDEN_ELEMENT_COLOR;
+ domElement = findVisibleParentElement(domElement);
}
}
+
+ return new FlasherData(selectionBorderColor, domElement);
}
+
+
/**
* Scrools viiew to some elements
@@ -449,7 +480,7 @@
* If node is a text node, then returns its parent
* Else returns null;
*/
- private nsIDOMElement getSelectedElementForNode(nsIDOMNode node) {
+ private static nsIDOMElement getElementForNode(nsIDOMNode node) {
if (node != null) {
if (node.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
return XPCOM.queryInterface(node, nsIDOMElement.class);
@@ -469,8 +500,8 @@
* arround which border will be shown
*
*/
- private void drawElementOutline(nsIDOMElement element) {
- getFlasher().drawElementOutline(element);
+ private void drawElementOutline(List<FlasherData> flasherData) {
+ getFlasher().drawElementOutline(flasherData);
}
/**
@@ -492,7 +523,7 @@
@Override
protected void onDispose() {
- lastSelectedNode = null;
+ selectedNodes = new ArrayList<nsIDOMNode>();
if (flasher != null) {
flasher.dispose();
flasher = null;
@@ -507,5 +538,15 @@
}
}
-
+ /**
+ *
+ * @return selected element if only one element selected in visual part
+ */
+ public nsIDOMElement getSelectedElement(){
+ nsIDOMElement resizeElement = null;
+ if(getLastSelectedNodes()!=null&&getLastSelectedNodes().size()>0){
+ resizeElement =getElementForNode(getLastSelectedNodes().get(0));
+ }
+ return resizeElement;
+ }
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/selection/jbide-8115-test-case.html
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/selection/jbide-8115-test-case.html (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/resources/TestProject/WebContent/pages/selection/jbide-8115-test-case.html 2011-03-02 08:28:12 UTC (rev 29438)
@@ -0,0 +1,13 @@
+<html>
+<head></head>
+<body>
+<input type ="button" value="1" />
+<p/>
+<input type ="button" value="2" />
+<p/>
+<input type ="button" value="3" />
+<p/>
+<input type ="button" value="4" />
+<p/>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2011-03-02 03:19:37 UTC (rev 29437)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/VpeTest.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -354,7 +354,7 @@
TestUtil.delay(50);
- assertNotNull(xulRunnerEditor.getLastSelectedNode());
+ assertNotNull(xulRunnerEditor.getSelectedElement());
nsIDOMNode sample;
if (nodeMapping.getSourceNode().getNodeType() == Node.TEXT_NODE
@@ -366,7 +366,7 @@
sample = nodeMapping.getVisualNode();
}
- assertEquals(sample, xulRunnerEditor.getLastSelectedNode());
+ assertEquals(sample, xulRunnerEditor.getSelectedElement());
}
}
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java 2011-03-02 08:28:12 UTC (rev 29438)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test.editor;
+
+import java.io.IOException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.base.test.TestUtil;
+import org.jboss.tools.vpe.base.test.VpeTest;
+import org.jboss.tools.vpe.ui.test.VpeUiTests;
+
+/**
+ * Junit test for JBIDE-8115
+ *
+ * @author mareshkau
+ *
+ */
+public class MultipleSelectionTest extends VpeTest{
+
+ private static final String TEST_CASE="WebContent/pages/selection/jbide-8115-test-case.html"; //$NON-NLS-1$
+
+ public MultipleSelectionTest(String name) {
+ super(name);
+ }
+
+ public void testMultipleSelectionForSimplePage() throws CoreException, IOException{
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_CASE,
+ VpeUiTests.IMPORT_PROJECT_NAME);
+ IEditorInput input = new FileEditorInput(file);
+ JSPMultiPageEditor part = openEditor(input);
+ ITextViewer viewer = part.getSourceEditor().getTextViewer();
+
+ int startSelectionOffcet = TestUtil.getLinePositionOffcet(viewer, 6, 1);
+ int endSelectionOffcet = TestUtil.getLinePositionOffcet(viewer, 9, 4);
+ viewer.setSelectedRange(startSelectionOffcet, endSelectionOffcet);
+ }
+}
13 years, 10 months
JBoss Tools SVN: r29437 - trunk/bpel/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: mcaspers
Date: 2011-03-01 22:19:37 -0500 (Tue, 01 Mar 2011)
New Revision: 29437
Modified:
trunk/bpel/docs/reference/en-US/Book_Info.xml
trunk/bpel/docs/reference/en-US/Revision_History.xml
trunk/bpel/docs/reference/en-US/reference.xml
trunk/bpel/docs/reference/en-US/summary.xml
trunk/bpel/docs/reference/en-US/tasks.xml
Log:
General Documentation Updates
Modified: trunk/bpel/docs/reference/en-US/Book_Info.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/Book_Info.xml 2011-03-02 02:50:26 UTC (rev 29436)
+++ trunk/bpel/docs/reference/en-US/Book_Info.xml 2011-03-02 03:19:37 UTC (rev 29437)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.0</productnumber>
<edition>4.0.0</edition>
- <pubsnumber>8</pubsnumber>
+ <pubsnumber>9</pubsnumber>
<abstract>
<para>The JBoss BPEL User Guide explains how to use the BPEL Tools to create BPEL files quickly and with precision.</para>
</abstract>
Modified: trunk/bpel/docs/reference/en-US/Revision_History.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/Revision_History.xml 2011-03-02 02:50:26 UTC (rev 29436)
+++ trunk/bpel/docs/reference/en-US/Revision_History.xml 2011-03-02 03:19:37 UTC (rev 29437)
@@ -6,7 +6,21 @@
<simpara>
<revhistory>
<revision>
- <revnumber>1-0</revnumber>
+ <revnumber>0-2</revnumber>
+ <date>Wed Mar 02 2011</date>
+ <author>
+ <firstname>Matthew</firstname>
+ <surname>Casperson</surname>
+ <email>mcaspers(a)redhat.com</email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Screenshot updates and general editing</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
+ <revnumber>0-1</revnumber>
<date>Tue Jan 18 2011</date>
<author>
<firstname>Matthew</firstname>
Modified: trunk/bpel/docs/reference/en-US/reference.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/reference.xml 2011-03-02 02:50:26 UTC (rev 29436)
+++ trunk/bpel/docs/reference/en-US/reference.xml 2011-03-02 03:19:37 UTC (rev 29437)
@@ -14,7 +14,7 @@
<title>Wizards</title>
<section>
<title>New BPEL project Wizard</title>
- <para>This wizard helps to create new BPEL project. It is available by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other</guimenuitem><guimenuitem>BPEL project</guimenuitem></menuchoice> in the menu bar.</para>
+ <para>This wizard is provided to create a new BPEL project. It is available by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other</guimenuitem><guimenuitem>BPEL project</guimenuitem></menuchoice>.</para>
<figure>
<title>New BPEL Project Wizard</title>
<mediaobject>
@@ -23,12 +23,12 @@
</imageobject>
</mediaobject>
</figure>
- <para>It consists of two pages:</para>
+ <para>The wizard consists of two pages:</para>
<itemizedlist>
<listitem>
<para>On the first page you can adjust the name of the project and the directory where it will be created.</para>
<para>
- If "<property>Use default</property>" option is checked the output directory will be the workspace, otherwise the user should specify it by himself using <guibutton>Browse</guibutton> button.
+ If the <guilabel>Use default location</guilabel> option is checked the output directory will be set to the workspace, otherwise a custom location can be specified by clicking the <guibutton>Browse</guibutton> button.
</para>
<figure>
<title>New BPEL Project Wizard</title>
@@ -40,7 +40,7 @@
</figure>
</listitem>
<listitem>
- <para>On the second page you can specify the name of the Content Folder.</para>
+ <para>On the second page you can specify the name of the <guilabel>Content Folder</guilabel>.</para>
<figure>
<title>New BPEL Project Wizard</title>
<mediaobject>
@@ -54,7 +54,7 @@
</section>
<section>
<title>Apache ODE Deployment Descriptor Wizard</title>
- <para>Using this wizard user can create ODE deployment descriptor (<filename>deploy.xml</filename>) and place it in the temporary directory.It is available by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other</guimenuitem><guimenuitem>Apache ODE Deployment Descriptor Wizard</guimenuitem></menuchoice> in the menu bar.</para>
+ <para>This wizard can be used to create an ODE deployment descriptor (<filename>deploy.xml</filename>) file and place it in the temporary directory. It is available by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other</guimenuitem><guimenuitem>Apache ODE Deployment Descriptor Wizard</guimenuitem></menuchoice>.</para>
<figure>
<title>New BPEL Project Wizard</title>
<mediaobject>
@@ -64,16 +64,16 @@
</mediaobject>
</figure>
<para>
- On the page you can adjust the name of the deployment descriptor and the directory where it will be created.Note,that you should use <filename>/PROJECT_NAME/bpelContent</filename> directory as an output one.
+ On this page you can adjust the name of the deployment descriptor and the directory where it will be created. Note that you should use <filename>/PROJECT_NAME/bpelContent</filename> directory for the output.
</para>
</section>
<section>
<title>New BPEL Process file Wizard</title>
- <para>Using the <property>New BPEL Process file Wizard</property> it is possible to create a BPEL process file and a WSDL file.
+ <para>Using the <guilabel>New BPEL Process file Wizard</guilabel> it is possible to create a BPEL process file and a WSDL file.
The wizard includes several pages:</para>
<itemizedlist>
- <listitem><para>The first page has the following options to set:</para>
+ <listitem><para>The first page includes the following options:</para>
<table>
<title>New BPEL Process file Wizard. First Page Options.</title>
<tgroup cols="3">
@@ -135,7 +135,7 @@
</figure>
</listitem>
- <listitem><para>The second page has the following options to set:</para>
+ <listitem><para>The second page include the following options:</para>
<table>
<title>New BPEL Process file Wizard. Second Page Options.</title>
<tgroup cols="3">
@@ -195,7 +195,7 @@
</listitem>
</itemizedlist>
<note>
- <para>Process files that are used in the BPEL project must be under the <property>bpelContent</property> folder. Only in this case these files can be deployed to JBoss server.
+ <para>Process files that are used in the BPEL project must be under the <filename>bpelContent</filename> folder. This is necessary for the files to be deployed to a JBoss server.
</para>
</note>
</section>
@@ -204,9 +204,8 @@
<title>Editors</title>
<section>
<title>Business Process Editor</title>
- <para>Business Process Editor is intended to facilitate the process of changing and
- adding new logic to BPEL process file. You can open <emphasis>.bpel</emphasis>
- in this editor by right click the file in the project explorer and selecting <menuchoice><guimenuitem>Open With...</guimenuitem><guimenuitem>Business Process Editor</guimenuitem></menuchoice>
+ <para>
+ The Business Process Editor is intended to facilitate the process of changing and adding new logic to a BPEL process file. You can open <filename>.bpel</filename> files in this editor by right click the file in the <guilabel>Project Explorer</guilabel> and selecting <menuchoice><guimenuitem>Open With...</guimenuitem><guimenuitem>Business Process Editor</guimenuitem></menuchoice>.
</para>
<figure>
<title>Business Process Editor</title>
@@ -216,10 +215,10 @@
</imageobject>
</mediaobject>
</figure>
- <para>The editor consists of two tabs:<property>Design</property> tab and <property>Source</property> tab.</para>
+ <para>The editor consists of two tabs: the <guilabel>Design</guilabel> tab and the <guilabel>Source</guilabel> tab.</para>
<section>
<title>Design tab</title>
- <para>Design tab is the main part of Business Process Editor.It consists of 3 parts:</para>
+ <para>The <guilabel>Design</guilabel> tab is the main part of the <guilabel>Business Process Editor</guilabel>. It consists of 3 parts:</para>
<itemizedlist>
<listitem><para>Visual Pane:</para>
<figure>
@@ -230,7 +229,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>The Visual Pane graphically displays the order in which the activities are executed.</para>
+ <para>The Visual Pane provides a graphical representation of the order in which the activities are executed.</para>
</listitem>
<listitem><para>Palette:</para>
<figure>
@@ -242,7 +241,7 @@
</mediaobject>
</figure>
<para>
- The <property>Palette</property> represents different elements of the BPEL activities organized into functional categories. Using it the developer can easily add new elements to the sequence activity. To do this, click the required element and then drag and drop it to the place on the Visual Pane where it should be added.
+ The <guilabel>Palette</guilabel> view represents the different BPEL activities elements organized into functional categories. Using it the developer can easily add new elements to the sequence activity. To do this, click the required element and then drag and drop it to the place on the Visual Pane.
</para>
</listitem>
<listitem><para>Behavior Components View:</para>
@@ -254,10 +253,9 @@
</imageobject>
</mediaobject>
</figure>
- <para>Execution behavior components are grouped into the <property>
- Behavior Components View</property>.
- The view is also fully synchronized with Properties view where you can customize all
- the properties of the component.</para>
+ <para>
+ Execution behavior components are grouped into the <guilabel>Behavior Components</guilabel> view. This view is also fully synchronized with <guilabel>Properties</guilabel> view where you can customize all the properties of the component.
+ </para>
<figure>
<title>Process Structure View of Business Process Editor</title>
<mediaobject>
@@ -266,7 +264,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>To add an element to some component group click the plus (<inlinemediaobject>
+ <para>To add an element to a component group click the plus (<inlinemediaobject>
<imageobject>
<imagedata fileref="images/reference/bpel_ref_10.png"/>
</imageobject>
@@ -279,7 +277,7 @@
</section>
<section>
<title>Source tab</title>
- <para>Source tab can be used for editing BPEL process file directly. It is also possible to validate the file structure.
+ <para>The <guilabel>Source</guilabel> tab can be used for directly editing BPEL process files. It is also possible to validate the file structure.
</para>
<figure>
<title>Validation error in Source tab</title>
@@ -289,7 +287,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>If the user wants to disable/unable validation he can do it by selecting <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>Validation</guimenuitem></menuchoice>.</para>
+ <para>Validation can be enabled or disabled by selecting <menuchoice><guimenuitem>Window</guimenuitem><guimenuitem>Preferences</guimenuitem><guimenuitem>Validation</guimenuitem></menuchoice>.</para>
<figure>
<title>Validation configuration</title>
<mediaobject>
@@ -302,7 +300,7 @@
</section>
<section>
<title>ODE Deployment Descriptor Editor</title>
- <para>To deploy your process in ODE you need to create a simple deployment descriptor with basic information, using the <property>ODE Deployment Descriptor Editor</property> to facilitate the process of descriptor configuration. You can see how the descriptor file opened in the editor looks like in the picture below:
+ <para>To deploy your process in ODE you need to create a simple deployment descriptor with basic information, using the <property>ODE Deployment Descriptor Editor</property> to facilitate the process of descriptor configuration. You can see how the descriptor file looks when it is opened in the editor in the image below:
</para>
<figure>
<title>ODE Deployment Descriptor Editor</title>
Modified: trunk/bpel/docs/reference/en-US/summary.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/summary.xml 2011-03-02 02:50:26 UTC (rev 29436)
+++ trunk/bpel/docs/reference/en-US/summary.xml 2011-03-02 03:19:37 UTC (rev 29437)
@@ -3,7 +3,7 @@
<?dbhtml filename="summary.html"?>
<title>Summary</title>
<para>
- This document highlights the capabilities of BPEL Tools, as well as providing the steps required to create and configure BPEL process and deployment descriptor files. If you have questions or suggestions concerned both the documentation and tools behavior, you are welcome to JBoss Tools Users forum. Please, use Jira to report bugs and requests on documentation.
+ This document highlights the capabilities of BPEL Tools, as well as providing the steps required to create and configure BPEL process and deployment descriptor files. If you have questions or suggestions concerned both the documentation and tools behavior please visit the JBoss Tools Users forum.
</para>
<section>
Modified: trunk/bpel/docs/reference/en-US/tasks.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/tasks.xml 2011-03-02 02:50:26 UTC (rev 29436)
+++ trunk/bpel/docs/reference/en-US/tasks.xml 2011-03-02 03:19:37 UTC (rev 29437)
@@ -410,7 +410,7 @@
<itemizedlist>
<listitem>
<para>
- Create the deploy.xml by selecting <menuchoice><guimenuitem>New</guimenuitem><guimenuitem>Other...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>Apache ODE Deployment Descriptor</guimenuitem></menuchoice>. Click the <guibutton>Next</guibutton> button.
+ Create the <filename>deploy.xml</filename> file by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Other...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>Apache ODE Deployment Descriptor</guimenuitem></menuchoice>. Click the <guibutton>Next</guibutton> button.
</para>
<figure>
<title>New BPEL Deploy file</title>
@@ -424,10 +424,10 @@
<listitem>
<para>On the next wizard page you should enter the following information:</para>
<para>
- <emphasis><property>BPEL Project</property> </emphasis>: Click the <guibutton>Browse...</guibutton> button to select the BPEL project in your workspace which you want to deploy to the runtime. Please note, that you should select the <filename>bpelContent</filename> folder in your new BPEL project as a value of <property>BPEL Project</property> field because the <filename>deploy.xml</filename> should be created in this place.
+ <emphasis><property>BPEL Project</property> </emphasis>: Click the <guibutton>Browse...</guibutton> button to select the BPEL project in your workspace where you want to deploy to the runtime. Please note that you should select the <filename>bpelContent</filename> folder in your new BPEL project for the <property>BPEL Project</property> field because this is the correct location for the <filename>deploy.xml</filename> file.
</para>
<para>
- <emphasis><property>File name</property></emphasis>: The default value is <filename>deploy.xml</filename>. Please, don't change it.
+ <emphasis><property>File name</property></emphasis>: The default value is <filename>deploy.xml</filename>. This should not be changed.
</para>
<para>Click on the <guibutton>Finish</guibutton> button to close the wizard and a new <filename>deploy.xml</filename> file will be created.</para>
<figure>
@@ -441,7 +441,7 @@
</listitem>
<listitem>
<para>
- Double-click the <filename>deploy.xml</filename> file to open it in ODE Descriptor Deployment Editor. In the <property>Inbound Interfaces</property> section, click the <property>Associated Port</property> column and select <property>HelloWorldProcessPort</property> in the dropdown box.The <property>Related Service</property> and <property>Binding Used</property> columns should be automatically filled in. Save the <filename>deploy.xml</filename>.
+ Double-click the <filename>deploy.xml</filename> file to open it in <guilabel>ODE Descriptor Deployment Editor</guilabel>. In the <guilabel>Inbound Interfaces</guilabel> section, click the <guilabel>Associated Port</guilabel> column and select <guilabel>HelloWorldProcessPort</guilabel> in the dropdown box.The <guilabel>Related Service</guilabel> and <guilabel>Binding Used</guilabel> columns should be automatically filled in. Save the changes to the <filename>deploy.xml</filename> file.
</para>
<figure>
<title>deploy.xml file editor</title>
@@ -457,17 +457,17 @@
<section id="createruntime">
<title>Creating JBoss BPEL Server</title>
<para>
- Suppose you have installed the <property>JBoss BPEL Runtime-RiftSaw</property><!-- as it was described in <xref linkend="installRuntime"/>-->, now you can create a server for JBoss BPEL runtime.
+ Once you have installed the <property>JBoss BPEL Runtime-RiftSaw</property><!-- as it was described in <xref linkend="installRuntime"/>-->, you can create a server for JBoss BPEL runtime.
</para>
<itemizedlist>
<listitem>
<para>
- Open the <property>Servers</property> view by selecting <menuchoice><guimenuitem>Windows</guimenuitem><guimenuitem>Show View</guimenuitem><guimenuitem>Other...</guimenuitem><guimenuitem>Server</guimenuitem><guimenuitem>Servers</guimenuitem></menuchoice>.
+ Open the <guilabel>Servers</guilabel> view by selecting <menuchoice><guimenuitem>Windows</guimenuitem><guimenuitem>Show View</guimenuitem><guimenuitem>Other...</guimenuitem><guimenuitem>Server</guimenuitem><guimenuitem>Servers</guimenuitem></menuchoice>.
</para>
</listitem>
<listitem>
<para>
- Right-click the Servers view and select <menuchoice><guimenuitem>New</guimenuitem><guimenuitem>Server</guimenuitem></menuchoice> to open the New Server Wizard:
+ Right-click the <guilabel>Servers</guilabel> view and select <menuchoice><guimenuitem>New</guimenuitem><guimenuitem>Server</guimenuitem></menuchoice> to open the <guilabel>New Server</guilabel> wizard:
</para>
<figure>
<title>New Server Wizard</title>
@@ -479,7 +479,7 @@
</figure>
</listitem>
<listitem>
- <para>Select <property>JBoss AS 5.1</property> as a server type. </para>
+ <para>Select <guilabel>JBoss AS 5.1</guilabel> as a server type. </para>
<note>
<para>Please note, that only JBoss As 5.1 or higher version supports BPEL.</para>
</note>
@@ -487,7 +487,7 @@
<listitem>
<para>
- Click the <guibutton>Next</guibutton> button. On the next page, you should input your <emphasis><property>JBoss As</property> </emphasis> location. Then click the <guibutton>Next</guibutton> button and you will get the page like this:
+ Click the <guibutton>Next</guibutton> button. On the next page, you should input your <productname>JBoss As</productname> location. Then click the <guibutton>Next</guibutton> button and you will get the page like this:
</para>
<figure>
<title>Add resource to the server</title>
@@ -500,7 +500,7 @@
</listitem>
<listitem>
<para>
- Select <property>HelloWorld</property>, then click the <guibutton>Add</guibutton> button to add the project to the server. Then click on the <guibutton>Finish</guibutton> button.
+ Select <guilabel>HelloWorld</guilabel>, then click the <guibutton>Add</guibutton> button to add the project to the server. Finally, click the <guibutton>Finish</guibutton> button.
</para>
<para>Start the server by right-clicking on the server and selecting the <guilabel>Start</guilabel> item. </para>
@@ -512,10 +512,10 @@
</imageobject>
</mediaobject>
</figure>
- <para>If some aspects of server creation is not clear, please, read <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html_single/index...">JBoss Server Manager Reference Guide</ulink> for more details.</para>
+ <para>Read the <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html_single/index...">JBoss Server Manager Reference Guide</ulink> for more detail on this process.</para>
</listitem>
<listitem>
- <para>You can enter the link <ulink url="http://localhost:8080/bpel-console/app.html">http://localhost:8080/bpel-console/app.html</ulink> to the browser to get the deployed processes.</para>
+ <para>You can enter the link <ulink url="http://localhost:8080/bpel-console/app.html">http://localhost:8080/bpel-console/app.html</ulink> in your web browser to access the deployed processes.</para>
<figure>
<title>The BPEL console</title>
<mediaobject>
@@ -526,8 +526,9 @@
</figure>
</listitem>
</itemizedlist>
- <para>If there's anything we didn't cover or you can't figure out, please feel free to visit our <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss Tools Users Forum</ulink> to ask questions.
- There we are also waiting for your suggestions and comments.</para>
+ <para>
+ Please visit the <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201">JBoss Tools Users Forum</ulink> for more information and assistance.
+ </para>
</section>
</section>
</chapter>
13 years, 10 months
JBoss Tools SVN: r29436 - in trunk/bpel/docs/reference/en-US: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mcaspers
Date: 2011-03-01 21:50:26 -0500 (Tue, 01 Mar 2011)
New Revision: 29436
Added:
trunk/bpel/docs/reference/en-US/deploy.xml.old
trunk/bpel/docs/reference/en-US/detail.xml.old
trunk/bpel/docs/reference/en-US/images/bpel_ref_1.png
trunk/bpel/docs/reference/en-US/images/bpel_ref_2.png
trunk/bpel/docs/reference/en-US/images/bpel_ref_2a.png
trunk/bpel/docs/reference/en-US/images/bpel_ref_3.png
trunk/bpel/docs/reference/en-US/install.xml.old
Removed:
trunk/bpel/docs/reference/en-US/deploy.xml
trunk/bpel/docs/reference/en-US/detail.xml
trunk/bpel/docs/reference/en-US/install.xml
trunk/bpel/docs/reference/en-US/master_output.xml
Log:
General Documentation Updates
Deleted: trunk/bpel/docs/reference/en-US/deploy.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/deploy.xml 2011-03-02 02:49:24 UTC (rev 29435)
+++ trunk/bpel/docs/reference/en-US/deploy.xml 2011-03-02 02:50:26 UTC (rev 29436)
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="deploy">
- <title>Deploy a JBoss BPEL project to JBoss BPEL Runtime</title>
- <section id="createdeploy">
- <title>Creating a deploy.xml file</title>
- <para>If you want to deploy a BPEL project to JBoss BPEL Runtime, you should create a deploy.xml file.
- JBoss tools can help you to create it:
- </para>
- <itemizedlist>
- <listitem>
- <para>Create the <filename>deploy.xml</filename> by selecting dbmenu
- <emphasis><property>New > Other... > BPEL 2.0 > Apache ODE Deployment Descriptor</property></emphasis>. Click the <property>Next</property> button.
- </para>
- <figure>
- <title>New BPEL Deploy file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>On the next wizard page you should enter the following information:</para>
- <para><emphasis><property>BPEL Project</property></emphasis>: Click the <property>Browse...</property> button to select the BPEL project in your workspace which you want to deploy to the runtime.
- Please note, that you should select the <property>bpelContent</property> folder in your new BPEL project as a value of <property>BPEL Project</property> field because the deploy.xml should be created in this place.
- </para>
- <para><emphasis><property>File name</property></emphasis>: The default value is deploy.xml. Please, don't change it.</para>
- <para>Click on <property>Finish</property> button to close the wizard and a new deploy.xml file will be created.</para>
- <figure>
- <title>New BPEL Deploy file Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Double-click the deploy.xml file to open it in ODE Descriptor Deployment Editor.
- In the <property>Inbound Interfaces</property> section, click the
- <property>Associated Port</property> column and select <property>HelloWorldProcessPort</property>
- in the dropdown box.The <property>Related Service</property> and <property>Binding Used</property>
- columns should be automatically filled in. Save the <emphasis><property>deploy.xml</property></emphasis>.
- </para>
- <figure>
- <title>deploy.xml file editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
- <section id="createruntime">
- <title>Creating JBoss BPEL Server</title>
- <para>Suppose you have installed the <property>JBoss BPEL Runtime-RiftSaw</property>, now you can create a server for JBoss BPEL runtime.</para>
- <itemizedlist>
- <listitem>
- <para>Open the <property>Servers</property> view by selecting
- <emphasis><property>Windows > Show View > Other... > Server > Servers</property></emphasis>.
- </para>
- </listitem>
- <listitem>
- <para>Right-click the Servers view and select
- <emphasis><property>New > Server</property></emphasis> to open the New Server Wizard:
- </para>
- <figure>
- <title>New Server Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Select <property>JBoss AS 5.1 </property>as a server type. </para>
- <note>
- <para>Please note, that only JBoss As 5.1 or higher version supports BPEL.</para>
- </note>
- </listitem>
- <listitem>
-
- <para>Click the <property>Next</property> button. On the next page, you should input your <emphasis><property>JBoss As</property></emphasis> location, and on the page after that you can specify the server behaviour. Then click the <property>Next</property> button and
- you will get the page like this:
- </para>
- <figure>
- <title>Add resource to the server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Select <property>HelloWorld</property>, then click the <property>Add </property> button to add the project to the server.
- Then click on the <property>Finish</property> button.
- </para>
- <para>Start the server by right-clicking on the server and selecting the <property>Start</property> item. </para>
-
- <figure>
- <title>The started server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>If some aspects of server creation is not clear, please, read <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html_single/index...">JBoss Server Manager Reference Guide</ulink> for more details.</para>
- </listitem>
- <listitem>
- <para>You can enter the link <ulink url="http://localhost:8080/bpel/processes.html">http://localhost:8080/bpel/processes.html</ulink> to the browser to get the deployed processes.</para>
- <figure>
- <title>The BPEL console</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>If there's anything we didn't cover or you can't figure out, please feel free to visit our <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201"
- >JBoss Tools Users Forum</ulink> to ask questions.
- There we are also waiting for your suggestions and comments.</para>
- </section>
-</chapter>
Added: trunk/bpel/docs/reference/en-US/deploy.xml.old
===================================================================
--- trunk/bpel/docs/reference/en-US/deploy.xml.old (rev 0)
+++ trunk/bpel/docs/reference/en-US/deploy.xml.old 2011-03-02 02:50:26 UTC (rev 29436)
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="deploy">
+ <title>Deploy a JBoss BPEL project to JBoss BPEL Runtime</title>
+ <section id="createdeploy">
+ <title>Creating a deploy.xml file</title>
+ <para>If you want to deploy a BPEL project to the JBoss BPEL Runtime, a deploy.xml file needs to be created. The steps below show you how to create this file in JBDS:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>Create the <filename>deploy.xml</filename> by selecting dbmenu
+ <emphasis><property>New > Other... > BPEL 2.0 > Apache ODE Deployment Descriptor</property></emphasis>. Click the <guibutton>Next</guibutton> button.
+ </para>
+ <figure>
+ <title>New BPEL Deploy file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>On the next wizard page you should enter the following information:</para>
+ <para><emphasis><property>BPEL Project</property></emphasis>: Click the <property>Browse...</property> button to select the BPEL project in your workspace which you want to deploy to the runtime.
+ Please note, that you should select the <property>bpelContent</property> folder in your new BPEL project as a value of <property>BPEL Project</property> field because the deploy.xml should be created in this place.
+ </para>
+ <para><emphasis><property>File name</property></emphasis>: The default value is deploy.xml. Please, don't change it.</para>
+ <para>Click on <property>Finish</property> button to close the wizard and a new deploy.xml file will be created.</para>
+ <figure>
+ <title>New BPEL Deploy file Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Double-click the deploy.xml file to open it in ODE Descriptor Deployment Editor.
+ In the <property>Inbound Interfaces</property> section, click the
+ <property>Associated Port</property> column and select <property>HelloWorldProcessPort</property>
+ in the dropdown box.The <property>Related Service</property> and <property>Binding Used</property>
+ columns should be automatically filled in. Save the <emphasis><property>deploy.xml</property></emphasis>.
+ </para>
+ <figure>
+ <title>deploy.xml file editor</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="createruntime">
+ <title>Creating JBoss BPEL Server</title>
+ <para>Suppose you have installed the <property>JBoss BPEL Runtime-RiftSaw</property>, now you can create a server for JBoss BPEL runtime.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Open the <property>Servers</property> view by selecting
+ <emphasis><property>Windows > Show View > Other... > Server > Servers</property></emphasis>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Right-click the Servers view and select
+ <emphasis><property>New > Server</property></emphasis> to open the New Server Wizard:
+ </para>
+ <figure>
+ <title>New Server Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Select <property>JBoss AS 5.1 </property>as a server type. </para>
+ <note>
+ <para>Please note, that only JBoss As 5.1 or higher version supports BPEL.</para>
+ </note>
+ </listitem>
+ <listitem>
+
+ <para>Click the <property>Next</property> button. On the next page, you should input your <emphasis><property>JBoss As</property></emphasis> location, and on the page after that you can specify the server behaviour. Then click the <property>Next</property> button and
+ you will get the page like this:
+ </para>
+ <figure>
+ <title>Add resource to the server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Select <property>HelloWorld</property>, then click the <property>Add </property> button to add the project to the server.
+ Then click on the <property>Finish</property> button.
+ </para>
+ <para>Start the server by right-clicking on the server and selecting the <property>Start</property> item. </para>
+
+ <figure>
+ <title>The started server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>If some aspects of server creation is not clear, please, read <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html_single/index...">JBoss Server Manager Reference Guide</ulink> for more details.</para>
+ </listitem>
+ <listitem>
+ <para>You can enter the link <ulink url="http://localhost:8080/bpel/processes.html">http://localhost:8080/bpel/processes.html</ulink> to the browser to get the deployed processes.</para>
+ <figure>
+ <title>The BPEL console</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/deploy_createdeploy_7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>If there's anything we didn't cover or you can't figure out, please feel free to visit our <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201"
+ >JBoss Tools Users Forum</ulink> to ask questions.
+ There we are also waiting for your suggestions and comments.</para>
+ </section>
+</chapter>
Property changes on: trunk/bpel/docs/reference/en-US/deploy.xml.old
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/bpel/docs/reference/en-US/detail.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/detail.xml 2011-03-02 02:49:24 UTC (rev 29435)
+++ trunk/bpel/docs/reference/en-US/detail.xml 2011-03-02 02:50:26 UTC (rev 29436)
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="detail">
- <title>Creating and editing a BPEL project</title>
- <para>In the chapter we describe the steps required to create a new BPEL project and to edit the BPEL files.
- Here and further in the guide we will create
- a simple echo example, used to respond to a sent message with a
- modified version of the request message being returned in a response.
- First of all, you should create a BPEL project.
-
- </para>
- <section id="createproject">
- <title>Creating a BPEL project</title>
- <para>Create the project by selecting
- <emphasis><property>New > Project... > BPEL 2.0 > BPEL Project</property></emphasis> from the menu bar.
- Then click the <property>Next</property> button.
- </para>
- <figure>
- <title>New BPEL Project</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createproject_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On this page of the <property>New BPEL Project Wizard</property> enter a project name in the <property>Project Name</property>
- field,e.g enter <property>HelloWorld</property>.</para>
-
- <figure>
- <title>New BPEL Project Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createproject_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click the <property>Finish</property> button. So you have created the BPEL project named <property>HelloWorld</property>. Its structure is like this: </para>
- <figure>
- <title>The BPEL Project structure</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createproject_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="createprocess">
- <title>Creating a BPEL process</title>
- <para>Now you should create a BPEL process. You can create it by selecting
- <emphasis><property>New > Others... > BPEL 2.0 > New BPEL Process File</property></emphasis>.
- </para>
- <figure>
- <title>New BPEL Process File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createprocess_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click the <property>Next</property> button. Enter the following information:</para>
- <table>
-
- <title>Fields and values</title>
- <tgroup cols="2">
- <colspec colnum="1" align="left" colwidth="2*"/>
- <colspec colnum="2" colwidth="4*"/>
- <thead>
- <row>
- <entry>Field</entry>
- <entry>Value</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>BPEL Process Name</para></entry>
- <entry><para>enter a process name. For example, <property>HelloWorld</property>.</para></entry>
- </row>
- <row>
- <entry><para>Namespace</para></entry>
- <entry><para>enter or select a namespace for the BPEL process.</para></entry>
- </row>
- <row>
- <entry><para>Template</para></entry>
- <entry><para>select a template for the BPEL process. When you select the template, you will see the information about the template below on the page.</para></entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <figure>
- <title>New BPEL Process File Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createprocess_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click the <property>Next</property> button. On the second page make sure that the folder <property>HelloWorld/bpelContent</property> is selected.
- Click <property>Finish</property>.
- </para>
- <note>
- <para>All of your files that are used in your BPEL project must be under the <property>bpelContent</property> folder. Only in this case
- these files can be deployed to JBoss server.
- </para>
- </note>
-
- <para>This will create a simple BPEL process as shown in the image below.</para>
- <figure>
- <title>A simple BPEL Process File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_createprocess_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The next step, you can do is to edit the BPEL process file and then deploy it to JBoss server. </para>
- </section>
- <section id="editprocess">
- <title>Editing a BPEL process file</title>
- <para>If the <emphasis><property>Properties view</property></emphasis> and <emphasis><property>Palette view</property></emphasis> are not opened, you can open the views by right-clicking the BPEL editor and selecting
- <property>Show in Properties</property>, <property>Show Palette in Palette view</property>. Then you should have the view like this:
- </para>
- <figure>
- <title>The BPEL editor view</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>In the <emphasis><property>Palette view</property></emphasis>, you can drag a BPEL element to the BPEL editor and drop it in the place you want.</para>
- <para>In the <emphasis><property>Properties view</property></emphasis>, you can view the information on every element of the BPEL process.
- In the BPEL editor select any element you want,and then
- the element's properties will be shown in the Properties view.The table below describes the tabs of the Properties view:
- </para>
- <table>
-
- <title>Tabs of the Property view</title>
- <tgroup cols="2">
- <colspec colnum="1" align="left" colwidth="2*"/>
- <colspec colnum="2" colwidth="4*"/>
- <thead>
- <row>
- <entry>Tab</entry>
- <entry>Description</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>Description</para></entry>
- <entry><para>Shows the descriptive information about the element,e.g. <property>Name</property> of the element.</para></entry>
- </row>
- <row>
- <entry><para>Details</para></entry>
- <entry><para>Shows the detailed and important information about the element.
- It is the most important section of an element.
- Most of the properties of an element are set in this section.</para></entry>
- </row>
- <row>
- <entry><para>Join Behavior</para></entry>
- <entry><para>Shows the <property>Join Failure</property> property of the element.</para></entry>
- </row>
- <row>
- <entry><para>Documentation</para></entry>
- <entry><para>Shows the <property>documentation</property> sub-element of an element.</para></entry>
- </row>
- <row>
- <entry><para>Other</para></entry>
- <entry><para>Every BPEL element has its own sections: Correlation section, Message Exchange section, and so on. We will
- introduce them while using them.</para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>In order to see how a simple BPEL process works in action, you should do some steps as below: </para>
- <itemizedlist>
- <listitem>
- <para>Add an <property>Assign</property> element between the <property>receiveInput</property> element and <property>replyOutput</property> element.</para>
- </listitem>
- <listitem>
- <para>Click the <property>Assign</property> element in the BPEL editor in order to get the properties information of it in the Properties view.
- </para>
- </listitem>
- <listitem>
- <para>In the <property>Details</property> section of Properties view, you should click the <property>New</property> button to add a <property>copy</property> sub-element to the element.
- Assign "input->payload->input" to "output->payload->result". At this time, an "<property>initializer</property>" popup dialog appears. Click on the <property>Yes</property> button in the dialog.
- </para>
- <figure>
- <title>Add <property>Assign</property> to the process</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Open the file <filename>HelloWorldArtifacts.wsdl</filename> in the <filename>HelloWorld</filename> project by double-clicking the file. Right-click the WSDL editor and select
- <property>Add Service</property>. A new service should appear in the editor. Name it <filename>HelloWorldProcessService</filename>. It has the Port
- named <property>NewPort</property>. Select it, right-click on it and rename it to <filename>HelloWorldProcessPort</filename> in the Properties
- view.
- </para>
- <figure>
- <title>Add <property>Service</property> to the WSDL file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Right-click somewhere in the whitespace of the WSDL editor and select
- <property>Add Binding</property>. A new Binding component will appear in the editor. Name it <property>HelloWorldSOAPBinding</property>. Select it, in the
- General tab of the Properties view and select <property>HelloWorld</property> as a port type in the <property>PortType</property>. Then click on the
- <property>Generate Binding Content...</property> button to open the <property>Binding Wizard</property>. In the wizard, select <property>SOAP </property>
- as the <property>Protocol</property>. Finally, click the <property>Finish</property> button to close the wizard.
- </para>
- <figure>
- <title>Add a <property>Binding</property> to the WSDL file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para>Click the <property>HelloWorldProcessPort</property> property in the General section of the Properties view, select <property>HelloWorldSOAPBinding</property> in
- the <property>Binding</property> combobox. In the <property>Address</property> field input <ulink url="http://localhost:8080/bpel/processes/HelloWorld?wsdl">http://localhost:8080/bpel/processes/HelloWorld?wsdl</ulink>.
- </para>
- <figure>
- <title>Add the <property>HelloWorldSOAPBinding</property> to the <property>HelloWorldProcessPort</property></title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>Now you have finished creating a simple BPEL process.As a next step, you can deploy the BPEL project to JBoss BPEL Runtime.</para>
-
- </section>
-</chapter>
Added: trunk/bpel/docs/reference/en-US/detail.xml.old
===================================================================
--- trunk/bpel/docs/reference/en-US/detail.xml.old (rev 0)
+++ trunk/bpel/docs/reference/en-US/detail.xml.old 2011-03-02 02:50:26 UTC (rev 29436)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="detail">
+ <title>Creating and editing a BPEL project</title>
+ <para>In the chapter we describe the steps required to create a new BPEL project and to edit the BPEL files.
+ Here and further in the guide we will create
+ a simple echo example, used to respond to a sent message with a
+ modified version of the request message being returned in a response.
+ First of all, you should create a BPEL project.
+
+ </para>
+ <section id="createproject">
+ <title>Creating a BPEL project</title>
+ <para>Create the project by selecting
+ <emphasis><property>New > Project... > BPEL 2.0 > BPEL Project</property></emphasis> from the menu bar.
+ Then click the <property>Next</property> button.
+ </para>
+ <figure>
+ <title>New BPEL Project</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createproject_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>On this page of the <guilabel>New BPEL Project</guilabel> wizard enter a project name in the <guilabel>Project Name</guilabel>
+ field, e.g <guilabel>HelloWorld</guilabel>.</para>
+
+ <figure>
+ <title>New BPEL Project Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createproject_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click the <property>Finish</property> button. This will create a BPEL project named <guilabel>HelloWorld</guilabel>. Its structure is shown in the image below: </para>
+ <figure>
+ <title>The BPEL Project structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createproject_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+ <section id="createprocess">
+ <title>Creating a BPEL process</title>
+ <para>Now you should create a BPEL process. You can create it by selecting
+ <emphasis><property>New > Others... > BPEL 2.0 > New BPEL Process File</property></emphasis>.
+ </para>
+ <figure>
+ <title>New BPEL Process File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createprocess_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click the <property>Next</property> button. Enter the following information:</para>
+ <table>
+
+ <title>Fields and values</title>
+ <tgroup cols="2">
+ <colspec colnum="1" align="left" colwidth="2*"/>
+ <colspec colnum="2" colwidth="4*"/>
+ <thead>
+ <row>
+ <entry>Field</entry>
+ <entry>Value</entry>
+
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><para>BPEL Process Name</para></entry>
+ <entry><para>enter a process name. For example, <property>HelloWorld</property>.</para></entry>
+ </row>
+ <row>
+ <entry><para>Namespace</para></entry>
+ <entry><para>enter or select a namespace for the BPEL process.</para></entry>
+ </row>
+ <row>
+ <entry><para>Template</para></entry>
+ <entry><para>select a template for the BPEL process. When you select the template, you will see the information about the template below on the page.</para></entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <figure>
+ <title>New BPEL Process File Wizard</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createprocess_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Click the <property>Next</property> button. On the second page make sure that the folder <property>HelloWorld/bpelContent</property> is selected.
+ Click <property>Finish</property>.
+ </para>
+ <note>
+ <para>All of your files that are used in your BPEL project must be under the <property>bpelContent</property> folder. Only in this case
+ these files can be deployed to JBoss server.
+ </para>
+ </note>
+
+ <para>This will create a simple BPEL process as shown in the image below.</para>
+ <figure>
+ <title>A simple BPEL Process File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_createprocess_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>The next step, you can do is to edit the BPEL process file and then deploy it to JBoss server. </para>
+ </section>
+ <section id="editprocess">
+ <title>Editing a BPEL process file</title>
+ <para>If the <emphasis><property>Properties view</property></emphasis> and <emphasis><property>Palette view</property></emphasis> are not opened, you can open the views by right-clicking the BPEL editor and selecting
+ <property>Show in Properties</property>, <property>Show Palette in Palette view</property>. Then you should have the view like this:
+ </para>
+ <figure>
+ <title>The BPEL editor view</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_editprocess_1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>In the <emphasis><property>Palette view</property></emphasis>, you can drag and drop BPEL elements to the BPEL editor.</para>
+ <para>In the <emphasis><property>Properties view</property></emphasis>, you can view the information on every element of the BPEL process.
+ In the BPEL editor select any element you want,and then
+ the element's properties will be shown in the Properties view.The table below describes the tabs of the Properties view:
+ </para>
+ <table>
+
+ <title>Tabs of the Property view</title>
+ <tgroup cols="2">
+ <colspec colnum="1" align="left" colwidth="2*"/>
+ <colspec colnum="2" colwidth="4*"/>
+ <thead>
+ <row>
+ <entry>Tab</entry>
+ <entry>Description</entry>
+
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><para>Description</para></entry>
+ <entry><para>Shows the descriptive information about the element, e.g. the <property>Name</property> of the element.</para></entry>
+ </row>
+ <row>
+ <entry><para>Details</para></entry>
+ <entry><para>Shows the detailed and important information about the element.
+ It is the most important section of an element.
+ Most of the properties of an element are set in this section.</para></entry>
+ </row>
+ <row>
+ <entry><para>Join Behavior</para></entry>
+ <entry><para>Shows the <property>Join Failure</property> property of the element.</para></entry>
+ </row>
+ <row>
+ <entry><para>Documentation</para></entry>
+ <entry><para>Shows the <property>documentation</property> sub-element of an element.</para></entry>
+ </row>
+ <row>
+ <entry><para>Other</para></entry>
+ <entry><para>Every BPEL element has its own sections: Correlation section, Message Exchange section, and so on. We will
+ introduce them while using them.</para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <para>The following steps will allow you to see a simple BPEL process in action: </para>
+ <itemizedlist>
+ <listitem>
+ <para>Add an <guilabel>Assign</guilabel> element between the <guilabel>receiveInput</guilabel> element and <guilabel>replyOutput</guilabel> element.</para>
+ </listitem>
+ <listitem>
+ <para>Click the <guilabel>Assign</guilabel> element in the BPEL editor in order to get the properties information of it in the <guilabel>Properties</guilabel> view.
+ </para>
+ </listitem>
+ <listitem>
+ <para>In the <guilabel>Details</guilabel> section of <guilabel>Properties</guilabel> view, you should click the <guibutton>New</guibutton> button to add a <property>copy</property> sub-element to the element.
+ Assign "input->payload->input" to "output->payload->result". At this time, an <guilabel>initializer</guilabel> popup dialog appears. Click on the <guibutton>Yes</guibutton> button in the dialog.
+ </para>
+ <figure>
+ <title>Add <property>Assign</property> to the process</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_editprocess_2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Open the file <filename>HelloWorldArtifacts.wsdl</filename> in the <filename>HelloWorld</filename> project by double-clicking the file. Right-click the WSDL editor and select
+ <property>Add Service</property>. A new service should appear in the editor. Name it <filename>HelloWorldProcessService</filename>. It has the Port
+ named <property>NewPort</property>. Select it, right-click on it and rename it to <filename>HelloWorldProcessPort</filename> in the Properties
+ view.
+ </para>
+ <figure>
+ <title>Add <property>Service</property> to the WSDL file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_editprocess_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Right-click somewhere in the whitespace of the WSDL editor and select
+ <property>Add Binding</property>. A new Binding component will appear in the editor. Name it <property>HelloWorldSOAPBinding</property>. Select it, in the
+ General tab of the Properties view and select <property>HelloWorld</property> as a port type in the <property>PortType</property>. Then click on the
+ <property>Generate Binding Content...</property> button to open the <property>Binding Wizard</property>. In the wizard, select <property>SOAP </property>
+ as the <property>Protocol</property>. Finally, click the <property>Finish</property> button to close the wizard.
+ </para>
+ <figure>
+ <title>Add a <property>Binding</property> to the WSDL file</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_editprocess_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ <listitem>
+ <para>Click the <property>HelloWorldProcessPort</property> property in the General section of the Properties view, select <property>HelloWorldSOAPBinding</property> in
+ the <property>Binding</property> combobox. In the <property>Address</property> field input <ulink url="http://localhost:8080/bpel/processes/HelloWorld?wsdl">http://localhost:8080/bpel/processes/HelloWorld?wsdl</ulink>.
+ </para>
+ <figure>
+ <title>Add the <property>HelloWorldSOAPBinding</property> to the <property>HelloWorldProcessPort</property></title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/detail_editprocess_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </itemizedlist>
+ <para>Now you have finished creating a simple BPEL process.As a next step, you can deploy the BPEL project to JBoss BPEL Runtime.</para>
+
+ </section>
+</chapter>
Property changes on: trunk/bpel/docs/reference/en-US/detail.xml.old
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/bpel/docs/reference/en-US/images/bpel_ref_1.png
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/docs/reference/en-US/images/bpel_ref_1.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/docs/reference/en-US/images/bpel_ref_2.png
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/docs/reference/en-US/images/bpel_ref_2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/docs/reference/en-US/images/bpel_ref_2a.png
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/docs/reference/en-US/images/bpel_ref_2a.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/bpel/docs/reference/en-US/images/bpel_ref_3.png
===================================================================
(Binary files differ)
Property changes on: trunk/bpel/docs/reference/en-US/images/bpel_ref_3.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/bpel/docs/reference/en-US/install.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/install.xml 2011-03-02 02:49:24 UTC (rev 29435)
+++ trunk/bpel/docs/reference/en-US/install.xml 2011-03-02 02:50:26 UTC (rev 29436)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<chapter id="install">
- <title>Installation JBoss BPEL Tools</title>
- <section id="installeclipse">
- <title>Installation JBoss BPEL editor</title>
- <para>
- To begin you need a copy of Eclipse 3.6. You can get it from <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse Web Site</ulink>.
- </para>
- <para>The JBoss BPEL editor is included with JBoss Tools. There are a number of different JBoss Tools installation methods. See <ulink url="http://www.jboss.org/tools/download/installation.html">Installing JBoss Tools</ulink> for more information.</para>
- <para>
- If you want to install only the JBoss BPEL editor, you can install it from <ulink url="http://jboss.org/tools/download/dev.html">JBoss Tools</ulink> page separately. Please note that only JBoss Tools 3.1 or higher version includes JBoss BPEL editor.
- </para>
- </section>
- <section>
- <title>Prerequisites</title>
- <para>For installation and configuring BPEL engine into a JBossAS environment you will need the following: </para>
- <itemizedlist>
- <listitem>
- <para> JBossAS (version 5.1.0.GA or higher), available from <ulink url="http://www.jboss.org/jbossas">http://www.jboss.org/jbossas</ulink>.</para>
- </listitem>
- <listitem>
- <para>RiftSaw (version 2.1 or higher), available from <ulink url="http://www.jboss.org/riftsaw">http://www.jboss.org/riftsaw</ulink>.</para>
- </listitem>
- <listitem>
- <para>Ant, available from <ulink url="http://ant.apache.org">here</ulink>.</para>
- </listitem>
- </itemizedlist>
-
- </section>
- <section id="installRuntime">
- <title>Installation JBoss BPEL Runtime</title>
- <itemizedlist>
- <listitem>
- <para>Unpack the JBossAS installation archive into the required location.</para>
- </listitem>
- <listitem>
- <para>Unpack the RiftSaw distribution into the location alongside the JBossAS installation:</para>
- <itemizedlist>
- <listitem>
- <para>Edit the <filename>install/deployment.properties</filename> file to update the JBossAS location settings.</para>
- </listitem>
- <listitem>
- <para>From the <filename>install</filename> folder run: <command>ant deploy -Ddatabase=hsql</command> to deploy RiftSaw to JBossAS.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>
- Then in the <filename>${RiftSaw}/install</filename> folder run the command: <command>ant deploy -Ddatabase=hsql -Dws.stack=native -Dws.version=3.2.2.GA</command> It will help you to download the web service stack, and then upgrade it for JBoss AS. Alternatively, you can do it step by step by following the guide from <ulink url="http://www.jboss.org/riftsaw/documentation">JBoss RiftSaw documents</ulink> or the README file in <filename>${RiftSaw}/install</filename>
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
-</chapter>
\ No newline at end of file
Added: trunk/bpel/docs/reference/en-US/install.xml.old
===================================================================
--- trunk/bpel/docs/reference/en-US/install.xml.old (rev 0)
+++ trunk/bpel/docs/reference/en-US/install.xml.old 2011-03-02 02:50:26 UTC (rev 29436)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chapter id="install">
+ <title>Installation JBoss BPEL Tools</title>
+ <section id="installeclipse">
+ <title>Installation JBoss BPEL editor</title>
+ <para>
+ To begin you need a copy of Eclipse 3.6. You can get it from <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse Web Site</ulink>.
+ </para>
+ <para>The JBoss BPEL editor is included with JBoss Tools. There are a number of different JBoss Tools installation methods. See <ulink url="http://www.jboss.org/tools/download/installation.html">Installing JBoss Tools</ulink> for more information.</para>
+ <para>
+ If you want to install only the JBoss BPEL editor, you can install it from <ulink url="http://jboss.org/tools/download/dev.html">JBoss Tools</ulink> page separately. Please note that only JBoss Tools 3.1 or higher version includes JBoss BPEL editor.
+ </para>
+ </section>
+ <section>
+ <title>Prerequisites</title>
+ <para>For installation and configuring BPEL engine into a JBossAS environment you will need the following: </para>
+ <itemizedlist>
+ <listitem>
+ <para> JBossAS (version 5.1.0.GA or higher), available from <ulink url="http://www.jboss.org/jbossas">http://www.jboss.org/jbossas</ulink>.</para>
+ </listitem>
+ <listitem>
+ <para>RiftSaw (version 2.1 or higher), available from <ulink url="http://www.jboss.org/riftsaw">http://www.jboss.org/riftsaw</ulink>.</para>
+ </listitem>
+ <listitem>
+ <para>Ant, available from <ulink url="http://ant.apache.org">here</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ <section id="installRuntime">
+ <title>Installation JBoss BPEL Runtime</title>
+ <itemizedlist>
+ <listitem>
+ <para>Unpack the JBossAS installation archive into the required location.</para>
+ </listitem>
+ <listitem>
+ <para>Unpack the RiftSaw distribution into the location alongside the JBossAS installation:</para>
+ <itemizedlist>
+ <listitem>
+ <para>Edit the <filename>install/deployment.properties</filename> file to update the JBossAS location settings.</para>
+ </listitem>
+ <listitem>
+ <para>From the <filename>install</filename> folder run: <command>ant deploy -Ddatabase=hsql</command> to deploy RiftSaw to JBossAS.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ Then in the <filename>${RiftSaw}/install</filename> folder run the command: <command>ant deploy -Ddatabase=hsql -Dws.stack=native -Dws.version=3.2.2.GA</command> It will help you to download the web service stack, and then upgrade it for JBoss AS. Alternatively, you can do it step by step by following the guide from <ulink url="http://www.jboss.org/riftsaw/documentation">JBoss RiftSaw documents</ulink> or the README file in <filename>${RiftSaw}/install</filename>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+</chapter>
\ No newline at end of file
Property changes on: trunk/bpel/docs/reference/en-US/install.xml.old
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/bpel/docs/reference/en-US/master_output.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/master_output.xml 2011-03-02 02:49:24 UTC (rev 29435)
+++ trunk/bpel/docs/reference/en-US/master_output.xml 2011-03-02 02:50:26 UTC (rev 29436)
@@ -1,1133 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
-"http://www.docbook.org/xml/4.3/docbookx.dtd"
-
-[<!ENTITY overview SYSTEM "overview.xml">
-<!ENTITY install SYSTEM "install.xml">
-<!ENTITY detail SYSTEM "detail.xml">
-<!ENTITY deploy SYSTEM "deploy.xml">
-<!ENTITY reference SYSTEM "reference.xml">
-<!ENTITY summary SYSTEM "summary.xml">
-<!ENTITY tasks SYSTEM "tasks.xml">
-]><book xmlns:diffmk="http://diffmk.sf.net/ns/diff">
-
- <bookinfo>
- <title>JBoss BPEL User Guide</title>
-
- <corpauthor>
- <inlinemediaobject>
- <imageobject role="fo">
- <imagedata fileref="images/jbosstools_logo.png" format="PNG"></imagedata>
- </imageobject>
- <imageobject role="html">
- <imagedata></imagedata>
- </imageobject>
- </inlinemediaobject>
- </corpauthor>
- <author><firstname>Denny</firstname><surname>Xu</surname><email>dxu(a)redhat.com</email></author>
- <author><firstname>Grid</firstname><surname>Qian</surname><email>fqian(a)redhat.com</email></author>
- <copyright>
- <year>2009</year>
- <year>2010</year>
- <holder>JBoss by Red Hat</holder>
- </copyright>
- <releaseinfo>
- Version: 1.0.0.trunk
- </releaseinfo>
-<abstract>
- <title></title>
- <para>
- <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/bpel_ref_guide/pdf/B...">PDF version</ulink>
- </para>
-</abstract>
-
-
- </bookinfo>
-
- <toc></toc>
-
-<chapter id="overview" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/bpel/docs/reference/en-US/modules/overview.xml">
- <title>JBoss BPEL project Overview</title>
-
- <para>JBoss BPEL project is a WS-BPEL 2.0 project that gives a way to create, edit, validate and deploy BPEL files to JBoss BPEL runtime. It is based on Eclipse
- <ulink url="http://www.eclipse.org/bpel/">BPEL
- project </ulink>. </para>
-
- <para>It improves the Eclipse BPEL project in the following way: </para>
- <itemizedlist>
- <listitem><para> Implements close integration with JBoss BPEL runtime. Adds a new project type for the deployment to JBoss BPEL runtime.</para></listitem>
- <listitem><para> Supports two ways of deployment: one way is to deploy a bpel project directly to JBoss BPEL runtime. The other way is to deploy bpel files in JBoss ESB project to JBoss BPEL runtime. </para></listitem>
- <listitem><para> Improves the BPEL validator and increases Eclipse BPEL editor's quality. </para></listitem>
- </itemizedlist>
-
- <para>
- <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html">WS-BPEL 2.0</ulink>
- stands for Web Service Business Process Execution Language. Like EAI, BPEL is an XML-based language,
- but BPEL is more specific and targeted. A programmer uses BPEL to join sometimes
- disparate functions into an integrated process, resulting in a seamless use of the Internet to
- conduct business transactions ranging from simple money exchanges to complex calculations and
- asset reallocation.
- </para>
-
-<section>
- <title>Key Features of JBoss BPEL project</title>
- <para>Let's start with looking through the table of the main features of JBoss BPEL editor project: </para>
-
- <table>
-
- <title>Key Functionality for JBoss BPEL editor project</title>
- <tgroup cols="2">
- <colspec align="left" colnum="1" colwidth="2*"></colspec>
- <colspec colnum="2" colwidth="4*"></colspec>
- <thead>
- <row>
- <entry>Feature</entry>
- <entry>Benefit</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>WS-BPEL 2.0 support</para></entry>
- <entry><para>JBoss BPEL project supports the newest WS-BPEL 2.0 specifications. </para></entry>
- </row>
- <row>
- <entry><para>Close integration with JBoss BPEL runtime</para></entry>
- <entry><para>There are two ways to deploy BPEL files to JBoss BPEL runtime.
- The user can deploy a BPEL project as a whole and can deploy BPEL files in
- JBoss ESB project to JBoss BPEL runtime. </para></entry>
- </row>
- <row>
- <entry><para>BPEL file editor</para></entry>
- <entry><para>The user can use the editor separately to edit a BPEL file. </para></entry>
- </row>
- <row>
- <entry><para>BPEL file validator</para></entry>
- <entry><para>The validator can give the error messages about BPEL files to the user. </para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
-</section>
-
-</chapter>
-
-<chapter id="install" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/bpel/docs/reference/en-US/modules/install.xml">
- <title>Installation JBoss BPEL Tools</title>
- <section id="installeclipse">
- <title>Installation JBoss BPEL editor</title>
- <para>At first, you need Eclipse 3.6. You can get it from <ulink url="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downlo...">Eclipse Web Site</ulink>.
- </para>
- <para>The JBoss BPEL editor is included into JBoss Tools.
- You have some methods to install JBoss Tools.
- See <ulink url="http://www.jboss.org/tools/download/installation.html">Installing JBoss Tools</ulink> for more information.</para>
- <para>If you want to install only the JBoss BPEL editor, you can install it from <ulink url="http://jboss.org/tools/download/dev.html">JBoss Tools</ulink> page separately.
- Please, note, that only JBoss Tools 3.1 or higher version includes JBoss BPEL editor.
- </para>
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Prerequisites</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">For installation and configuring BPEL engine into a JBossAS environment
- you will need the following: </diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added"> JBossAS (version 5.1.0.GA or higher),
- available from </diffmk:wrapper><ulink diffmk:change="added" url="http://www.jboss.org/jbossas"><diffmk:wrapper diffmk:change="added">
- http://www.jboss.org/jbossas</diffmk:wrapper></ulink><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">RiftSaw (version 2.1 or higher), available from </diffmk:wrapper><ulink diffmk:change="added" url="http://www.jboss.org/riftsaw"><diffmk:wrapper diffmk:change="added">http://www.jboss.org/riftsaw</diffmk:wrapper></ulink><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Ant, available from </diffmk:wrapper><ulink diffmk:change="added" url="http://ant.apache.org"><diffmk:wrapper diffmk:change="added">here</diffmk:wrapper></ulink><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para></listitem>
- </itemizedlist>
-
- </section>
- <section id="installRuntime">
- <title>Installation JBoss BPEL Runtime</title>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para><diffmk:wrapper diffmk:change="added">Unpack the JBossAS installation archive into the required location.
- </diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Unpack the RiftSaw distribution into the location
- alongside the JBossAS installation:</diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Edit the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">install/deployment.properties</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> file to update
- the JBossAS location settings.
- </diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">From the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">install</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> folder,
- run: </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">ant deploy -Ddatabase=hsql</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">
- to deploy RiftSaw to JBossAS.
- </diffmk:wrapper></para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Then in the
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">${RiftSaw}/install</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> folder run the command:
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">ant deploy -Ddatabase=hsql -Dws.stack=native -Dws.version=3.2.2.GA</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">
- It will help you to download the web service stack, and then upgrade it for JBoss AS. Anyway, you can do it step by step by following the guide from </diffmk:wrapper> <ulink url="http://www.jboss.org/riftsaw/documentation">JBoss RiftSaw documents</ulink> or the README file in <property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">${RiftSaw}/install</diffmk:wrapper></property>
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
-</chapter>
-
-<chapter id="tasks" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/bpel/docs/reference/en-US/modules/tasks.xml">
- <title><diffmk:wrapper diffmk:change="changed">Tasks</diffmk:wrapper></title>
- <section diffmk:change="added" id="detail">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Creating and editing a BPEL project</diffmk:wrapper></title>
- <para><diffmk:wrapper diffmk:change="added">In the chapter we describe the necessary steps to create a new BPEL project and edit the BPEL files.
- You can get the source of the example from </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">
- riftsaw/samples/quickstart/hello_world</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.
- Here and further in the guide we will create
- a simple echo example, used to respond to a sent message with a
- modified version of the request message being returned in a response.
- First of all, you should create a BPEL project.
-
- </diffmk:wrapper></para>
- <section diffmk:change="added" id="createproject">
- <title>Creating a BPEL project</title>
- <para><diffmk:wrapper diffmk:change="changed">Create the project by selecting
- </diffmk:wrapper><emphasis><property moreinfo="none">New > Project... > BPEL 2.0 > BPEL Project</property></emphasis><diffmk:wrapper diffmk:change="changed"> from the menu bar.
- Then click the </diffmk:wrapper><property moreinfo="none">Next</property><diffmk:wrapper diffmk:change="changed"> button.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>New BPEL Project</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createproject_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On this page of the <property moreinfo="none">New BPEL Project Wizard</property> enter a project name in the <property moreinfo="none">Project Name</property><diffmk:wrapper diffmk:change="changed">
- field,e.g enter </diffmk:wrapper><property moreinfo="none">HelloWorld</property>.</para>
-
- <figure float="0">
- <title>New BPEL Project Wizard</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createproject_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click the <property moreinfo="none">Finish</property><diffmk:wrapper diffmk:change="changed"> button.
- So you have created the BPEL project named </diffmk:wrapper><property moreinfo="none">HelloWorld</property><diffmk:wrapper diffmk:change="changed">.
- Its structure is like this: </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>The BPEL Project structure</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createproject_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section diffmk:change="added" id="createprocess">
- <title>Creating a BPEL process</title>
- <para><diffmk:wrapper diffmk:change="changed">Now you should create a BPEL process. You can create it by selecting
- </diffmk:wrapper><emphasis><property moreinfo="none">New > Others... > BPEL 2.0 > New BPEL Process File</property></emphasis><diffmk:wrapper diffmk:change="changed">.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>New BPEL Process File</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createprocess_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Click the <property moreinfo="none">Next</property> button. Enter the following information:</para>
- <table>
-
- <title>Fields and values</title>
- <tgroup cols="2">
- <colspec align="left" colnum="1" colwidth="2*"></colspec>
- <colspec colnum="2" colwidth="4*"></colspec>
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry>Field</entry>
- <entry>Value</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>BPEL Process Name</para></entry>
- <entry><para>enter a process name. For example, <property moreinfo="none">HelloWorld</property>.</para></entry>
- </row>
- <row>
- <entry><para>Namespace</para></entry>
- <entry><para>enter or select a namespace for the BPEL process.</para></entry>
- </row>
- <row>
- <entry><para>Template</para></entry>
- <entry><para><diffmk:wrapper diffmk:change="added">Select the necessary template for the BPEL process.
- When you select the template, you will see the information
- about the template below on the page.In our case you should
- select </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Synchronous BPEL Process</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para></entry>
- </row>
-
- </tbody>
- </tgroup>
- </table>
-
- <figure float="0">
- <title>New BPEL Process File Wizard</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createprocess_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Click the <property moreinfo="none">Next</property> button. On the second page, you can custom your wsdl service details. Enter the following information:</para>
- <table>
-
- <title>Fields and values</title>
- <tgroup cols="2">
- <colspec align="left" colnum="1" colwidth="2*"></colspec>
- <colspec colnum="2" colwidth="4*"></colspec>
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry>Field</entry>
- <entry>Value</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>Service Name</para></entry>
- <entry><para>a wsdl service name for the BPEL process. The default is, <property moreinfo="none">HelloWorld</property>.</para></entry>
- </row>
- <row>
- <entry><para>Port Name</para></entry>
- <entry><para>a wsdl port name for the BPEL process. The default is, <property moreinfo="none">HelloWorldPort</property>.</para></entry>
- </row>
- <row>
- <entry><para>Service Address</para></entry>
- <entry><para>an address of the wsdl service for the BPEL process. The default is, <property moreinfo="none">http://localhost:8080/HelloWorld</property>.</para></entry>
- </row>
- <row>
- <entry><para>Binding Protocol</para></entry>
- <entry><para>the binding protocal that you use in the wsdl. You can choose SOAP or HTTP. The default is, <property moreinfo="none">SOAP</property>.</para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <figure float="0">
- <title>Create WSDL file for the BPEL Process wizardpage</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createprocess_2a.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para>Click the <property moreinfo="none">Next</property> button. On the third page, you can choose a folder for the process file from the projects in your workspace. If not choose, The default folder <property moreinfo="none">HelloWorld/bpelContent</property><diffmk:wrapper diffmk:change="changed"> is selected.
- Click </diffmk:wrapper><property moreinfo="none">Finish</property><diffmk:wrapper diffmk:change="changed">.
- </diffmk:wrapper></para>
- <note diffmk:change="added">
- <para>All of your files that are used in your BPEL project must be under the <property moreinfo="none">bpelContent</property><diffmk:wrapper diffmk:change="changed"> folder of a BPEL project. Only in this case
- these files can be deployed to JBoss server.
- </diffmk:wrapper></para>
- </note>
-
- <para>Up to now, you have got a simple BPEL process as on the screen below.</para>
- <figure diffmk:change="added" float="0">
- <title>A simple BPEL Process File</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_createprocess_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>The next step, you can do is to edit the BPEL process file and then deploy it to JBoss server. </para>
- </section>
- <section diffmk:change="added" id="editprocess">
- <title>Editing a BPEL process file</title>
- <para>If the <emphasis><property moreinfo="none">Properties view</property></emphasis> and <emphasis><property moreinfo="none">Palette view</property></emphasis><diffmk:wrapper diffmk:change="changed"> are not opened, you can open the views by right-clicking the BPEL editor and selecting
- </diffmk:wrapper><property moreinfo="none">Show in Properties</property>, <property moreinfo="none">Show Palette in Palette view</property><diffmk:wrapper diffmk:change="changed">. Then you should have the view like this:
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>The BPEL editor view</title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata fileref="images/detail_editprocess_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>In the <emphasis><property moreinfo="none">Palette view</property></emphasis>, you can drag a BPEL element to the BPEL editor and drop it in the place you want.</para>
- <para>In the <emphasis><property moreinfo="none">Properties view</property></emphasis><diffmk:wrapper diffmk:change="changed">, you can get the information about every element of the BPEL process.
- In the BPEL editor select any element you want,and then
- the element's properties will be shown in the Properties view.The table below describes the tabs of the Properties view:
- </diffmk:wrapper></para>
- <table>
-
- <title>Tabs of the Property view</title>
- <tgroup cols="2">
- <colspec align="left" colnum="1" colwidth="2*"></colspec>
- <colspec colnum="2" colwidth="4*"></colspec>
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry>Tab</entry>
- <entry>Description</entry>
-
- </row>
- </thead>
- <tbody>
- <row>
- <entry><para>Description</para></entry>
- <entry><para>Shows the descriptive information about the element,e.g. <property moreinfo="none">Name</property> of the element.</para></entry>
- </row>
- <row>
- <entry><para>Details</para></entry>
- <entry><para><diffmk:wrapper diffmk:change="changed">Shows the detailed and important information about the element.
- It is the most important section of an element.
- Most of the properties of an element are set in this section.</diffmk:wrapper></para></entry>
- </row>
- <row>
- <entry><para>Join Behavior</para></entry>
- <entry><para>Shows the <property moreinfo="none">Join Failure</property> property of the element.</para></entry>
- </row>
- <row>
- <entry><para>Documentation</para></entry>
- <entry><para>Shows the <property moreinfo="none">documentation</property> sub-element of an element.</para></entry>
- </row>
- <row>
- <entry><para>Other</para></entry>
- <entry><para><diffmk:wrapper diffmk:change="changed">Every BPEL element has its own sections: Correlation section, Message Exchange section, and so on. We will
- introduce them while using them.</diffmk:wrapper></para></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <para>In order to see how a simple BPEL process works in action, you should do some steps as below: </para>
- <itemizedlist>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Modify two variables of the process:</diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Click on the details tab of the input variable,
- select </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Browse...</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.
- Then choose </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">string</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> primitive from the list.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Edit variable in </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">process</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> file</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/bpel_task_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Select </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">xsd</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> as a namespace in the popup menu.</diffmk:wrapper></para>
- </listitem>
- </itemizedlist>
-
- </listitem>
- <listitem diffmk:change="added">
- <para>Add an <property moreinfo="none">Assign</property> element between the <property moreinfo="none">receiveInput</property> element and <property moreinfo="none">replyOutput</property> element.</para>
- </listitem>
- <listitem diffmk:change="added">
- <para>Click the <property moreinfo="none">Assign</property><diffmk:wrapper diffmk:change="changed"> element in the BPEL editor in order to get the properties information of it in the Properties view.
- </diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Set its name in the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Description</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> tab as </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">assignHelloMesg</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para>
- <para>In the <property moreinfo="none">Details</property><diffmk:wrapper diffmk:change="changed"> section of Properties view,
- you should click the </diffmk:wrapper><property moreinfo="none">New</property> button to add a <property moreinfo="none">copy</property><diffmk:wrapper diffmk:change="changed"> sub-element to the element.
- Assign "Variable to Variable"(input:string to output). At this time, an "</diffmk:wrapper><property moreinfo="none">initializer</property>" popup dialog appears. Click on the <property moreinfo="none">Yes</property><diffmk:wrapper diffmk:change="changed"> button in the dialog.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>Add <property moreinfo="none">Assign</property> to the process</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/bpel_task_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Then you should click </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">New</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> once more and select Expression to Variable
- (assign </diffmk:wrapper><code diffmk:change="added"><diffmk:wrapper diffmk:change="added">concat($input,' World'))</diffmk:wrapper></code><diffmk:wrapper diffmk:change="added"> to </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">result:string</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">. </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Add </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Expression assign</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> to the process</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/bpel_task_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
-
- <section diffmk:change="added" id="wsdl">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Adding Service to WSDL file</diffmk:wrapper></title>
- <para diffmk:change="added"></para>
- <para diffmk:change="added">The HelloWorldArtifacts.wsdl has been added a service when you create a BPEL process file. You have a default service in this WSDL file. But if you want to add a service by yourself, you can follow the steps as below: </para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para>Open the file "<property moreinfo="none">HelloWorldArtifacts.wsdl</property>" in the "<property moreinfo="none">HelloWorld</property><diffmk:wrapper diffmk:change="changed">" project by double-clicking the file. Right-click the WSDL editor and select
- </diffmk:wrapper><property moreinfo="none">Add Service</property>. A new service should appear in the editor. Name it <property moreinfo="none">HelloWorldProcessService</property><diffmk:wrapper diffmk:change="changed">. It has the Port
- named </diffmk:wrapper><property moreinfo="none">NewPort</property>. Select it, right-click on it and rename it to <property moreinfo="none">HelloWorldProcessPort</property><diffmk:wrapper diffmk:change="changed"> in the Properties
- view.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>Add <property moreinfo="none">Service</property> to the WSDL file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para><diffmk:wrapper diffmk:change="changed">Right-click somewhere in the whitespace of the WSDL editor and select
- </diffmk:wrapper><property moreinfo="none">Add Binding</property>. A new Binding component will appear in the editor. Name it <property moreinfo="none">HelloWorldSOAPBinding</property><diffmk:wrapper diffmk:change="changed">. Select it, in the
- General tab of the Properties view and select </diffmk:wrapper><property moreinfo="none">HelloWorld</property> as a port type in the <property moreinfo="none">PortType</property><diffmk:wrapper diffmk:change="changed">. Then click on the
- </diffmk:wrapper><property moreinfo="none">Generate Binding Content...</property> button to open the <property moreinfo="none">Binding Wizard</property>. In the wizard, select <property moreinfo="none">SOAP </property><diffmk:wrapper diffmk:change="changed">
- as the </diffmk:wrapper><property moreinfo="none">Protocol</property>. Finally, click the <property moreinfo="none">Finish</property><diffmk:wrapper diffmk:change="changed"> button to close the wizard.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>Add a <property moreinfo="none">Binding</property> to the WSDL file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_4.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para>Click the <property moreinfo="none">HelloWorldProcessPort</property> property in the General section of the Properties view, select <property moreinfo="none">HelloWorldSOAPBinding</property><diffmk:wrapper diffmk:change="changed"> in
- the </diffmk:wrapper><property moreinfo="none">Binding</property> combobox. In the <property moreinfo="none">Address</property> field input <ulink url="http://localhost:8080/bpel/processes/HelloWorld?wsdl">http://localhost:8080/bpel/processes/HelloWorld?wsdl</ulink><diffmk:wrapper diffmk:change="changed">.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>Add the <property moreinfo="none">HelloWorldSOAPBinding</property> to the <property moreinfo="none">HelloWorldProcessPort</property></title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/detail_editprocess_5.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">You should also change some service part configurations.
- To do this,click part element in the WSDL editor,
- then put the following data in the Properties view.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Configuration of service part</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/detail_editprocess_5.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
-
- <para>Now you have finished creating a simple BPEL process.As a next step, you can deploy the BPEL project to JBoss BPEL Runtime.</para>
-
- </section>
-
- </section>
- <section diffmk:change="added" id="deploy">
- <title>Deploy a JBoss BPEL project to JBoss BPEL Runtime</title>
- <section diffmk:change="added" id="createdeploy">
- <title>Creating a deploy.xml file</title>
- <para><diffmk:wrapper diffmk:change="changed">If you want to deploy a BPEL project to JBoss BPEL Runtime, you should create a deploy.xml file.
- JBoss tools can help you to create it:
- </diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para><diffmk:wrapper diffmk:change="changed">Create the deploy.xml by selecting
- </diffmk:wrapper><emphasis><property moreinfo="none">New > Other... > BPEL 2.0 > Apache ODE Deployment Descriptor</property></emphasis>. Click the <property moreinfo="none">Next</property><diffmk:wrapper diffmk:change="changed"> button.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>New BPEL Deploy file</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para>On the next wizard page you should enter the following information:</para>
- <para><emphasis><property moreinfo="none">BPEL Project</property></emphasis>: Click the <property moreinfo="none">Browse...</property><diffmk:wrapper diffmk:change="changed"> button to select the BPEL project in your workspace which you want to deploy to the runtime.
- Please note, that you should select the </diffmk:wrapper><property moreinfo="none">bpelContent</property> folder in your new BPEL project as a value of <property moreinfo="none">BPEL Project</property><diffmk:wrapper diffmk:change="changed"> field because the deploy.xml should be created in this place.
- </diffmk:wrapper></para>
- <para><emphasis><property moreinfo="none">File name</property></emphasis>: The default value is deploy.xml. Please, don't change it.</para>
- <para>Click on <property moreinfo="none">Finish</property> button to close the wizard and a new deploy.xml file will be created.</para>
- <figure diffmk:change="added" float="0">
- <title>New BPEL Deploy file Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para><diffmk:wrapper diffmk:change="changed">Double-click the deploy.xml file to open it in ODE Descriptor Deployment Editor.
- In the </diffmk:wrapper><property moreinfo="none">Inbound Interfaces</property><diffmk:wrapper diffmk:change="changed"> section, click the
- </diffmk:wrapper><property moreinfo="none">Associated Port</property> column and select <property moreinfo="none">HelloWorldProcessPort</property><diffmk:wrapper diffmk:change="changed">
- in the dropdown box.The </diffmk:wrapper><property moreinfo="none">Related Service</property> and <property moreinfo="none">Binding Used</property><diffmk:wrapper diffmk:change="changed">
- columns should be automatically filled in. Save the </diffmk:wrapper><emphasis><property moreinfo="none">deploy.xml</property></emphasis><diffmk:wrapper diffmk:change="changed">.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>deploy.xml file editor</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
- <section diffmk:change="added" id="createruntime">
- <title>Creating JBoss BPEL Server</title>
- <para>Suppose you have installed the <property moreinfo="none">JBoss BPEL Runtime-RiftSaw</property><diffmk:wrapper diffmk:change="added"> as it was described </diffmk:wrapper><link diffmk:change="added" linkend="installRuntime"><diffmk:wrapper diffmk:change="added">before</diffmk:wrapper></link>, now you can create a server for JBoss BPEL runtime.</para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para>Open the <property moreinfo="none"><diffmk:wrapper diffmk:change="changed">Servers</diffmk:wrapper></property><diffmk:wrapper diffmk:change="changed"> view by selecting
- </diffmk:wrapper><emphasis><property moreinfo="none"><diffmk:wrapper diffmk:change="changed">Windows > Show View > Other... > Server > Servers</diffmk:wrapper></property></emphasis><diffmk:wrapper diffmk:change="changed">.
- </diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added">
- <para><diffmk:wrapper diffmk:change="changed">Right-click the Servers view and select
- </diffmk:wrapper><emphasis><property moreinfo="none">New > Server</property></emphasis><diffmk:wrapper diffmk:change="changed"> to open the New Server Wizard:
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>New Server Wizard</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_4.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para>Select <property moreinfo="none">JBoss AS 5.1 </property>as a server type. </para>
- <note diffmk:change="added">
- <para>Please note, that only JBoss As 5.1 or higher version supports BPEL.</para>
- </note>
- </listitem>
- <listitem>
-
- <para>Click the <property moreinfo="none">Next</property> button. On the next page, you should input your <emphasis><property moreinfo="none">JBoss As</property></emphasis> location. Then click the <property moreinfo="none">Next</property><diffmk:wrapper diffmk:change="changed"> button and
- you will get the page like this:
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title>Add resource to the server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_5.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- <listitem diffmk:change="added">
- <para>Select <property moreinfo="none">HelloWorld</property>, then click the <property moreinfo="none">Add </property><diffmk:wrapper diffmk:change="changed"> button to add the project to the server.
- Then click on the </diffmk:wrapper><property moreinfo="none">Finish</property><diffmk:wrapper diffmk:change="changed"> button.
- </diffmk:wrapper></para>
- <para>Start the server by right-clicking on the server and selecting the <property moreinfo="none">Start</property> item. </para>
-
- <figure float="0">
- <title>The started server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_6.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para>If some aspects of server creation is not clear, please, read <ulink url="http://download.jboss.org/jbosstools/nightly-docs/en/as/html_single/index...">JBoss Server Manager Reference Guide</ulink> for more details.</para>
- </listitem>
- <listitem diffmk:change="added">
- <para>You can enter the link <ulink url="http://localhost:8080/bpel-console/app.html">http://localhost:8080/bpel-console/app.html</ulink> to the browser to get the deployed processes.</para>
- <figure float="0">
- <title>The BPEL console</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/deploy_createdeploy_7.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <para>If there's anything we didn't cover or you can't figure out, please feel free to visit our <ulink
- url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=201"
- >JBoss Tools Users Forum</ulink> to ask questions.
- There we are also waiting for your suggestions and comments.</para> </section>
- </section>
-</chapter>
-
- <!-- &detail;
- &deploy;-->
-
-<chapter diffmk:change="added" id="reference" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/bpel/docs/reference/en-US/modules/reference.xml">
- <?dbhtml filename="reference.html"?>
- <chapterinfo diffmk:change="added">
- <keywordset diffmk:change="added">
- <keyword diffmk:change="added"><diffmk:wrapper diffmk:change="added">JBoss Tools</diffmk:wrapper></keyword>
- <keyword diffmk:change="added"><diffmk:wrapper diffmk:change="added">BPEL</diffmk:wrapper></keyword>
- <keyword diffmk:change="added"><diffmk:wrapper diffmk:change="added">JBT</diffmk:wrapper></keyword>
- </keywordset>
- </chapterinfo>
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Reference</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">This chapter includes detailed reference information about all BPEL tools wizards and editors.</diffmk:wrapper></para>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Wizards</diffmk:wrapper></title>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL project Wizard</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">This wizard helps to create new BPEL project.It is available with clicking
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">File->New->Other->BPEL project</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> in the menu bar.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Project Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_1.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">It consists of only one page:</diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">On the page you can adjust the name of the project and the directory where it will be created.</diffmk:wrapper></para>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">If "</diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Use default</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">" option is checked the output directory will be the workspace,
- othervise the user should specify it by himself using </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Browse</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> button.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Project Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Apache ODE Deployment Descriptor Wizard</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Using this wizard user can create ODE deployment descriptor (deploy.xml) and place it in the temporary directory.It is available with clicking
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">File->New->Other->Apache ODE Deployment Descriptor Wizard</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> in the menu bar.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Project Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/deploy_createdeploy_2.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">On the page you can adjust the name of the deployment descriptor and
- the directory where it will be created.Note,that you should use </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">
- /PROJECT_NAME/bpelContent</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> directory as an output one.</diffmk:wrapper></para>
-
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Using </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">
- user can create BPEL process file and WSDL file if it is necessary.
- The wizard includes several pages:</diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The first page has the following options to set:</diffmk:wrapper></para>
- <table diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard. First Page Options.</diffmk:wrapper></title>
- <tgroup cols="3" diffmk:change="added">
- <colspec align="left" colnum="1" colwidth="1*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="2" colwidth="3*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="3" colwidth="1*" diffmk:change="added"></colspec>
-
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Option</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Description</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Default</diffmk:wrapper></entry>
- </row>
- </thead>
- <tbody diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Name</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Enter the process name.</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">no default value</diffmk:wrapper></entry>
- </row>
-
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Namespace</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Enter the namespace url here</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">no default value</diffmk:wrapper></entry>
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Template</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Select one of the provided templates:
- </diffmk:wrapper><itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">Asynchronous BPEL Process</diffmk:wrapper></emphasis><diffmk:wrapper diffmk:change="added"> -
- generates the basis of orchestration logic: receive and reply activities
- are included into the process;client WSDL is generated,
- service is defined in the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">parentlink</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> of the process.
- The caller is notified asynchronously when the process completes.
- </diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">Empty BPEL Process</diffmk:wrapper></emphasis><diffmk:wrapper diffmk:change="added"> - list of services participating in this BPEL process together
- with the one of messages used within the process is empty.There are no any orchestration logic.</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">Synchronous BPEL Process</diffmk:wrapper></emphasis><diffmk:wrapper diffmk:change="added"> -
- similar to Asynchronous BPEL Process template except the fact that here
- the caller is notified synchronously when the process completes.</diffmk:wrapper></para></listitem>
- </itemizedlist></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Asynchronous BPEL Process</diffmk:wrapper></entry>
- </row>
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Abstract Process</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Specifies the created process as an abstract one -partially
- specified processes that are not intended to be executed.</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">unchecked</diffmk:wrapper></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_3.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
-
- </listitem>
-
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The second page has the following options to set:</diffmk:wrapper></para>
- <table diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard. Second Page Options.</diffmk:wrapper></title>
- <tgroup cols="3" diffmk:change="added">
- <colspec align="left" colnum="1" colwidth="1*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="2" colwidth="3*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="3" colwidth="1*" diffmk:change="added"></colspec>
-
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Option</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Description</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Default</diffmk:wrapper></entry>
- </row>
- </thead>
- <tbody diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Service Name</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Enter a wsdl service name for the BPEL process.</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">The process name</diffmk:wrapper></entry>
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Port Name</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Enter a wsdl port name for the BPEL process.</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">The process name + 'Port' </diffmk:wrapper></entry>
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Service Address</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Enter an address of the wsdl service for the BPEL process.</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">http://localhost:8080/ + process name </diffmk:wrapper></entry>
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Binding Protocol</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Choose the binding protocal that you use in the wsdl: SOAP or HTTP </diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">SOAP </diffmk:wrapper></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_3a.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
-
- </listitem>
-
-
-
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">On the third page the user should select the BPEL project
- and folder where the process file will be created:</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">New BPEL Process file Wizard</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_4.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
- </itemizedlist>
- <note diffmk:change="added">
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Process files that are used in the BPEL project must be under the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">bpelContent</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> folder. Only in this case
- these files can be deployed to JBoss server.
- </diffmk:wrapper></para>
- </note>
- </section>
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Editors</diffmk:wrapper></title>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Business Process Editor</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Business Process Editor is intended to facilitate the process of changing and
- adding new logic to BPEL process file.You can open </diffmk:wrapper><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">.bpel</diffmk:wrapper></emphasis><diffmk:wrapper diffmk:change="added">
- in this editor by right click the file in the project explorer and selecting
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Open With...->Business Process Editor</diffmk:wrapper></property>
- </para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Business Process Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_5.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The editor consists of two tabs:</diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Design</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> tab and </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Source</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> tab.</diffmk:wrapper></para>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Design tab</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Design tab is the main part of Business Process Editor.It consists of 3 parts:</diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Visual Pane:</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Visual Pane of Business Process Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_6.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The Visual Pane graphically displays the order in which the activities are executed.</diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Palette:</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Palette of Business Process Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_7.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Palette</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> represents different elements of the BPEL activities
- organized into functional categories.
- Using it the user can easily add new elements to the sequence activity.
- To do this,he should just click the required element and then drug
- and drop it to the place on the Visual Pane where it should be added.</diffmk:wrapper></para>
- </listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Behavior Components View:</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Behavior Components View of Business Process Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_8.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Execution behavior components are grouped into the </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">
- Behavior Components View</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.
- The view is also fully syncronized with Properties view where you can customize all
- the properties of the component.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Process Structure View of Business Process Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_9.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">To add an element to some component group click plus(</diffmk:wrapper><inlinemediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_10.png"></imagedata>
- </imageobject>
- </inlinemediaobject><diffmk:wrapper diffmk:change="added">) icon,
- for its deleting you should click the element and
- use its </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Delete</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> option in the popup menu.</diffmk:wrapper></para>
- </listitem>
-
- </itemizedlist>
-
-
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Source tab</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Source tab can be used for editing BPEL process file directly.
- The validation of file structure is also available.
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Validation error in Source tab</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_11.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">If the user wants to disable/unable validation he can do it by following
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">Window->Preferences->Validation</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added">.</diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Validation configuration</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_12.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- </section>
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">ODE Deployment Descriptor Editor</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">To deploy your process in Ode you need to create a
- simple deployment descriptor with basic information and
- </diffmk:wrapper><property diffmk:change="added" moreinfo="none"><diffmk:wrapper diffmk:change="added">ODE Deployment Descriptor Editor</diffmk:wrapper></property><diffmk:wrapper diffmk:change="added"> facilitates the process of descriptor configuration.
- You can see how the descriptor file,opened in the editor looks like on the picture below:
- </diffmk:wrapper></para>
- <figure diffmk:change="added" float="0">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">ODE Deployment Descriptor Editor</diffmk:wrapper></title>
- <mediaobject diffmk:change="added">
- <imageobject diffmk:change="added">
- <imagedata diffmk:change="added" fileref="images/reference/bpel_ref_13.png"></imagedata>
- </imageobject>
- </mediaobject>
- </figure>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The table below describes the configuration options of the
- ODE Deployment Descriptor Editor:</diffmk:wrapper></para>
- <table diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">ODE Deployment Descriptor Editor.Options.</diffmk:wrapper></title>
- <tgroup cols="3" diffmk:change="added">
- <colspec align="left" colnum="1" colwidth="1*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="2" colwidth="3*" diffmk:change="added"></colspec>
- <colspec align="left" colnum="3" colwidth="1*" diffmk:change="added"></colspec>
-
- <thead diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Section</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Options</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Description</diffmk:wrapper></entry>
- </row>
- </thead>
- <tbody diffmk:change="added">
- <row diffmk:change="added">
- <entry diffmk:change="added" morerows="1" valign="middle"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">
- General</diffmk:wrapper></para></entry>
-
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">This process is</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Select one of the provided options:
- </diffmk:wrapper><itemizedlist diffmk:change="added">
- <listitem diffmk:change="added">
- <para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">activated</diffmk:wrapper></emphasis>
- </para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">deactivated</diffmk:wrapper></emphasis></para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added"><emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">retired</diffmk:wrapper></emphasis>
- </para>
- </listitem>
- </itemizedlist></entry>
-
- </row>
- <row diffmk:change="added"><entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Run this process in memory</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">for performance purposes,
- you can define the process as being
- executed only in-memory.</diffmk:wrapper></entry>
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Inbound Interfaces(Services)</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Associated Port</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Click Associated Port and the dropdown list with all available port names will appear.
- Select the one you need ,other fields will be filled automatically.
- This action configure the services
- provided by the process and
- bind each service to an endpoint
- </diffmk:wrapper></entry>
-
- </row>
-
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Outbound Interfaces(Invokes)</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Associated Port</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Click Associated Port and the dropdown list with all available port names will appear.
- Select the one you need, other fields will be filled automatically.
- This action configure the services
- invoked by the process</diffmk:wrapper></entry>
- </row>
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Process-level Monitoring Events</diffmk:wrapper></entry>
- <entry diffmk:change="added"> <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added">
- <emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">None</diffmk:wrapper></emphasis>
- </para></listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added">
- <emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">All</diffmk:wrapper></emphasis>
- </para>
- </listitem>
- <listitem diffmk:change="added">
- <para diffmk:change="added">
- <emphasis diffmk:change="added"><diffmk:wrapper diffmk:change="added">Selected</diffmk:wrapper></emphasis><diffmk:wrapper diffmk:change="added">:
- </diffmk:wrapper></para>
- <itemizedlist diffmk:change="added">
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Instance life cycle</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Activity life cycle</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Data handling</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Scope handling</diffmk:wrapper></para></listitem>
- <listitem diffmk:change="added"><para diffmk:change="added"><diffmk:wrapper diffmk:change="added">Correlation</diffmk:wrapper></para></listitem>
-
- </itemizedlist>
-
- </listitem>
- </itemizedlist>
- </entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Using ODE's deployment descriptor, it's also
- possible to make events generation to
- filtrate which ones get created.
- All option just duplicates the default behaviour,
- when nothing is specified in the deployment.</diffmk:wrapper></entry>
- </row>
- <row diffmk:change="added">
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Scope-level Monitoring Events</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">Scope</diffmk:wrapper></entry>
- <entry diffmk:change="added"><diffmk:wrapper diffmk:change="added">This section makes it possible to
- define filtering for each scope of your process.
- </diffmk:wrapper></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- </section>
-
-
-</chapter>
-
-
-
-<chapter diffmk:change="added" xml:base="file:///home/vchukhutsina/repos/ochik_jboss/bpel/docs/reference/en-US/modules/summary.xml">
- <?dbhtml filename="summary.html"?>
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Summary</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">In conclusion, with this document you know all the capabilities of BPEL Tools
- and could easily start with them.
- The chapters above walked you through the steps on how to create and configure BPEL process and
- deployment descriptor files.
- If you have questions or suggestions concerned both the documentation and tools behavior,
- you are welcome to JBoss Tools Users forum.
- Please, use Jira to report bugs and requests on documentation.</diffmk:wrapper></para>
-
- <section diffmk:change="added">
- <title diffmk:change="added"><diffmk:wrapper diffmk:change="added">Other relevant resources on the topic</diffmk:wrapper></title>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">All JBoss Developer Studio/JBoss Tools release documentation you can find at
- </diffmk:wrapper><ulink diffmk:change="added" url="http://docs.jboss.org/tools"><diffmk:wrapper diffmk:change="added">http://docs.jboss.org/tools</diffmk:wrapper></ulink><diffmk:wrapper diffmk:change="added"> in the corresponding release directory.
- </diffmk:wrapper></para>
- <para diffmk:change="added"><diffmk:wrapper diffmk:change="added">The latest documentation builds are available at </diffmk:wrapper><ulink diffmk:change="added" url="http://download.jboss.org/jbosstools/nightly-docs"><diffmk:wrapper diffmk:change="added">http://download.jboss.org/jbosstools/nightly-docs</diffmk:wrapper></ulink><diffmk:wrapper diffmk:change="added">. </diffmk:wrapper></para>
-
- </section>
-</chapter>
-
-</book>
13 years, 10 months
JBoss Tools SVN: r29435 - trunk/bpel/docs/reference/en-US.
by jbosstools-commits@lists.jboss.org
Author: mcaspers
Date: 2011-03-01 21:49:24 -0500 (Tue, 01 Mar 2011)
New Revision: 29435
Modified:
trunk/bpel/docs/reference/en-US/master.xml
trunk/bpel/docs/reference/en-US/overview.xml
trunk/bpel/docs/reference/en-US/reference.xml
trunk/bpel/docs/reference/en-US/tasks.xml
Log:
General Documentation Updates
Modified: trunk/bpel/docs/reference/en-US/master.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/master.xml 2011-03-02 00:22:05 UTC (rev 29434)
+++ trunk/bpel/docs/reference/en-US/master.xml 2011-03-02 02:49:24 UTC (rev 29435)
@@ -3,9 +3,9 @@
"http://www.docbook.org/xml/4.3/docbookx.dtd"
[<!ENTITY overview SYSTEM "overview.xml">
-<!ENTITY install SYSTEM "install.xml">
-<!ENTITY detail SYSTEM "detail.xml">
-<!ENTITY deploy SYSTEM "deploy.xml">
+<!--<!ENTITY install SYSTEM "install.xml">-->
+<!--<!ENTITY detail SYSTEM "detail.xml">-->
+<!--<!ENTITY deploy SYSTEM "deploy.xml">-->
<!ENTITY reference SYSTEM "reference.xml">
<!ENTITY summary SYSTEM "summary.xml">
<!ENTITY tasks SYSTEM "tasks.xml">
@@ -52,5 +52,5 @@
</abstract>
</bookinfo>
<toc/>
-&overview;&install;&tasks;<!-- &detail;
- &deploy;-->&reference;&summary;</book>
\ No newline at end of file
+ &overview;&tasks;&reference;&summary;
+<!--&overview;&install;&tasks;&detail;&deploy;&reference;&summary;--></book>
\ No newline at end of file
Modified: trunk/bpel/docs/reference/en-US/overview.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/overview.xml 2011-03-02 00:22:05 UTC (rev 29434)
+++ trunk/bpel/docs/reference/en-US/overview.xml 2011-03-02 02:49:24 UTC (rev 29435)
@@ -7,18 +7,18 @@
<para>It improves the Eclipse BPEL project in the following ways: </para>
<itemizedlist>
<listitem>
- <para> Implements close integration with JBoss BPEL runtime, and adds a new project type for the deployment to JBoss BPEL runtime.</para>
+ <para> Implements close integration with JBoss BPEL runtime, and adds a new project type for the deployment to the JBoss BPEL runtime.</para>
</listitem>
<listitem>
- <para> Supports two ways of deployment. The first way is to deploy a BPEL project directly to JBoss BPEL runtime. The second way is to deploy BPEL files in JBoss ESB project to JBoss BPEL runtime. </para>
+ <para> Supports two deployment methods. The first method is to deploy a BPEL project directly to the JBoss BPEL runtime. The second method is to deploy BPEL files in JBoss ESB project to the JBoss BPEL runtime. </para>
</listitem>
<listitem>
- <para> Improves the BPEL validator and improves the quality of the Eclipse BPEL editor. </para>
+ <para>Enhances the BPEL validator and improves the quality of the Eclipse BPEL editor. </para>
</listitem>
</itemizedlist>
<para>
- <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html">WS-BPEL 2.0</ulink> stands for Web Service Business Process Execution Language. Like EAI, BPEL is an XML-based language, but BPEL is more specific and targeted. A programmer uses BPEL to join sometimes disparate functions into an integrated process, resulting in a seamless use of the Internet to conduct business transactions ranging from simple money exchanges to complex calculations and asset reallocation.
+ <ulink url="http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html">WS-BPEL 2.0</ulink> stands for Web Service Business Process Execution Language. Like EAI, BPEL is an XML-based language, but BPEL is more specific and targeted. BPEL is used by developers to join sometimes disparate functions into an integrated process, resulting in a seamless use of the Internet to conduct business transactions ranging from simple money exchanges to complex calculations and asset reallocation.
</para>
<section>
@@ -44,7 +44,7 @@
<para>WS-BPEL 2.0 support</para>
</entry>
<entry>
- <para>JBoss BPEL project supports the newest WS-BPEL 2.0 specifications. </para>
+ <para>JBoss BPEL project supports the most recent WS-BPEL 2.0 specifications. </para>
</entry>
</row>
<row>
@@ -52,7 +52,7 @@
<para>Close integration with JBoss BPEL runtime</para>
</entry>
<entry>
- <para>There are two ways to deploy BPEL files to JBoss BPEL runtime. The user can deploy a BPEL project as a whole and can deploy BPEL files in JBoss ESB project to JBoss BPEL runtime. </para>
+ <para>There are two methods to deploy BPEL files to JBoss BPEL runtime. The user can deploy a BPEL project as a whole and can deploy BPEL files in a JBoss ESB project to the JBoss BPEL runtime. </para>
</entry>
</row>
<row>
@@ -68,7 +68,7 @@
<para>BPEL file validator</para>
</entry>
<entry>
- <para>The validator provides a list of BPEL file errors to the user. </para>
+ <para>The validator displays a list of BPEL file errors. </para>
</entry>
</row>
</tbody>
Modified: trunk/bpel/docs/reference/en-US/reference.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/reference.xml 2011-03-02 00:22:05 UTC (rev 29434)
+++ trunk/bpel/docs/reference/en-US/reference.xml 2011-03-02 02:49:24 UTC (rev 29435)
@@ -152,23 +152,23 @@
<tbody>
<row>
<entry>Service Name</entry>
- <entry>Enter a wsdl service name for the BPEL process.</entry>
+ <entry>Enter a WDSL service name for the BPEL process.</entry>
<entry>The process name</entry>
</row>
<row>
<entry>Port Name</entry>
- <entry>Enter a wsdl port name for the BPEL process.</entry>
+ <entry>Enter a WDSL port name for the BPEL process.</entry>
<entry>The process name + 'Port'</entry>
</row>
<row>
<entry>Service Address</entry>
- <entry>Enter an address of the wsdl service for the BPEL process.</entry>
+ <entry>Enter an address of the WDSL service for the BPEL process.</entry>
<entry>http://localhost:8080/ + process name </entry>
</row>
<row>
<entry>Binding Protocol</entry>
- <entry>Choose the binding protocal that you use in the wsdl: SOAP or HTTP</entry>
+ <entry>Choose the binding protocal that you use in the WDSL: SOAP or HTTP</entry>
<entry>SOAP</entry>
</row>
</tbody>
Modified: trunk/bpel/docs/reference/en-US/tasks.xml
===================================================================
--- trunk/bpel/docs/reference/en-US/tasks.xml 2011-03-02 00:22:05 UTC (rev 29434)
+++ trunk/bpel/docs/reference/en-US/tasks.xml 2011-03-02 02:49:24 UTC (rev 29435)
@@ -10,7 +10,7 @@
<section id="createproject">
<title>Creating a BPEL project</title>
<para>
- Create the project by selecting <menuchoice><guimenuitem>New</guimenuitem><guimenuitem>Project...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>BPEL Project</guimenuitem></menuchoice> from the menu bar. Then click the <guibutton>Next</guibutton> button.
+ Create the project by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Project...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>BPEL Project</guimenuitem></menuchoice> from the menu bar. Then click the <guibutton>Next</guibutton> button.
</para>
<figure>
<title>New BPEL Project</title>
@@ -46,7 +46,7 @@
<section id="createprocess">
<title>Creating a BPEL process</title>
<para>
- Now you should create a BPEL process. You can create it by selecting <menuchoice><guimenuitem>New</guimenuitem><guimenuitem>Others...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>New BPEL Process File</guimenuitem></menuchoice>.
+ Now you should create a BPEL process. You can create it by selecting <menuchoice><guimenuitem>File</guimenuitem><guimenuitem>New</guimenuitem><guimenuitem>Others...</guimenuitem><guimenuitem>BPEL 2.0</guimenuitem><guimenuitem>New BPEL Process File</guimenuitem></menuchoice>.
</para>
<figure>
<title>New BPEL Process File</title>
@@ -92,7 +92,7 @@
</entry>
<entry>
<para>
- Select the necessary template for the BPEL process. When you select the template, you will see the information about the template below on the page. In our case you should select <property>Synchronous BPEL Process</property>.
+ Select the appropriate template for the BPEL process. When you select the template, you will see the information about the template below on the page. In this case you should select <guilabel>Synchronous BPEL Process</guilabel>.
</para>
</entry>
</row>
@@ -109,7 +109,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>Click the <guibutton>Next</guibutton> button. On the second page, you can custom your WSDL service details. Enter the following information:</para>
+ <para>Click the <guibutton>Next</guibutton> button. On the second page, you can customize your WSDL service details. Enter the following information:</para>
<table>
<title>Fields and values</title>
@@ -128,7 +128,7 @@
<para>Service Name</para>
</entry>
<entry>
- <para>A wsdl service name for the BPEL process. The default is, <property moreinfo="none">HelloWorld</property>.</para>
+ <para>A wsdl service name for the BPEL process. The default value is <guilabel>HelloWorld</guilabel>.</para>
</entry>
</row>
<row>
@@ -136,7 +136,7 @@
<para>Port Name</para>
</entry>
<entry>
- <para>A wsdl port name for the BPEL process. The default is, <property moreinfo="none">HelloWorldPort</property>.</para>
+ <para>A wsdl port name for the BPEL process. The default value is <guilabel>HelloWorldPort</guilabel>.</para>
</entry>
</row>
<row>
@@ -144,7 +144,7 @@
<para>Service Address</para>
</entry>
<entry>
- <para>An address of the WSDL service for the BPEL process. The default is, <property moreinfo="none">http://localhost:8080/HelloWorld</property>.</para>
+ <para>An address of the WSDL service for the BPEL process. The default value is <guilabel>http://localhost:8080/HelloWorld</guilabel>.</para>
</entry>
</row>
<row>
@@ -152,7 +152,7 @@
<para>Binding Protocol</para>
</entry>
<entry>
- <para>The binding protocal that you use in the wsdl. You can choose SOAP or HTTP. The default is, <property moreinfo="none">SOAP</property>.</para>
+ <para>The binding protocal that you use in the wsdl. You can choose SOAP or HTTP. The default value is <guilabel>SOAP</guilabel>.</para>
</entry>
</row>
</tbody>
@@ -177,7 +177,7 @@
</para>
</note>
- <para>Up to now, you have got a simple BPEL process as on the screen below.</para>
+ <para>This will create a simple BPEL process as shown in the image below.</para>
<figure>
<title>A simple BPEL Process File</title>
<mediaobject>
@@ -186,12 +186,11 @@
</imageobject>
</mediaobject>
</figure>
- <para>The next step will show you how to edit the BPEL process file and then deploy it to JBoss server. </para>
</section>
<section id="editprocess">
<title>Editing a BPEL process file</title>
<para>
- If the <guilabel>Properties view</guilabel> and <guilabel>Palette view</guilabel> are not opened, you can open the views by right-clicking the BPEL editor and selecting <guilabel>Show in Properties</guilabel>, <guilabel>Show Palette in Palette view</guilabel>. Then you should have the view like this:
+ If the <guilabel>Properties view</guilabel> and <guilabel>Palette view</guilabel> are not opened, you can open the views by right-clicking the BPEL editor and selecting the <guilabel>Show in Properties</guilabel> or <guilabel>Show Palette in Palette view</guilabel> options. Then you should have the view like this:
</para>
<figure>
<title>The BPEL editor view</title>
@@ -203,7 +202,7 @@
</figure>
<para>In the <guilabel>Palette</guilabel> view, you can drag a BPEL element to the BPEL editor and drop it in the place you want.</para>
<para>
- In the <guilabel>Properties</guilabel> view, you can get the information about every element of the BPEL process. In the BPEL editor select any element you want, and then the element's properties will be shown in the <guilabel>Properties</guilabel> view. The table below describes the tabs of the <guilabel>Properties</guilabel> view:
+ In the <guilabel>Properties</guilabel> view, you can view the information on every element in the BPEL process. The contents of the <guilabel>Properties</guilabel> view is automatically updated as elements are selected in the BPEL editor. The table below describes the tabs shown in the <guilabel>Properties</guilabel> view:
</para>
<table>
@@ -258,7 +257,7 @@
</entry>
<entry>
<para>
- Every BPEL element has its own sections: Correlation section, Message Exchange section, and so on. We will introduce them while using them.
+ Every BPEL element has its own sections: Correlation section, Message Exchange section, and so on. These sections will be covered in later sections.
</para>
</entry>
</row>
@@ -282,7 +281,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>Then choose <property>string</property> primitive from the list.</para>
+ <para>Then choose <guilabel>string</guilabel> primitive from the list of <guilabel>Matches</guilabel>.</para>
<figure>
<title>Edit variable in <property>process</property> file</title>
<mediaobject>
@@ -293,7 +292,7 @@
</figure>
</listitem>
<listitem>
- <para>Select <property>xsd</property> as a namespace in the popup menu.</para>
+ <para>Select <guilabel>xsd</guilabel> as a namespace in the popup menu.</para>
</listitem>
</itemizedlist>
@@ -322,7 +321,7 @@
</mediaobject>
</figure>
<para>
- Then you should click the <guibutton>New</guibutton> once more and select Expression to Variable (assign <code>concat($input,' World'))</code> to <property>result:string</property>.
+ Then you should click the <guibutton>New</guibutton> button once more and select Expression to Variable (assign <code>concat($input,' World')</code>) to <guilabel>result:string</guilabel>.
</para>
<figure>
<title>Add <property>Expression assign</property> to the process</title>
@@ -340,12 +339,12 @@
<title>Adding Service to WSDL file</title>
<para></para>
<para>
- The <filename>HelloWorldArtifacts.wsdl</filename> file has been added a service when you create a BPEL process file. You have a default service in this WSDL file. But if you want to add a service by yourself, you can follow the steps as below:
+ The <filename>HelloWorldArtifacts.wsdl</filename> file is added a service when you create a BPEL process file. A default service is already defined in this WSDL file. However, if you want to add your own service, follow the steps below:
</para>
<itemizedlist>
<listitem>
<para>
- Open the file <filename>HelloWorldArtifacts.wsdl</filename> in the "<property>HelloWorld</property>" project by double-clicking the file. Right-click the WSDL editor and select <guilabel>Add Service</guilabel>. A new service should appear in the editor. Name it <property>HelloWorldProcessService</property>. It has the Port named <property>NewPort</property>. Select it, right-click on it and rename it to <property>HelloWorldProcessPort</property> in the Properties view.
+ Open the file <filename>HelloWorldArtifacts.wsdl</filename> in the <guilabel>HelloWorld</guilabel> project by double-clicking the file. Right-click the WSDL editor and select the <guilabel>Add Service</guilabel> option. A new service should appear in the editor. Name it <guilabel>HelloWorldProcessService</guilabel>. It has the Port named <guilabel>NewPort</guilabel>. Select it, right-click on it and rename it to <guilabel>HelloWorldProcessPort</guilabel> in the <guilabel>Properties</guilabel> view.
</para>
<figure>
<title>Add <property>Service</property> to the WSDL file</title>
@@ -358,7 +357,7 @@
</listitem>
<listitem>
<para>
- Right-click somewhere in the whitespace of the WSDL editor and select <guilabel>Add Binding</guilabel>. A new Binding component will appear in the editor. Name it <property>HelloWorldSOAPBinding</property>. Select it, in the General tab of the Properties view and select <property>HelloWorld</property> as a port type in the <property>PortType</property>. Then click on the <property>Generate Binding Content...</property> button to open the <property>Binding Wizard</property>. In the wizard, select <property>SOAP</property> as the <property>Protocol</property>. Finally, click the <guibutton>Finish</guibutton> button to close the wizard.
+ Right-click somewhere in the whitespace of the WSDL editor and select the <guilabel>Add Binding</guilabel> option. A new Binding component will appear in the editor. Name it <guilabel>HelloWorldSOAPBinding</guilabel>. Select it, and in the <guilabel>General</guilabel> tab of the <guilabel>Properties</guilabel> view and select <guilabel>HelloWorld</guilabel> as a port type in the <guilabel>PortType</guilabel> field. Then click on the <guibutton>Generate Binding Content...</guibutton> button to open the <guilabel>Binding Wizard</guilabel>. In the wizard, select <guilabel>SOAP</guilabel> as the <guilabel>Protocol</guilabel>. Finally, click the <guibutton>Finish</guibutton> button to close the wizard.
</para>
<figure>
<title>Add a <property>Binding</property> to the WSDL file</title>
@@ -371,7 +370,7 @@
</listitem>
<listitem>
<para>
- Click the <property>HelloWorldProcessPort</property> property in the General section of the Properties view, select <property>HelloWorldSOAPBinding</property> in the <property>Binding</property> combobox. In the <property>Address</property> field input <ulink url="http://localhost:8080/bpel/processes/HelloWorld?wsdl">http://localhost:8080/bpel/processes/HelloWorld?wsdl</ulink>.
+ Click the <guilabel>HelloWorldProcessPort</guilabel> property in the <guilabel>General</guilabel> section of the <guilabel>Properties</guilabel> view, select <guilabel>HelloWorldSOAPBinding</guilabel> in the <guilabel>Binding</guilabel> combobox. Enter <ulink url="http://localhost:8080/bpel/processes/HelloWorld?wsdl">http://localhost:8080/bpel/processes/HelloWorld?wsdl</ulink> in the <guilabel>Address</guilabel> field.
</para>
<figure>
<title>Add the <property>HelloWorldSOAPBinding</property> to the <property>HelloWorldProcessPort</property>
@@ -398,8 +397,6 @@
</listitem-->
</itemizedlist>
- <para>Now you have finished creating a simple BPEL process. As a next step, you can deploy the BPEL project to JBoss BPEL Runtime.</para>
-
</section>
</section>
@@ -408,7 +405,7 @@
<section id="createdeploy">
<title>Creating a deploy.xml file</title>
<para>
- If you want to deploy a BPEL project to JBoss BPEL Runtime, you should create a <filename>bpel-deploy.xml</filename> file. JBoss tools can help you to create it:
+ If you want to deploy a BPEL project to the JBoss BPEL Runtime, a <filename>deploy.xml</filename> file needs to be created. The steps below show you how to create this file in JBDS:
</para>
<itemizedlist>
<listitem>
13 years, 10 months
JBoss Tools SVN: r29434 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-01 19:22:05 -0500 (Tue, 01 Mar 2011)
New Revision: 29434
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/
Log:
setting svn ignore prop on target
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration
___________________________________________________________________
Added: svn:ignore
+ target
13 years, 10 months
JBoss Tools SVN: r29433 - trunk/deltacloud/plugins.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-01 19:21:11 -0500 (Tue, 01 Mar 2011)
New Revision: 29433
Modified:
trunk/deltacloud/plugins/pom.xml
Log:
JBIDE-7589 last commit?
Modified: trunk/deltacloud/plugins/pom.xml
===================================================================
--- trunk/deltacloud/plugins/pom.xml 2011-03-02 00:20:18 UTC (rev 29432)
+++ trunk/deltacloud/plugins/pom.xml 2011-03-02 00:21:11 UTC (rev 29433)
@@ -7,8 +7,9 @@
<name>org.jboss.tools.deltacloud.plugins</name>
<packaging>pom</packaging>
<modules>
+ <module>org.jboss.tools.deltacloud.client</module>
+ <module>org.jboss.tools.deltacloud.core</module>
<module>org.jboss.tools.deltacloud.ui</module>
- <module>org.jboss.tools.deltacloud.core</module>
<module>org.jboss.tools.deltacloud.integration</module>
<module>org.jboss.tools.deltacloud.docs</module>
</modules>
13 years, 10 months
JBoss Tools SVN: r29432 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-01 19:20:18 -0500 (Tue, 01 Mar 2011)
New Revision: 29432
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
Log:
JBIDE-7589 last commit?
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-03-02 00:18:30 UTC (rev 29431)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2011-03-02 00:20:18 UTC (rev 29432)
@@ -22,7 +22,8 @@
org.eclipse.equinox.security;bundle-version="[1.0.100,2.0.0)",
org.eclipse.equinox.security.ui;bundle-version="1.0.200",
org.eclipse.jsch.core;bundle-version="1.1.200",
- org.eclipse.ui.navigator;bundle-version="3.5.0"
+ org.eclipse.ui.navigator;bundle-version="3.5.0",
+ org.jboss.tools.deltacloud.client;bundle-version="0.1.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.deltacloud.ui,
13 years, 10 months
JBoss Tools SVN: r29431 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-01 19:18:30 -0500 (Tue, 01 Mar 2011)
New Revision: 29431
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/
Log:
JBIDE-7589 adding an svn ignore propset
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client
___________________________________________________________________
Added: svn:ignore
+ target
13 years, 10 months
JBoss Tools SVN: r29430 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src: org and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-01 19:08:54 -0500 (Tue, 01 Mar 2011)
New Revision: 29430
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudClientBundle.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudException.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/API.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Action.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ActionAware.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/AddressList.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthClientException.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientException.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudNotFoundClientException.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpMethod.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusCode.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusRange.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/IdAware.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Image.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Instance.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Key.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Property.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Realm.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ResourceAction.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/StateAware.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractDeltaCloudRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractListObjectsRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/DeltaCloudRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfileRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfilesRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImageRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImagesRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstanceRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstancesRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmsRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/PerformActionRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/TypeRequest.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/APIUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractActionAwareUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDOMUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectsUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ActionUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfileUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfilesUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/IDeltaCloudObjectUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImageUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImagesUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstanceUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstancesUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeyUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeysUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmsUnmarshaller.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/StringUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/UrlBuilder.java
Log:
JBIDE-7589 cursecursecurse
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudClientBundle.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudClientBundle.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudClientBundle.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,50 @@
+package org.jboss.tools.deltacloud.client;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class DeltaCloudClientBundle extends Plugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.deltacloud.client"; //$NON-NLS-1$
+
+ // The shared instance
+ private static DeltaCloudClientBundle plugin;
+
+ /**
+ * The constructor
+ */
+ public DeltaCloudClientBundle() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static DeltaCloudClientBundle getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudException.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudException.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/client/DeltaCloudException.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.client;
+
+public class DeltaCloudException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ public DeltaCloudException(String message, Throwable clause)
+ {
+ super(message, clause);
+ }
+
+ public DeltaCloudException(Throwable clause)
+ {
+ super(clause);
+ }
+
+ public DeltaCloudException(String message)
+ {
+ super(message);
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/API.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/API.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/API.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class API extends IdAware {
+
+ private static final long serialVersionUID = 1L;
+
+ public static enum Driver {
+ UNKNOWN, MOCK, EC2;
+
+ public static Driver checkedValueOf(String name) {
+ for (Driver driver : values()) {
+ if (driver.name().equals(name)) {
+ return driver;
+ }
+ }
+ return UNKNOWN;
+ }
+
+ }
+
+ private Driver driver;
+
+ public API() {
+ }
+
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
+
+ public void setDriver(String driver) {
+ setDriver(Driver.checkedValueOf(driver.toUpperCase()));
+ }
+
+ public Driver getDriver() {
+ return driver;
+ }
+
+ @Override
+ public String toString() {
+ return "API [driver=" + driver.name() + super.toString() + "]";
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Action.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Action.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Action.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * An action that may be performed on a resource
+ *
+ * @author André Dietisheim
+ */
+public class Action<OWNER> {
+
+ public static final String START_NAME = "start";
+ public static final String STOP_NAME = "stop";
+ public static final String REBOOT_NAME = "reboot";
+ public static final String DESTROY_NAME = "destroy";
+
+ private String name;
+ private String url;
+ private HttpMethod method;
+ private OWNER owner;
+
+ public HttpMethod getMethod() {
+ return method;
+ }
+
+ public void setMethodString(String method) {
+ this.method = HttpMethod.valueOf(method.toUpperCase());
+ }
+
+ public void setMethod(HttpMethod method) {
+ this.method = method;
+ }
+
+ public void setMethod(String method) {
+ this.method = HttpMethod.valueOf(method.toUpperCase());
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setOwner(OWNER owner) {
+ this.owner = owner;
+ }
+
+ public OWNER getOwner() {
+ return owner;
+ }
+
+ public boolean isStart() {
+ return START_NAME.equals(getName());
+ }
+
+ public boolean isStop() {
+ return STOP_NAME.equals(getName());
+ }
+
+ public boolean isReboot() {
+ return REBOOT_NAME.equals(getName());
+ }
+
+ public boolean isDestroy() {
+ return DESTROY_NAME.equals(getName());
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ActionAware.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ActionAware.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ActionAware.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Martyn Taylor
+ * @author André Dietisheim
+ */
+public abstract class ActionAware<OWNER> extends IdAware {
+
+ private List<Action<OWNER>> actions;
+
+ public Action<OWNER> getAction(String name) {
+ if (name == null) {
+ return null;
+ }
+
+ for (Action<OWNER> action : getActions()) {
+ if (name.equals(action.getName())) {
+ return action;
+ }
+ }
+ return null;
+ }
+
+ public List<String> getActionNames() {
+ ArrayList<String> names = new ArrayList<String>();
+ for (Action<OWNER> action : getActions()) {
+ names.add(action.getName());
+ }
+ return names;
+ }
+
+ public boolean start(DeltaCloudClient client) throws DeltaCloudClientException {
+ return client.performAction(getAction(Action.START_NAME));
+ }
+
+ public boolean stop(DeltaCloudClient client) throws DeltaCloudClientException {
+ return client.performAction(getAction(Action.STOP_NAME));
+ }
+
+ public boolean destroy(DeltaCloudClient client) throws DeltaCloudClientException {
+ return client.performAction(getAction(Action.DESTROY_NAME));
+ }
+
+ public boolean reboot(DeltaCloudClient client) throws DeltaCloudClientException {
+ return client.performAction(getAction(Action.REBOOT_NAME));
+ }
+
+ public boolean canStart() {
+ return getAction(Action.START_NAME) != null;
+ }
+
+ public boolean canStop() {
+ return getAction(Action.STOP_NAME) != null;
+ }
+
+ public boolean canReboot() {
+ return getAction(Action.REBOOT_NAME) != null;
+ }
+
+ public boolean canDestroy() {
+ return getAction(Action.DESTROY_NAME) != null;
+ }
+
+ public void setActions(List<Action<OWNER>> actions) {
+ this.actions = actions;
+ }
+
+ public List<Action<OWNER>> getActions() {
+ return actions;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/AddressList.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/AddressList.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/AddressList.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.List;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlList;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author Martyn Taylor
+ * @author André Dietisheim
+ */
+@XmlType
+public class AddressList
+{
+ private static final long serialVersionUID = 1L;
+
+ @XmlElement
+ @XmlList
+ private List<String> addresses;
+
+ public AddressList()
+ {
+ }
+
+ public AddressList(List<String> addresses)
+ {
+ setAddress(addresses);
+ }
+
+ protected void setAddress(List<String> addresses)
+ {
+ this.addresses = addresses;
+ }
+
+ public List<String> getAddress()
+ {
+ return addresses;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthClientException.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthClientException.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudAuthClientException.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class DeltaCloudAuthClientException extends DeltaCloudClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public DeltaCloudAuthClientException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public DeltaCloudAuthClientException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public DeltaCloudAuthClientException(String message)
+ {
+ super(message);
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClient.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.API.Driver;
+
+/**
+ * @author Martyn Taylor
+ * @author Andre Dietisheim
+ */
+public interface DeltaCloudClient {
+
+ /**
+ * Returns the server type this client is connected to.
+ *
+ * @return the server type
+ *
+ * @see DeltaCloudServerType
+ */
+ public Driver getServerType();
+
+ /**
+ * Returns a list of Delta Cloud Realms
+ *
+ * @return List of Delta Cloud Realms
+ * @throws DeltaCloudClientException
+ */
+ public List<Realm> listRealms() throws DeltaCloudClientException;
+
+ /**
+ * Returns a single Delta Cloud Realm given its ID
+ *
+ * @param realmId
+ * @return Delta Cloud Realm
+ * @throws DeltaCloudClientException
+ */
+ public Realm listRealms(String realmId) throws DeltaCloudClientException;
+
+ public List<HardwareProfile> listProfiles() throws DeltaCloudClientException;
+
+ /**
+ * Returns a Delta Cloud Flavors
+ *
+ * @param flavorId
+ * @return Delta Cloud Flavor
+ * @throws DeltaCloudClientException
+ */
+ public HardwareProfile listProfile(String profileId) throws DeltaCloudClientException;
+
+ /**
+ * Returns a List of Delta Cloud Images
+ *
+ * @return List of Delta Cloud Images
+ * @throws DeltaCloudClientException
+ */
+ public List<Image> listImages() throws DeltaCloudClientException;
+
+ /**
+ * Returns a Delta Cloud Image given its ID
+ *
+ * @param imageId
+ * @return
+ * @throws DeltaCloudClientException
+ */
+ public Image listImages(String imageId) throws DeltaCloudClientException;
+
+ /**
+ * Returns a list of all Instances from the Delta Cloud Provider
+ *
+ * @return
+ * @throws DeltaCloudClientException
+ */
+ public List<Instance> listInstances() throws DeltaCloudClientException;
+
+ /**
+ * Returns an Instance from the Delta Cloud Provider given on the Instances
+ * ID
+ *
+ * @param instanceId
+ * @return
+ * @throws DeltaCloudClientException
+ */
+ public Instance listInstances(String instanceId) throws DeltaCloudClientException;
+
+ /**
+ * Creates a new Delta Cloud Instance based on the Image specified by the
+ * Image ID. Default parameters are used for the Flavor, Realm and Name.
+ * These are specified by the Delta Cloud Provider
+ *
+ * @param imageId
+ * @return The newly created Delta Cloud Instance
+ * @throws DeltaCloudClientException
+ */
+ public Instance createInstance(String imageId) throws DeltaCloudClientException;
+
+ /**
+ * Creates a new Delta Cloud Instance, the instance will be based on the
+ * Image specified by the instance ID. It will be of type flavor and in the
+ * location realm
+ *
+ * @param imageId
+ * @param flavor
+ * @param realm
+ * @param name
+ * @return
+ * @throws DeltaCloudClientException
+ */
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String memory, String storage)
+ throws DeltaCloudClientException;
+
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String keyname, String memory,
+ String storage) throws DeltaCloudClientException;
+
+ /**
+ * Creates a key for a given name on the deltacloud server.
+ *
+ * @param keyname
+ * the name of the key to retrieve from the server
+ * @param keyStoreLocation
+ * the path to the file to store the key in
+ * @throws DeltaCloudClientException
+ * the delta cloud client exception
+ */
+ public Key createKey(String keyname) throws DeltaCloudClientException;
+
+ /**
+ * Lists all keys available on the deltacloud server this client is
+ * connected to.
+ *
+ * @return the keys that are available
+ * @throws DeltaCloudClientException
+ *
+ */
+ public List<Key> listKeys() throws DeltaCloudClientException;
+
+ /**
+ * Returns a key with the given name if it is available on the server.
+ * Throws a DeltaCloudException if it is not available.
+ */
+ public Key listKey(String id) throws DeltaCloudClientException;
+
+ /**
+ * Performs the given action.
+ *
+ * @param action the action to execute
+ * @return true, if successful
+ *
+ * @see Action
+ */
+ public boolean performAction(Action<?> action) throws DeltaCloudClientException;
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientException.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientException.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientException.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Martyn Taylor
+ */
+public class DeltaCloudClientException extends Exception
+{
+ private static final long serialVersionUID = 1L;
+
+ public DeltaCloudClientException(String message, Throwable clause)
+ {
+ super(message, clause);
+ }
+
+ public DeltaCloudClientException(Throwable clause)
+ {
+ super(clause);
+ }
+
+ public DeltaCloudClientException(String message)
+ {
+ super(message);
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudClientImpl.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,348 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.http.HttpResponse;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.methods.HttpDelete;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.impl.client.DefaultHttpClient;
+import org.jboss.tools.deltacloud.core.client.API.Driver;
+import org.jboss.tools.deltacloud.core.client.request.CreateInstanceRequest;
+import org.jboss.tools.deltacloud.core.client.request.CreateKeyRequest;
+import org.jboss.tools.deltacloud.core.client.request.DeltaCloudRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListHardwareProfileRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListHardwareProfilesRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListImageRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListImagesRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListInstanceRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListInstancesRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListKeyRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListKeysRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListRealmRequest;
+import org.jboss.tools.deltacloud.core.client.request.ListRealmsRequest;
+import org.jboss.tools.deltacloud.core.client.request.PerformActionRequest;
+import org.jboss.tools.deltacloud.core.client.request.TypeRequest;
+import org.jboss.tools.deltacloud.core.client.unmarshal.APIUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.HardwareProfileUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.HardwareProfilesUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.ImageUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.ImagesUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.InstanceUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.InstancesUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.KeyUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.KeysUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.RealmUnmarshaller;
+import org.jboss.tools.deltacloud.core.client.unmarshal.RealmsUnmarshaller;
+
+/**
+ * @author Andre Dietisheim (based on prior implementation by Martyn Taylor)
+ */
+public class DeltaCloudClientImpl implements DeltaCloudClient {
+
+ private String baseUrl;
+ private String username;
+ private String password;
+
+ public DeltaCloudClientImpl(String url) throws MalformedURLException,
+ DeltaCloudClientException {
+ this(url, null, null);
+ }
+
+ public DeltaCloudClientImpl(String url, String username, String password) throws DeltaCloudClientException {
+ this.baseUrl = url;
+ this.username = username;
+ this.password = password;
+ }
+
+ protected InputStream request(DeltaCloudRequest deltaCloudRequest)
+ throws DeltaCloudClientException {
+ DefaultHttpClient httpClient = new DefaultHttpClient();
+ try {
+ URL url = deltaCloudRequest.getUrl();
+ addCredentials(url, httpClient, username, password);
+ HttpUriRequest request = createRequest(deltaCloudRequest);
+ HttpResponse httpResponse = httpClient.execute(request);
+ throwOnHttpErrors(deltaCloudRequest.getUrl(), httpResponse);
+ if (httpResponse.getEntity() == null) {
+ return null;
+ }
+ return httpResponse.getEntity().getContent();
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (MalformedURLException e) {
+ throw new DeltaCloudClientException(MessageFormat.format(
+ "Could not connect to \"{0}\". The url is invalid.", deltaCloudRequest.toString()), e);
+ } catch (IOException e) {
+ throw new DeltaCloudClientException(e);
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ }
+
+ private void throwOnHttpErrors(URL requestUrl, HttpResponse httpResponse)
+ throws DeltaCloudClientException {
+ int statusCode = httpResponse.getStatusLine().getStatusCode();
+ if (HttpStatusCode.OK.isStatus(statusCode)) {
+ return;
+ } else if (HttpStatusCode.UNAUTHORIZED.isStatus(statusCode)) {
+ throw new DeltaCloudAuthClientException(
+ MessageFormat
+ .format("The server reported an authorization error \"{0}\" on requesting \"{1}\"",
+ httpResponse.getStatusLine()
+ .getReasonPhrase(), requestUrl));
+ } else if (HttpStatusCode.NOT_FOUND.isStatus(statusCode)) {
+ throw new DeltaCloudNotFoundClientException(MessageFormat.format(
+ "The server could not find the resource \"{0}\"",
+ requestUrl));
+ } else if (HttpStatusRange.CLIENT_ERROR.isInRange(statusCode)
+ || HttpStatusRange.SERVER_ERROR.isInRange(statusCode)) {
+ throw new DeltaCloudClientException(
+ MessageFormat
+ .format("The server reported an error \"{0}\" on requesting \"{1}\"",
+ httpResponse.getStatusLine()
+ .getReasonPhrase(), requestUrl));
+ }
+ }
+
+ /**
+ * Returns a request instance for the given request type and url.
+ *
+ * @param httpMethod
+ * the request type to use
+ * @param requestUrl
+ * the requested url
+ * @return the request instance
+ * @throws MalformedURLException
+ */
+ protected HttpUriRequest createRequest(DeltaCloudRequest deltaCloudRequest)
+ throws MalformedURLException {
+ HttpUriRequest request = null;
+ String url = deltaCloudRequest.getUrl().toString();
+ HttpMethod httpMethod = deltaCloudRequest.getHttpMethod();
+ switch (httpMethod) {
+ case POST:
+ request = new HttpPost(url);
+ break;
+ case DELETE:
+ request = new HttpDelete(url);
+ break;
+ case GET:
+ default:
+ request = new HttpGet(url);
+ }
+ request.setHeader("Accept", "application/xml;q=1");
+ return request;
+ }
+
+ /**
+ * Adds the credentials to the given http client.
+ *
+ * @param httpClient
+ * the http client
+ * @return the default http client
+ * @throws UnknownHostException
+ */
+ private DefaultHttpClient addCredentials(URL url,
+ DefaultHttpClient httpClient, String username, String password)
+ throws UnknownHostException {
+ if (username != null && password != null) {
+ httpClient.getCredentialsProvider().setCredentials(
+ new AuthScope(url.getHost(), url.getPort()),
+ new UsernamePasswordCredentials(username, password));
+ }
+ return httpClient;
+ }
+
+ public Driver getServerType() {
+ try {
+ InputStream response = request(new TypeRequest(baseUrl));
+ API api = new APIUnmarshaller().unmarshall(response, new API());
+ return api.getDriver();
+ } catch (DeltaCloudClientException e) {
+ return Driver.UNKNOWN;
+ }
+ }
+
+ @Override
+ public Instance createInstance(String imageId) throws DeltaCloudClientException {
+ try {
+ InputStream response = request(new CreateInstanceRequest(baseUrl, imageId));
+ return new InstanceUnmarshaller().unmarshall(response, new Instance());
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+
+ }
+
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String memory,
+ String storage) throws DeltaCloudClientException {
+ return createInstance(name, imageId, profileId, realmId, null, memory, storage);
+ }
+
+ public Instance createInstance(String name, String imageId, String profileId, String realmId, String keyId,
+ String memory, String storage) throws DeltaCloudClientException {
+ try {
+ InputStream response = request(
+ new CreateInstanceRequest(baseUrl, name, imageId, profileId, realmId, keyId, memory, storage));
+ Instance instance = new InstanceUnmarshaller().unmarshall(response, new Instance());
+ // TODO: WORKAROUND for
+ // https://issues.jboss.org/browse/JBIDE-8005
+ if (keyId != null) {
+ instance.setKeyId(keyId);
+ }
+ // TODO: WORKAROUND for
+ // https://issues.jboss.org/browse/JBIDE-8005
+ return instance;
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ }
+
+ @Override
+ public HardwareProfile listProfile(String profileId) throws DeltaCloudClientException {
+ try {
+ InputStream response = request(new ListHardwareProfileRequest(baseUrl, profileId));
+ return new HardwareProfileUnmarshaller().unmarshall(response, new HardwareProfile());
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ }
+
+ @Override
+ public List<HardwareProfile> listProfiles() throws DeltaCloudClientException {
+ try {
+ InputStream response = request(new ListHardwareProfilesRequest(baseUrl));
+ List<HardwareProfile> profiles = new ArrayList<HardwareProfile>();
+ new HardwareProfilesUnmarshaller().unmarshall(response, profiles);
+ return profiles;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(MessageFormat.format("could not get realms on cloud at \"{0}\"",
+ baseUrl), e);
+ }
+ }
+
+ @Override
+ public List<Image> listImages() throws DeltaCloudClientException {
+ InputStream response = request(new ListImagesRequest(baseUrl));
+ List<Image> images = new ArrayList<Image>();
+ new ImagesUnmarshaller().unmarshall(response, images);
+ return images;
+ }
+
+ @Override
+ public Image listImages(String imageId) throws DeltaCloudClientException {
+ InputStream response = request(new ListImageRequest(baseUrl, imageId));
+ return new ImageUnmarshaller().unmarshall(response, new Image());
+ }
+
+ @Override
+ public List<Instance> listInstances() throws DeltaCloudClientException {
+ InputStream inputStream = request(new ListInstancesRequest(baseUrl));
+ List<Instance> instances = new ArrayList<Instance>();
+ new InstancesUnmarshaller().unmarshall(inputStream, instances);
+ return instances;
+ }
+
+ @Override
+ public Instance listInstances(String instanceId) throws DeltaCloudClientException {
+ try {
+ InputStream response = request(new ListInstanceRequest(baseUrl, instanceId));
+ return new InstanceUnmarshaller().unmarshall(response, new Instance());
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ }
+
+ @Override
+ public List<Realm> listRealms() throws DeltaCloudClientException {
+ try {
+ InputStream inputStream = request(new ListRealmsRequest(baseUrl));
+ List<Realm> realms = new ArrayList<Realm>();
+ new RealmsUnmarshaller().unmarshall(inputStream, realms);
+ return realms;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(
+ MessageFormat.format("could not get realms on cloud at \"{0}\"", baseUrl), e);
+ }
+ }
+
+ @Override
+ public Realm listRealms(String realmId) throws DeltaCloudClientException {
+ try {
+ InputStream response = request(new ListRealmRequest(baseUrl, realmId));
+ return new RealmUnmarshaller().unmarshall(response, new Realm());
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(
+ MessageFormat.format("could not get realms on cloud at \"{0}\"", baseUrl), e);
+ }
+ }
+
+ public Key createKey(String keyname) throws DeltaCloudClientException {
+ try {
+ CreateKeyRequest keyRequest = new CreateKeyRequest(baseUrl, keyname);
+ InputStream inputStream = request(keyRequest);
+ Key key = new KeyUnmarshaller().unmarshall(inputStream, new Key());
+ return key;
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ }
+
+ public List<Key> listKeys() throws DeltaCloudClientException {
+ InputStream inputStream = request(new ListKeysRequest(baseUrl));
+ List<Key> keys = new ArrayList<Key>();
+ new KeysUnmarshaller().unmarshall(inputStream, keys);
+ return keys;
+ }
+
+ public Key listKey(String id) throws DeltaCloudClientException {
+ InputStream inputStream = request(new ListKeyRequest(baseUrl, id));
+ Key key = new KeyUnmarshaller().unmarshall(inputStream, new Key());
+ return key;
+ }
+
+ public boolean performAction(Action<?> action) throws DeltaCloudClientException {
+ if (action != null) {
+ try {
+ request(new PerformActionRequest(action.getUrl(), action.getMethod()));
+ } catch (DeltaCloudClientException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new DeltaCloudClientException(e);
+ }
+ return true;
+ }
+ return false;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudNotFoundClientException.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudNotFoundClientException.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/DeltaCloudNotFoundClientException.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class DeltaCloudNotFoundClientException extends DeltaCloudClientException {
+
+ private static final long serialVersionUID = 1L;
+
+ public DeltaCloudNotFoundClientException(String message, Throwable clause)
+ {
+ super(message, clause);
+ }
+
+ public DeltaCloudNotFoundClientException(Throwable clause)
+ {
+ super(clause);
+ }
+
+ public DeltaCloudNotFoundClientException(String message)
+ {
+ super(message);
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HardwareProfile.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.Property.Names;
+
+/**
+ * @author Martyn Taylor
+ * @author André Dietisheim
+ */
+public class HardwareProfile extends IdAware {
+ private static final long serialVersionUID = 1L;
+
+ private List<Property> properties;
+
+ public HardwareProfile() {
+ }
+
+ public void setProperties(List<Property> properties) {
+ this.properties = properties;
+ }
+
+ public List<Property> getProperties() {
+ if (properties == null)
+ properties = new ArrayList<Property>();
+ return properties;
+ }
+
+ public Property getNamedProperty(Names nameEnum) {
+ if (nameEnum == null) {
+ return null;
+ }
+ return getNamedProperty(nameEnum.name().toLowerCase());
+ }
+
+ public Property getNamedProperty(String name) {
+ if (properties != null) {
+ for (Property p : properties) {
+ if (p.getName().equals(name))
+ return p;
+ }
+ }
+ return null;
+ }
+
+ public String getArchitecture() {
+ Property p = getNamedProperty(Property.Names.ARCHITECTURE);
+ if (p != null)
+ return p.getValue();
+ return null;
+ }
+
+ public String getMemory() {
+ Property p = getNamedProperty("memory");
+ if (p != null)
+ return p.toString();
+ return null;
+ }
+
+ public String getStorage() {
+ Property p = getNamedProperty("storage");
+ if (p != null)
+ return p.toString();
+ return null;
+ }
+
+ public String getCPU() {
+ Property p = getNamedProperty("cpu");
+ if (p != null)
+ return p.getValue();
+ return null;
+ }
+
+ @Override
+ public String toString() {
+ String s = "";
+ s += "Hardware-profile:\t\t" + getId() + "\n";
+ for (Property p : properties) {
+ s += p.getName() + ":\t\t" + p.getValue() + "\n";
+ }
+ return s;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpMethod.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpMethod.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpMethod.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+public enum HttpMethod {
+ GET, POST, PUT, DELETE, HEAD;
+}
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusCode.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusCode.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusCode.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Andre Dietisheim
+ */
+public enum HttpStatusCode {
+
+ OK(200), NOT_FOUND(404), FORBIDDEN(403), UNAUTHORIZED(401);
+
+ private int code;
+
+ private HttpStatusCode(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+ public boolean isStatus(int statusCode) {
+ return code == statusCode;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusRange.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusRange.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/HttpStatusRange.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Andre Dietisheim
+ */
+public enum HttpStatusRange {
+
+ CLIENT_ERROR(400, 499), SERVER_ERROR(500, 599);
+
+ private int start;
+ private int stop;
+
+ HttpStatusRange(int start, int stop) {
+ this.start = start;
+ this.stop = stop;
+ }
+
+ public boolean isInRange(int statusCode) {
+ return statusCode >= start
+ && statusCode <= stop;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/IdAware.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/IdAware.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/IdAware.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * @author Martyn Taylor
+ * @author André Dietisheim
+ */
+public abstract class IdAware {
+
+ protected String id;
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @XmlAttribute
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public String toString() {
+ return "IdAware [id=" + id + "]";
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Image.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Image.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Image.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+
+/**
+ * @author Martyn Taylor
+ */
+public class Image extends IdAware
+{
+ private static final long serialVersionUID = 1L;
+
+ private String ownerId;
+
+ private String name;
+
+ private String description;
+
+ private String architecture;
+
+ public Image()
+ {
+ }
+
+ public void setOwnerId(String ownerId)
+ {
+ this.ownerId = ownerId;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ public void setArchitecture(String architecture)
+ {
+ this.architecture = architecture;
+ }
+
+ public String getOwnerId()
+ {
+ return ownerId;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getArchitecture()
+ {
+ return architecture;
+ }
+
+ @Override
+ public String toString()
+ {
+ String s = "";
+ s += "Image:\t\t" + getId() + "\n";
+ s += "Owner:\t\t" + getOwnerId() + "\n";
+ s += "Name:\t\t" + getName() + "\n";
+ s += "Desc:\t\t" + getDescription() + "\n";
+ s += "Arch:\t\t" + getArchitecture() + "\n";
+ return s;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Instance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Instance.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Instance.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.List;
+
+/**
+ * @author Martyn Taylor
+ * @author Andre Dietisheim
+ */
+public class Instance extends StateAware<Instance> {
+
+ private static final long serialVersionUID = 1L;
+
+ private String ownerId;
+
+ private String name;
+
+ private String imageId;
+
+ private String profileId;
+
+ private String memory;
+
+ private String storage;
+
+ private String cpu;
+
+ private String realmId;
+
+ private String keyId;
+
+ private AddressList publicAddresses;
+
+ private AddressList privateAddresses;
+
+ public Instance() {
+ }
+
+ public void setOwnerId(String ownerId) {
+ this.ownerId = ownerId;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setImageId(String imageId) {
+ this.imageId = imageId;
+ }
+
+ public void setProfileId(String profileId) {
+ this.profileId = profileId;
+ }
+
+ protected void setMemory(String memory) {
+ this.memory = memory;
+ }
+
+ protected void setStorage(String storage) {
+ this.storage = storage;
+ }
+
+ protected void setCPU(String cpu) {
+ this.cpu = cpu;
+ }
+
+ public void setRealmId(String realmId) {
+ this.realmId = realmId;
+ }
+
+ public void setKeyId(String keyId) {
+ this.keyId = keyId;
+ }
+
+ public String getKeyId() {
+ return keyId;
+ }
+
+ public void setPrivateAddresses(AddressList privateAddresses) {
+ this.privateAddresses = privateAddresses;
+ }
+
+ public void setPublicAddresses(AddressList publicAddresses) {
+ this.publicAddresses = publicAddresses;
+ }
+
+ public String getOwnerId() {
+ return ownerId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getImageId() {
+ return imageId;
+ }
+
+ public String getProfileId() {
+ return profileId;
+ }
+
+ public String getMemory() {
+ return memory;
+ }
+
+ public String getStorage() {
+ return storage;
+ }
+
+ public String getCPU() {
+ return cpu;
+ }
+
+ public String getRealmId() {
+ return realmId;
+ }
+
+ public List<String> getPublicAddresses() {
+ return publicAddresses.getAddress();
+ }
+
+ public List<String> getPrivateAddresses() {
+ return privateAddresses.getAddress();
+ }
+
+ @Override
+ public String toString() {
+ String s = "";
+ s += "Instance:\t" + getId() + "\n";
+ s += "Owner:\t\t" + getOwnerId() + "\n";
+ s += "Image:\t\t" + getImageId() + "\n";
+ s += "Realm:\t\t" + getRealmId() + "\n";
+ s += "Profile:\t\t" + getProfileId() + "\n";
+ if (getMemory() != null)
+ s += "Memory:\t\t" + getMemory() + "\n";
+ if (getStorage() != null) {
+ s += "Storage:\t\t" + getStorage() + "\n";
+ }
+ if (getCPU() != null) {
+ s += "CPU:\t\t" + getCPU() + "\n";
+ }
+ s += "State:\t\t" + getState() + "\n";
+
+ List<Action<Instance>> actions = getActions();
+ if (actions != null) {
+ for (int i = 0; i < actions.size(); i++) {
+ if (i == 0) {
+ s += "Actions:\t" + actions.get(i) + "\n";
+ } else {
+ s += "\t\t" + actions.get(i) + "\n";
+ }
+ }
+ }
+
+ for (int i = 0; i < publicAddresses.getAddress().size(); i++) {
+ if (i == 0) {
+ s += "Public Addr:\t" + publicAddresses.getAddress().get(i) + "\n";
+ } else {
+ s += "\t\t" + publicAddresses.getAddress().get(i) + "\n";
+ }
+ }
+
+ for (int i = 0; i < publicAddresses.getAddress().size(); i++) {
+ if (i == 0) {
+ s += "Private Addr:\t" + publicAddresses.getAddress().get(i) + "\n";
+ } else {
+ s += "\t\t" + privateAddresses.getAddress().get(i) + "\n";
+ }
+ }
+
+ return s;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Key.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Key.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Key.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class Key extends StateAware<Key> {
+
+ private static final long serialVersionUID = 1L;
+
+ private URL url;
+ private String pem;
+ private String fingerprint;
+ private String state;
+
+ public Key() {
+ }
+
+ public void setUrl(URL url) {
+ this.url = url;
+ }
+
+ public void setUrl(String url) throws MalformedURLException {
+ this.url = new URL(url);
+ }
+
+ public void setPem(String pem) {
+ this.pem = pem;
+ }
+
+ public void setFingerprint(String fingerprint) {
+ this.fingerprint = fingerprint;
+ }
+
+ public URL getUrl() {
+ return url;
+ }
+
+ public String getFingerprint() {
+ return fingerprint;
+ }
+
+ public String getPem() {
+ return pem;
+ }
+
+ @Override
+ public String toString() {
+ return "Key [url=" + url + ", pem=" + pem + ", fingerprint=" + fingerprint + ", state=" + state + ", actions="
+ + getActions() + ", toString()=" + super.toString() + "]";
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Property.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Property.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Property.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+import java.util.List;
+
+/**
+ * @author Martyn Taylor
+ */
+public class Property extends IdAware {
+
+ private static final long serialVersionUID = 1L;
+
+ public static enum Kind {
+ FIXED, RANGE, ENUM
+ };
+
+ public static enum Names {
+ MEMORY, STORAGE, CPU, ARCHITECTURE
+ }
+
+ public static enum UNIT {
+ MB {
+ public boolean matches(String value) {
+ return name().equals(value);
+ }},
+ GB{
+ public boolean matches(String value) {
+ return name().equals(value);
+ }},
+ LABEL{
+ public boolean matches(String value) {
+ return name().toLowerCase().equals(value);
+ }},
+ COUNT{
+ public boolean matches(String value) {
+ return name().toLowerCase().equals(value);
+ }};
+
+ public abstract boolean matches(String value);
+ }
+
+ public class Range {
+ private String first;
+ private String last;
+
+ public Range(String first, String last) {
+ this.first = first;
+ this.last = last;
+ }
+
+ public String getFirst() {
+ return first;
+ }
+
+ public String getLast() {
+ return last;
+ }
+ }
+
+ public Property() {
+ }
+
+ private String kind;
+
+ private String unit;
+
+ private String name;
+
+ private String value;
+
+ // For range
+ private String first;
+ private String last;
+
+ // For enum
+ private List<String> enums;
+
+ public String getKind() {
+ return kind;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public Range getRange() {
+ return new Range(first, last);
+ }
+
+ public List<String> getEnums() {
+ return enums;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+
+ public void setKind(String kind) {
+ this.kind = kind;
+ }
+
+ public void setRange(String first, String last) {
+ this.first = first;
+ this.last = last;
+ }
+
+ public void setEnums(List<String> enums) {
+ this.enums = enums;
+ }
+
+ public String toString() {
+ if (kind.equals("range")) {
+ // return first += "-" + last + "(default:" + value + ")";
+ return new StringBuilder()
+ .append(first)
+ .append('-').append(last)
+ .append("(default: ").append(value).append(")")
+ .toString();
+ } else if (kind.equals("enum")) {
+ String s = enums.get(0);
+ for (int i = 1; i < enums.size(); ++i) {
+ s += ", " + enums.get(i);
+ }
+ s += " (default:" + value + ")";
+ return s;
+ } else {
+ // return value += " " + (unit.equals("label") ? "" : unit);
+ StringBuilder builder = new StringBuilder();
+ builder.append(value);
+ if (!UNIT.LABEL.matches(unit)) {
+ builder.append(' ').append(unit);
+ }
+ return builder.toString();
+ }
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Realm.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Realm.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/Realm.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat Inc..
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat Incorporated - initial API and implementation
+ *******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+/**
+ * @author Martyn Taylor
+ * @author André Dietisheim
+ */
+public class Realm extends IdAware {
+ private static final long serialVersionUID = 1L;
+
+ public static final int LIMIT_DEFAULT = -1;
+
+ private String name;
+ private RealmState state;
+ private int limit;
+
+ public static enum RealmState {
+ AVAILABLE, UNAVAILABLE, UNKNOWN
+ }
+
+ public Realm() {
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ public void setLimit(int limit) {
+ this.limit = limit;
+ }
+
+ public void setLimit(String limit) {
+ try {
+ this.limit = Integer.parseInt(limit);
+ } catch (Exception e) {
+ this.limit = LIMIT_DEFAULT;
+ }
+ }
+
+ public int getLimit() {
+ return limit;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setState(String state) {
+ try {
+ this.state = RealmState.valueOf(state.toUpperCase());
+ } catch (Exception e) {
+ this.state = RealmState.UNKNOWN;
+ }
+ }
+
+ public RealmState getState() {
+ return state;
+ }
+
+ @Override
+ public String toString() {
+ String s = "";
+ s += "Realm:\t\t" + getId() + "\n";
+ s += "Name\t\t" + getName() + "\n";
+ s += "State:\t\t" + getState() + "\n";
+ s += "Limit:\t\t" + getLimit() + "\n";
+ return s;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ResourceAction.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ResourceAction.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/ResourceAction.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+
+/**
+ * @author André Dietisheim
+ */
+public interface ResourceAction<OWNER> {
+
+ public static final String DESTROY = "destroy";
+
+ public String getName();
+
+ public String getUrl();
+
+ public HttpMethod getMethod();
+
+ public OWNER getOwner();
+
+ public boolean isDestroy();
+}
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/StateAware.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/StateAware.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/StateAware.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client;
+
+
+/**
+ * @author André Dietisheim
+ *
+ * @param <OWNER>
+ */
+public class StateAware<OWNER> extends ActionAware<OWNER> {
+
+ public static enum State {
+ RUNNING, STOPPED, PENDING, TERMINATED, BOGUS
+ };
+
+ private State state;
+
+ public void setState(String state) {
+ try {
+ this.state = State.valueOf(state);
+ } catch (Exception e) {
+ this.state = State.BOGUS;
+ }
+ }
+
+ public State getState() {
+ return state;
+ }
+
+ public boolean isRunning() {
+ return getState() == State.RUNNING;
+ }
+
+ public boolean isStopped() {
+ return getState() == State.STOPPED;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractDeltaCloudRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractDeltaCloudRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractDeltaCloudRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * @author André Dietisheim
+ */
+public abstract class AbstractDeltaCloudRequest implements DeltaCloudRequest {
+
+ private String urlString;
+ private URL url;
+ private HttpMethod httpMethod;
+ private UrlBuilder urlBuilder;
+
+ protected AbstractDeltaCloudRequest(String baseURL, HttpMethod httpMethod) {
+ this.httpMethod = httpMethod;
+ this.urlBuilder = createUrlBuilder(baseURL);
+ }
+
+ protected abstract String doCreateUrl(UrlBuilder urlBuilder);
+
+ protected UrlBuilder createUrlBuilder(String baseUrl) {
+ return new UrlBuilder(baseUrl).path(API_PATH_SEGMENT);
+ }
+
+ public URL getUrl() throws MalformedURLException {
+ if (url == null) {
+ this.url = new URL(getUrlString());
+ }
+ return url;
+ }
+
+ protected String getUrlString() {
+ if (urlString == null) {
+ this.urlString = doCreateUrl(urlBuilder);
+ }
+ return urlString;
+ }
+
+ public String toString() {
+ return getUrlString();
+ }
+
+ public HttpMethod getHttpMethod() {
+ return httpMethod;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractListObjectsRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractListObjectsRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/AbstractListObjectsRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Lists images, instances, realms or profiles on the deltacloud server.
+ *
+ * @see ListRealmRequest
+ * @see ListHardwareProfilesRequest
+ * @see ListHardwareProfilesRequest
+ * @see ListInstancesRequest
+ *
+ * @author André Dietisheim
+ */
+public abstract class AbstractListObjectsRequest extends AbstractDeltaCloudRequest {
+
+ private String objectType;
+
+ public AbstractListObjectsRequest(String baseUrl, String objectType) {
+ super(baseUrl, HttpMethod.GET);
+ this.objectType = objectType;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path(objectType).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateInstanceRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Creates a new instance
+ *
+ * @author André Dietisheim
+ */
+public class CreateInstanceRequest extends AbstractDeltaCloudRequest {
+
+ private String name;
+ private String imageId;
+ private String profileId;
+ private String realmId;
+ private String keyname;
+ private String memory;
+ private String storage;
+
+ public CreateInstanceRequest(String baseUrl, String imageId) {
+ this(baseUrl, null, imageId, null, null, null, null, null);
+ }
+
+ public CreateInstanceRequest(String baseUrl, String name, String imageId, String profileId, String realmId,
+ String keyId, String memory, String storage) {
+ super(baseUrl, HttpMethod.POST);
+ this.name = name;
+ this.imageId = imageId;
+ this.profileId = profileId;
+ this.realmId = realmId;
+ this.keyname = keyId;
+ this.memory = memory;
+ this.storage = storage;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("instances")
+ .parameter("keyname", keyname)
+ // WORKAROUND for JBIDE-8005, STEAM-303
+ .parameter("key_name", keyname)
+ // WORKAROUND for JBIDE-8005, STEAM-303
+ .parameter("name", name)
+ .parameter("image_id", imageId)
+ .parameter("hwp_id", profileId)
+ .parameter("realm_id", realmId)
+ .parameter("hwp_memory", memory)
+ .parameter("hwp_storage", storage)
+ .parameter("commit", "create")
+ .toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/CreateKeyRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Creates a key on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class CreateKeyRequest extends AbstractDeltaCloudRequest {
+
+ private String keyName;
+
+ public CreateKeyRequest(String baseUrl, String keyName) {
+ super(baseUrl, HttpMethod.POST);
+ this.keyName = keyName;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("keys")
+ .parameter("name", keyName)
+ .parameter("commit", "create")
+ .toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/DeltaCloudRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/DeltaCloudRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/DeltaCloudRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+
+/**
+ * @author André Dietisheim
+ */
+public interface DeltaCloudRequest {
+
+ public static final char PATH_SEPARATOR = '/';
+ public static final char PARAMETER_SEPARATOR = '?';
+ public static final String API_PATH_SEGMENT = "api";
+
+ public URL getUrl() throws MalformedURLException;
+
+ public HttpMethod getHttpMethod();
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfileRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfileRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfileRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * A request for a hardware profile on a deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListHardwareProfileRequest extends AbstractDeltaCloudRequest {
+
+ private String profileId;
+
+ /**
+ * Instantiates a new type request.
+ *
+ * @param baseUrl the base url
+ * @param imageId
+ */
+ public ListHardwareProfileRequest(String baseUrl, String profileId) {
+ super(baseUrl, HttpMethod.GET);
+ this.profileId = profileId;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("hardware_profiles").path(profileId).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfilesRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfilesRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListHardwareProfilesRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+/**
+ * Lists profiles on the deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListHardwareProfilesRequest extends AbstractListObjectsRequest {
+
+ public ListHardwareProfilesRequest(String baseUrl) {
+ super(baseUrl, "hardware_profiles");
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImageRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImageRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImageRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+
+/**
+ * A request for an image on a deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListImageRequest extends AbstractDeltaCloudRequest {
+
+ private String imageId;
+
+ public ListImageRequest(String baseUrl, String imageId) {
+ super(baseUrl, HttpMethod.GET);
+ this.imageId = imageId;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("images").path(imageId).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImagesRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImagesRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListImagesRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+/**
+ * Lists images on the deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListImagesRequest extends AbstractListObjectsRequest {
+
+ public ListImagesRequest(String baseUrl) {
+ super(baseUrl, "images");
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstanceRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstanceRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstanceRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Lists an instance on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class ListInstanceRequest extends AbstractDeltaCloudRequest {
+
+ private String instanceId;
+
+ public ListInstanceRequest(String baseUrl, String instanceId) {
+ super(baseUrl, HttpMethod.GET);
+ this.instanceId = instanceId;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("instances").path(instanceId).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstancesRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstancesRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListInstancesRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+/**
+ * Lists instances on the deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListInstancesRequest extends AbstractListObjectsRequest {
+
+ public ListInstancesRequest(String baseUrl) {
+ super(baseUrl, "instances");
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeyRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * List a key with a given name that is available on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class ListKeyRequest extends AbstractDeltaCloudRequest {
+
+ private String name;
+
+ public ListKeyRequest(String baseUrl, String name) {
+ super(baseUrl, HttpMethod.GET);
+ this.name = name;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("keys").path(name).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListKeysRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Lists keys available on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class ListKeysRequest extends AbstractDeltaCloudRequest {
+
+ public ListKeysRequest(String baseUrl) {
+ super(baseUrl, HttpMethod.GET);
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("keys").toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Lists a realm on the deltacloud server
+ *
+ * @author André Dietisheim
+ */
+public class ListRealmRequest extends AbstractDeltaCloudRequest {
+
+ private String realmId;
+
+ public ListRealmRequest(String baseUrl, String realmId) {
+ super(baseUrl, HttpMethod.GET);
+ this.realmId = realmId;
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.path("realms").path(realmId).toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmsRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmsRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/ListRealmsRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+/**
+ * Lists realms on the deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class ListRealmsRequest extends AbstractListObjectsRequest {
+
+ public ListRealmsRequest(String baseUrl) {
+ super(baseUrl, "realms");
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/PerformActionRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/PerformActionRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/PerformActionRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * Performs an action on a resource of the deltacloud server. The typical
+ * actions are
+ * <ul>
+ * <li>START</li>
+ * <li>STOP</li>
+ * <li>DESTROY</li>
+ * <li>REBOOT</li>
+ * </ul>
+ *
+ * @author André Dietisheim
+ *
+ * @see Action
+ */
+public class PerformActionRequest extends AbstractDeltaCloudRequest {
+
+ public PerformActionRequest(String url, HttpMethod httpMethod) {
+ super(url, httpMethod);
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.toString();
+ }
+
+ @Override
+ protected UrlBuilder createUrlBuilder(String baseURL) {
+ return new UrlBuilder(baseURL);
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/TypeRequest.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/TypeRequest.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/request/TypeRequest.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.request;
+
+import org.jboss.tools.deltacloud.core.client.HttpMethod;
+import org.jboss.tools.deltacloud.core.client.utils.UrlBuilder;
+
+/**
+ * A request for the type of deltacloud server.
+ *
+ * @author André Dietisheim
+ */
+public class TypeRequest extends AbstractDeltaCloudRequest {
+
+ public TypeRequest(String baseUrl) {
+ super(baseUrl, HttpMethod.GET);
+ }
+
+ @Override
+ protected String doCreateUrl(UrlBuilder urlBuilder) {
+ return urlBuilder.parameter("format", "xml").toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/APIUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/APIUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/APIUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.API;
+import org.w3c.dom.Element;
+
+/**
+ * @author André Dietisheim
+ */
+public class APIUnmarshaller extends AbstractDOMUnmarshaller<API> {
+
+ public APIUnmarshaller() {
+ super("api", API.class);
+ }
+
+ protected API doUnmarshall(Element element, API server) throws Exception {
+ if (element != null) {
+ server.setDriver(getAttributeText("driver", element));
+ }
+ return server;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractActionAwareUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractActionAwareUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractActionAwareUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author André Dietisheim
+ *
+ * @param <DELTACLOUDOBJECT>
+ */
+public abstract class AbstractActionAwareUnmarshaller<DELTACLOUDOBJECT> extends AbstractDOMUnmarshaller<DELTACLOUDOBJECT>{
+
+ private String actionElementName;
+ public AbstractActionAwareUnmarshaller(String tagName, Class<DELTACLOUDOBJECT> type, String actionElementName) {
+ super(tagName, type);
+ this.actionElementName = actionElementName;
+ }
+
+ protected List<Action<DELTACLOUDOBJECT>> getActions(Element element, DELTACLOUDOBJECT owner) throws DeltaCloudClientException {
+ if (element == null) {
+ return null;
+ }
+ List<Action<DELTACLOUDOBJECT>> actions = new ArrayList<Action<DELTACLOUDOBJECT>>();
+ NodeList nodeList = element.getElementsByTagName(actionElementName);
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node linkNode = nodeList.item(i);
+ Action<DELTACLOUDOBJECT> action = createAction(linkNode);
+ if (action != null) {
+ action.setOwner(owner);
+ actions.add(action);
+ }
+ }
+ return actions;
+ }
+
+ protected Action<DELTACLOUDOBJECT> createAction(Node node) throws DeltaCloudClientException {
+ if (!(node instanceof Element)) {
+ return null;
+ }
+ return unmarshallAction((Element) node);
+ }
+
+ protected abstract Action<DELTACLOUDOBJECT> unmarshallAction(Element element) throws DeltaCloudClientException;
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDOMUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDOMUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDOMUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author André Dietisheim
+ *
+ * @param <DELTACLOUDOBJECT>
+ */
+public abstract class AbstractDOMUnmarshaller<DELTACLOUDOBJECT> {
+
+ private Class<DELTACLOUDOBJECT> type;
+ private String tagName;
+
+ public AbstractDOMUnmarshaller(String tagName, Class<DELTACLOUDOBJECT> type) {
+ this.type = type;
+ this.tagName = tagName;
+ }
+
+ public DELTACLOUDOBJECT unmarshall(InputStream inputStream, DELTACLOUDOBJECT deltacloudObject) throws DeltaCloudClientException {
+ try {
+ Element element = getFirstElement(tagName, getDocument(inputStream));
+ if (element == null) {
+ return null;
+ }
+ return unmarshall(element, deltacloudObject);
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ throw new DeltaCloudClientException(
+ MessageFormat.format("Could not unmarshall type \"{0}\"", type), e);
+ }
+
+ }
+
+ protected Document getDocument(InputStream inputStream) throws ParserConfigurationException, SAXException, IOException {
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder documentBuilder = factory.newDocumentBuilder();
+ return documentBuilder.parse(inputStream);
+ }
+
+ public DELTACLOUDOBJECT unmarshall(Element element, DELTACLOUDOBJECT resource) throws DeltaCloudClientException {
+ try {
+ return doUnmarshall(element, resource);
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ throw new DeltaCloudClientException(
+ MessageFormat.format("Could not unmarshall type \"{0}\"", type), e);
+ }
+ }
+
+ protected abstract DELTACLOUDOBJECT doUnmarshall(Element element, DELTACLOUDOBJECT resource) throws Exception;
+
+ protected String getFirstElementAttributeText(String elementName, String attributeId, Element element) {
+ Element firstElement = getFirstElement(elementName, element);
+ if (firstElement == null) {
+ return null;
+ }
+ return firstElement.getAttribute(attributeId);
+ }
+
+ protected String getFirstElementText(String elementName, Element element) {
+ Element firstElement = getFirstElement(elementName, element);
+ if (firstElement == null) {
+ return null;
+ }
+ return firstElement.getTextContent();
+ }
+
+ protected Element getFirstElement(String elementName, Element element) {
+ NodeList elements = element.getElementsByTagName(elementName);
+ if (elements != null
+ && elements.getLength() > 0) {
+ return (Element) elements.item(0);
+ }
+ return null;
+ }
+
+ protected Element getFirstElement(String elementName, Document document) {
+ NodeList elements = document.getElementsByTagName(elementName);
+ if (elements != null
+ && elements.getLength() > 0) {
+ return (Element) elements.item(0);
+ }
+ return null;
+ }
+
+ protected String getAttributeText(String attributeName, Element element) {
+ Node attribute = element.getAttributeNode(attributeName);
+ if (attribute != null) {
+ return attribute.getTextContent();
+ }
+ return null;
+ }
+
+ protected String stripText(String textContent) {
+ if (textContent == null || textContent.length() == 0) {
+ return textContent;
+ }
+ return textContent.trim();
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+* Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.io.InputStream;
+import java.text.MessageFormat;
+
+import org.jboss.tools.deltacloud.client.DeltaCloudException;
+
+/**
+ * @author André Dietisheim
+ *
+ * @param <RESOURCE>
+ */
+public abstract class AbstractDeltaCloudObjectUnmarshaller<RESOURCE> implements IDeltaCloudObjectUnmarshaller<RESOURCE> {
+
+ private Class<RESOURCE> type;
+
+ public AbstractDeltaCloudObjectUnmarshaller(Class<RESOURCE> type) {
+ this.type = type;
+ }
+
+ public RESOURCE create(InputStream inputStream) throws DeltaCloudException {
+
+ try {
+ return doCreate(inputStream);
+ } catch (Exception e) {
+ // TODO: internationalize strings
+ throw new DeltaCloudException(
+ MessageFormat.format("Could not unmarshall resource of type \"{0}\"", type), e);
+ }
+ }
+
+ protected abstract RESOURCE doCreate(InputStream inputStream) throws Exception;
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectsUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectsUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/AbstractDeltaCloudObjectsUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author André Dietisheim
+ */
+@SuppressWarnings("rawtypes")
+public abstract class AbstractDeltaCloudObjectsUnmarshaller<CHILD> extends AbstractDOMUnmarshaller<List> {
+
+ private String childTag;
+
+ public AbstractDeltaCloudObjectsUnmarshaller(String parentTag, String childTag) {
+ super(parentTag, List.class);
+ this.childTag = childTag;
+ }
+
+ @SuppressWarnings("unchecked")
+ protected List doUnmarshall(Element element, List children) throws Exception {
+ if (element != null) {
+ NodeList nodeList = element.getElementsByTagName(childTag);
+ if (nodeList != null
+ && nodeList.getLength() > 0) {
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node node = nodeList.item(i);
+ if (node instanceof Element) {
+ CHILD child = unmarshallChild(node);
+ children.add(child);
+ }
+ }
+ }
+ }
+ return children;
+ }
+
+ protected abstract CHILD unmarshallChild(Node node) throws DeltaCloudClientException;
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ActionUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ActionUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ActionUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.w3c.dom.Element;
+
+/**
+ * @author André Dietisheim
+ */
+public class ActionUnmarshaller<OWNER> extends AbstractDOMUnmarshaller<Action<OWNER>> {
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public ActionUnmarshaller() {
+ super("link", (Class) Action.class);
+ }
+
+ @Override
+ protected Action<OWNER> doUnmarshall(Element element, Action<OWNER> action) throws Exception {
+ if (element != null) {
+ action.setMethod(getAttributeText("method", element));
+ action.setName(getAttributeText("rel", element));
+ action.setUrl(getAttributeText("href", element));
+ }
+ return action;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfileUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfileUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfileUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.Assert;
+import org.jboss.tools.deltacloud.core.client.HardwareProfile;
+import org.jboss.tools.deltacloud.core.client.Property;
+import org.jboss.tools.deltacloud.core.client.Property.Kind;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author André Dietisheim
+ */
+public class HardwareProfileUnmarshaller extends AbstractDOMUnmarshaller<HardwareProfile> {
+
+ public HardwareProfileUnmarshaller() {
+ super("hardware_profile", HardwareProfile.class);
+ }
+
+ @Override
+ protected HardwareProfile doUnmarshall(Element element, HardwareProfile profile) throws Exception {
+ profile.setId(getAttributeText("id", element));
+ profile.setProperties(createProperties(element.getElementsByTagName("property")));
+ return profile;
+ }
+
+ private List<Property> createProperties(NodeList propertiesList) {
+ List<Property> properties = new ArrayList<Property>();
+ for (int i = 0; i < propertiesList.getLength(); i++) {
+ Property property = createProperty(propertiesList.item(i));
+ properties.add(property);
+ }
+ return properties;
+ }
+
+ private Property createProperty(Node node) {
+ Assert.isTrue(node instanceof Element);
+ Element element = (Element) node;
+ Property property = new Property();
+ property.setName(element.getAttribute("name"));
+ property.setId(element.getAttribute("id"));
+ property.setUnit(element.getAttribute("unit"));
+ property.setValue(element.getAttribute("value"));
+ String kind = element.getAttribute("kind");
+ Assert.isTrue(kind != null);
+ kind = kind.toUpperCase();
+ property.setKind(kind);
+ if (Kind.RANGE.toString().equals(property.getKind())) {
+ setRange(element, property);
+ } else if (Kind.ENUM.toString().equals(property.getKind())) {
+ setEnum(element, property);
+ } else if (Kind.FIXED.toString().equals(property.getKind())) {
+ // no special treatement
+ }
+ return property;
+ }
+
+ private void setRange(Element propertyElement, Property property) {
+ Node node = propertyElement.getElementsByTagName("range").item(0);
+ Assert.isLegal(node instanceof Element);
+ Element rangeElement = (Element) node;
+ property.setRange(rangeElement.getAttribute("first"), rangeElement.getAttribute("last"));
+ }
+
+ private void setEnum(Element propertyElement, Property property) {
+ Node node = propertyElement.getElementsByTagName("enum").item(0);
+ Assert.isLegal(node instanceof Element);
+ Element enumElement = (Element) node;
+ NodeList nodeList = enumElement.getElementsByTagName("entry");
+ ArrayList<String> enumValues = new ArrayList<String>();
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ Node entryNode = nodeList.item(i);
+ Assert.isTrue(entryNode instanceof Element);
+ Element entryElement = (Element) entryNode;
+ enumValues.add(entryElement.getAttribute("value"));
+ }
+ property.setEnums(enumValues);
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfilesUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfilesUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/HardwareProfilesUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.HardwareProfile;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author André Dietisheim
+ */
+public class HardwareProfilesUnmarshaller extends AbstractDeltaCloudObjectsUnmarshaller<HardwareProfile> {
+
+ public HardwareProfilesUnmarshaller() {
+ super("hardware_profiles", "hardware_profile");
+ }
+
+ @Override
+ protected HardwareProfile unmarshallChild(Node node) throws DeltaCloudClientException {
+ return new HardwareProfileUnmarshaller().unmarshall((Element) node, new HardwareProfile());
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/IDeltaCloudObjectUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/IDeltaCloudObjectUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/IDeltaCloudObjectUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.io.InputStream;
+
+/**
+ * @author André Dietisheim
+ */
+public interface IDeltaCloudObjectUnmarshaller<DELTACLOUDOBJECT> {
+
+ public DELTACLOUDOBJECT unmarshall(InputStream inputStream);
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImageUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImageUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImageUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.Image;
+import org.w3c.dom.Element;
+
+/**
+ * @author André Dietisheim
+ */
+public class ImageUnmarshaller extends AbstractDOMUnmarshaller<Image> {
+
+ public ImageUnmarshaller() {
+ super("image", Image.class);
+ }
+
+ protected Image doUnmarshall(Element element, Image image) throws Exception {
+ image.setId(getAttributeText("id", element));
+ image.setName(getFirstElementText("name", element));
+ image.setOwnerId(getFirstElementText("owner_id", element));
+ image.setDescription(getFirstElementText("description", element));
+ image.setArchitecture(getFirstElementText("architecture", element));
+ return image;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImagesUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImagesUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/ImagesUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Image;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author André Dietisheim
+ */
+public class ImagesUnmarshaller extends AbstractDeltaCloudObjectsUnmarshaller<Image> {
+
+ public ImagesUnmarshaller() {
+ super("images", "image");
+ }
+
+ @Override
+ protected Image unmarshallChild(Node node) throws DeltaCloudClientException {
+ Image image = new ImageUnmarshaller().unmarshall((Element) node, new Image());
+ return image;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstanceUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstanceUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstanceUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.jboss.tools.deltacloud.core.client.AddressList;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Instance;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author André Dietisheim
+ */
+public class InstanceUnmarshaller extends AbstractActionAwareUnmarshaller<Instance> {
+
+ public InstanceUnmarshaller() {
+ super("instance", Instance.class, "link");
+ }
+
+ protected Instance doUnmarshall(Element element, Instance instance) throws Exception {
+ instance.setId(getAttributeText("id", element));
+ instance.setName(getFirstElementText("name", element));
+ instance.setOwnerId(getFirstElementText("owner_id", element));
+ instance.setOwnerId(getFirstElementText("owner_id", element));
+ instance.setImageId(getFirstElementAttributeText("image", "id", element));
+ instance.setProfileId(getFirstElementAttributeText("hardware_profile", "id", element));
+ instance.setRealmId(getFirstElementAttributeText("realm", "id", element));
+ instance.setState(getFirstElementText("state", element));
+ setKeyname(instance, element);
+ instance.setActions(getActions(element, instance));
+ instance.setPublicAddresses(getAddressList("public_addresses", element));
+ instance.setPrivateAddresses(getAddressList("private_addresses", element));
+ return instance;
+ }
+
+ private AddressList getAddressList(String elementName, Element element) {
+ Element addressElement = getFirstElement(elementName, element);
+ if (addressElement != null) {
+ NodeList addressList = addressElement.getChildNodes();
+ if (addressList != null) {
+ List<String> addresses = new ArrayList<String>();
+ for (int i = 0; i < addressList.getLength(); i++) {
+ Node addressNode = addressList.item(i);
+ if (addressNode != null) {
+ String address = stripText(addressNode.getTextContent());
+ if (address != null && address.length() > 0) {
+ addresses.add(address);
+ }
+ }
+ }
+ return new AddressList(addresses);
+ }
+ }
+ return new AddressList();
+ }
+
+ private void setKeyname(Instance instance, Element element) {
+ Element authenticationElement = getFirstElement("authentication", element);
+ if (authenticationElement != null) {
+ Element loginElement = getFirstElement("login", authenticationElement);
+ if (loginElement != null) {
+ String keyname = getFirstElementText("keyname", loginElement);
+ instance.setKeyId(keyname);
+ }
+ }
+ }
+
+ @Override
+ protected Action<Instance> unmarshallAction(Element element) throws DeltaCloudClientException {
+ Action<Instance> action = new Action<Instance>();
+ new ActionUnmarshaller<Instance>().unmarshall(element, action);
+ return action;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstancesUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstancesUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/InstancesUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Instance;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author André Dietisheim
+ */
+public class InstancesUnmarshaller extends AbstractDeltaCloudObjectsUnmarshaller<Instance> {
+
+ public InstancesUnmarshaller() {
+ super("instances", "instance");
+ }
+
+ @Override
+ protected Instance unmarshallChild(Node node) throws DeltaCloudClientException {
+ Instance instance = new InstanceUnmarshaller().unmarshall((Element) node, new Instance());
+ return instance;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeyUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeyUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeyUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.jboss.tools.deltacloud.core.client.Action;
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Key;
+import org.w3c.dom.Element;
+
+/**
+ * @author André Dietisheim
+ */
+public class KeyUnmarshaller extends AbstractActionAwareUnmarshaller<Key> {
+
+ public KeyUnmarshaller() {
+ super("key", Key.class, "link");
+ }
+
+ protected Key doUnmarshall(Element element, Key key) throws Exception {
+ if (element != null) {
+ key.setId(getAttributeText("id", element));
+ key.setUrl(getAttributeText("href", element));
+ key.setState(getFirstElementText("state", element));
+ key.setFingerprint(getFirstElementText("fingerprint", element));
+ key.setPem(trimPem(getPem(element))); //$NON-NLS-1$
+ key.setActions(getActions(element, key));
+ }
+ return key;
+ }
+
+ private String getPem(Element element) {
+ Element pemElement = getFirstElement("pem", element);
+ if (pemElement != null) {
+ return getFirstElementText("pem", pemElement);
+ }
+ return null;
+ }
+
+ private String trimPem(String pem) throws IOException {
+ if (pem == null
+ || pem.length() <= 0) {
+ return null;
+ }
+ StringBuffer sb = new StringBuffer();
+ String line = null;
+ BufferedReader reader = new BufferedReader(new StringReader(pem));
+ while ((line = reader.readLine()) != null) {
+ // We must trim off the white-space from the xml
+ // Complete white-space lines are to be ignored.
+ String trimmedLine = line.trim();
+ if (trimmedLine.length() > 0) {
+ sb.append(trimmedLine).append('\n');
+ }
+ }
+ return sb.toString();
+ }
+
+ @Override
+ protected Action<Key> unmarshallAction(Element element) throws DeltaCloudClientException {
+ Action<Key> keyAction = new Action<Key>();
+ new ActionUnmarshaller<Key>().unmarshall(element, keyAction);
+ return keyAction;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeysUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeysUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/KeysUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Key;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author André Dietisheim
+ */
+public class KeysUnmarshaller extends AbstractDeltaCloudObjectsUnmarshaller<Key> {
+
+ public KeysUnmarshaller() {
+ super("keys", "key");
+ }
+
+ @Override
+ protected Key unmarshallChild(Node node) throws DeltaCloudClientException {
+ Key key = new KeyUnmarshaller().unmarshall((Element) node, new Key());
+ return key;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.Realm;
+import org.w3c.dom.Element;
+
+/**
+ * @author André Dietisheim
+ */
+public class RealmUnmarshaller extends AbstractDOMUnmarshaller<Realm> {
+
+ public RealmUnmarshaller() {
+ super("realm", Realm.class);
+ }
+
+ protected Realm doUnmarshall(Element element, Realm realm) throws Exception {
+ realm.setId(getAttributeText("id", element));
+ realm.setName(getFirstElementText("name", element));
+ realm.setLimit(getFirstElementText("limit", element));
+ realm.setState(getFirstElementText("state", element));
+ return realm;
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmsUnmarshaller.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmsUnmarshaller.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/unmarshal/RealmsUnmarshaller.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.unmarshal;
+
+import org.jboss.tools.deltacloud.core.client.DeltaCloudClientException;
+import org.jboss.tools.deltacloud.core.client.Realm;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author André Dietisheim
+ */
+public class RealmsUnmarshaller extends AbstractDeltaCloudObjectsUnmarshaller<Realm> {
+
+ public RealmsUnmarshaller() {
+ super("realms", "realm");
+ }
+
+ @Override
+ protected Realm unmarshallChild(Node node) throws DeltaCloudClientException {
+ return new RealmUnmarshaller().unmarshall((Element) node, new Realm());
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/StringUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/StringUtils.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/StringUtils.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core.client.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class StringUtils {
+
+ /**
+ * Returns a formatted string for a collection of elements that get
+ * formatted by a user supplied element formatter.
+ *
+ * @param elements
+ * the elements to be processed
+ * @param elements
+ * the elements
+ * @param elementFormatter
+ * the formatter to apply on each element to be processed
+ * @return the formatted string
+ */
+ public static <E> String getFormattedString(Collection<E> elements, IElementFormatter<E> elementFormatter) {
+ StringBuilder builder = new StringBuilder();
+ for (E element : elements) {
+ String formattedElement = elementFormatter.format(element);
+ if (formattedElement != null && formattedElement.length() > 0) {
+ builder.append(formattedElement);
+ }
+ }
+ if (builder.length() > 0) {
+ return builder.toString();
+ } else {
+ return "";
+ }
+ }
+
+ public interface IElementFormatter<E> {
+ public String format(E element);
+ }
+
+ /**
+ * Returns a collection of formatted strings for the given collection of
+ * elements and given formatter
+ *
+ * @param <E>
+ * the type of elements that shall be processed
+ * @param elements
+ * the elements to be processed
+ * @param elementFormatter
+ * the formatter to apply on each element to be processed
+ * @return the formatted strings
+ */
+ public static <E> Collection<String> getFormattedStrings(Collection<E> elements,
+ IElementFormatter<E> elementFormatter) {
+ List<String> strings = new ArrayList<String>();
+ for (E element : elements) {
+ String formattedElement = elementFormatter.format(element);
+ if (formattedElement != null && formattedElement.length() > 0) {
+ strings.add(formattedElement);
+ }
+ }
+ return strings;
+ }
+
+ public static String null2EmptyString(String stringValue) {
+ if (stringValue == null) {
+ return "";
+ }
+ return stringValue;
+ }
+
+ public static String emptyString2Null(String stringValue) {
+ if (stringValue != null
+ && stringValue.length() == 0) {
+ return null;
+ }
+ return stringValue;
+ }
+
+ public static boolean isEmpty(String stringValue) {
+ return stringValue == null || stringValue.isEmpty();
+ }
+
+
+ public static String toString(InputStream inputStream) throws IOException {
+ StringBuilder builder = new StringBuilder();
+ for(int character = -1; (character = inputStream.read()) != -1; ) {
+ builder.append((char) character);
+ }
+ return builder.toString();
+ }
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/UrlBuilder.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/UrlBuilder.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.client/src/org/jboss/tools/deltacloud/core/client/utils/UrlBuilder.java 2011-03-02 00:08:54 UTC (rev 29430)
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.deltacloud.core.client.utils;
+
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLEncoder;
+import java.util.Collection;
+
+/**
+ * A builder for an url. Currently no state checking is done, the user is
+ * responsible to build something that makes sense.
+ *
+ * @author André Dietisheim
+ */
+public class UrlBuilder {
+ private static final String URL_ENCODING = "UTF-8";
+ private static final String HOST_PROTOCOL_DELIMITER = ":";
+ private static final String HTTP_PROTOCOL_PREFIX = "http://";
+ private static final char PARAMETER_URL_DELIMITER = '?';
+ private static final char PARAMETER_DELIMITER = '&';
+ private static final char PARAMETER_NAME_VALUE_DELIMITER = '=';
+ private static final char PATH_SEPARATOR = '/';
+
+ private StringBuilder urlStringBuilder = new StringBuilder();
+
+ private boolean parametersAdded = false;
+
+ public UrlBuilder() {
+ }
+
+ public UrlBuilder(String baseUrl) {
+ urlStringBuilder.append(baseUrl);
+ }
+
+ public UrlBuilder(URL baseUrl) {
+ urlStringBuilder.append(baseUrl.toString());
+ }
+
+ /**
+ * adds a host to .
+ *
+ * @param host
+ * the host
+ *
+ * @return the url builder
+ */
+ public UrlBuilder host(String host) {
+ urlStringBuilder.append(HTTP_PROTOCOL_PREFIX);
+ urlStringBuilder.append(host);
+ return this;
+ }
+
+ /**
+ * Adds a port.
+ *
+ * @param port
+ * the port
+ *
+ * @return the url builder
+ */
+ public UrlBuilder port(Object port) {
+ urlStringBuilder.append(HOST_PROTOCOL_DELIMITER);
+ urlStringBuilder.append(port);
+ return this;
+ }
+
+ /**
+ * adds a path to the url.
+ *
+ * @param path
+ * the path
+ *
+ * @return the url builder
+ */
+ public UrlBuilder path(String path) {
+ urlStringBuilder.append(PATH_SEPARATOR);
+ urlStringBuilder.append(path);
+ return this;
+ }
+
+ public UrlBuilder path(Collection<String> paths) {
+ for (String path : paths) {
+ path(path);
+ }
+ return this;
+ }
+
+ public UrlBuilder parameter(String name, String value) {
+ if (value != null) {
+ appendParameterDelimiter();
+ urlStringBuilder.append(name).append(PARAMETER_NAME_VALUE_DELIMITER).append(urlEncode(value));
+ }
+ return this;
+ }
+
+ private void appendParameterDelimiter() {
+ if (!parametersAdded) {
+ urlStringBuilder.append(PARAMETER_URL_DELIMITER);
+ parametersAdded = true;
+ } else {
+ urlStringBuilder.append(PARAMETER_DELIMITER);
+ }
+ }
+
+ public UrlBuilder parameters(String... parameters) {
+ for (String parameter : parameters) {
+ parameter(parameter);
+ }
+ return this;
+ }
+
+ public UrlBuilder parameter(String parameter) {
+ appendParameterDelimiter();
+ urlStringBuilder.append(urlEncode(parameter));
+ return this;
+ }
+
+ private String urlEncode(String value) {
+ try {
+ return URLEncoder.encode(value, URL_ENCODING);
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public URL toUrl() throws MalformedURLException {
+ return new URL(urlStringBuilder.toString());
+ }
+
+ public String toString() {
+ return urlStringBuilder.toString();
+ }
+}
13 years, 10 months