Examples of CaoWritableElement


Examples of de.mhus.lib.cao.CaoWritableElement

          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);
           
            Property priv = child.getProperty("rep:privileges");
            if (priv.isMultiple()) {
              StringBuffer sb = new StringBuffer();
              for (Value val : priv.getValues()) {
                sb.append("[").append(val.getString()).append("]");
              }
              pw.setString(RULE,sb.toString());               
            } else {
              pw.setString(RULE,priv.getString());
            }
            pw.save();

            list.add(p);
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.