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.
To be able to publish models to Cameo Collaborator for Teamwork Cloud:
Publishing from the command-line interface consists of 2 main steps:
- Configuring publishing properties
- Publishing or scheduling publishing as a background task
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 in the file describing the properties listed below, and specify their values (or leave the default values if they do not need to be changed):
- publish_to - Specify the TWC value, since you intend to publish to Cameo Collaborator for Teamwork Cloud,
- project - Specify the name of the model stored in Teamwork Cloud.
- scope - Specify the full qualified name of the model element containing the model data you want to publish. You can find this the value of this property in the Specification window of the element. For multiple scope elements, separate entries with a semicolon (;).
scope_by_server_element_id - Specify the element server ID of the model element containing the model data you want to publish. You can find this the value of this property in the Specification window of the element.
|title||Specifying the scope|
- You need to specify only one scope related property: either scope or scope_by_server_element_id.
- Multiple scope values must be separated with semicolons (;).
template_document_name - Specify the name of the Document element displayed in the Collaborator View Diagram of the template you intend to use for publishing.
If you update a published model, specify the same template that you used before. Otherwise, the navigation between comments and commented items will be corrupted. To restore corrupted navigation, update the document again using the initial template.
- template_location - If you do not use the template you want to apply for publishing in your model, specify the full file path to the template. Otherwise, leave the property unspecified. Predefined Cameo Collaborator templates are stored in the <modeling tool installation directory>\modelLibraries directory.
- document_name - Specify the name of the Cameo Collaborator document.
overwrite_existing_document - Set to true if you want to update the existing document with the same name.
|title||Projects reverted to an earlier version|
When publishing, the selected template is automatically used in your model and then committed to Teamwork Cloud. If you update a model that has been reverted to an earlier version (without the template used in it), you will corrupt the navigation between existing comments and commented items. Afterward, navigation cannot be restored.
- comments_enabled - Set to true to enable commenting in a published document.
- server_username - Specify the user name of the Teamwork Cloud server where you store the model you want to publish.
server_password - Specify the password of the Teamwork Cloud server where you store the model you want to publish.
server_url - Specify the address of the Teamwork Cloud server where you store the model you want to publish. If the connection between the server and your modeling tool is encrypted, type https in front of the server address.
server_use_ssl - Set to true if the Teamwork Cloud server where you store model you want to publish is configured to use SSL certificates.
require_update_module - Set to true if you want to update used projects to the newest versions when publishing.
- project_version* - If you want to publish a specific version of the project, specify the version number.
branch_name* - If you want to publish a specific branch of the project, specify the branch name.
- project_password - If the project you want to publish is password-protected, specify the project password.
- Save and close the file.
*There are four possible outcomes, depending on which of the project_version and branch_name properties you specify:
Publishing a model to Cameo Collaborator for TWC
- If both properties have default values, the latest available version of the model is published (either the Trunk version or the Branch version).
- If you specify only the version number (the branch_name property has the default value), the specified Trunk version of the model is published.
- If you specify only the branch name (the project_version property has the default value), the latest version of the specified branch of the model is published.
- If both properties are specified, the specified version of the specified branch of the model is published.
To publish a model from the command-line interface, you need to execute a specific command, outlined below.
To publish a model to Cameo Collaborator 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. The executive file is the corresponding .sh or .bat file depending on your operating system and the version of your modeling tool.
In the command line, type the following command:
These commands are valid only if the name of the actual executive file matches the name included in the command, e.g., publish.bat. Before executing the command, check the executive file name, and, if needed, change it to match the name in the command.
Scheduling a model to be published
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.
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.bat 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 Teamwork Cloud will use fewer connections when publishing, so the publishing performance will improve.
Changing the highlighted environment options improves publishing performance.