Package de.iritgo.aktera.model

Examples of de.iritgo.aktera.model.KeelResponse


    int displayType = event.getDisplayType();
    long userUniqueId = event.getUserUniqueId();

    if (displayType == GUIControllerRequest.QUERY)
    {
      KeelResponse result = getKeelResultList(controllerTypeId, "list", userUniqueId, "", "");

      if (result == null)
      {
        return;
      }

      ResponseElement resultList = result.get("list");

      Controller controller = createController(controllerTypeId);

      WidgetDescription wdGroup = createWidget(controller.getUniqueId(), controllerTypeId, "group", "group",
              false, true);

      controller.addWidgetDescription(wdGroup);

      for (Iterator i = ((ResponseElement) resultList.getAttribute("header")).getAll().iterator(); i.hasNext();)
      {
        ResponseElement field = (ResponseElement) i.next();
        String attributeName = (String) ((Output) field).getContent();
        String fieldLabel = (String) ((Output) field).getAttribute("label");
        boolean hide = ((Output) field).getAttribute("hide") != null ? true : false;

        wdGroup.addWidgetDescription(createWidget(controller.getUniqueId(), fieldLabel, attributeName,
                attributeName, false, hide));
      }

      Input attribute = (Input) result.get("listSearchCategory");

      if (attribute != null)
      {
        controller.addWidgetDescription(createWidget(controller.getUniqueId(), "listSearchCategory",
                "listSearchCategory", "listSearchCategory", false, false));
      }

      // Wird noch ben�tigt um zu �perpr�fen ob �berhaupt die Neuanlage
      // erlaubt ist.
      // Command cmdNew = (Command) resultList.getAttribute ("cmdNew");
      Command cmdEdit = (Command) resultList.getAttribute("cmdEdit");

      if (cmdEdit != null)
      {
        controller.addCommandDescription(createCommand(controller.getUniqueId(), "NewAkteraObjectCommand",
                cmdEdit.getModel(), "new", "new", "des", true, true));

        controller.addCommandDescription(createCommand(controller.getUniqueId(), "EditAkteraObjectCommand",
                cmdEdit.getModel(), "edit", "edit", "des", true, true));
      }

      ResponseElement itemCommands = (ResponseElement) resultList.getAttribute("itemCommands");

      if (itemCommands != null)
      {
        for (Iterator i = itemCommands.getAll().iterator(); i.hasNext();)
        {
          Command command = (Command) i.next();

          if (command.getName().equals("delete"))
          {
            controller.addCommandDescription(createCommand(controller.getUniqueId(),
                    "DeleteAkteraObjectCommand", command.getModel(), "delete", "delete", "des",
                    true, true));
          }
        }
      }

      controller.addCommandDescription(createCommand(controller.getUniqueId(), "CancelAkteraObjectCommand",
              "cancel", "cancel", "cancel", "des", true, true));

      guiManager.addController(controllerTypeId, controller);
    }

    if (displayType == GUIControllerRequest.DATAOBJECT)
    {
      KeelResponse keelForm = getKeelObject(controllerTypeId, "0", userUniqueId);

      Controller controller = createController(controllerTypeId);

      ResponseElement groups = keelForm.get("groups");

      for (Iterator i = groups.getAll().iterator(); i.hasNext();)
      {
        ResponseElement group = (ResponseElement) i.next();

        WidgetDescription wdGroup = createWidget(controller.getUniqueId(), (String) ((Output) group)
                .getContent(), "group", "group", false, true);

        controller.addWidgetDescription(wdGroup);

        for (Iterator j = group.getAll().iterator(); j.hasNext();)
        {
          Input field = (Input) j.next();
          String fieldName = field.getName();
          String fieldLabel = field.getLabel();
          boolean duty = field.getAttribute("duty") == null ? false : true;

          WidgetDescription fieldWidget = createWidget(controller.getUniqueId(), fieldLabel, fieldName,
                  (String) ((Input) field).getAttribute("editor"), duty, true);

          wdGroup.addWidgetDescription(fieldWidget);
        }
      }

      Command cmdSave = (Command) keelForm.get("save");

      if (cmdSave != null)
      {
        controller.addCommandDescription(createCommand(controller.getUniqueId(), "SaveAkteraObjectCommand",
                cmdSave.getModel(), "save", "save", "des", true, true));
View Full Code Here


      request.setRequest((HttpServletRequest) pageContext.getRequest());
      client.setRequest(request);
      client.setResponse((HttpServletResponse) pageContext.getResponse());
      client.setModel(model);

      KeelResponse response = client.execute();

      for (Iterator i = response.getAll(); i.hasNext();)
      {
        ResponseElement element = (ResponseElement) i.next();

        if (element instanceof Output)
        {
View Full Code Here

      keelRequest.setParameter("operation", operation);
    }

    try
    {
      KeelResponse response = getClient(session).execute(keelRequest);

      return ((Boolean) response.getAttribute("allowed")).booleanValue();
    }
    catch (ModelException e)
    {
      log.log(Level.SEVERE, e.getMessage(), e);
    }
View Full Code Here

    {
      WebappClientConnector connector = new StrutsClientConnector(request, response, form, getServlet());

      connector.setLogger(log);

      KeelResponse kres = connector.execute();

      /* Now determine what the appropriate ActionForward to return is */
      /*
       * If we have an output called "forward", we use this name as the
       * forward. If not, we use the default
View Full Code Here

  public KeelResponse deserialize(byte[] bytes) throws IOException
  {
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
    ObjectInputStream ois = new ObjectInputStream(bais);
    KeelResponse myObject = null;

    try
    {
      myObject = (ModelResponseMessage) ois.readObject();
    }
View Full Code Here

   * @see de.iritgo.aktera.clients.ClientConnector#execute(de.iritgo.aktera.model.KeelRequest)
   */
  public KeelResponse execute(KeelRequest kreq) throws ClientException, ModelException
  {
    KeelClient currentClient = getClient();
    KeelResponse kres = null;

    try
    {
      kres = currentClient.execute(kreq);
    }
View Full Code Here

      initParamsParsed = true;
    }

    KeelRequest kreq = makeKeelRequest(wreq, defaultModelName);

    KeelResponse kres = super.execute(kreq);

    if (kres == null)
    {
      throw new ClientException("Model response was null");
    }

    String modelName = kreq.getModel();

    kres.setAttribute("model", modelName);

    makeWebappResponse(kreq, kres, wres, wreq, modelName);

    return kres;
  }
View Full Code Here

TOP

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

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.