Package org.jahia.services.content.nodetypes

Examples of org.jahia.services.content.nodetypes.ValueImpl


        } catch (RepositoryException e) {
            logger.error(e.getMessage(), e);
            return Collections.emptyList();
        }
        for (ExtendedPropertyDefinition propertyDef : propertyDefs) {
            choiceListValues.add(new ChoiceListValue(propertyDef.getLabel(locale), null, new ValueImpl(
                    propertyDef.getName(), PropertyType.STRING, false)));
        }
        Collections.sort(choiceListValues);
        return choiceListValues;
    }
View Full Code Here


         * @return the value
         * @throws javax.jcr.ValueFormatException if the property is multi-valued.
         * @throws javax.jcr.RepositoryException  if another error occurs.
         */
        public Value getValue() throws ValueFormatException, RepositoryException {
            return new ValueImpl(value.toString(), PropertyType.STRING);
        }
View Full Code Here

        Calendar time = new GregorianCalendar();
        if (offset != 0) {
            time.setTimeInMillis(time.getTimeInMillis() + offset);
        }
       
        return new Value[] { new ValueImpl(ISO8601.format(time), PropertyType.DATE, false) };       
    }
View Full Code Here

        if (values == null || values.size() == 0) {
            List<ChoiceListValue> l = new ArrayList<ChoiceListValue>();
            String[] constr = epd.getValueConstraints();
            for (String s : constr) {
                ChoiceListValue bean = new ChoiceListValue(rb.get(epd.getResourceBundleKey() + "." + s.replace(':', '_'), s), new HashMap<String, Object>(),
                                                           new ValueImpl(s, PropertyType.STRING, false));

                l.add(bean);
            }
            return l;
        } else {
View Full Code Here

                    "select * from [" + nodetype + "] as n where isdescendantnode(n,['" +site.getPath()+"'])", Query.JCR_SQL2).execute();
            final NodeIterator ni = result.getNodes();
            while (ni.hasNext()) {
                JCRNodeWrapperImpl nodeWrapper = (JCRNodeWrapperImpl) ni.nextNode();
                String displayName = nodeWrapper.getDisplayableName();
                set.add(new ChoiceListValue(displayName, new HashMap<String, Object>(), new ValueImpl(
                        nodeWrapper.getIdentifier(), PropertyType.STRING, false)));
            }

        } catch (Exception e) {
            logger.error(e.getMessage(), e);
View Full Code Here

            return Collections.emptyList();
        }

        List<ChoiceListValue> vs = new LinkedList<ChoiceListValue>();
        for (ExtendedPropertyDefinition propertyDef : propertyDefs) {
            vs.add(new ChoiceListValue(propertyDef.getLabel(locale), null, new ValueImpl(
                    propertyDef.getName(), PropertyType.STRING, false)));
        }
        if(commonChildNodeDefinitions!=null && commonChildNodeDefinitions.getReferencedDefs()!=null && commonChildNodeDefinitions.getReferencedDefs().size()>0) {
            Map<String, Map<ExtendedPropertyDefinition, Map<String, ExtendedPropertyDefinition>>> referencedDefs = commonChildNodeDefinitions.getReferencedDefs();
            for (Map.Entry<String, Map<ExtendedPropertyDefinition, Map<String, ExtendedPropertyDefinition>>> entry : referencedDefs.entrySet()) {
                for (Map.Entry<ExtendedPropertyDefinition, Map<String, ExtendedPropertyDefinition>> s : entry.getValue().entrySet()) {
                    for (ExtendedPropertyDefinition propertyDefinition : s.getValue().values()) {
                        vs.add(new ChoiceListValue(s.getKey().getLabel(locale)+"->"+propertyDefinition.getLabel(locale),null,new ValueImpl(
                                s.getKey().getName()+";"+propertyDefinition.getName(),PropertyType.STRING,false)));
                    }
                }
            }
        }
View Full Code Here

                                        }
                                    }
                                    value = baseType != null ? mapping.getMappedPropertyValue(
                                            baseType, localName, value) : value;
                                    if (constraints.isEmpty() || constraints.contains(value)) {
                                        values.add(new ValueImpl(string, propertyDefinition
                                                .getRequiredType()));
                                    }
                                }
                                ;
                                n.setProperty(propertyName,
View Full Code Here

                                                     Map<String, Object> context) {
        Map<String, Action> map = templateService.getActions();
        List<ChoiceListValue> vs = new ArrayList<ChoiceListValue>();
        for (Map.Entry<String, String> action : actionsMap.entrySet()) {
            if (map.containsKey(action.getValue()) || action.getKey().equals("default")) {
                vs.add(new ChoiceListValue(action.getKey(), new HashMap<String, Object>(), new ValueImpl(
                        action.getValue(), PropertyType.STRING, false)));
            }
        }
        return vs;
    }
View Full Code Here

                if (!map.containsKey(subInitializer)) {
                    valid = false;
                }
            }
            if (valid) {
                vs.add(new ChoiceListValue(initializer.getKey(), new HashMap<String, Object>(), new ValueImpl(
                        initializer.getValue(), PropertyType.STRING, false)));
            }
        }
        return vs;
    }
View Full Code Here

TOP

Related Classes of org.jahia.services.content.nodetypes.ValueImpl

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.