Versions Compared

Key

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

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

Before you begin, ensure that your computer is prepared for publishing projects, and that you are able to log on to Cameo Collaborator.
 

Warning
titleCompatability warning

Ensure that the versions of Cameo Collaborator and Cameo Collaborator Publisher plugin are compatible. You cannot publish a project:

  • To Cameo Collaborator 18.0 SP3 or an earlier version of the product using Cameo Collaborator Publisher 18.0 SP4.
  • To Cameo Collaborator 18.0 SP4 using Cameo Collaborator Publisher 18.0 SP3 or an earlier version of the plugin.


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

  1. Preparing for model publishing
  2. Configuring publishing properties
  3. Publishing or scheduling publishing as a background task
     

Anchor
prepare
prepare
Preparing for model publishing

In order to publish your model using the command-line interface, ensure that the default JVM heap size of the publisher is big enough, and, optionally, use the template that you intend to apply for publishing in your model.

 

To prepare for model publishing from the command-line interface 


  1. If your model is large, increase the default JVM heap size of the publisher. We recommend keeping 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
    titleClick to learn how to increase the default JVM heap size
    1. In the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, open to edit:
      • On Windows:
        • For modeling tool versions 18.0 and 18.1 - the publish.bat file.

        • For modeling tool version 18.2 - the publish_182.bat file

        • For modeling tool version 18.3 or later - the publish_183_or_later.bat file.

      • On OS X or Linux:
        • For modeling tool versions 18.0 and 18.1 - the publish.sh file.
        • For modeling tool version 18.2 - the publish_182.sh file.
        • For modeling tool version 18.3 or later - the publish_183_or_later.sh file.
    2. Increase the -Xmx value, e.g., -Xmx4000M.

    3. Save and close the file.

     

  2. In the model that you intend to publish, use the library that contains the template you want to apply for publishing. This step is not necessary if you specify the template_location property described in the Configuring publishing properties section.

    Expand
    titleClick to learn how to use a library in a model
    1. Open the model that you intend to publish.
    2. From the Options menu, select Project Usages, and click the Use Project button. The Use Project dialog opens.
    3. In the Select project step displayed below, select the library you want to use.

      Tip
      titleTip

      Predefined Cameo Collaborator templates, such as Entire Model, are stored in the <modeling tool installation directory>\modelLibraries directory.


    4. Click the Next button, and, if required, specify usage options.
    5. In the Load Mode area of the wizard, ensure that you select the Always load check box if it is not already selected.
    6. Click the Finish button to close the dialog.
    7. Save the model and close the modeling tool.


    Warning
    titleImportant

    Do not skip this step if:

    • You want to publish a model stored in the Teamwork Cloud. Otherwise updating a published project will corrupt the navigation between comments and commented items.
    • You do not specify the template_location property described in the Configuring publishing properties section.


Now that your model is prepared for publishing, you need to configure the publishing properties.


Anchor
configure
configure
Configuring publishing properties

Before publishing a project from the command-line interface, you need to specify publishing properties by modifying a properties file. You can modify the file for every model that you publish, or reuse it for several models if the values of publishing properties do not need to be changed. The procedure below explains how to open the file and define the properties it contains.

 

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 valid values of the properties listed below, and fill in the desired values (or leave the default values if they meet your needs):

      • alfresco_username.
      • alfresco_password.
      • alfresco_repository_url.
      • location_root.
      • site_url_name - Specify the desired site URL If you are going to publish your project to Repository/Site.
      • full_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 - Valid values are true or false.
      • comments_enabled - Valid values are true or false.
      • diagram_image_type.
         

        Note
        titleImage format information

        If you choose the .svg format, diagrams may not be displayed when browsing a project in Internet Explorer 9, 10, and 11. This issue occurs randomly, and can be solved by refreshing the web page.


      • project_location - If your project is local, the project location is the full file path. If you store your project on the Teamwork Cloud server, the project location is the project name.

      • scope - Provide a full qualified name of the model element that owns the model data you want to publish; e.g., 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 semicolon (;).

      • template_document_name - The value of this property is the name of the Document element displayed in the Collaborator View Diagram of the template that you intend to use for publishing.
         

        Warning
        titleUpdating projects

        If you update a published project by republishing it, ensure that you specify the same template document name you used when publishing the project the first time. Not doing so will result in the loss of all comments.


      • template_location - The value of this property is 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 the template that you want to apply for publishing is used in your model, you can leave this property unspecified.

    The following properties are intended for models that are stored in a remote repository:

      • server_username.

      • server_password.

      • server_urlIf the connection between the server and the model editor is encrypted, type https in front of the server address.

      • server_type - Valid values are Teamwork or CEDW.

      • project_version*.
      • branch_name*.
         

  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, then the specified version of the specified branch of the model is published.
     

Anchor
publish
publish
Publishing a model to Cameo Collaborator

To publish a model from the command-line interface, you need to execute a specific command, as described 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 one of the following commands depending on your operating system and modeling tool version:

    • On Windows: 

      • If you use 18.1 or an earlier version of a modeling tool:

        publish.bat -properties template.properties

      • If you use 18.2 version of a modeling tool:

        publish_182.bat -properties template.properties

      • If you use 18.3 or a later version of a modeling tool:

        publish_183_or_later.bat -properties template.properties

    • On OS X or Linux:
      • If you use 18.1 or an earlier version of a modeling tool:

        ./publish.sh -properties template.properties

      • If you use 18.2 version of a modeling tool:

        ./publish_182.sh -properties template.properties

      • If you use 18.3 or a later version of a modeling tool:

        ./publish_183_or_later.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 described above, yo
ur model is published to Cameo Collaborator. If you want to publish the same model frequently, you don't need to do it manually every time. Instead, schedule publishing as a background task to save time. 

Note
titleCopying published projects

In Alfresco, do not try to copy a published project or the folder that contains one or more published projects. A copy of a published project is considered a shortcut to the copied project. Therefore, if you need to have a standalone copy of a published project, publish the same project twice using a different name.


Anchor
schedule
schedule
Scheduling the task for 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 will guide you through the scheduling process on Windows and Linux operating systems.
 

Expand
titleClick to learn how to automatically 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 then click Next.
  3. Specify when you want the task to start, and click Next.
  4. To schedule the publishing to start automatically, select the Start a program check-box and click Next.

  5. Click the Browse button, and, in the <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher directory, find the executable .bat file (the file name depends on the version of your modeling tool).

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



  7. Click Finish.


Expand
titleClick to learn how to automatically 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 synax 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 one of the procedures (depending on your operating system) described above, your model is published automatically on a regular basis, at a specified time.