Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.RepositoryInfo


    }

    private static String getRootFolderId(CmisBinding binding, String repositoryId, String rootFolderId) {
        RepositoryService repSvc = binding.getRepositoryService();

        RepositoryInfo rep = repSvc.getRepositoryInfo(repositoryId, null);
        if (null == rootFolderId || rootFolderId.length() == 0) {
            rootFolderId = rep.getRootFolderId();
        }

        return rootFolderId;
    }
View Full Code Here


    public void run(Session session) throws Exception {
        CmisTestResult success;
        CmisTestResult failure;

        // check root folder id
        RepositoryInfo ri = getRepositoryInfo(session);

        success = createResult(OK, "Root folder id: " + ri.getRootFolderId());
        failure = createResult(FAILURE, "Root folder id is not set!");
        addResult(assertStringNotEmpty(ri.getRootFolderId(), success, failure));

        // get the root folder
        Folder rootFolder = session.getRootFolder(SELECT_ALL_NO_CACHE_OC);

        if (rootFolder == null) {
            addResult(createResult(FAILURE, "Root folder is not available!"));
            return;
        }

        String[] propertiesToCheck = new String[rootFolder.getType().getPropertyDefinitions().size()];

        int i = 0;
        for (String propId : rootFolder.getType().getPropertyDefinitions().keySet()) {
            propertiesToCheck[i++] = propId;
        }

        addResult(checkObject(rootFolder, propertiesToCheck, "Root folder object spec compliance"));

        // folder and path
        failure = createResult(FAILURE,
                "Root folder id in the repository info doesn't match the root folder object id!");
        addResult(assertEquals(ri.getRootFolderId(), rootFolder.getId(), null, failure));

        failure = createResult(FAILURE, "Root folder is not a cmis:folder!");
        addResult(assertEquals(BaseTypeId.CMIS_FOLDER, rootFolder.getBaseTypeId(), null, failure));

        failure = createResult(FAILURE, "Root folder path is not '/'!");
View Full Code Here

    private AclCapabilities aclCapabilities = null;

    @Before
    public void setup() {
        RepositoryInfo r = this.session.getRepositoryInfo();
        // capabilities
        RepositoryCapabilities repcap = r.getCapabilities();
        CapabilityAcl capacl = repcap.getAclCapability();

        if (capacl != CapabilityAcl.NONE) {
            // acl capabilities
            this.aclCapabilities = r.getAclCapabilities();
        }

        Assume.assumeNotNull(this.aclCapabilities);
    }
View Full Code Here

        assertNotNull(fRepSvc);
        assertNotNull(fObjSvc);
        assertNotNull(fNavSvc);

        RepositoryInfo rep = fRepSvc.getRepositoryInfo(REPOSITORY_ID, null);
        fRootFolderId = rep.getRootFolderId();
        fRepositoryId = rep.getId();

        assertNotNull(fRepositoryId);
        assertNotNull(fRootFolderId);
    }
View Full Code Here

    }

    private void callRepoInfo(String repositoryId, int count) {
        RepositoryService repSvc = getBinding().getRepositoryService();
        TimeLogger timeLogger = new TimeLogger("RepoInfoTest");
        RepositoryInfo repoInfo = null;
        for (int i = 0; i < count; i++) {
            binding.clearRepositoryCache(repositoryId);
            timeLogger.start();
            repoInfo = repSvc.getRepositoryInfo(repositoryId, null);
            timeLogger.stop();
        }
        System.out.println("Root Folder id is: " + (repoInfo == null ? "<unknown>" : repoInfo.getRootFolderId()));
        timeLogger.printTimes();
    }
View Full Code Here

    }

    public abstract void run(Session session) throws Exception;

    protected RepositoryInfo getRepositoryInfo(Session session) {
        RepositoryInfo ri = session.getRepositoryInfo();

        CmisTestResult failure = createResult(FAILURE, "Repository info is null!", true);
        addResult(assertNotNull(ri, null, failure));

        return ri;
View Full Code Here

          // from everywhere
          DummyCallContext ctx = new DummyCallContext();
          svc.setCallContext(ctx);

          // Build the tree
          RepositoryInfo rep = svc.getRepositoryInfo(repositoryId, null);
          String rootFolderId = rep.getRootFolderId();

          try {
              gen.createFolderHierachy(levels, childrenPerLevel, rootFolderId);
              // Dump the tree
              gen.dumpFolder(rootFolderId, "*");
 
View Full Code Here

    public RepositoryServiceImpl(BindingSession session) {
        this.session = session;
    }

    public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
        RepositoryInfo result = null;
        boolean hasExtension = (extension != null) && (!extension.getExtensions().isEmpty());

        RepositoryInfoCache cache = CmisBindingsHelper.getRepositoryInfoCache(session);

        // if extension is not set, check the cache first
View Full Code Here

    public void testRepositoryInfo() {
        if (!isEnabled(TEST_REPOSITORY_INFO)) {
            return;
        }

        RepositoryInfo repInfo = getRepositoryInfo();

        Tools.print(repInfo);

        assertNotNull(repInfo.getId());
        assertNotNull(repInfo.getCmisVersionSupported());
        assertNotNull(repInfo.getRootFolderId());
        assertNotNull(repInfo.getCapabilities());
    }
View Full Code Here

    /**
     * Returns the info object of the test repository.
     */
    protected RepositoryInfo getRepositoryInfo() {
        RepositoryInfo repositoryInfo = getBinding().getRepositoryService().getRepositoryInfo(getTestRepositoryId(),
                null);

        assertNotNull(repositoryInfo);
        assertNotNull(repositoryInfo.getId());
        assertEquals(getTestRepositoryId(), repositoryInfo.getId());

        return repositoryInfo;
    }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.RepositoryInfo

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.