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.
Note
title
Publishing prerequisites
To be able to publish models to Cameo Collaborator for Teamwork Cloud:
Before publishing a model using the command-line interface, ensure that it is ready to be published by checking the following:
If your model is large, make sure the default JVM heap size of Cameo Collaborator Publisher is big enough. It is recommended to keep the heap size value larger than the value defined for your modeling tool. You can find it in the properties file located in the <modeling tool installation directory>\bin directory (e.g, magicdraw.properties).
Expand
title
Click to learn how to increase the default JVM heap size
In the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, open to edit:
The publish.bat fileon Windows.
The publish.sh fileon OS X or Linux.
Increase the -Xmx value, e.g., -Xmx4000M.
Save and close the file.
If you do not intend to specify the template_location property described in the Configuring publishing properties section, make sure the librarycontaining the template you want to apply for publishing is used in the model.
Expand
title
Click to learn how to use a library in a model
Open the model you intend to publish.
From the Options menu, select Project Usages, and click the Use Project button. The Use Project dialog opens.
In the Select project step displayed below, select the library you want to use.
Tip
title
Tip
Predefined Cameo Collaborator templates, such as Entire Model, are stored in the <modeling tool installation directory>\modelLibraries directory.
Click the Next button, and, if required, specify usage options.
In the Load Mode area of the wizard, ensure that you select the Always load check box if it is not already selected.
Click the Finish button to close the dialog.
Save the model and close the modeling tool.
Now that your model is prepared for publishing, configure the publishing properties as described in the next section.
Anchor
configure
configure
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 Alfresco value, since Cameo Collaborator allows publishing to the Alfresco server only.
project - If your project is local, specify the full file path. If you store your project in Teamwork Cloud or Teamwork Server, specify the project name.
scope - Specify the full qualified name of the model element that owns the model data you want to publish. For example, specify the name of the root package of a model if you want to publish the entire model. For multiple scope elements, separate entries with a semicolon (;).
scope_by_server_element_id - Specify the Element Server ID of the model element that owns the model data you want to publish. You can find this poroperty in the Specification window of the element.
template_document_name - The value of this property is the name of the Document element displayed in the Collaborator View Diagram of the template you intend to use for publishing.
Warning
title
Updating projects
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 - Specify the full file path to the template you intend to apply for publishing. Predefined Cameo Collaborator templates are stored in the <modeling tool installation directory>\modelLibraries directory. If you use the template you want to apply for publishing in your model, you can leave this property unspecified.
document_name - If you are going to publish your project to a folder in the selected location root, specify the full path to the document.
overwrite_existing_document - Set to true if you want to update the existing document with the same name.
Warning
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. Afterwards the navigation cannot be restored.
comments_enabled - Set to true to enable commenting in a published document.
server_username - Specify the user name of the server where you store the project you want to publish.
server_password - Specify the password of the server where you store the project you want to publish.
server_url - Specify the address of the server where you store the project to be published. 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 server where you store the project to be published 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:
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.
Anchor
publish
publish
Publishing a model to Cameo Collaborator for TWC
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:
On Windows:
publish.bat -properties template.properties
On OS X or Linux:
./publish.sh -properties template.properties
Warning
title
Important
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.
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.
Anchor
schedule
schedule
Scheduling a model to be published
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 synax create a cronjob to run the model publishing task once a day at midnight:
After completing the procedure for your operating system, as 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 less connections when publishing, so the publishing performance will improve.
Changing the highlighted environment options improves publishing performance.