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

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


    }

    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


        ObjectStore sm = fMapRepositoryToObjectStore.get(repositoryId);
        if (null == sm) {
            return null;
        }

        RepositoryInfo repoInfo = createRepositoryInfo(repositoryId);

        return repoInfo;
    }
View Full Code Here

    }

    private void callRepoInfo(String repositoryId, int count) {
        RepositoryService repSvc = getClientBindings().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

        ObjectStore sm = fMapRepositoryToObjectStore.get(repositoryId);
        if (null == sm) {
            return null;
        }

        RepositoryInfo repoInfo = createRepositoryInfo(repositoryId);

        return repoInfo;
    }
View Full Code Here

     * getRepositoryInfo.
     */
    public static void getRepositoryInfo(CallContext context, CmisService service, String repositoryId,
            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // execute
        RepositoryInfo ri = service.getRepositoryInfo(repositoryId, null);

        String repositoryUrl = BrowserBindingUtils.compileRepositoryUrl(request, ri.getId()).toString();
        String rootUrl = BrowserBindingUtils.compileRootUrl(request, ri.getId()).toString();

        JSONObject result = new JSONObject();
        result.put(ri.getId(), JSONConverter.convert(ri, repositoryUrl, rootUrl));

        response.setStatus(HttpServletResponse.SC_OK);
        BrowserBindingUtils.writeJSON(result, request, response);
    }
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

        List<RepositoryInfo> repInfos = new ArrayList<RepositoryInfo>();

        for (Object jri : json.values()) {
            if (jri instanceof Map) {
                @SuppressWarnings("unchecked")
                RepositoryInfo ri = JSONConverter.convertRepositoryInfo((Map<String, Object>) jri);
                String id = ri.getId();

                if (ri instanceof RepositoryInfoBrowserBindingImpl) {
                    String repositoryUrl = ((RepositoryInfoBrowserBindingImpl) ri).getRepositoryUrl();
                    String rootUrl = ((RepositoryInfoBrowserBindingImpl) ri).getRootUrl();
View Full Code Here

    private void getRepositoryInfo() {
        LOG.debug("getting repository info for repository " + repositoryId);
        // Because the browser binding silently retrieves all repositories on the first request we call it twice
        // and use a dummy extension data element to prevent caching
        RepositoryInfo repoInfo = repSvc.getRepositoryInfo(repositoryId, null);
        if (bindingType.equals(BindingType.BROWSER)) {
            ExtensionDataImpl dummyExt = new ExtensionDataImpl();
            List<CmisExtensionElement> extList = new ArrayList<CmisExtensionElement>() {{ add(new CmisExtensionElementImpl("foo", "foo", null, "bar")); }};
            dummyExt.setExtensions(extList);
            repoInfo = repSvc.getRepositoryInfo(repositoryId, dummyExt);
        }
        LOG.debug("repository id is: " + repoInfo.getId());
        rootFolderId = repoInfo.getRootFolderId();
        LOG.debug("root folder id is: " + repoInfo.getRootFolderId());
        renameFiles("getRepositoryInfo");
        LOG.debug("getRepositoryInfo() done.");
    }
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

        CapabilityAcl aclCap = getAclCapability(session);
        return (aclCap != null) && (aclCap != CapabilityAcl.NONE);
    }

    protected CapabilityAcl getAclCapability(Session session) {
        RepositoryInfo repository = session.getRepositoryInfo();

        if (repository.getCapabilities().getAclCapability() == null) {
            return null;
        }

        return repository.getCapabilities().getAclCapability();
    }
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.