Package de.iritgo.aktera.model

Examples of de.iritgo.aktera.model.ResponseElement


    if (result == null)
    {
      return;
    }

    ResponseElement resultList = result.get("list");
    IObjectList results = (IObjectList) akteraQuery.getIObjectListResults();

    if (resultList == null)
    {
      Log.logError("ConnectorServerManager", "No result list for model: " + model);
    }

    registerListElement(resultList, model);

    List rows = resultList.getAll();
    DynDataObject listObject = null;

    for (Iterator i = rows.iterator(); i.hasNext();)
    {
      ResponseElement row = (ResponseElement) i.next();

      listObject = createQueryDataObjectAndRegister(row, row.getAll().iterator(), resultList, model, akteraQuery);

      if (listObject != null)
      {
        // System.out.println (listObject.dump ());
        results.add(listObject);
View Full Code Here


    DynDataObject listObject = new DynDataObject(model);

    for (Iterator i = ((ResponseElement) resultList.getAttribute("header")).getAll().iterator(); i.hasNext();)
    {
      ResponseElement field = (ResponseElement) i.next();
      String attributeName = (String) ((Output) field).getContent();

      listObject.setAttribute(attributeName, "");
    }
View Full Code Here

    else
    {
      dataObject.setUniqueId(new Long(keelObjectId));
    }

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

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

      for (Iterator j = group.getAll().iterator(); j.hasNext();)
      {
        Input attribute = (Input) j.next();

        String attributeName = attribute.getName();
        String attributeContent = (String) attribute.getDefaultValue().toString();
View Full Code Here

    int colCounter = 0;

    while (col.hasNext())
    {
      ResponseElement colResp = (ResponseElement) col.next();

      String attributeName = (String) ((Output) ((ResponseElement) resultList.getAttribute("header")).getAll()
              .get(colCounter)).getContent();

      String content = (String) (((Output) colResp).getContent()).toString();
View Full Code Here

      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;
View Full Code Here

     * with "$" and *not* have it internationalized, just use "$$". This
     * will be converted to a single "$" for display. Once we've done
     * internationalization, create a DynaBean from the response.
     */
    MessageResources messages = getMessageResources(kres, wreq, wres, modelName);
    ResponseElement re = null;

    for (Iterator i = allElements; i.hasNext();)
    {
      re = (ResponseElement) i.next();

      internationalize(re, messages);

      /* Now make a dynabean for the given element */
      ResponseElementDynaBean reAsBean = new ResponseElementDynaBean(re);

      wreq.setAttribute(re.getName(), reAsBean);

      if (re instanceof Input)
      {
        inputs.add(reAsBean);
      }
      else if (re instanceof Output)
      {
        // HACK: For the moment, if re is output file, write to stream
        // here, as not being written otherwise
        final String outputType = (String) re.getAttribute("type");

        if ((outputType != null) && outputType.equals("binary"))
        {
          // Binary data, so dump to output stream now....
          log.debug("File Data is available");

          final BinaryWrapper data = (BinaryWrapper) ((Output) re).getContent();

          //          hres.setContentLength(new
          //          Integer(((Long)re.getAttribute("ContentLength")).toString()).intValue());
          final long dataSize = data.getSize();

          if ((dataSize > 0) && (dataSize < Integer.MAX_VALUE))
          {
            // Have a valid content length.
            hres.setContentLength((int) data.getSize());
          }

          hres.setContentType(data.getContentType());
          hres.setHeader("Content-Disposition", (String) re.getAttribute("Content-Disposition"));

          //          String encodings = hreq.getHeader ("Accept-Encoding");
          BufferedOutputStream buffOut = null;

          try
View Full Code Here

  }

  protected void internationalize(ResponseElement re, MessageResources messages)
  {
    /* Check for nested elements, internationalize each one */
    ResponseElement oneNested = null;

    for (Iterator i = re.getAll().iterator(); i.hasNext();)
    {
      oneNested = (ResponseElement) i.next();
      internationalize(oneNested, messages);
View Full Code Here

      log.error("No elements in response from server");
    }

    MessageResources messages = getMessageResources(controller, request, beanName);

    ResponseElement re = null;

    for (Iterator i = allElements; i.hasNext();)
    {
      re = (ResponseElement) i.next();
      internationalize(re, messages);

      ResponseElementDynaBean reAsBean = new ResponseElementDynaBean(re);

      request.setAttribute(re.getName(), reAsBean);

      if (re instanceof Input)
      {
        inputs.add(reAsBean);
      }
      else if (re instanceof Output)
      {
        // HACK: For the moment, if re is output file, write to stream
        // here, as not being written otherwise
        final String outputType = (String) re.getAttribute("type");

        if ((outputType != null) && outputType.equals("binary"))
        {
          // Binary data, so dump to output stream now....
          log.debug("File Data is available");

          final BinaryWrapper data = (BinaryWrapper) ((Output) re).getContent();

          // hres.setContentLength(new
          // Integer(((Long)re.getAttribute("ContentLength")).toString()).intValue());
          final long dataSize = data.getSize();

          if ((dataSize > 0) && (dataSize < Integer.MAX_VALUE))
          {
            // Have a valid content length.
            response.setContentLength((int) data.getSize());
          }

          response.setContentType(data.getContentType());
          response.setHeader("Content-Disposition", (String) re.getAttribute("Content-Disposition"));

          // String encodings = hreq.getHeader ("Accept-Encoding");
          BufferedOutputStream buffOut = null;

          try
View Full Code Here

   * @param re
   * @param messages
   */
  private void internationalize(ResponseElement re, MessageResources messages)
  {
    ResponseElement oneNested = null;

    for (Iterator i = re.getAll().iterator(); i.hasNext();)
    {
      oneNested = (ResponseElement) i.next();
      internationalize(oneNested, messages);
View Full Code Here

      KeelResponse response = client.execute();

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

        if (element instanceof Output)
        {
          ResponseElementDynaBean elementAsBean = new ResponseElementDynaBean(element);

          pageContext.setAttribute(element.getName(), elementAsBean, getScope(scope));
        }
      }

      return EVAL_PAGE;
    }
View Full Code Here

TOP

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

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.