Package org.modeshape.web.shared

Examples of org.modeshape.web.shared.JcrProperty


            names.addAll(Arrays.asList(defs));
        }

        ArrayList<JcrProperty> list = new ArrayList<>();
        for (PropertyDefinition def :  names) {
            JcrProperty prop = null;
           
            String name = def.getName();
            String type = PropertyType.nameFromValue(def.getRequiredType());
            String value = null;
            String display = null;
           
            Property p = null;
            try {
                p = node.getProperty(def.getName());
            } catch (PathNotFoundException e) {
            }
           
            display = values(def, p)
           
            switch (def.getRequiredType()) {
                case PropertyType.BINARY:
                    HttpServletRequest request = this.getThreadLocalRequest();
                    String context = request.getContextPath();
                    value = String.format("%s/binary/node?repository=%s&workspace=%s&path=%s&property=%s",
                            context, repository, workspace, path, def.getName());
                    break;
                default:
                    value = p == null ? "N/A" : p.getValue() != null ? p.getValue().getString() : "N/A";
                    break;
            }
           
            list.add(new JcrProperty(name, type, value, display));
        }
        return list;
    }   
View Full Code Here

TOP

Related Classes of org.modeshape.web.shared.JcrProperty

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.