Package org.jahia.services.content.nodetypes

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


        try {
            List<WorkflowDefinition> defs = workflowService.getWorkflows(locale);

            for (WorkflowDefinition def : defs) {
                choiceListValues.add(new ChoiceListValue(def.getName(), new HashMap<String, Object>(),
                        new ValueImpl(def.getProvider() + ":" + def.getKey(), PropertyType.STRING, false)));
            }
        } catch (RepositoryException e) {
            e.printStackTrace();
        }
        return choiceListValues;
View Full Code Here


                if (tagNode == null && createTagIfNotExists) {
                    tagNode = createTag(t, siteKey, session);
                    doSessionCommit = true;
                }
                if (tagNode != null) {
                    Value[] newValues = new Value[]{new ValueImpl(tagNode.getIdentifier(), PropertyType.WEAKREFERENCE)};
                    Value[] values = null;
                    boolean exists = false;
                    if (node.hasProperty(TAGS)) {
                        values = node.getProperty(TAGS).getValues();
                        for (Value existingValue : values) {
View Full Code Here

                }
                JahiaResourceBundle rb = new JahiaResourceBundle(null, locale, view.getModule().getName());

                String displayName = rb.get(declaringPropertyDefinition.getResourceBundleKey() + "." + view.getKey().replace(':', '_'),
                        view.getKey());
                ChoiceListValue c =  new ChoiceListValue(displayName, map, new ValueImpl(view.getKey(), PropertyType.STRING, false));
                try {

                    final File imagePath = new File(
                            view.getModule().getFilePath() + File.separator + "img" + File.separator + c.getValue().getString() + ".png");
                    if (imagePath.exists()) {
View Full Code Here

        try {
            ExtendedNodeType nodeType = NodeTypeRegistry.getInstance().getNodeType(param);
            NodeTypeIterator nti = nodeType.getSubtypes();
            while (nti.hasNext()) {
                ExtendedNodeType type = (ExtendedNodeType) nti.next();
                listValues.add(new ChoiceListValue(type.getLabel(locale),new HashMap<String, Object>(), new ValueImpl(
                                type.getName(), PropertyType.STRING, false)));
            }
        } catch (NoSuchNodeTypeException e) {
            logger.error("Cannot get type",e);
        }
View Full Code Here

                ExtendedNodeType nodeType = NodeTypeRegistry.getInstance()
                        .getNodeType(nodeTypeName);
                if (!isExcludedType(nodeType, excludedTypes)) {
                    listValues.add(new ChoiceListValue(nodeType
                            .getLabel(locale), new HashMap<String, Object>(),
                            new ValueImpl(nodeType.getName(),
                                    PropertyType.STRING, false)));
                }
                NodeTypeIterator nti = nodeType.getSubtypes();
                while (nti.hasNext()) {
                    ExtendedNodeType type = (ExtendedNodeType) nti.next();
                    if (!isExcludedType(type, excludedTypes)) {
                        listValues.add(new ChoiceListValue(type
                                .getLabel(locale),
                                new HashMap<String, Object>(), new ValueImpl(
                                        type.getName(), PropertyType.STRING,
                                        false)));
                    }
                }
            }
View Full Code Here

                                                     List<ChoiceListValue> values, Locale locale, Map<String, Object> context) {
        String[] iso = Locale.getISOCountries();
        List<ChoiceListValue> l = new ArrayList<ChoiceListValue>(iso.length);
        for (String anIso : iso) {
            l.add(new ChoiceListValue(new Locale("en", anIso).getDisplayCountry(locale), null,
                                      new ValueImpl(anIso, PropertyType.STRING, false)));
        }
        Collections.sort(l);
        return l;
    }
View Full Code Here

                }
                name = name.trim();
                if (name.equals("")) {
                    name = node.getName();
                }
                vs.add(new ChoiceListValue(name, new HashMap<String,Object>(), new ValueImpl(node.getUUID(), PropertyType.WEAKREFERENCE, false)));
            }
        } catch (RepositoryException e) {
            e.printStackTrace();
        }
        return vs;
View Full Code Here

* Date: Dec 30, 2008
* Time: 5:35:31 PM
*/
public class CurrentUser implements ValueInitializer {
    public Value[] getValues(ExtendedPropertyDefinition declaringPropertyDefinition, List<String> params) {
        return new Value[] { new ValueImpl(JCRSessionFactory.getInstance().getCurrentUser().getUsername(), PropertyType.STRING, false) };
    }
View Full Code Here

        final NodeIterator nodeIterator = node.getNodes();
        while (nodeIterator.hasNext()) {
            JCRNodeWrapper nodeWrapper = (JCRNodeWrapper) nodeIterator.next();
            if (nodeWrapper.isNodeType(nodetype)) {
                String displayName = nodeWrapper.getDisplayableName();
                listValues.add(new ChoiceListValue(displayName, new HashMap<String, Object>(), new ValueImpl(
                        nodeWrapper.getIdentifier(), PropertyType.STRING, false)));
                if (subTree) {
                    addSubnodes(listValues, nodetype, nodeWrapper, subTree);
                }
            }
View Full Code Here

    public List<ChoiceListValue> getChoiceListValues(ExtendedPropertyDefinition epd, String param, List<ChoiceListValue> values, Locale locale,
                                                     Map<String, Object> context) {
        final Map<String, BackgroundAction> map = templateManagerService.getBackgroundActions();
        List<ChoiceListValue> choiceListValues = new ArrayList<ChoiceListValue>();
        for (String s : map.keySet()) {
            choiceListValues.add(new ChoiceListValue(s,new HashMap<String, Object>(), new ValueImpl(s, PropertyType.STRING)));
        }
        return choiceListValues;
    }
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.