Package org.apache.chemistry.opencmis.commons.impl.dataobjects

Examples of org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl


    public static RepositoryInfo convert(CmisRepositoryInfoType repositoryInfo) {
        if (repositoryInfo == null) {
            return null;
        }

        RepositoryInfoImpl result = new RepositoryInfoImpl();

        result.setAclCapabilities(convert(repositoryInfo.getAclCapability()));
        result.setChangesIncomplete(repositoryInfo.isChangesIncomplete());
        List<BaseTypeId> baseObjectTypeIds = new ArrayList<BaseTypeId>();
        for (EnumBaseObjectTypeIds bot : repositoryInfo.getChangesOnType()) {
            baseObjectTypeIds.add(convert(BaseTypeId.class, bot));
        }
        result.setChangesOnType(baseObjectTypeIds);
        result.setCmisVersionSupported(repositoryInfo.getCmisVersionSupported());
        result.setLatestChangeLogToken(repositoryInfo.getLatestChangeLogToken());
        result.setPrincipalAnonymous(repositoryInfo.getPrincipalAnonymous());
        result.setPrincipalAnyone(repositoryInfo.getPrincipalAnyone());
        result.setProductName(repositoryInfo.getProductName());
        result.setProductVersion(repositoryInfo.getProductVersion());
        result.setCapabilities(convert(repositoryInfo.getCapabilities()));
        result.setDescription(repositoryInfo.getRepositoryDescription());
        result.setId(repositoryInfo.getRepositoryId());
        result.setName(repositoryInfo.getRepositoryName());
        result.setRootFolder(repositoryInfo.getRootFolderId());
        result.setThinClientUri(repositoryInfo.getThinClientURI());
        result.setVendorName(repositoryInfo.getVendorName());

        // handle extensions
        convertExtension(repositoryInfo, result);

        return result;
View Full Code Here


    private RepositoryInfo createDefaultRepositoryInfo(String repositoryId) {
        ObjectStore objStore = getObjectStore(repositoryId);
        String rootFolderId = objStore.getRootFolder().getId();
        // repository info
        RepositoryInfoImpl repoInfo;
        repoInfo = new RepositoryInfoImpl();
        repoInfo.setId(repositoryId == null ? "inMem" : repositoryId);
        repoInfo.setName("InMemory Repository");
        repoInfo.setDescription("InMemory Test Repository");
        repoInfo.setCmisVersionSupported("1.0");
        repoInfo.setCapabilities(null);
        repoInfo.setRootFolder(rootFolderId);
        repoInfo.setPrincipalAnonymous("anonymous");
        repoInfo.setPrincipalAnyone("anyone");
        repoInfo.setThinClientUri(null);
        repoInfo.setChangesIncomplete(Boolean.TRUE);
        repoInfo.setChangesOnType(null);
        repoInfo.setLatestChangeLogToken(null);
        repoInfo.setVendorName("OpenCMIS");
        repoInfo.setProductName("OpenCMIS InMemory-Server");
        repoInfo.setProductVersion("0.1");

        // set capabilities
        RepositoryCapabilitiesImpl caps = new RepositoryCapabilitiesImpl();
        caps.setAllVersionsSearchable(false);
        caps.setCapabilityAcl(CapabilityAcl.NONE);
        caps.setCapabilityChanges(CapabilityChanges.PROPERTIES); // just for
        // testing
        caps.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.PWCONLY);
        caps.setCapabilityJoin(CapabilityJoin.NONE);
        caps.setCapabilityQuery(CapabilityQuery.METADATAONLY); // just for
        // testing
        caps.setCapabilityRendition(CapabilityRenditions.NONE);
        caps.setIsPwcSearchable(false);
        caps.setIsPwcUpdatable(true);
        caps.setSupportsGetDescendants(true);
        caps.setSupportsGetFolderTree(true);
        caps.setSupportsMultifiling(true);
        caps.setSupportsUnfiling(true);
        caps.setSupportsVersionSpecificFiling(false);
        repoInfo.setCapabilities(caps);

        // AclCapabilitiesDataImpl aclCaps = new AclCapabilitiesDataImpl();
        // aclCaps.setACLPropagation(AclPropagation.REPOSITORYDETERMINED);
        // aclCaps.setPermissionDefinitionData(null);
        // aclCaps.setPermissionMappingData(null);
        // repoInfo.setACLCapabilities(aclCaps);
        repoInfo.setAclCapabilities(null);
        fRepositoryInfo = repoInfo;
        return repoInfo;
    }
