Examples of PropertyDefinitionTemplate


Examples of org.jboss.dna.jcr.nodetype.PropertyDefinitionTemplate

        NodeDefinitionTemplate childNodeA = new JcrNodeDefinitionTemplate(this.context);
        childNodeA.setName("nodeA");
        childNodeA.setOnParentVersion(OnParentVersionAction.IGNORE);
        mixinTypeA.getNodeDefinitionTemplates().add(childNodeA);

        PropertyDefinitionTemplate propertyA = new JcrPropertyDefinitionTemplate(this.context);
        propertyA.setName("propertyA");
        propertyA.setOnParentVersion(OnParentVersionAction.IGNORE);
        propertyA.setRequiredType(PropertyType.STRING);
        mixinTypeA.getPropertyDefinitionTemplates().add(propertyA);

        NodeTypeTemplate mixinTypeB = new JcrNodeTypeTemplate(this.context);
        mixinTypeB.setName("mixinTypeB");
        mixinTypeB.setMixin(true);

        NodeDefinitionTemplate childNodeB = new JcrNodeDefinitionTemplate(this.context);
        childNodeB.setName("nodeB");
        childNodeB.setDefaultPrimaryType("nt:base");
        childNodeB.setOnParentVersion(OnParentVersionAction.IGNORE);
        mixinTypeB.getNodeDefinitionTemplates().add(childNodeB);

        PropertyDefinitionTemplate propertyB = new JcrPropertyDefinitionTemplate(this.context);
        propertyB.setName("propertyB");
        propertyB.setOnParentVersion(OnParentVersionAction.IGNORE);
        propertyB.setRequiredType(PropertyType.BINARY);
        mixinTypeB.getPropertyDefinitionTemplates().add(propertyB);

        NodeTypeTemplate mixinTypeC = new JcrNodeTypeTemplate(this.context);
        mixinTypeC.setName("mixinTypeC");
        mixinTypeC.setMixin(true);

        childNodeA = new JcrNodeDefinitionTemplate(this.context);
        childNodeA.setName("nodeA");
        childNodeA.setOnParentVersion(OnParentVersionAction.IGNORE);
        mixinTypeC.getNodeDefinitionTemplates().add(childNodeA);

        propertyB = new JcrPropertyDefinitionTemplate(this.context);
        propertyB.setName("propertyB");
        propertyB.setOnParentVersion(OnParentVersionAction.IGNORE);
        propertyB.setRequiredType(PropertyType.STRING);
        mixinTypeC.getPropertyDefinitionTemplates().add(propertyB);

        NodeTypeTemplate mixinTypeWithAutoChild = new JcrNodeTypeTemplate(this.context);
        mixinTypeWithAutoChild.setName("mixinTypeWithAutoCreatedChildNode");
        mixinTypeWithAutoChild.setMixin(true);

        childNodeB = new JcrNodeDefinitionTemplate(this.context);
        childNodeB.setName("nodeB");
        childNodeB.setOnParentVersion(OnParentVersionAction.IGNORE);
        childNodeB.setMandatory(true);
        childNodeB.setAutoCreated(true);
        childNodeB.setDefaultPrimaryType("nt:unstructured");
        childNodeB.setRequiredPrimaryTypes(new String[] {"nt:unstructured"});
        mixinTypeWithAutoChild.getNodeDefinitionTemplates().add(childNodeB);

        NodeTypeTemplate mixinTypeWithAutoProperty = new JcrNodeTypeTemplate(this.context);
        mixinTypeWithAutoProperty.setName("mixinTypeWithAutoCreatedProperty");
        mixinTypeWithAutoProperty.setMixin(true);

        propertyB = new JcrPropertyDefinitionTemplate(this.context);
        propertyB.setName("propertyB");
        propertyB.setMandatory(true);
        propertyB.setAutoCreated(true);
        propertyB.setOnParentVersion(OnParentVersionAction.IGNORE);
        propertyB.setRequiredType(PropertyType.LONG);
        propertyB.setDefaultValues(new String[] {"10"});
        mixinTypeWithAutoProperty.getPropertyDefinitionTemplates().add(propertyB);

        NodeTypeTemplate primaryTypeA = new JcrNodeTypeTemplate(this.context);
        primaryTypeA.setName("primaryTypeA");
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.