Exporting Macros
Exporting macros exports their metadata from one MashZone NextGen Repository to a file. You can then import this file to another MashZone NextGen Repository.
Typically, you export and import macros along with the mashups that use them to move new mashups to production or to replicate data for a new instance of the MashZone NextGen Server. You can also use export and import for macros to make new custom blocks available in Wires for other instances of the MashZone NextGen Server.
1. If it is not running, start the MashZone NextGen Server for the MashZone NextGen Repository that is the source for the macros that you wish to export. See Start and Stop the
MashZone NextGen
Server for instructions. 2. Open a command window and move to the MashZoneNG-install/prestocli/bin folder.
3. Enter this command:
padmin exportEmmlMacro -f output-file
[-d domain -g -n macroName -l prestoURL]
-u username -w password
[-v]
-f output-file: is the path and name of the export file to hold the metadata.
-d domain: the macro domain containing the macro(s) to export. The
domain value can be:
all or
ALL = export all macros in all domains from this
MashZone NextGen Repository. This omits global macros.
domain-name is the name of one specific domain that contains the macro(s) you want to export.
Note: | This option is mutually exclusive with the -g option. If neither -d or -g as specified, all macros are exported. |
-g: to export global macro(s). If no macro name is included with the
-n option, this exports all global macros and omits macros in any custom domain.
Note: | This option is mutually exclusive with the -d option. If neither -d or -g as specified, all macros are exported. |
-n macroName: the name of the specific macro to export. You must also specify the domain for this macro with the
-d option or use the
-g option if this is a global macro.
-l prestoUrl: is optional. Use this if the
MashZone NextGen Server is remote or if it is not running in Tomcat on the default Tomcat port. If you omit this option, this defaults to
http://localhost:8080/mashzone/edge/api.
-u username: is the
MashZone NextGen username to log in with. This account
must have
MashZone NextGen administrator permissions.
-w password: is the
MashZone NextGen password to log in with.
-v: is an optional flag to turn on verbose logging.
General messages and errors from the export process are sent to the command window (stdout). Messages for specific artifact failures are included in the export file in <FailedExport> elements. Once the export command completes successfully, you can use the output file to import macros to another MashZone NextGen Repository.
Examples
The combinations of the -d, -g and -n options give you precise control of the macros you want to export. This example exports all macros, both global and custom domains, from the MashZone NextGen Server in the local host to a file named allMacros.xml:
padmin exportEmmlMacro -f allMacros.xml -u Administrator -w manage
This next example export the macros from the MashZone NextGen Server at presto12.myorg.com:8080 in the domain named Finance:
padmin exportEmmlMacro -f financeMacros.xml -d Finance -l presto12.myorg.com:8080 -u Administrator -w manage
This example exports all macros in custom domains from the MashZone NextGen Server in the local host:
padmin exportEmmlMacro -f domainMacros.xml -d ALL -u Administrator -w manage
While this example exports all global macros from the same MashZone NextGen Server:
padmin exportEmmlMacro -f globalMacros.xml -g -u Administrator -w manage
This final example exports the global macro named computeBasicAuth:
padmin exportEmmlMacro -f basicAuthMacro.xml -g -n computeBasicAuth -u Administrator -w manage