View Full Code Here

            caps.setSupportsGetFolderTree(true);
            caps.setSupportsMultifiling(false);
            caps.setSupportsUnfiling(true);
            caps.setSupportsVersionSpecificFiling(false);

            RepositoryInfoImpl repositoryInfo = new RepositoryInfoImpl();
            repositoryInfo.setId(REPOSITORY_ID);
            repositoryInfo.setName("InMemory Repository");
            repositoryInfo.setDescription("InMemory Test Repository");
            repositoryInfo.setCmisVersionSupported("0.7");
            repositoryInfo.setCapabilities(caps);
            repositoryInfo.setRootFolder("/");
            repositoryInfo.setAclCapabilities(null);
            repositoryInfo.setPrincipalAnonymous("anonymous");
            repositoryInfo.setPrincipalAnyone("anyone");
            repositoryInfo.setThinClientUri(null);
            repositoryInfo.setChangesIncomplete(Boolean.TRUE);
            repositoryInfo.setChangesOnType(null);
            repositoryInfo.setLatestChangeLogToken(null);
            repositoryInfo.setVendorName("OpenCMIS");
            repositoryInfo.setProductName("OpenCMIS Client");
            repositoryInfo.setProductVersion("0.1");
            return repositoryInfo;
        }
View Full Code Here

*/
public class ConverterTest extends TestCase {

    public void testRepositoryInfo() throws Exception {
        // dry run
        RepositoryInfoImpl obj1 = new RepositoryInfoImpl();
        RepositoryInfo obj2 = Converter.convert(Converter.convert(obj1));

        assertDataObjectsEquals("RepositoryInfo", obj1, obj2);

        // values
        obj1 = new RepositoryInfoImpl();
        obj1.setChangesIncomplete(Boolean.TRUE);
        obj1.setChangesOnType(Collections.singletonList(BaseTypeId.CMIS_DOCUMENT));
        obj1.setCmisVersionSupported("1.0");
        obj1.setLatestChangeLogToken("changeLogToken");
        obj1.setPrincipalAnonymous("principalAnonymous");
        obj1.setPrincipalAnyone("principalAnyone");
        obj1.setProductName("productName");
        obj1.setProductVersion("productVersion");
        obj1.setDescription("description");
        obj1.setId("id");
        obj1.setName("name");
        obj1.setRootFolder("rootFolderId");
        obj1.setThinClientUri("thinClientUri");
        obj1.setVendorName("vendorName");

        RepositoryCapabilitiesImpl cap1 = new RepositoryCapabilitiesImpl();
        cap1.setAllVersionsSearchable(Boolean.TRUE);
        cap1.setCapabilityAcl(CapabilityAcl.DISCOVER);
        cap1.setCapabilityChanges(CapabilityChanges.ALL);
        cap1.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME);
        cap1.setCapabilityJoin(CapabilityJoin.INNERANDOUTER);
        cap1.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED);
        cap1.setCapabilityRendition(CapabilityRenditions.READ);
        cap1.setIsPwcSearchable(Boolean.TRUE);
        cap1.setIsPwcUpdatable(Boolean.TRUE);
        cap1.setSupportsGetDescendants(Boolean.TRUE);
        cap1.setSupportsGetFolderTree(Boolean.TRUE);
        cap1.setSupportsMultifiling(Boolean.TRUE);
        cap1.setSupportsUnfiling(Boolean.TRUE);
        cap1.setSupportsVersionSpecificFiling(Boolean.TRUE);
        obj1.setCapabilities(cap1);

        AclCapabilitiesDataImpl acl1 = new AclCapabilitiesDataImpl();
        acl1.setAclPropagation(AclPropagation.PROPAGATE);
        List<PermissionDefinition> pddList = new ArrayList<PermissionDefinition>();
        PermissionDefinitionDataImpl pdd1 = new PermissionDefinitionDataImpl();
        pdd1.setPermission("test:perm1");
        pdd1.setDescription("Permission1");
        pddList.add(pdd1);
        PermissionDefinitionDataImpl pdd2 = new PermissionDefinitionDataImpl();
        pdd2.setPermission("test:perm2");
        pdd2.setDescription("Permission2");
        pddList.add(pdd2);
        acl1.setPermissionDefinitionData(pddList);
        Map<String, PermissionMapping> pmd = new LinkedHashMap<String, PermissionMapping>();
        PermissionMappingDataImpl pmd1 = new PermissionMappingDataImpl();
        pmd1.setKey(PermissionMapping.CAN_CREATE_DOCUMENT_FOLDER);
        pmd1.setPermissions(Arrays.asList(new String[] { "p1", "p2" }));
        pmd.put(pmd1.getKey(), pmd1);
        PermissionMappingDataImpl pmd2 = new PermissionMappingDataImpl();
        pmd2.setKey(PermissionMapping.CAN_DELETE_OBJECT);
        pmd2.setPermissions(Arrays.asList(new String[] { "p3", "p4" }));
        pmd.put(pmd2.getKey(), pmd2);
        acl1.setPermissionMappingData(pmd);
        obj1.setAclCapabilities(acl1);

        obj2 = Converter.convert(Converter.convert(obj1));

        assertDataObjectsEquals("RepositoryInfo", obj1, obj2);
    }
