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:
-collectionName of collection (required)
-servicesList 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:
-collectionCollection the schema belongs to (required)
-xsdSchema file name (required)
-servicesService 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:
-collectionThe collection to sumbit XML to (required)
-fileA single XML file to sumbit
-serviceThe service ID of the Mako (required)
-directoryA 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.
materializerefers 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.levelstakes an integer and represents the number of levels below the root (target of the XPath) you wish to materialize.
Script name:submitXPath
Arguments:
-collectionThe collection to use (required)
-materializeWhether or not to materialize included XML true false
-levelsHow many leves of includes to materialize
-fileAn XPath file
-serviceThe service id of the Mako (required)
-queryAn 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:
-collectionThe collection name (required)
-fileAn XUpdate file
-serviceThe service ID of the Mako (required)
-queryAn 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:
-collectionName of the parent collection
-serviceService 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:
-collectionThe name of the collection (required)
-serviceThe ID of the Mako service (required) - Retrieve Service Information
-
Prints the service data of the data service specified.
Script name:getServiceData
Arguments:
-onlyXMLReturn the raw XML with no formatting (trueorfalse)
-serviceThe 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:
-collectionThe collection to remove (required)
-serviceService ID(s) of the Mako(s) (required) - Remove XML
-
Clears a collection of the specified items, whether they are docIds or XPaths. The
waitboolean ensures proper removal occurs because it waits for the database to do the actual data removal.
Script name:removeXML
Arguments:
-collectionThe collection to remove documents from (required)
-docsDocument Ids to remove
-serviceThe service ID of the Mako (required)
-xpathXpath by which documents will be removed
-waitWait for each document to be removed (trueorfalse) (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:
-templateThe template configuration file to build from. (required)
-outputDirectory to write new config files into
-hostsHostnames to make config files for (required)