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. 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 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 false
-levels How many leves of includes to materialize
-file An XPath file
-service The service id of the Mako (required)
-query An XPath query
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 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)
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)