View Full Code Here

    private RepositoryInfo createDefaultRepositoryInfo(String repositoryId) {
        ObjectStore objStore = getObjectStore(repositoryId);
        String rootFolderId = objStore.getRootFolder().getId();
        // repository info
        RepositoryInfoImpl repoInfo;
        repoInfo = new RepositoryInfoImpl();
        repoInfo.setId(repositoryId == null ? "inMem" : repositoryId);
        repoInfo.setName("InMemory Repository");
        repoInfo.setDescription("InMemory Test Repository");
        repoInfo.setCmisVersionSupported("1.0");
        repoInfo.setCapabilities(null);
        repoInfo.setRootFolder(rootFolderId);
        repoInfo.setPrincipalAnonymous("anonymous");
        repoInfo.setPrincipalAnyone("anyone");
        repoInfo.setThinClientUri(null);
        repoInfo.setChangesIncomplete(Boolean.TRUE);
        repoInfo.setChangesOnType(null);
        repoInfo.setLatestChangeLogToken(null);
        repoInfo.setVendorName("OpenCMIS");
        repoInfo.setProductName("OpenCMIS InMemory-Server");
        repoInfo.setProductVersion("0.1");

        // set capabilities
        RepositoryCapabilitiesImpl caps = new RepositoryCapabilitiesImpl();
        caps.setAllVersionsSearchable(false);
        caps.setCapabilityAcl(CapabilityAcl.NONE);
        caps.setCapabilityChanges(CapabilityChanges.PROPERTIES); // just for
        // testing
        caps.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.PWCONLY);
        caps.setCapabilityJoin(CapabilityJoin.NONE);
        caps.setCapabilityQuery(CapabilityQuery.METADATAONLY); // just for
        // testing
        caps.setCapabilityRendition(CapabilityRenditions.NONE);
        caps.setIsPwcSearchable(false);
        caps.setIsPwcUpdatable(true);
        caps.setSupportsGetDescendants(true);
        caps.setSupportsGetFolderTree(true);
        caps.setSupportsMultifiling(true);
        caps.setSupportsUnfiling(true);
        caps.setSupportsVersionSpecificFiling(false);
        repoInfo.setCapabilities(caps);

        // AclCapabilitiesDataImpl aclCaps = new AclCapabilitiesDataImpl();
        // aclCaps.setACLPropagation(AclPropagation.REPOSITORYDETERMINED);
        // aclCaps.setPermissionDefinitionData(null);
        // aclCaps.setPermissionMappingData(null);
        // repoInfo.setACLCapabilities(aclCaps);
        repoInfo.setAclCapabilities(null);
        fRepositoryInfo = repoInfo;
        return repoInfo;
    }
