Package org.apache.stanbol.cmsadapter.servicesapi.model.web

Examples of org.apache.stanbol.cmsadapter.servicesapi.model.web.PropertyDefinition


    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        // initialize a dummy repository
        repository = new ArrayList<Object>();
        PropertyDefinition pd1 = new PropertyDefinitionBuilder(PX_PD_1).build();
        PropertyDefinition pd2 = new PropertyDefinitionBuilder(PX_PD_2).build();
        PropertyDefinition pd3 = new PropertyDefinitionBuilder(PX_PD_3).build();
        Property p1 = new PropertyBuilder(PX_P_1).propertyDefinition(pd1).build();
        Property p2 = new PropertyBuilder(PX_P_2).propertyDefinition(pd2).build();
        CMSObject root = new CMSObjectBuilder(PX_ROOT).build();
        CMSObject child11 = new CMSObjectBuilder(PX_O_11).build();
        CMSObject child12 = new CMSObjectBuilder(PX_O_12).build();
View Full Code Here


    }

    @Test
    public void testGetPropertyDefinition() throws RepositoryAccessException {
        CMSObject root = (CMSObject) repository.get(0);
        PropertyDefinition expected = (PropertyDefinition) repository.get(8);
        Property p = root.getProperty().get(0);
        PropertyDefinition propDef = offlineAccess.getPropertyDefinition(p, null);
        assertSame(expected, propDef);

    }
View Full Code Here

        }
        return property;
    }

    public static PropertyDefinition getPropertyDefinition(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> type) {
        PropertyDefinition propDef = new PropertyDefinition();
        propDef.setUniqueRef(type.getId());
        String[] names = separateNamespace(type.getLocalName());
        propDef.setLocalname(names[0]);
        propDef.setNamespace(names[1]);
        propDef.setRequired(type.isRequired());
        // TODO Set cardinality
        propDef.setPropertyType(convertPropertyType(type.getPropertyType()));
        return propDef;
    }
View Full Code Here

        propDef.setPropertyType(convertPropertyType(type.getPropertyType()));
        return propDef;
    }

    public static PropertyDefinition getRelationshipType(RelationshipType relType) {
        PropertyDefinition propDef = new PropertyDefinition();
        propDef.setUniqueRef(relType.getId());
        propDef.setLocalname(relType.getLocalName());
        propDef.setNamespace(relType.getLocalNamespace());
        // TODO Set cardinality
        propDef.setPropertyType(PropType.REFERENCE);
        return propDef;
    }
View Full Code Here

        return propertyDefinition;
    }

    private DPropertyDefinition getPropertyDefinitionOnline() throws RepositoryAccessException {
        PropertyDefinition propDef = access.getPropertyDefinition(instance, factory.getSession());
        return factory.wrapAsDPropertyDefinition(propDef);
    }
View Full Code Here

    @BeforeClass
    public static void setUpBeforeClass() throws Exception {
        // initialize a dummy repository
        repository = new ArrayList<Object>();
        PropertyDefinition pd1 = new PropertyDefinitionBuilder(PX_PD_1).build();
        PropertyDefinition pd2 = new PropertyDefinitionBuilder(PX_PD_2).build();
        PropertyDefinition pd3 = new PropertyDefinitionBuilder(PX_PD_3).build();
        Property p1 = new PropertyBuilder(PX_P_1).propertyDefinition(pd1).build();
        Property p2 = new PropertyBuilder(PX_P_2).propertyDefinition(pd2).build();
        CMSObject root = new CMSObjectBuilder(PX_ROOT).build();
        CMSObject child11 = new CMSObjectBuilder(PX_O_11).build();
        CMSObject child12 = new CMSObjectBuilder(PX_O_12).build();
View Full Code Here

    }

    @Test
    public void testGetPropertyDefinition() throws RepositoryAccessException {
        CMSObject root = (CMSObject) repository.get(0);
        PropertyDefinition expected = (PropertyDefinition) repository.get(8);
        Property p = root.getProperty().get(0);
        PropertyDefinition propDef = offlineAccess.getPropertyDefinition(p, null);
        assertSame(expected, propDef);

    }
View Full Code Here

TOP

Related Classes of org.apache.stanbol.cmsadapter.servicesapi.model.web.PropertyDefinition

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.