Package org.openqreg.element

Examples of org.openqreg.element.Container


    retrieveObjects();

    // Container container = disp.getSystemHolder()
    // .getContainer(containerName);
    Container container = systemHolder.getContainer(containerName);
    // if the container asked for does not exist, do nothing
    if (containerName == null || containerName.equals("")
        || container == null) {
      String jspPage = (String) pageContext.getAttribute(THISPAGENAME);
      log.log(Level.ERROR, " No Page object, " + containerName
          + " for jsp page: " + jspPage);
      return SKIP_BODY;
    }

    // if the page does not send an outputFormat use HTML
    if (null == outputFormat) {
      outputFormat = OutputFormat.HTML;
    }

    // if the page does not send an elemparam, create one
    if (null == elemParam) {
      // create elemPrameter
      elemParam = new DefaultElementParameter();
      elemParam.setUser(user);
     
      // The calendar could be set from the page
      if (calendar != null) {
        elemParam.setCalendar(calendar);
      }
      //The serviceMap could be set from the page
      if(serviceMap!=null) {
        elemParam.setServices(serviceMap);
      }
      fetch = (FetchData) pageContext.getAttribute(FETCH);
      elemParam.setFetch(fetch);
    }

    StringBuffer out = new StringBuffer();
    // if only containerName set in variablestag, get entire container
    out.append(container.getOutput(elemParam, outputFormat));

    // write to page
    try {
      pageContext.getOut().write(out.toString());
    } catch (IOException e) {
View Full Code Here


    // inputAttributes changed to tempAttributes to enable running right js
    // initialisation on return
    Map<String, String> html = new TreeMap<String, String>();
    Map<String, String> js = new TreeMap<String, String>();
    SystemHolder sh = Dispatcher.getInstance().getSystemHolder();
    Container container = null;
    if (containerIds != null) {
      for (String containerId : containerIds) {
        container = sh.getContainer(containerId);
        html.put(containerId, container.getOutput(elemParam, OutputFormat.HTML));
        js.put(containerId, container.getOutput(elemParam,
            OutputFormat.JAVASCRIPT).replaceAll("inputAttributes", "tempAttributes"));
      }
    }
    // aga.setHTML(container.getOutput(elemParam, OutputFormat.HTML)
    // .replaceAll("inputAttributes", "tempAttributes"));
View Full Code Here

      // get all containers from this document
      Collection<VarcontainerBean> contCol = VarcontainerFinder
          .findByDocument(con, doBean.getDocument());

      Container container;
      // loop varcontainers and turn them into elementContainers the class
      // used to write out html etc
      for (VarcontainerBean varContBean : contCol) {
        container = (Container) instanciateElement(varContBean);
        // container.setParentId(varBean.getParentid());
        // set scripts, intervals, services, attributes
        populateContainerDynamics(con, container);
        // Attributes...
        // populateAttributes(attributeMap, container,
        // container.getId());
        // Put the container into the containers collection
        // allContainersAndVariables.add(container);

        // if we have more than one container with the same id will only
        // the one read last be present in containers, overrideing in
        // other documents will work :)
        containers.put(container.getId(), container);
      }
      // add all Containers to containersAndVariables
      // allContainersAndVariables.addAll();
      // VarvarFinder.findbydo //find out how to get vars...
View Full Code Here

  // Map<String, Collection<VarattributeBean>> attributeMap,
  // Collection<? extends VarBean> col) {
  private void getAllContainerElements(Connection con,
      Collection<? extends VarBean> col) {

    Container container;
    for (VarBean varBean : col) {
      container = (Container) instanciateElement(varBean);
      // container.setParentId(varBean.getParentid());
      // set scripts, intervals, services, attributes
      populateContainerDynamics(con, container);
View Full Code Here

    // containers.put(container.getId(), (Container) container);
    // }
    // }
    //loop all containers and add them to their parent, (at the right position)
    for (String containerId : containers.keySet()) {
      Container container = containers.get(containerId);
      // TODO: for each container just get its parent from containers and
      // add it to the right place (see code in getContainers)
//      container.setElements(getContainers(container.getAutoId()));

      if (null != container.getParentId()) {
        //using parentd as they are stored against that to eliminate duplicates
        containers
            .get(container.getParentId())
            .setElementOnPosition(container, container.getOrderNo());
      }
     
      //add all vars to the current container
      try {
        //using autoid to get right one for this container
        Collection<VarvarBean> varBeanCol = VarvarFinder.findByParentautoid(con, container.getAutoId());
        for(VarvarBean varBean : varBeanCol) {
          // Populate (make an instance) of the element
          StandardVariable variable = (StandardVariable) instanciateElement(varBean);
          // Set the row name
          // variable.setParentId(varBean.getParentid());
          variable.setDataId(varBean.getDataid());
          // Set the help text ID, and description ID
          //TODO: read text based on what
          variable.setHelpTextID(variable.getId() + "_H");
          variable.setDescriptionID(variable.getId() + "_D");

          // set scripts, intervals, services, attributes
          populateDynamics(con, variable);
          //todo: add variable to container..... sdflkasjf
          container.setElementOnPosition(variable, variable.getOrderNo());
         
        }
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.openqreg.element.Container

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.