View Full Code Here

    public static RepositoryInfo convert(CmisRepositoryInfoType repositoryInfo) {
        if (repositoryInfo == null) {
            return null;
        }

        RepositoryInfoImpl result = new RepositoryInfoImpl();

        result.setAclCapabilities(convert(repositoryInfo.getAclCapability()));
        result.setChangesIncomplete(repositoryInfo.isChangesIncomplete());
        List<BaseTypeId> baseObjectTypeIds = new ArrayList<BaseTypeId>();
        for (EnumBaseObjectTypeIds bot : repositoryInfo.getChangesOnType()) {
            baseObjectTypeIds.add(convert(BaseTypeId.class, bot));
        }
        result.setChangesOnType(baseObjectTypeIds);
        result.setCmisVersionSupported(repositoryInfo.getCmisVersionSupported());
        result.setLatestChangeLogToken(repositoryInfo.getLatestChangeLogToken());
        result.setPrincipalAnonymous(repositoryInfo.getPrincipalAnonymous());
        result.setPrincipalAnyone(repositoryInfo.getPrincipalAnyone());
        result.setProductName(repositoryInfo.getProductName());
        result.setProductVersion(repositoryInfo.getProductVersion());
        result.setCapabilities(convert(repositoryInfo.getCapabilities()));
        result.setDescription(repositoryInfo.getRepositoryDescription());
        result.setId(repositoryInfo.getRepositoryId());
        result.setName(repositoryInfo.getRepositoryName());
        result.setRootFolder(repositoryInfo.getRootFolderId());
        result.setThinClientUri(repositoryInfo.getThinClientURI());
        result.setVendorName(repositoryInfo.getVendorName());

        // handle extensions
        convertExtension(repositoryInfo, result);

        return result;
View Full Code Here

            caps.setSupportsGetFolderTree(true);
            caps.setSupportsMultifiling(false);
            caps.setSupportsUnfiling(true);
            caps.setSupportsVersionSpecificFiling(false);

            RepositoryInfoImpl repositoryInfo = new RepositoryInfoImpl();
            repositoryInfo.setId(REPOSITORY_ID);
            repositoryInfo.setName("InMemory Repository");
            repositoryInfo.setDescription("InMemory Test Repository");
            repositoryInfo.setCmisVersionSupported("0.7");
            repositoryInfo.setCapabilities(caps);
            repositoryInfo.setRootFolder("/");
            repositoryInfo.setAclCapabilities(null);
            repositoryInfo.setPrincipalAnonymous("anonymous");
            repositoryInfo.setPrincipalAnyone("anyone");
            repositoryInfo.setThinClientUri(null);
            repositoryInfo.setChangesIncomplete(Boolean.TRUE);
            repositoryInfo.setChangesOnType(null);
            repositoryInfo.setLatestChangeLogToken(null);
            repositoryInfo.setVendorName("OpenCMIS");
            repositoryInfo.setProductName("OpenCMIS Client");
            repositoryInfo.setProductVersion("0.1");
            return repositoryInfo;
        }
View Full Code Here

    }

    //------------------------------------------< private >---

    private RepositoryInfo compileRepositoryInfo(String repositoryId) {
        RepositoryInfoImpl fRepositoryInfo = new RepositoryInfoImpl();

        fRepositoryInfo.setId(repositoryId);
        fRepositoryInfo.setName(getRepositoryName());
        fRepositoryInfo.setDescription(getRepositoryDescription());

        fRepositoryInfo.setCmisVersionSupported("1.0");

        fRepositoryInfo.setProductName("OpenCMIS JCR");
        fRepositoryInfo.setProductVersion("0.3");
        fRepositoryInfo.setVendorName("OpenCMIS");

        fRepositoryInfo.setRootFolder(PathManager.CMIS_ROOT_ID);
        fRepositoryInfo.setThinClientUri("");

        RepositoryCapabilitiesImpl capabilities = new RepositoryCapabilitiesImpl();
        capabilities.setCapabilityAcl(CapabilityAcl.NONE);
        capabilities.setAllVersionsSearchable(false);
        capabilities.setCapabilityJoin(CapabilityJoin.NONE);
        capabilities.setSupportsMultifiling(false);
        capabilities.setSupportsUnfiling(false);
        capabilities.setSupportsVersionSpecificFiling(false);
        capabilities.setIsPwcSearchable(false);
        capabilities.setIsPwcUpdatable(true);
        capabilities.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED);
        capabilities.setCapabilityChanges(CapabilityChanges.NONE);
        capabilities.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME);
        capabilities.setSupportsGetDescendants(true);
        capabilities.setSupportsGetFolderTree(true);
        capabilities.setCapabilityRendition(CapabilityRenditions.NONE);
        fRepositoryInfo.setCapabilities(capabilities);

        return fRepositoryInfo;
    }
View Full Code Here

        // set up user table
        fUserMap = new HashMap<String, Boolean>();

        // compile repository info
        fRepositoryInfo = new RepositoryInfoImpl();

        fRepositoryInfo.setId(fRepositoryId);
        fRepositoryInfo.setName(fRepositoryId);
        fRepositoryInfo.setDescription(fRepositoryId);
View Full Code Here

public class DummyService extends AbstractCmisService {

    private final RepositoryInfoImpl fRepInfo;

    public DummyService(String id, String name) {
        fRepInfo = new RepositoryInfoImpl();

        fRepInfo.setId(id);
        fRepInfo.setName(name);
        fRepInfo.setDescription(name);
        fRepInfo.setCmisVersionSupported("1.0");
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl

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.