Convert the command to the screen document type.
@param strCommand The command text.
@param The standard document type (MAINT/DISPLAY/SELECT/MENU/etc).
172371
public int commandToDocType(String strCommand)
    {
        if (ProjectTask.PROJECT_PREDECESSOR_DETAIL_SCREEN.equalsIgnoreCase(strCommand))
            return ProjectTask.PROJECT_PREDECESSOR_DETAIL_MODE;
        if (ProjectTask.PROJECT_TASK_CALENDAR_SCREEN.equalsIgnoreCase(strCommand))
            return ProjectTask.PROJECT_TASK_CALENDAR_MODE;
        return super.commandToDocType(strCommand);
    }
338791
function execCommand(editor, command, value, useCSS, button) {

    // Restore the current ie selection
    restoreRange(editor);

    // Set the styling method
    if (!ie) {
      if (useCSS === undefined || useCSS === null)
        useCSS = editor.options.useCSS;
      editor.doc.execCommand("styleWithCSS", 0, useCSS.toString());
    }

    // Execute the command and check for error
    var success = true, description;
    if (ie && command.toLowerCase() == "inserthtml")
      getRange(editor).pasteHTML(value);
    else {
      try { success = editor.doc.execCommand(command, 0, value || null); }
      catch (err) { description = err.description; success = false; }
      if (!success) {
        if ("cutcopypaste".indexOf(command) > -1)
          showMessage(editor, "For security reasons, your browser does not support the " +
            command + " command. Try using the keyboard shortcut or context menu instead.",
            button);
        else
          showMessage(editor,
            (description ? description : "Error executing the " + command + " command."),
            button);
      }
    }

    // Enable the buttons
    refreshButtons(editor);
    return success;

  }
1356175
public final Object handleRemoteCommand(String strCommand, Map<String, Object> properties)
        throws DBException, RemoteException
    {
        boolean bDontCallIfLocal = false;
        if (properties != null)
            if (Constants.TRUE.equals(properties.get("DontCallIfLocal")))
                bDontCallIfLocal = true;
        return this.handleRemoteCommand(strCommand, properties, true, bDontCallIfLocal, true);
    }
927778
def __printCommandSyntax(self, command):
        
        commandHelp = self.completion[command]
        if commandHelp != None and len(commandHelp) > 2:
            commandValues = commandHelp[2]
            #commandDefault = commandHelp[3]
            displayHelp = [self._color(self.COLOR_WHITE, command)]
            if commandValues != None:
                valuesIsEnum = len(commandHelp) >= 6
                if '+' in command or command.upper() in ['ATS0']:
                    displayHelp.append(self._color(self.COLOR_WHITE, '='))
                displayHelp.append(('|' if valuesIsEnum else ',').join([value[0] for value in commandValues]))
            sys.stdout.write('\r Syntax: {0}\n'.format(self._color(self.COLOR_WHITE, ''.join(displayHelp))))
            sys.stdout.flush()
            self._refreshInputPrompt(len(self.inputBuffer))
49288
public String getProperties(String strCommand, Map<String,Object> properties)
    {
        int iIndex = strCommand.indexOf('=');
        if (iIndex != -1)
        {
            if (this.getParentScreen().getTask() != null)
            	Util.parseArgs(properties, strCommand);
            if (properties.get(DBParams.COMMAND) != null)
                strCommand = (String)properties.get(DBParams.COMMAND);
        }
        return strCommand;
    }
9142
public String getScreenCommand()
    {
        String strCommand = super.getScreenCommand();
        FieldList record = this.getFieldList();
        if (record != null)
            if ((record.getEditMode() == Constants.EDIT_IN_PROGRESS)
                || (record.getEditMode() == Constants.EDIT_CURRENT))
                    strCommand = UrlUtil.addURLParam(strCommand , Constants.OBJECT_ID, record.getCounterField().toString());
        return strCommand;
    }
