Create remote repository
Objective
Create a tool that facilitates the creation of a remote repository containing specific components and/or flows. This tool allows the component descriptors and all the necessary resources (jar file dependencies) and the flow descriptor to be written to disk or to a website. The tool writes out three different formats of RDF and all the resources.
Background
During the development of a component, and even after its completion, the programmer may need to create real flows using the component, to make sure that everything would work ok in a "production" environment. So far the programmer had to manually upload the component and manually re-create the flow each time a change was made to the component, making the process very lengthy and cumbersome. This tool facilitates the creation of the flows that can then be used rather than having to recreate the flow.
An additional motivation for this tool is for purposes of demos and troubleshooting. Suppose that a developer has a problem with a particular flow, or needs to do a "show-and-tell" session about a flow with someone else. Short of having to instruct the other person to sync the SVN repository, upload the component, re-create the flow, there was no other solution.
This tool allows the developer to create a remote repository (for testing purposes or for demos) containing just the pieces of interest (one or more flows, or an entire repository).
Approach
The user must specify the server where Meandre is running, the username/password for accessing the Meandre server, and the destination URL where the repository should be created. Optionally, the user may specify one or more flows to be uploaded into the remote repository. If no flows are specified, it is assumed that the entire repository should be uploaded remotely.
The tool extracts the RDF model for the specified flows (or the entire repository), finds all the components, and replaces the context URIs for each component with URIs pointing to the new remote location. Afterwards, the tool uploads the context for each component to the remote location, along with the RDF model of the newly created remote repository.
Usage
This tool resides in the Meandre-Component-Devkit
project available from SVN. The latest version of this tool can be built by invoking "ant dist". Once the build process is completed, the tool is available in the "dist/" folder as a JAR file.
Usage:
java -Xmx512m -jar CreateRepository-x.y.z.jar [--help] (-s|--server) <server> [--port <port>] (-u|--user)
<user> (-p|--password) <password> [(-f|--flow) <flow>] [--flowFile <flow file>]
[(-c|--component) <component>] [--compFile <component file>] (-d|--destination)
<destination> [--davuser <webdav username>] [--davpassword <webdav password>]
[--skip-upload] [-v|--verbose]
Creates/updates a remote WebDAV repository for the specified flow(s) and/or
component(s) and returns the location to it
[--help]
Prints this help message.
(-s|--server) <server>
Meandre server name
[--port <port>]
Meandre server port (default: 1714)
(-u|--user) <user>
Meandre user name
(-p|--password) <password>
Meandre user password
[(-f|--flow) <flow>]
The flow name; repeat as necessary
[--flowFile <flow file>]
The file to read the flow names from
[(-c|--component) <component>]
The component name; repeat as necessary
[--compFile <component file>]
The file to read the component names from
(-d|--destination) <destination>
The destination where to create the repository
[--davuser <webdav username>]
The destination WebDAV user name
[--davpassword <webdav password>]
The destination WebDAV password
[--skip-upload]
Skip uploading of JAR dependencies
[-v|--verbose]
Enable verbose output
Examples
To create a repository based on the fictional flow 'http://test.org/flow/webdav-test' and store it at 'http://norma.ncsa.uiuc.edu/public-dav/Meandre/demos/Webdav':
java -Xmx512m -jar CreateRepository-x.x.x.jar -s localhost -u admin -p admin -f http://test.org/flow/webdav-test
-d http://norma.ncsa.uiuc.edu/public-dav/Meandre/demos/Webdav![]()
To create a repository based on the same flow as above, but this time be uploaded to a password-protected WebDAV with credentials "username: some_user password: some_password" at 'http://norma.ncsa.uiuc.edu/private-dav/Meandre/demos/Webdav'
java -Xmx512m -jar CreateRepository-x.x.x.jar -s localhost -u admin -p admin -f http://test.org/flow/webdav-test
-d http://norma.ncsa.uiuc.edu/public-dav/Meandre/demos/Webdav
--davuser some_user --davpassword some_password
To create a repository that contains only components, and the URIs of these components is to be read from the file 'components.txt'. This time, let's assume the server is running on port 9000:
java -Xmx512m -jar CreateRepository-x.x.x.jar -s localhost --port 9000 -u admin -p admin --compFile components.txt -d http://norma.ncsa.uiuc.edu/public-dav/Meandre/demos/Webdav![]()
| The file format expected by --compFile and --flowFile is one component (or flow) URI per line. Blank lines are ignored. |
| Parameters -c and --compFile cannot be combined. Similarly, parameters -f and --flowFile cannot be combined. |
| The parameter -f can be specified multiple times if more than one flow should be included, or omitted completely if the entire repository should be included. Similarly, parameter -c can be specified multiple times if more than one component needs to be uploaded. |
| Any parameters not specified in the command line will be read from the file ~/.SEASR/CreateRepository.conf (if it exists). This file follows the traditional Java properties format (with property=value assignments), and is a good place to store values such as the server, username, and password, so they don't have to be re-entered every time. If a particular flow is modified/tested many times, you can also specify the flow(s) URI(s) in the file, and the destination too, if needed. |
Example CreateRepository.conf:
server=localhost port=1714 user=admin password=admin
Comments (2)
Sep 09, 2009
Anonymous says:
It is not clear, but it seems that this tools does not allow a user to sourc an ...It is not clear, but it seems that this tools does not allow a user to sourc an entire location content, seems like that should be spported.
Sep 10, 2009
Boris Capitanu says:
This is supported. Omitting the -f and -c (or their longer equivalents --flow an...This is supported. Omitting the -f and -c (or their longer equivalents --flow and --component) would give you the behavior you expect.
For example:
java -Xmx512m -jar CreateRepository-x.x.x.jar -s localhost -u admin -p admin -d http://some.webdav.url/locations/test
creates a location containing all the components and flows from the specified server. If you now want to import this location into another server, all you have to do is to add the location "http://some.webdav.url/locations/test/repository.rdf" to this other server.
Add Comment