Examples of ExtendedPropertyDefinition


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

            return true;
        }
        try {
            if (getPropertiesIterator().hasNext()) {
                Property property = getPropertiesIterator().nextProperty();
                ExtendedPropertyDefinition epd = node.getApplicablePropertyDefinition(property.getName());
                tempNext = new JCRPropertyWrapperImpl(node, property, node.getSession(), node.getProvider(), epd);
                return true;
            } else {
                do {
                    Property property = getI18NPropertyIterator().nextProperty();
                    final String name = property.getName();
                    final ExtendedPropertyDefinition def = node.getApplicablePropertyDefinition(name);
                    if (def!=null && def.isInternationalized()) {
                        tempNext = new JCRPropertyWrapperImpl(node, property, node.getSession(), node.getProvider(), def, name);
                        return true;
                    }
                } while (true);
            }
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public JCRPropertyWrapper getProperty(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException {
        ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
        if (epd != null) {
            if ((epd.getRequiredType() == PropertyType.WEAKREFERENCE) ||
                    (epd.getRequiredType() == PropertyType.REFERENCE)) {
                if (isNodeType(Constants.JAHIAMIX_EXTERNALREFERENCE)) {
                    return retrieveExternalReferenceProperty(name, epd);
                }
            }
            return internalGetProperty(name, epd);
View Full Code Here

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

        checkLock();
        hasPropertyCache.remove(name);

        name = ensurePrefixedName(name);
        final Locale locale = getSession().getLocale();
        ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
        if (epd == null) {
            throw new ConstraintViolationException("Couldn't find definition for property " + name);
        }

        if (value != null && PropertyType.UNDEFINED != epd.getRequiredType() && value.getType() != epd.getRequiredType()) {
            // if the type doesn't match the required type, we attempt a conversion.
            value = getSession().getValueFactory().createValue(value.getString(), epd.getRequiredType());
        }
        value = JCRStoreService.getInstance().getInterceptorChain().beforeSetValue(this, name, epd, value);

        if (value instanceof ExternalReferenceValue) {
            String nodeIdentifier = value.getString();
            JCRNodeWrapper node = getSession().getNodeByIdentifier(nodeIdentifier);
            return setExternalReferenceProperty(name, node, epd);
        }

        if (locale != null) {
            if (epd != null && epd.isInternationalized()) {
                return new JCRPropertyWrapperImpl(this, getOrCreateI18N(locale).setProperty(name, value), session, provider, epd, name);
            }
        }

        if (value == null) {
View Full Code Here

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

        checkLock();
        hasPropertyCache.remove(name);

        final Locale locale = getSession().getLocale();
        name = ensurePrefixedName(name);
        ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
        if (epd == null) {
            throw new ConstraintViolationException("Couldn't find definition for property " + name);
        }
        value = JCRStoreService.getInstance().getInterceptorChain().beforeSetValue(this, name, epd, value);

        if (value instanceof ExternalReferenceValue) {
            String nodeIdentifier = value.getString();
            JCRNodeWrapper node = getSession().getNodeByIdentifier(nodeIdentifier);
            return setExternalReferenceProperty(name, node, epd);
        }

        if (locale != null) {
            if (epd != null && epd.isInternationalized()) {
                return new JCRPropertyWrapperImpl(this, getOrCreateI18N(locale).setProperty(name, value, type), session, provider, epd, name);
            }
        }

        if (value == null) {
View Full Code Here

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

    public JCRPropertyWrapper setProperty(String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
        checkLock();
        hasPropertyCache.remove(name);
        final Locale locale = getSession().getLocale();
        name = ensurePrefixedName(name);
        ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
        if (epd == null) {
            throw new ConstraintViolationException("Couldn't find definition for property " + name);
        }

        if (values != null) {
            for (int i = 0; i < values.length; i++) {
                if (values[i] != null && PropertyType.UNDEFINED != epd.getRequiredType() && values[i].getType() != epd.getRequiredType()) {
                    values[i] = getSession().getValueFactory()
                            .createValue(values[i].getString(), epd.getRequiredType());
                }
            }
        }

        values = JCRStoreService.getInstance().getInterceptorChain().beforeSetValues(this, name, epd, values);

        if (locale != null) {
            if (epd != null && epd.isInternationalized()) {
                return new JCRPropertyWrapperImpl(this, getOrCreateI18N(locale).setProperty(name, values), session, provider, epd, name);
            }
        }

        return new JCRPropertyWrapperImpl(this, objectNode.setProperty(name, values), session, provider, epd);
View Full Code Here

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

     */
    public JCRPropertyWrapper setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
        final Locale locale = getSession().getLocale();
        hasPropertyCache.remove(name);
        name = ensurePrefixedName(name);
        ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
        if (epd == null) {
            throw new ConstraintViolationException("Couldn't find definition for property " + name);
        }

        values = JCRStoreService.getInstance().getInterceptorChain().beforeSetValues(this, name, epd, values);

        if (locale != null) {
            if (epd != null && epd.isInternationalized()) {
                return new JCRPropertyWrapperImpl(this, getOrCreateI18N(locale).setProperty(name, values, type), session, provider, epd, name);
            }
        }

        return new JCRPropertyWrapperImpl(this, objectNode.setProperty(name, values, type), session, provider, epd);
View Full Code Here

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

        Value v = null;
        if (value != null) {
            if (value instanceof JCRNodeWrapper) {
                value = ((JCRNodeWrapper) value).getRealNode();
            }
            ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
            if (epd != null) {
                if (value.getClass().getName().equals(getRealNode().getClass().getName())) {
                    v = getSession().getValueFactory().createValue(value, epd.getRequiredType() == PropertyType.WEAKREFERENCE);
                } else {
                    return setExternalReferenceProperty(name, value, epd);

                }
            }
View Full Code Here

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

    private boolean internalHasProperty(String propertyName) throws RepositoryException {
        final Locale locale = getSession().getLocale();
        if (locale != null && !propertyName.equals("jcr:language")) {
            try {
                ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(propertyName);
                if (epd != null && epd.isInternationalized()) {
                    if (hasI18N(locale, true)) {
                        final Node localizedNode = getI18N(locale);
                        return localizedNode.hasProperty(propertyName);
                    }
                }
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public ExtendedPropertyDefinition getApplicablePropertyDefinition(String propertyName)
            throws RepositoryException {
        ExtendedPropertyDefinition result = null;
        if (applicablePropertyDefinition.containsKey(propertyName)) {
            result = applicablePropertyDefinition.get(propertyName);
            return result;
        }

View Full Code Here

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

                    foundPropertyName = curPropertyName;
                    break;
                }
            }
            if (foundPropertyName != null) {
                ExtendedPropertyDefinition epd = node.getApplicablePropertyDefinition(foundPropertyName);
                if (epd != null)  {
                    Property nodeProperty = new ExternalReferencePropertyImpl(foundPropertyName, node, session, getIdentifier(), this);
                    matchingProperties.add(new JCRPropertyWrapperImpl(this, nodeProperty, session, provider, epd));
                }
            } else {
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.