666008
public Object doRemoteCommand(String strCommand, Map<String, Object> properties)
    {
        if (SET_DEFAULT_COMMAND.equalsIgnoreCase(strCommand))
            if (properties != null)
                if (properties.get(DBConstants.SYSTEM_NAME) != null)
        {
            if (this.getTask() != null)
            if (this.getTask().getApplication() instanceof BaseApplication)
            if (((BaseApplication)this.getTask().getApplication()).getEnvironment() != null)
            {
                String systemName = properties.get(DBConstants.SYSTEM_NAME).toString();
                Environment env = ((BaseApplication)this.getTask().getApplication()).getEnvironment();
                properties.put(DBConstants.SYSTEM_NAME, "base");
                BaseApplication app = new MainApplication(env, properties, null);
                try {
                    Task task = new AutoTask(app, null, properties);
                    RecordOwner recordOwner = new BaseProcess(task, null, properties);
                    Menus menus = new Menus(recordOwner);
                    menus.setKeyArea(Menus.CODE_KEY);
                    menus.getField(Menus.CODE).setString(ResourceConstants.DEFAULT_RESOURCE);
                    if (menus.seek(null))
                        menus.edit();
                    else
                        menus.addNew();
                    menus.getField(Menus.CODE).setString(ResourceConstants.DEFAULT_RESOURCE);
                    ((PropertiesField)menus.getField(Menus.PARAMS)).setProperty(DBConstants.SYSTEM_NAME, systemName);
                    if (menus.getEditMode() == DBConstants.EDIT_ADD)
                        menus.add();
                    else
                        menus.set();
                } catch (DBException e) {
                    e.printStackTrace();
                } finally {
                    app.free();
                }
                env.getDefaultApplication().getSystemRecordOwner().setProperty(DBConstants.DEFAULT_SYSTEM_NAME, systemName);
                return Boolean.TRUE;    // Success
            }
        }
        return super.doRemoteCommand(strCommand, properties);
    }
1347263
public Object doRemoteCommand(String strCommand, Map<String,Object> properties) throws RemoteException, DBException
    {
        if (properties == null)
            properties = new Hashtable<String,Object>();
        this.setProperties(properties);
        
        StringWriter stringWriter = new StringWriter();
        PrintWriter out = new PrintWriter(stringWriter);
        
        if (CREATE_SCREEN.equals(strCommand))
        {
            BaseScreen screen = this.getScreen(properties);
            int iErrorCode = screen.checkSecurity();
            if ((iErrorCode != DBConstants.NORMAL_RETURN) && (iErrorCode != Constants.READ_ACCESS))
            {
                String strError = this.getTask().getLastError(iErrorCode);
                if ((strError == null)
                    || (strError.length() == 0)
                    || ((iErrorCode >= DBConstants.ACCESS_DENIED) && (iErrorCode <= DBConstants.CREATE_USER_REQUIRED)))
                        strError = Integer.toString(iErrorCode);
                RemoteException ex = new RemoteException(strError);
                throw ex;
            }
            this.printScreen(screen, out);
        }
        else if (strCommand != null)
        {
            if (strCommand.indexOf('=') != -1)
                Utility.parseArgs(properties, strCommand);
            else
                properties.put(DBParams.COMMAND, strCommand);
            
            BaseScreen screen = this.getScreen(properties);
            if (screen != null)
            {
                screen = (BaseScreen)screen.doServletCommand(m_topScreen);  // Move the input params to the record fields
                if (screen != null)
                {
                    screen.processInputData(out);
                    if (stringWriter.getBuffer().length() == 0)
                        if (HtmlConstants.DISPLAY.equalsIgnoreCase((String)properties.get(HtmlConstants.FORMS)))
                            this.printScreen(screen, out);    // This is a report
                }
                else
                {   // Special case - command success, client needs to reset (to main menu)
                    String strMessage = this.getTask().getStatusText(DBConstants.INFORMATION_MESSAGE);
                    out.println(Utility.startTag(XMLTags.STATUS_TEXT));
                    if (strMessage != null)
                        out.println(Utility.startTag(XMLTags.TEXT) + strMessage + Utility.endTag(XMLTags.TEXT));
                    out.println(Utility.startTag(XMLTags.ERROR) + "information" + Utility.endTag(XMLTags.ERROR));
                    String strReturnCommand = Utility.addURLParam(null, XMLTags.MENU, DBConstants.BLANK);   // User's main menu
                    strReturnCommand = Utility.addURLParam(strReturnCommand, DBParams.USER_NAME, this.getProperty(DBParams.USER_NAME));
                    strReturnCommand = Utility.addURLParam(strReturnCommand, DBParams.AUTH_TOKEN, this.getProperty(DBParams.AUTH_TOKEN));
                    out.println(Utility.startTag(DBParams.COMMAND) + Utility.encodeXML(strReturnCommand) + Utility.endTag(DBParams.COMMAND));
                    out.println(Utility.endTag(XMLTags.STATUS_TEXT));
                }
            }
        }
        
        out.flush();
        out.close();
        
        return stringWriter.toString();
    }
