Class 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
    • 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
    • useDefaultPropertyValidation - set false to disable validation of default properties
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String[] EMPTY_ARRAY  
      private com.nomagic.magicdraw.commandline.ProjectCommandLinePropertiesManager propertiesManager  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected byte execute()
      Override this method to execute your custom task(s) in running MagicDraw environment.
      protected abstract byte execute​(java.util.Properties properties, Project project)
      Override this method to execute your custom task(s) in running MagicDraw environment on opened project.
      protected void parseArgs​(java.lang.String[] args)
      Override to parse arguments before launching MagicDraw.
      protected void parseArguments​(java.lang.String[] args)
      Override to parse arguments before launching MagicDraw.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • propertiesManager

        private final com.nomagic.magicdraw.commandline.ProjectCommandLinePropertiesManager propertiesManager
      • EMPTY_ARRAY

        private static final java.lang.String[] EMPTY_ARRAY
    • Constructor Detail

      • ProjectCommandLine

        public ProjectCommandLine()
    • Method Detail

      • parseArgs

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

        protected void parseArguments​(java.lang.String[] args)
                               throws java.lang.Exception
        Override to parse arguments before launching MagicDraw.
        Parameters:
        args - program arguments
        Throws:
        java.lang.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​(java.util.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).