Package org.apache.jackrabbit.util.name

Examples of org.apache.jackrabbit.util.name.NamespaceMapping


    private static final QName[] REQUIRED_NODE_TYPES = new QName[]{REQUIRED_NODE_TYPE_1, REQUIRED_NODE_TYPE_2};

    private NodeTypeDef modelNodeTypeDef;

    protected void setUp() throws Exception {
        NamespaceMapping namespaceMapping = new NamespaceMapping();
        namespaceMapping.setMapping(NS_PREFIX, NS_URI);
        InternalValue dv1 = InternalValue.create(DEFAULT_VALUE_1);
        InternalValue dv2 = InternalValue.create(DEFAULT_VALUE_2);
        ValueConstraint vc = ValueConstraint.create(PropertyType.LONG, VALUE_CONSTRAINT, namespaceMapping);
        InternalValue[] defaultValues = new InternalValue[]{dv1, dv2};
        ValueConstraint[] valueConstraints = new ValueConstraint[]{vc};
View Full Code Here


    public void testCompactNodeTypeDef() throws Exception {

        // Read in node type def from test file
        CompactNodeTypeDefReader cndReader = new CompactNodeTypeDefReader(new FileReader(TEST_FILE), TEST_FILE);
        List ntdList = cndReader.getNodeTypeDefs();
        NamespaceMapping nsm = cndReader.getNamespaceMapping();
        NodeTypeDef ntd = (NodeTypeDef)ntdList.get(0);

        // Test CND Reader by comparing imported NTD with model NTD.
        NodeTypeDefDiff diff = NodeTypeDefDiff.create(modelNodeTypeDef, ntd);
        if (diff.isModified()){
View Full Code Here

            if (contentType.equalsIgnoreCase(JackrabbitNodeTypeManager.TEXT_XML)
                    || contentType.equalsIgnoreCase(APPLICATION_XML)) {
                return registerNodeTypes(new InputSource(in));
            } else if (contentType.equalsIgnoreCase(
                    JackrabbitNodeTypeManager.TEXT_X_JCR_CND)) {
                NamespaceMapping mapping = new NamespaceMapping(nsResolver);
                CompactNodeTypeDefReader reader = new CompactNodeTypeDefReader(
                        new InputStreamReader(in), "cnd input stream", mapping);
                return registerNodeTypes(reader.getNodeTypeDefs());
            } else {
                throw new UnsupportedOperationException(
View Full Code Here

     *
     * @param r
     * @throws ParseException
     */
    public CompactNodeTypeDefReader(Reader r, String systemId) throws ParseException {
        this(r, systemId, new NamespaceMapping());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.util.name.NamespaceMapping

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.