859789
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
    {
        int iIndex = strCommand.indexOf(DBParams.MENU + '=');
        if (iIndex != -1)
            if ((strCommand.indexOf(DBParams.TASK + '=') != -1) 
                || (strCommand.indexOf(DBParams.APPLET + '=') != -1) 
                || (strCommand.indexOf(DBParams.SCREEN + '=') != -1))
                    iIndex = -1;    // Special case - thin menu (create an applet window)
        if (iIndex == -1)
        {
            String strJobCommand = DBParams.JOB + '=';
            int iCommandIndex = strCommand.indexOf(strJobCommand);
            if (iCommandIndex != -1)
            {
                iCommandIndex += strJobCommand.length();
                strCommand = strCommand.substring(iCommandIndex, Math.max(strCommand.indexOf('&', iCommandIndex), strCommand.length()));
                try   {
                    strCommand = URLDecoder.decode(strCommand, DBConstants.URL_ENCODING);
                } catch (java.io.UnsupportedEncodingException ex) {
                    ex.printStackTrace();
                    strCommand = "";
                }
            }
        }
        if ((iIndex != -1) && ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) != ScreenConstants.USE_NEW_WINDOW))
        {	// Same window
//x            strCommand = "?samewindow=&" + strCommand.substring(iIndex);
            if (strCommand.indexOf(MenuScreen.SAME_WINDOW_PARAM) == -1)
                strCommand = Utility.addURLParam(strCommand, MenuScreen.SAME_WINDOW_PARAM, DBConstants.BLANK);
            this.freeAllSFields(false);
            if (this.getTask() != null)
                this.getTask().setProperties(null);
            //          this.setMenuProperty(strParam);   // Set the menu to the current "menu" parameter.
            m_strMenu = null;
            m_strMenuObjectID = null;
            m_strMenuTitle = null;
            boolean bSuccess = this.getScreenFieldView().doCommand(strCommand);     // Initial menu
            this.resizeToContent(this.getTitle());
            //          Container control = (Container)this.getScreenFieldView().getControl();  // Redisplay
            //          control.validate();     // Re-layout the container
            //          control.repaint();      // Re-display this screen
            this.getParentScreen().pushHistory(strCommand, ((iCommandOptions & DBConstants.DONT_PUSH_TO_BROWSER) == DBConstants.PUSH_TO_BROWSER));   // History of screens displayed
            return bSuccess;
        }
        else
            return super.doCommand(strCommand, sourceSField, iCommandOptions); // Do inherited
    }
584552
public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException
    {
        synchronized(m_objSync)
        {
            return m_tableRemote.doRemoteAction(strCommand, properties);
        }
    }
