JBoss.orgCommunity Documentation

Chapter 8. Overlord S-RAMP Command Line

8.1. Connecting to S-RAMP server
8.2. Browsing the S-RAMP repository
8.3. Updating artifact MetaData
8.3.1. Properties
8.3.2. Custom Properties
8.3.3. Classifications
8.4. Querying the S-RAMP Repository using XPath2 Syntax

Using the S-RAMP cmdline tool s-ramp.sh

In the bin directory of the distribution you can find the s-ramp.sh. Run this command to fire up the shell

./s-ramp.sh
**********************************************************************
           _____       ______  ___ ___  ________
          /  ___|      | ___ \/ _ \|  \/  | ___ \
          \ `--. ______| |_/ / /_\ \ .  . | |_/ /
           `--. \______|    /|  _  | |\/| |  __/
          /\__/ /      | |\ \| | | | |  | | |
          \____/       \_| \_\_| |_|_|  |_|_|

  JBoss S-RAMP Kurt Stam and Eric Wittmann, Licensed under the
  Apache License, V2.0, Copyright 2012
**********************************************************************
s-ramp>

The shell supports auto-completion and keeps a command history for duration of the session.

To connect the shell to the server type connect and hit the tab key. It should auto-complete to say s-ramp:connect http://localhost:8080/s-ramp-server and when hitting the return key the cursor should go from red to green. Of course you will need to update the server and port information if your S-RAMP repository runs elsewhere.

To browse the artifacts in the repository run the following query:

s-ramp> s-ramp:query /s-ramp
Querying the S-RAMP repository:
    /s-ramp
Atom Feed (9 entries)
  Idx                    Type Name
  ---                    ---- ----
    1           ImageDocument user-properties.png
    2                Document overlord.demo.CheckDeployment-taskform.flt
    3         BrmsPkgDocument SRAMPPackage.pkg
    4           ImageDocument overlord.demo.SimpleReleaseProcess-image.png
    5           ImageDocument run-build-install.png
    6                Document overlord.demo.SimpleReleaseProcess-taskform.flt
    7           ImageDocument audio-input-microphone-3.png
    8            BpmnDocument overlord.demo.SimpleReleaseProcess.bpmn
    9            TextDocument HttpClientWorkDefinitions.wid

To obtain the metaData of overlord.demo.SimpleReleaseProcess.bpmn, which is number 8 in the list, issue

s-ramp> s-ramp:getMetaData feed:8
Meta Data for: 31b3acbc-cda8-4856-9e34-d3e645283035
--------------
  -- Core S-RAMP Info --
  Type: BpmnDocument
  Model: ext
  UUID: 31b3acbc-cda8-4856-9e34-d3e645283035
  Name: overlord.demo.SimpleReleaseProcess.bpmn
  Derived: false
  Created By: <anonymous>
  Created On: 2013-03-08T14:00:37.036-05:00
  Modified By: <anonymous>
  Modified On: 2013-03-18T14:58:46.328-04:00
s-ramp>

TBD - reference to generic section on XPath2 query syntax

S-RAMP supports an XPath2 Syntax for querying. For example to obtain all WSDL models in the repository use

s-ramp> s-ramp:query /s-ramp/wsdl/WsdlDocument
Querying the S-RAMP repository:
    /s-ramp/wsdl/WsdlDocument
Atom Feed (1 entries)
  Idx                    Type Name
  ---                    ---- ----
    1            WsdlDocument OrderService.wsdl
s-ramp>

When this WSDL file was uploaded derived information was extracted from it and stored a WSDL model. TO see the various data structures it derived simply hit the tab on s-ramp:query /s-ramp/wsdl

s-ramp> s-ramp:query /s-ramp/wsdl/
Binding                  BindingOperation         BindingOperationFault    BindingOperationInput    BindingOperationOutput
Fault                    Message                  Operation                OperationInput           OperationOutput
Part                     Port                     PortType                 WsdlDocument             WsdlExtension
WsdlService
s-ramp>

Note that derived data is read only, and cannot be updated by the user.

To obtain all Operations in this WSDL use

s-ramp:query /s-ramp/wsdl/Operation
Querying the S-RAMP repository:
    /s-ramp/wsdl/Operation
Atom Feed (1 entries)
  Idx                    Type Name
  ---                    ---- ----
    1               Operation submitOrder
s-ramp>

You can narrow this query down even more by adding that the name needs to start with submit

s-ramp:query "/s-ramp/wsdl/Operation[xp2:matches(@name, 'submit.*')]"
Querying the S-RAMP repository:
    /s-ramp/wsdl/Operation[xp2:matches(@name, 'submit.*')]
Atom Feed (1 entries)
  Idx                    Type Name
  ---                    ---- ----
    1               Operation submitOrder
s-ramp>

don’t forget to use the surrounding quotes, and a . after submit as required by XPath2.