Package de.mhus.lib.cao.util

Examples of de.mhus.lib.cao.util.MutableElement


    try {
      if (CaoDriver.TREE_DEFAULT.equals(name)) {
        Node node = ((JackConnection) getConnection()).getSession()
            .getRootNode();
        MutableElement ele = new MutableElement(this);
        ele.setName("Content");
        LinkedList<CaoElement> list = new LinkedList<CaoElement>();
        list.add(new JackRootElement(this, node, node.getSession()
            .getWorkspace().getName(), attributes));
        ele.setChildren(new LinkedCaoList(ele, list));
       
        return  ele;
      }
    } catch (Exception e) {
      throw new CaoException(e);
View Full Code Here


    try {
      if (CaoDriver.TREE_DEFAULT.equals(name)) {
        Node node = ((JackConnection) getConnection()).getSession()
            .getRootNode();
        MutableElement ele = new MutableElement(this);
        ele.setName("Content");
        LinkedList<CaoElement> list = new LinkedList<CaoElement>();
        list.add(new JackRootElement(this, node, node.getSession()
            .getWorkspace().getName(), attributes));
        ele.setChildren(new LinkedCaoList(ele, list));
       
        return  ele;
      }
    } catch (Exception e) {
      throw new CaoException(e);
View Full Code Here

    }

    @Override
    protected CaoElement nextElement() throws CaoException {
      // return new JackElement(list.getApplication(),rows.nextRow(),null);
      MutableElement out = new MutableElement(list.getApplication());
      out.setMetadata(list.meta);
      Row row = rows.nextRow();
      for (CaoMetaDefinition m : list.meta) {
        try {
          out.setString(m.getName(), row.getValue(m.getName()).getString());
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
      return out;
View Full Code Here

      Node nPolicy = ((JackElement)element).getNode().getNode("rep:policy");
      if (nPolicy != null) {
        for (NodeIterator ni = nPolicy.getNodes();ni.hasNext();) {
          Node child = (Node) ni.next();
          if ("rep:GrantACE".equals(child.getPrimaryNodeType().getName())) {
            MutableElement p = new MutableElement(this);
            p.getMetaDefinitions().add(new CaoMetaDefinition(p.getMetadata(), CaoPolicy.PRINCIPAL, TYPE.ELEMENT, null, 0));
            p.getMetaDefinitions().add(new CaoMetaDefinition(p.getMetadata(), RULE, TYPE.STRING, null, 256,CaoPolicy.CATEGORY_RIGHT));
           
            CaoWritableElement pw = p.getWritableNode();
            String principal = child.getProperty("rep:principalName").getString();
            if (child.hasProperty("rep:glob"))
              principal+= " at " + child.getProperty("rep:glob").getString();
            pw.setString(CaoPolicy.PRINCIPAL,principal);
           
View Full Code Here

  @Override
  public CaoElement queryElement(String name, CaoAccess access,
      String... attributes) throws CaoException {
   
    if (CaoDriver.AUTO_COMPLEATION.equals(name)) {
      MutableElement out = new MutableElement(this);
      LinkedList<CaoElement> labels = new LinkedList<CaoElement>();
      Map<String, Object> map = manager.getNameMapping();
      for (String str : map.keySet()) {
        MutableElement label = new MutableElement(out);
        try {
          label.setString(CaoDriver.AUTO_COMPLETION_NAME, "$" + str + "$");
        } catch (MException e) {}  // should not happen in this case
        labels.add(label);
      }
      out.setObject(CaoDriver.AUTO_COMPLETION_LABELS, labels);
      return out;
View Full Code Here

    }

    @Override
    protected CaoElement nextElement() throws CaoException {
      if (!hasNext) throw new CaoException("no more elements");
      MutableElement element = new MutableElement(getApplication());
      element.setMetadata(queryList.meta);
      try {
        for (CaoMetaDefinition m : queryList.meta) {
          element.setString(m.getName(), res.getString(m.getName()));
        }
       
        hasNext = res.next();
      } catch (Exception e) {
        throw new CaoException(e);
View Full Code Here

TOP

Related Classes of de.mhus.lib.cao.util.MutableElement

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.