On this page
Cameo Collaborator for TWC allows you to publish your models using the command-line interface. This option is useful if you want to publish them periodically, e.g., once a day or during non-business hours to save time.
Publishing prerequisites
- The Cameo Collaborator Publisher plugin must be installed in your modeling tool.
- Cameo Collaborator for Magic Collaboration Studio works only with server projects. If you want to publish a local model, add it to Teamwork Cloud.
- You must have the user permissions necessary for document publishing.
Recommendations
- If you intend to publish a large model, increase the default JVM heap size of the Cameo Collaborator Publisher plugin as follows:
Go to the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory and open the publish.properties file.
Increase the -Xmx value, e.g., -Xmx4000M. It is recommended to set a larger heap size value than the one defined for your modeling tool.
Save and close the file.
- Depending on the size of the model you intend to publish, allocate a sufficient amount of memory to your modeling tool:
2 million element model - 24 GB of RAM
1 million element model - 15 GB of RAM
500k element model - 7 GB of RAM
Publishing from the command-line interface consists of these steps:
- Configuring publishing properties
- Publishing a Cameo Collaborator document or scheduling publishing as a background task
Publishing tips
- You can publish a Cameo Collaborator document from a historic version of a model as well. However, note that the commenting, editing, and comment import functionalities in such a document will be disabled.
- To change the number of decimals displayed in Cameo Collaborator documents, in the main menu, go to Options > Project Options and specify the Decimal Places option. The setting is remembered and used for the documents published from the project.
- You can specify the diagram export options, such as dimensions and building time (the latter applies only to tables and matrices). To learn more, refer to Diagram image export.
Project permissions
When you publish a new document with the Administer Resources permission, it inherits Magic Collaboration Studio project permissions. When you update a document, project permissions are not affected.
Configuring publishing properties
Before publishing a project from the command line interface, specify publishing properties by modifying a properties file. You can modify the file for every model you publish or reuse it for several models if you do not need to change the values of publishing properties.
To configure the properties for publishing to Cameo Collaborator
- In the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, open the template.properties file.
Read the comments and specify the values of the following properties (or leave the default values if they do not need to be changed):
# # TeamworkCloud server properties: # server=<localhost> username=<userName> password=<passWord> #enableSSL=false #encryptPassword=false # # Project properties: # # Project name. # project=<project> # # Project branch name. # This property is optional. # If this property is not specified project # is loaded from trunk. # #branch=branch1 # # Project version. # This property is optional. # If this property is not specified or does not exist in current branch, latest version is opened. # #version=version_number # # Protected project password. # #projectPassword=password # # Document properties: # # Document name. # documentName=MyDocument # # Category name or path to the category with "/" as the category separator. # categoryName=myCategory # # In order to set scope, provide full qualified name. # For multiple scope elements, separate entries with semicolon (;). # scope=Model # # In order to set scope, provide element server id. # For multiple scope elements, separate entries with semicolon (;). # #scopeById=<element.server.id> # # Document element name in the template which will be used for publishing. # templateName=Entire Model # # Document template module is a server project which will be imported to # active project and will be committed. # # For example: # myModule # myModule##myBranch # myModule##myBranch##version # #templateModule=<my.module> # # Comments location: # comments_in_document - all comments created in document will be stored in document. # comments_in_project_without_import - all comments created will be stored in project. Existing document comments will not be migrated. # comments_in_project_with_import - all comments created will be stored in project. Existing document comments will be migrated. # # NOTE: You need to specify Cameo Collaborator for Magic Collaboration Studio URL in order to migrate comments to project. # # By default comments are saved in document. # #commentsLocation=comments_in_document # # Set to true in order to enable editing. # #enableEditing=true # # Set to true in order to enable commenting. # enableCommenting=true # # Set to true in order to update the document. # updateDocument=true # # Set to true in order to mark document as OSLC resource. # #markResourceAsOSLC=true
- Save and close the file.
Publishing a Cameo Collaborator document
To publish a Cameo Collaborator document from the command line interface, you need to execute a specific command outlined below.
To publish a Cameo Collaborator document from the command line interface
- Open the command line interface.
Go to the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory containing the executive file for model publishing.
Execute the following command:
On Windows
publish.exe properties=<modeling_tool_installation_directory>\plugins\com.nomagic.collaborator.publisher\template.properties
On OS X or Linux
./publish properties=<modeling_tool_installation_directory>/plugins/com.nomagic.collaborator.publisher/template.properties
After completing the steps above, your model is published to Cameo Collaborator. If you want to publish the same model frequently, you do not need to do it manually every time. Instead, schedule publishing as a background task to save time.
Logging
When publishing, all information is logged to the log file of your modeling tool. If you want the information to be logged to the command line interface, open the <modeling_tool_intallation_directory>\plugins\com.nomagic.collaborator.publisher\publish.properties file and add -verbose to the APP_ARGS line.
Scheduling to publish a document
If you need to publish your models periodically and/or during non-business hours, you can schedule them to be published automatically. The following procedures describe the scheduling process on Windows and Linux operating systems.
To schedule a publishing task on Windows
- Open the Task Scheduler from the Start menu of your Windows computer and select the option to create a basic task.
- Type the task name, an optional description and click Next.
- Select how often you want the task to reoccur and click Next.
- Specify when you want the task to start and click Next.
To schedule the publishing to start automatically, select the Start a program radio button and click Next.
Click the Browse button, go to the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, and open the publish.exe file.
In the Add Arguments (optional) box, type -properties template.properties and click Next.
- Click Finish.
To schedule a publishing task on Linux
- Connect to the remote server using SSH, or open the terminal directly.
Type the following command to open the crontab file with the default text editor:
# crontab -e
Using the Cron syntax create a cronjob to run the model publishing task once a day at midnight:
0 0 * * * <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher/publish.sh -properties template.properties
Save the crontab file.
After completing the steps described above, your model is published automatically on a regular basis at a specified time.
Improving publishing performance
You can improve publishing performance by changing environment options in your modeling tool, as described below.
To improve publishing performance
- In the main menu of your modeling tool, select Options > Environment.
- On the left side of the Environment Options dialog, select the Collaboration option group.
- On the right side of the dialog, set the Notify About New Project Versions on the Server option to false.
- On the right side of the dialog, set the Notify About Newer Project Usages option to Never.
- Click OK.
Now Magic Collaboration Studio will use fewer connections when publishing, so the publishing performance will improve.