Package de.iritgo.aktera.model

Examples of de.iritgo.aktera.model.Command


  public ModelResponse execute(ModelRequest req) throws ModelException
  {
    SystemFirewall.disable();

    ModelResponse res = req.createResponse();
    Command cmd = res.createCommand("aktera.database.create");
    cmd.setName("create");
    cmd.setLabel("$createDatabase");
    res.add(cmd);

    return res;
  }
View Full Code Here


    log.info("*** Unblock firewall for database update...");
    SystemFirewall.disable();

    ModelResponse res = req.createResponse();

    Command cmd = res.createCommand("aktera.database.update");

    cmd.setName("update");
    cmd.setLabel("$updateDatabase");
    res.add(cmd);

    return res;
  }
View Full Code Here

    catch (ServiceException x)
    {
      throw new ModelException(x);
    }

    Command cmd = res.createCommand("aktera.tools.goto-start-model");

    cmd.setName("cmd");
    res.add(cmd);

    return res;
  }
View Full Code Here

        outMenu = res.createOutput(menuId);
        outMenuList.add(outMenu);
        outMenu.setAttribute("title", menuConfig.getAttribute("title", "$noTitle"));
      }

      Command cmd = null;

      Configuration[] items = menus[i].getChildren("item");

      int numVisibleItems = 0;

      for (int j = 0; j < items.length; ++j)
      {
        Configuration itemConfig = items[j];

        boolean itemAllowed = true;

        String model = itemConfig.getAttribute("model", null);

        if (model == null)
        {
          log.info("No model specified for menu item " + i + "/" + j);

          continue;
        }

        try
        {
          boolean validUser = itemConfig.getAttributeAsBoolean("validUser");

          try
          {
            itemAllowed = itemAllowed
                    && (validUser == (userEnv != null && userEnv.getUid() != UserEnvironment.ANONYMOUS_UID));
          }
          catch (AuthorizationException x)
          {
            itemAllowed = ! validUser;
          }
        }
        catch (ConfigurationException x)
        {
        }

        try
        {
          String userGroup = itemConfig.getAttribute("userGroup");

          try
          {
            itemAllowed = itemAllowed && userEnv != null && userEnv.getGroups().contains(userGroup);
          }
          catch (AuthorizationException x)
          {
            itemAllowed = false;
          }

          String notUserGroup = itemConfig.getAttribute("notUserGroup");

          if (notUserGroup != null)
          {
            try
            {
              itemAllowed = itemAllowed && userEnv != null
                      && ! userEnv.getGroups().contains(notUserGroup);
            }
            catch (AuthorizationException x)
            {
              itemAllowed = false;
            }
          }
        }
        catch (ConfigurationException x)
        {
        }

        if (itemAllowed)
        {
          cmd = res.createCommand(model);
          outMenu.add(cmd);

          cmd.setLabel(itemConfig.getAttribute("title", "$noTitle"));
          cmd.setAttribute("hasNext", new Boolean(j + 1 < items.length));
          cmd.setAttribute("bundle", itemConfig.getAttribute("bundle", "Aktera"));

          if (itemConfig.getAttribute("icon", null) != null)
          {
            cmd.setAttribute("icon", itemConfig.getAttribute("icon", "menu-bullet"));
          }

          ++numVisibleItems;
        }
      }

      outMenu.setAttribute("numVisibleItems", new Integer(numVisibleItems));

      if (cmd != null)
      {
        cmd.setAttribute("last", new Boolean(true));
      }
    }

    return res;
  }
View Full Code Here

      {
        System.out.println("[StoreLicense] " + x);
      }
    }

    Command cmd = res.createCommand("aktera.tools.goto-start-model");

    cmd.setName("cmdLogin");
    res.add(cmd);

    return res;
  }
View Full Code Here

    Input fileUpload1 = res.createInput("fileUpload1");

    res.add(fileUpload1);

    Command cmd = res.createCommand("aktera.session.store-license");

    cmd.setName("cmdStore");
    res.add(cmd);

    return res;
  }
View Full Code Here

      handleAttributes(re, out, xmldoc, elementNames);
      parent.appendChild(xmldoc.createTextNode("\n"));
    }
    else if (re instanceof Command)
    {
      Command c = (Command) re;

      Element comm = xmldoc.createElement("command");

      comm.setAttribute("name", c.getName());
      parent.appendChild(comm);
      //parent.appendChild(xmldoc.createTextNode("\n"));
      comm.setAttribute("label", c.getLabel());
      comm.setAttribute("model", c.getModel());

      Map params = c.getParameters();
      String oneKey = null;
      Object oneValue = null;

      for (Iterator ip = params.keySet().iterator(); ip.hasNext();)
      {
View Full Code Here

        }
      }

      if (lastLine != null && lastLine.indexOf("Result: OK") != - 1)
      {
        Command cmd = res.createCommand(getConfiguration().getChild("cmd-ok").getValue());

        cmd.setName("cmdOk");
        res.add(cmd);
      }
      else if (lastLine != null && lastLine.indexOf("Result: ERROR") != - 1)
      {
        Command cmd = res.createCommand(getConfiguration().getChild("cmd-error").getValue());

        cmd.setName("cmdError");
        res.add(cmd);

        res.add(res.createOutput("error", "Y"));
      }
      else
      {
        Command cmd = res.createCommand(getConfiguration().getChild("cmd-report").getValue());

        cmd.setName("cmdReport");
        res.add(cmd);
      }

      res
              .setAttribute("forward", getConfiguration().getChild("forward").getValue(
View Full Code Here

    if (request.getParameter("gc") != null)
    {
      System.gc();
    }

    Command cmd = response.addCommand("cmd5Minutes", "de.iritgo.aktera.base.ShowJvmMemoryHistory");

    cmd.setParameter("startTime", "5");

    cmd = response.addCommand("cmd30Minutes", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "30");

    cmd = response.addCommand("cmd60Minutes", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "60");

    cmd = response.addCommand("cmd120Minutes", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "120");

    cmd = response.addCommand("cmdDay", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "1440");

    cmd = response.addCommand("cmdWeek", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "10080");

    cmd = response.addCommand("cmdMonth", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("startTime", "302400");

    cmd = response.addCommand("cmdYear", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("cmdYear", "3628800");

    cmd = response.addCommand("cmdGC", "de.iritgo.aktera.base.ShowJvmMemoryHistory");
    cmd.setParameter("gc", "Y");
  }
View Full Code Here

      return res;
    }
    else
    {
      Command cmd = res.createCommand((String) req.getParameter("_lm"));

      for (Iterator i = req.getParameters().keySet().iterator(); i.hasNext();)
      {
        String key = (String) i.next();

        if (key.startsWith("_lp"))
        {
          cmd.setParameter(key.substring(3), req.getParameter(key));
        }
      }

      return cmd.execute(req, res);
    }
  }
View Full Code Here

TOP

Related Classes of de.iritgo.aktera.model.Command

Copyright © 2018 www.massapicom. 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.