Site Navigation


Mako Command Line Utilities Reference

The command line utilities are located in the /scripts directory. Each uses the Mako API to implement common Mako functionality. All of the command line tools that run during service uptime take a -factory argument that allows you to specify the factory class that will be used to get handles to Mobius network services. Omitting this flag will cause the tools to use the default factory for handles. Each of these will also take a -factoryXML argument that specifies the path to a Grid Service Factory configuration file, an example of which is given here.

Passing the -help argument will list the utility's required and optional arguments. Scripts ending .bat are for Windows, .sh for *nix.

Start a Mako
Starts a Mako server, parsing the config file passed in. Starting a Mako is a generic action, the specifics of which are determined by your config file.
Script name: startMako
Arguments:
Path to config file (required)
Create a Collection
This script adds a collection to the data service.
Script name: createCollection
Arguments:
-collection Name of collection (required)
-services List of data services to create the collection on (required)
Submit a Schema
This script submits an XML Schema to a Mako.
Script name: submitSchema
Arguments:
-collection Collection the schema belongs to (required)
-xsd Schema file name (required)
-services Service IDs of the Makos to send the schema to (required)
Submit Multiple Schemata
This script allows for batch submission of XML Schemata to a Mako.
Script name: submitSchemata
Arguments:
-collection Collection to submit schemata to (required)
-file Schema file name to be added
-service Service ID of the Mako to send the schemata to (required) -directory Path to a directory containing .xsd schema descriptions to be added
Submit XML
This script allows the submission of an XML document or a directory of XML documents to a collection existing on a Mako.
Script name: submitXML
Arguments:
-collection The collection to sumbit XML to (required)
-file A single XML file to sumbit
-service The service ID of the Mako (required)
-directory A directory full of XML files to sumbit
Submit an XPath Query
This script allows the execution of a XPath query on an XML collection within a Mako. The script allows you to specify how many levels of XML data to return. For example specifying 2 levels will return the root node and the root nodes children with a pointer to the root node's children's children. Specifying a level of 0 will return pointers or references to all the documents satisfying the query. The pointers can later be used to materialize the results. materialize refers to the documents in a Mako which are lazy loaded. They can be either materialized (displayed in full content) or lower levels can be represented by "DocumentReferences". A DocumentReference is a pointer to the actual document. It requires less overhead to return than the actual document. levels takes an integer and represents the number of levels below the root (target of the XPath) you wish to materialize.
Script name: submitXPath
Arguments:
-collection The collection to use (required)
-materialize Whether or not to materialize included XML (true or false)
-levels How many levels of includes to materialize
-file An XPath file
-service The service id of the Mako (required)
-query An XPath query
-namespaces A list of prefix=namespace definitions which define the prefixes you can use in XPath elements
-defaultNamespace The namespace to use when no prefix is used for an XPath element
Modify Existing XML
Using the XUpdate language, the XML in the database can be modified. The most flexible way to use this command is pass in the query via the file flag and put the query into a seperate file. Note: The rename command and the comment node type are not supported.
Script name: submitXUpdate
Arguments:
-collection The collection name (required)
-file An XUpdate file
-service The service ID of the Mako (required)
-query An XUpdate statement
Remove a Schema
Schema removal is not supported, as schemas are built into the database. To remove a schema, you must remove the collection and recreate it fresh with the new schema.
List Collections
Prints out a list of the collections on the specified data service.
Script name: getCollectionList
Arguments:
-collection Name of the parent collection
-service Service ID of the Mako to get the collection list from (required)
Retrieve Schema
Prints a list of schemas supported in the specified collection.
Script name: getSchemaList
Arguments:
-collection The name of the collection (required)
-service The ID of the Mako service (required)
Retrieve XML Documents
This script retrieves XML documents or references to XML documents from a collection on a specified Mako. The script allows you to specify how many levels of XML documents to return. For example specifying 2 levels will return the root document and the root document's children with a pointer to the root document's children's children. Specifying a level of 0 will return pointers or references to all the documents requested. The pointers can later be used to materialize (display full contents of) these documents. Documents can be either materialized or be represented by "DocumentReferences". A DocumentReference is a pointer to the actual document. It requires less overhead to return than the actual document. levels takes an integer and represents the number of levels below the root document you wish to materialize.
Script name: retrieveXML
Arguments:
-collection The name of the collection (required)
-materialize Materialize the returned XML documents (true or false)
-levels How many levels of documents to materialize
-service The ID of the Mako service (required)
-xmlids The IDs of the XML document(s) to retrieve (required)
Submit and Retrieve XML
In a single command, this script submits a number of XML documents and then retrieves all of them.
Script name: submitAndRetrieve
Arguments:
-collection The collection to submit documents to (required)
-outfile A path to an output file or directory (required)
-service The service ID of the Mako (required)
-times The number of times to retreive the submitted documents (required)
-directory The directory containing the XML documents to submit (required)
Retrieve Service Information
Prints the service data of the data service specified.
Script name: getServiceData
Arguments:
-onlyXML Return the raw XML with no formatting (true or false)
-service The service ID of the Mako (required)
Remove a Collection
Removes a collection and all of its data from the data service.
Script name: removeCollection
Arguments:
-collection The collection to remove (required)
-service Service ID(s) of the Mako(s) (required)
Remove XML
Clears a collection of the specified items, whether they are docIds or XPaths. The wait boolean ensures proper removal occurs because it waits for the database to do the actual data removal.
Script name: removeXML
Arguments:
-collection The collection to remove documents from (required)
-docs Document Ids to remove
-service The service ID of the Mako (required)
-xpath Xpath by which documents will be removed
-wait Wait for each document to be removed (true or false) (required) -namespaces A list of prefix=namespace definitions which define the prefixes you can use in XPath elements
-defaultNamespace The namespace to use when no prefix is used for an XPath element
Make a Configuration File
A replacement script that changes the localhost config files into the config file of the same type with the appropriate dataservices changed.
Script name: makoConfigurationMaker
Arguments:
-template The template configuration file to build from. (required)
-output Directory to write new config files into
-hosts Hostnames to make config files for (required)
Destroy a Mako
Destroys a specified Mako or list of Makos, killing the processes and removing database schemata.
Script name: destroyMako
Arguments:
-services The service IDs of Makos to destroy (required)