231288
@Override
    protected void doHandle(CommandContext ctx) throws CommandFormatException {

        BatchManager batchManager = ctx.getBatchManager();
        if(!batchManager.isBatchActive()) {
            throw new CommandFormatException("No active batch.");
        }

        Batch batch = batchManager.getActiveBatch();
        final int batchSize = batch.size();
        if(batchSize == 0) {
            throw new CommandFormatException("The batch is empty.");
        }

        List<String> arguments = ctx.getParsedCommandLine().getOtherProperties();
        if(arguments.isEmpty()) {
            throw new CommandFormatException("Missing line number.");
        }

        if(arguments.size() != 1) {
            throw new CommandFormatException("Expected only one argument - the line number but received: " + arguments);
        }

        String intStr = arguments.get(0);
        int lineNumber;
        try {
            lineNumber = Integer.parseInt(intStr);
        } catch(NumberFormatException e) {
            throw new CommandFormatException("Failed to parse line number '" + intStr + "': " + e.getLocalizedMessage());
        }

        if(lineNumber < 1 || lineNumber > batchSize) {
            throw new CommandFormatException(lineNumber + " isn't in range [1.." + batchSize + "].");
        }

        batch.remove(lineNumber - 1);
    }
1171939
public void printHelp(Command command) {
        if (command.getDescriptor().getUsage() != null) {
            printUsage(command.getDescriptor().getUsage());
        } else {
            printUsage(command);
        }
        int leftWidth = printOptions(command.getOptions());
        printArguments(command.getArgumentsList(), leftWidth);
    }
220833
public void printDisplayControl(PrintWriter out)
    {
        if (this.getScreenField().getConverter() != null)
        {
            String strFieldName = this.getScreenField().getConverter().getField().getFieldName(false, false);
            this.printInputControl(out, null, strFieldName, null, null, null, HtmlConstants.BUTTON, 0);   // Button that does nothing?
        }
        else if (this.getScreenField().getParentScreen() instanceof GridScreen)
        { // These are command buttons such as "Form" or "Detail"
            this.printInputControl(out, null, null, null, null, null, HtmlConstants.BUTTON, 0);   // Button that does nothing?
        }
    }
608520
public Object doRemoteAction(String strCommand, Map<String, Object> properties) throws DBException, RemoteException
    {
        BaseTransport transport = this.createProxyTransport(DO_REMOTE_ACTION);
        transport.addParam(NAME, strCommand);   // Don't use COMMAND
        transport.addParam(PROPERTIES, properties);
        Object strReturn = transport.sendMessageAndGetReply();
        if (strReturn instanceof String)
        {   // Could be returning a session
            BaseSessionProxy session = this.checkForSession((String)strReturn);
            if (session != null)
                return session;
        }
        Object objReturn = transport.convertReturnObject(strReturn);
        return this.checkDBException(objReturn);
    }
530150
public void printInputControl(PrintWriter out, String strFieldDesc, String strFieldName, String strSize, String strMaxSize, String strValue, String strControlType, String strFieldType)
    {
        out.println(" <xfm:" + strControlType + " xform=\"form1\" ref=\"" + strFieldName + "\" cols=\"" + strSize + "\" type=\"" + strFieldType + "\">");
        out.println("   <xfm:caption>" + strFieldDesc + "</xfm:caption>");
        out.println(" </xfm:" + strControlType + ">");
    }
151833
public int commandToDocType(String strCommand)
    {
        if (CLASS_DETAIL_SCREEN.equalsIgnoreCase(strCommand))
            return CLASS_DETAIL_MODE;
        if (RESOURCE_DETAIL_SCREEN.equalsIgnoreCase(strCommand))
            return RESOURCE_DETAIL_MODE;
        return super.commandToDocType(strCommand);
    }
223790
public void printDisplayControl(PrintWriter out)
    {
        if (this.getScreenField().getConverter() == null)
            return;
        String strField = Utility.encodeXML(this.getScreenField().getSFieldValue(true, false));
        if ((strField == null) || (strField.length() == 0))
            strField = "&nbsp;";    //?"<br>";
        String strHyperlink = ((Converter)this.getScreenField().getConverter()).getHyperlink();
        if (strHyperlink != null) if (strHyperlink.length() > 0)
            strField = "<a href=\"" + strHyperlink + "\">" + strField + "<a>";
        String strAlignment = this.getControlAlignment();
        out.println("<td" + strAlignment + ">" + strField + "</td>");
    }