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

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

  • The machine you publish from must run an OS with a graphical user interface.
  • The Cameo Collaborator Publisher plugin must be installed in your modeling tool.
  • You have to be logged into 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.properties file.

    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.

  • 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

Project 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 a historical version of a model

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.


Publishing from the command-line interface consists of these steps:

  1. Configuring publishing properties
  2. Publishing a Cameo Collaborator document 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


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


  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.

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

Publishing from a historical version of a model

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.

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


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