Examples of Command


Examples of de.iritgo.aktario.core.command.Command

  {
    final SystemProperties sysProperties = Engine.instance().getSystemProperties();

    if (sysProperties.getBool("autoLogin", false))
    {
      CommandTools.performAsync(new Command()
      {
        public void perform()
        {
          UserLoginHelper.login(null, sysProperties.getString("autoLoginServer", null), sysProperties
                  .getString("autoLoginUser", null), StringTools.decode(sysProperties.getString(
View Full Code Here

Examples of de.iritgo.aktera.model.Command

   *      java.lang.String)
   */
  public Command createCommand(String name, String bean)
  {
    assert StringTools.isNotTrimEmpty(name);
    Command command = new DefaultCommand();
    command.setName(name);
    command.setBean(bean);
    command.setLabel(name);
    return command;
  }
View Full Code Here

Examples of de.mnl.srcpd4cu.srcp.Command

                log.finer("Request: " + cmdLine);
                // Find command, first choose map according to state
                Map<String, Command> commandMap = COMMAND_MAPS.get(session
                        .getMode());
                // set to found command
                Command command = null;
                for (Map.Entry<String, Command> entry : commandMap.entrySet()) {
                    if (cmdLine.startsWith(entry.getKey() + " ")) {
                        command = entry.getValue();
                        // shorten command line to arguments
                        cmdLine = cmdLine
                                .substring(entry.getKey().length() + 1);
                        break;
                    }
                    if (cmdLine.equals(entry.getKey())) {
                        command = entry.getValue();
                        cmdLine = "";
                        break;
                    }
                }
                // if command found, execute
                if (command != null) {
                    Command.Response resp
                        = command.execute(session, cmdLine.trim());
                    respond(resp.getCode(), resp.getMessage());
                    continue;
                }
                respond(410, "ERROR unknown command");
            }
View Full Code Here

Examples of de.odysseus.calyxo.control.Command

        } else {
          clazz = context.getClassLoader().loadClass(className);
        }
        Action action = (Action)clazz.newInstance();
        action.init(actionConfig, context);
        Command command = chain(actionConfig.getFilterConfigs(), action);
        ActionCommand item = new ActionCommand(actionConfig, command);
        commands.put(actionConfig.getPath(), item);
      }
    }
  }
View Full Code Here

Examples of ds.pjftp.command.Command

        while ((request = session.readRequest()) != null) {

            final String reqCmd = request.getCommand();
            final String reqArg = request.getArgument();

            final Command command = Commands.get(reqCmd);
            if (command != null) {
                command.invoke(session, reqArg);
            } else {
                session.replyWithSpace(500, "Command  {} isn't supported", reqCmd);
            }
            session.setLastRequest(request);
        }
View Full Code Here

Examples of edu.isi.karma.controller.command.Command

  public Command createCommand(JSONArray inputJson, Workspace workspace)
      throws JSONException, KarmaException {
    String worksheetId = CommandInputJSONUtil.getStringValue(Arguments.worksheetId.name(), inputJson);
    String selectionName = CommandInputJSONUtil.getStringValue(Arguments.selectionName.name(), inputJson);
    String hNodeId = CommandInputJSONUtil.getStringValue(Arguments.hNodeId.name(), inputJson);
    Command cmd = new RefreshSelectionCommand(getNewId(workspace), worksheetId, selectionName, hNodeId);
    cmd.setInputParameterJson(inputJson.toString());
    return cmd;
  }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4compiler.ast.Command

        return ans;
    }

    void runFor3(Expr expr) throws Err {
        A4Options opt = new A4Options();
        Command cmd = new Command(false, 3, 3, 3, expr.and(fact));
        A4Solution sol = TranslateAlloyToKodkod.execute_command(NOP, sigs, cmd, opt);
        System.out.println(sol.toString().trim());
        if (sol.satisfiable()) {
            System.out.println("In particular, File = " + sol.eval(file));
            System.out.println("In particular, Dir = " + sol.eval(dir));
View Full Code Here

Examples of edu.uga.galileo.voci.bo.Command

   *      javax.servlet.http.HttpServletResponse)
   */
  @Override
  protected void handleRequest(HttpServletRequest request,
      HttpServletResponse response) {
    Command command = (Command) request.getAttribute("command");

    // set at the session level b/c customizable user prefs
    // will probably change it to session eventually
    request.getSession().setAttribute("resultsPerPage",
        Configuration.getInt("adminSearchResultsPerPage"));

    // get the default list of fields to use in creating search result
    // blurbs
    handleBlurbFieldData(command, request);

    // the 'fto' param should hold the url to forward the request to after
    // the search has been processed
    String forwardRequestTo = request.getParameter("fto");
   
    // make sure that the query is a valid one
    /*
    if ((command.isViewCommand())
        && (!isValidQuery(request.getParameter("query")))) {
      request
          .setAttribute(
              "errorMessage",
              "Your query must be at least three characters, "
                  + "and at least two of those must not be wildcards.");
      request.getSession().setAttribute("searchResults", null);
      request.getSession().setAttribute("queryString",
          request.getParameter("query"));
      try {
        request.getRequestDispatcher(
            response.encodeURL(forwardRequestTo)).forward(request,
            response);
      } catch (ServletException e) {
        Logger.warn("Couldn't forward request for URI "
            + request.getRequestURI() + " to the error page", e);
      } catch (IOException e) {
        Logger.warn("Couldn't forward request for URI "
            + request.getRequestURI() + " to the error page", e);
      }

      return;
    }
    */

    // then, if all's well, perform the actual searching
    if (forwardRequestTo != null) {
      boolean advanced = request.getParameter("adv") == null ? false
          : true;
      SearchType searchType = request.getParameter("type") == null ? SearchType.AND
          : SearchType.valueOf(request.getParameter("type")
              .toUpperCase());
      boolean activeOnly = request.getParameter("active") == null ? true
          : Boolean.valueOf(request.getParameter("active"));
      boolean allowsZero = request.getParameter("zeroes") == null ? false
          : Boolean.valueOf(request.getParameter("zeroes"));
      String username = request.getParameter("username");
      if ((username != null) && (username.trim().length() == 0)) {
        username = null;
      }
      String updateDateStart = request.getParameter("start");
      if ((updateDateStart != null)
          && (updateDateStart.trim().length() == 0)) {
        updateDateStart = null;
      }
      String updateDateEnd = request.getParameter("end");
      if ((updateDateEnd != null) && (updateDateEnd.trim().length() == 0)) {
        updateDateEnd = null;
      }
      List<SearchResult> results = null;

      // adjust blurb fields displayed based on user's preferences
      HashMap<ContentType, ArrayList<String>> useBlurbFields = getUserBlurbFields(
          command, request);

      if (advanced) {
        results = handleAdvancedSearchRequest(request, command,
            searchType, activeOnly, allowsZero, useBlurbFields,
            username, updateDateStart, updateDateEnd);
      } else {
        results = handleBasicSearchRequest(request, command,
            searchType, activeOnly, allowsZero, useBlurbFields,
            username, updateDateStart, updateDateEnd);
      }

      try {
        // '/do/...' urls are for admin areas, so we need to check user
        // editing permission for each, and attach that data to the
        // search results
        if ((forwardRequestTo.indexOf("/do/") != -1)
            && (results != null)) {
          WorkflowManager wm = new WorkflowManager();
          ProjectManager pm = new ProjectManager();
          User user = (User) request.getSession()
              .getAttribute("user");
          // if user is null, stick with the default that none of
          // the results is editable
          if (user != null) {
            SearchResult result;
            boolean includeExtras = request
                .getParameter("includeExtras") == null ? false
                : true;
            for (int m = results.size() - 1; m >= 0; m--) {
              result = results.get(m);
              try {
                if (wm.canEdit(user, pm.getProjectHandle(result
                    .getProjectId()), ContentType.valueOf(
                    result.getVBO().getType()).getPlural(),
                    result.getVBO().getId())) {
                  result.setUserEditable(true);
                } else if (!includeExtras) {
                  results.remove(m);
                }
              } catch (NoSuchProjectException e) {
                Logger
                    .error("Couldn't get project handle for ID "
                        + result.getProjectId());
              }
            }
          }
        }

        request.getRequestDispatcher(
            response.encodeURL(forwardRequestTo)).forward(request,
            response);
      } catch (ServletException e) {
        Logger.warn("Couldn't forward request for URI "
            + request.getRequestURI() + " to the error page", e);
      } catch (IOException e) {
        Logger.warn("Couldn't forward request for URI "
            + request.getRequestURI() + " to the error page", e);
      }
    } else {
      try {
        request.setAttribute("errorMessage",
            "The requested search didn't include a response page.");
        request.getRequestDispatcher(
            response.encodeURL("/" + command.getProject()
                + "/Error.jsp")).forward(request, response);
      } catch (ServletException e) {
        Logger.warn("Couldn't forward request for URI "
            + request.getRequestURI() + " to the error page", e);
      } catch (IOException e) {
View Full Code Here

Examples of edu.wpi.first.wpilibj.command.Command

    // @Test
    // public void hello() {}

    @Test
    public void testInitDefaultCommand() {
        Command expected = new DriveManualJoystickControl();

        assertEquals(CommandBase.drivetrain.getDefaultCommand().getName(), expected.getName());
    }
View Full Code Here

Examples of frontend.alphaspawn.tools.command.Command

      // Retrieve a list of all commands
      List cmdList = cmdMgr.getCommands();

      // Display list of commands
      for ( Iterator iter = cmdList.iterator() ; iter.hasNext() ; ) {
        Command cmd = (Command)iter.next();

        // Checks if the player has the right to see the command
        if ( cmd.checkAccess( playerName ) ) {
          String cmdName = cmd.getName().trim();
          if ( cmdName.length() > longestCmd ) { longestCmd = cmdName.length(); }

          // Memorize the command name
          cmdDisplay.put( cmdName, cmd );         
        }
      }
     
      // Display the help menu to the player
      String spaces = "    ";
     
      for ( Iterator iter = cmdDisplay.entrySet().iterator() ; iter.hasNext() ; ) {
        Command cmd = (Command)( (Map.Entry)iter.next() ).getValue();
       
        // Format the output string
        StringBuffer output = new StringBuffer( cmd.getName().trim() );
        // Fill the output with some space
        for ( int i = output.length() ; i < longestCmd ; i++ ) {
          output.append( ' ' );
        }
        // Add the description to the output
        output.append( spaces ).append( cmd.getDescription().trim() );
       
        // Display the command + description to the player
        this.objConnection.sendPrivateMessage( playerName, output.toString() );
      }
    }   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.