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

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


        // 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();
        CMSObject child21 = new CMSObjectBuilder(PX_O_21).build();
        CMSObject child13 = new CMSObjectBuilder(PX_O_13).build();
View Full Code Here


     * @Test public void testGetAllowableTypeDef() {}
     */
    @Test
    public void testGetContainerObject() throws RepositoryAccessException {
        CMSObject root = (CMSObject) repository.get(0);
        Property p = root.getProperty().get(0);
        CMSObject real = offlineAccess.getContainerObject(p, null);
        assertSame(root, real);

        expectedException.expect(IllegalArgumentException.class);
        offlineAccess.getContainerObject(p, new Object());
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

    }

    public static Property getProperty(CMSObject node,
                                       org.apache.chemistry.opencmis.client.api.Property<?> cmisProperty) {
        Property property = new Property();
        property.setLocalname(cmisProperty.getLocalName());
        // property.setType(convertPropertyType(cmisProperty.getType()));
        property.setContainerObjectRef(node.getUniqueRef());
        property.setSourceObjectTypeRef(node.getObjectTypeRef());
        property.setPropertyDefinition(getPropertyDefinition(cmisProperty.getDefinition()));
        if (cmisProperty.getValues() != null) {
            for (Object value : cmisProperty.getValues()) {
                if (value == null) {
                    continue;
                }
                if (cmisProperty.getType() == PropertyType.DATETIME) {
                    Calendar cal = (Calendar) value;
                    property.getValue().add(XML_DATETIME_FORMAT.format(cal.getTime()));
                } else {
                    property.getValue().add(value.toString());
                }
            }
        }
        return property;
    }
View Full Code Here

        // 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();
        CMSObject child21 = new CMSObjectBuilder(PX_O_21).build();
        CMSObject child13 = new CMSObjectBuilder(PX_O_13).build();
View Full Code Here

     * @Test public void testGetAllowableTypeDef() {}
     */
    @Test
    public void testGetContainerObject() throws RepositoryAccessException {
        CMSObject root = (CMSObject) repository.get(0);
        Property p = root.getProperty().get(0);
        CMSObject real = offlineAccess.getContainerObject(p, null);
        assertSame(root, real);

        expectedException.expect(IllegalArgumentException.class);
        offlineAccess.getContainerObject(p, new Object());
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.Property

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.