Class ProjectCommandLine

java.lang.Object
com.nomagic.magicdraw.commandline.CommandLine
com.nomagic.magicdraw.commandline.ProjectCommandLine

@OpenApiAll public abstract class ProjectCommandLine extends CommandLine
MagicDraw commandline launcher capable of opening project provided using default project arguments. Extend it and implement execute(Properties, Project). Specific argument parsing can be done by overriding parseArguments(String[])
Arguments are specified as name=value pairs.
Default arguments that will be used to try and open project:
  • project - Project name or path
  • projectDescriptor - Project descriptor
  • server - Server url
  • username - Username on server
  • password - Password for provided username
  • enableSSL - To use ssl
  • serverType - Should be any value of ServerType, if not specified ServerType.TEAMWORK_CLOUD will be used
  • encryptPassword - Set true if provided password is in plain text
  • properties - Path to properties file containing properties. Multiple properties files can be provided "properties=prop1.properties;prop2.properties"
  • projectPassword - Project password
  • version - Project version
  • branch - Project branch
  • revision - Platform branch revision
  • iteration - Platform revision iteration
  • useDefaultPropertyValidation - set false to disable validation of default properties
  • Constructor Details

    • ProjectCommandLine

      public ProjectCommandLine()
  • Method Details

    • parseArgs

      protected final void parseArgs(String[] args) throws Exception
      Description copied from class: CommandLine
      Override to parse arguments before launching MagicDraw.
      Overrides:
      parseArgs in class CommandLine
      Parameters:
      args - program arguments
      Throws:
      Exception - if arguments are not correct and MagicDraw should not be started
    • parseArguments

      protected void parseArguments(String[] args) throws Exception
      Override to parse arguments before launching MagicDraw.
      Parameters:
      args - program arguments
      Throws:
      Exception - if arguments are not correct and MagicDraw should not be started
    • execute

      protected final byte execute()
      Description copied from class: CommandLine
      Override this method to execute your custom task(s) in running MagicDraw environment. Do not explicitly call this method - call CommandLine.launch(String[]) to launch the commandline.
      Specified by:
      execute in class CommandLine
      Returns:
      application exit status
    • execute

      protected abstract byte execute(Properties properties, Project project)
      Override this method to execute your custom task(s) in running MagicDraw environment on opened project.
      Parameters:
      properties - parsed arguments for this project
      project - project opened based on provided arguments
      Returns:
      application exit status (default is 0).