Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Content layer
id829288506


Content column
id829288509


Content block
id495629113

On this page

Table of Contents
maxLevel4


Content block
id829288508

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
titlePublishing prerequisites

To be able to publish models to Cameo Collaborator for Teamwork Cloud:

  • The Cameo Collaborator Publisher plugin must be installed in your modeling tool.
  • You must log in to Teamwork Cloud.
  • You need to have user permissions to publish models.
  • The model you are trying to publish must be stored in Teamwork Cloud. If you want to publish a local model, first add it to Teamwork Cloud.
  • If you intend to publish a large model, increase the default JVM heap size of the Cameo Collaborator Publisher plugin as follows:
    1. Go to the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory and open:
      • The publish.bat fileon Windows.

      • The publish.sh fileon OS X or Linux.
    2. 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.

    3. Save and close the file.


Info
titleProject permissions

When you publish a new document, it inherits Teamwork Cloud project permissions. When you update a document, project permissions are not affected.


Publishing from the command-line interface consists of 2 main steps:

  1. Configuring publishing properties
  2. Publishing or scheduling publishing as a background task


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


  1. In the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, open the template.properties file.
  2. 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.

      Note
      titleSpecifying 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.

      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 -  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.

      Warning
      titleProjects 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.
  3. 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


  1. Open the command-line interface.
  2. 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.

  3. 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
    titleImportant

    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, yo
ur 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


  1. Open the Task Scheduler from the Start menu of your Windows computer and select the option to create a basic task.
  2. Type the task name, an optional description and click Next.
  3. Select how often you want the task to reoccur and click Next.
  4. Specify when you want the task to start and click Next.
  5. To schedule the publishing to start automatically, select the Start a program radio button and click Next.

  6. Click the Browse button, go to the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, and open the publish.bat file.

  7. In the Add Arguments (optional) box, type -properties template.properties and click Next.



  8. Click Finish.


To schedule a publishing task on Linux


  1. Connect to the remote server using SSH, or open the terminal directly.
  2. Type the following command to open the crontab file with the default text editor:

    # crontab -e

  3. 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

  4. 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


  1. In the main menu of your modeling tool, select Options > Environment.
  2. On the left side of the Environment Options dialog, select the Collaboration option group.
  3. On the right side of the dialog, set the Notify About New Project Versions on the Server option to false.
  4. On the right side of the dialog, set the Notify About Newer Project Usages option to Never.
  5. 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.


Content block
id829293007

Related pages



...