protected boolean isFulltextOnly(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().getQueryCapability() == null) { return false; } return repository.getCapabilities().getQueryCapability() == CapabilityQuery.FULLTEXTONLY; } }
protected boolean supportsMultifiling(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().isMultifilingSupported() == null) { return false; } return repository.getCapabilities().isMultifilingSupported().booleanValue(); } }
protected boolean supportsUnfiling(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().isUnfilingSupported() == null) { return false; } return repository.getCapabilities().isUnfilingSupported().booleanValue(); } }
protected boolean supportsContentChanges(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().getChangesCapability() == null) { return false; } return repository.getCapabilities().getChangesCapability() != CapabilityChanges.NONE; }
protected boolean supportsQuery(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().getQueryCapability() == null) { return false; } return repository.getCapabilities().getQueryCapability() != CapabilityQuery.NONE; }
private CapabilityContentStreamUpdates getContentStreamUpdatesCapbility(Session session) { if (session.getRepositoryInfo().getCapabilities() == null) { return null; } return session.getRepositoryInfo().getCapabilities().getContentStreamUpdatesCapability(); }
protected CapabilityAcl getAclCapability(Session session) { RepositoryInfo repository = session.getRepositoryInfo(); if (repository.getCapabilities().getAclCapability() == null) { return null; } return repository.getCapabilities().getAclCapability(); } }
protected boolean isOrderByNameSupported(Session session) { if (session.getRepositoryInfo().getCapabilities().getOrderByCapability() == CapabilityOrderBy.NONE) { return false; } return true; }
protected boolean isGetFolderTreeSupported(Session session) { RepositoryCapabilities cap = session.getRepositoryInfo().getCapabilities(); if (cap == null) { return false; } if (cap.isGetFolderTreeSupported() == null) { return false; } return cap.isGetFolderTreeSupported().booleanValue(); }
protected boolean isGetDescendantsSupported(Session session) { RepositoryCapabilities cap = session.getRepositoryInfo().getCapabilities(); if (cap == null) { return false; } if (cap.isGetDescendantsSupported() == null) { return false; } return cap.isGetDescendantsSupported().booleanValue(); }
public void doExample() { // Get a CMIS session Session cmisSession = getCmisSession(); // Get the repository info RepositoryInfo repoInfo = cmisSession.getRepositoryInfo(); System.out.println("Product name: " + repoInfo.getProductName()); System.out.println("Product version: " + repoInfo.getProductVersion()); System.out.println("Product vendor: " + repoInfo.getVendorName()); System.out.println("CMIS version supported: " + repoInfo.getCmisVersionSupported()); RepositoryCapabilities caps = repoInfo.getCapabilities(); System.out.println("Partial list of capabilities..."); System.out.println("Joins? " + caps.getJoinCapability()); System.out.println("ACLs? " + caps.getAclCapability()); System.out.println("Changes? " + caps.getChangesCapability()); System.out.println("Queries? " + caps.getQueryCapability()); System.out.println("Content stream updates? " + caps.getContentStreamUpdatesCapability()); System.out.println("Renditions? " + caps.getRenditionsCapability()); System.out.println("Multifiling? " + caps.isMultifilingSupported()); System.out.println("Version-specific filing? " + caps.isVersionSpecificFilingSupported()); } }
private void createTypeWithProperties(Session session, ObjectType parentType) { CmisTestResult failure = null; CreatablePropertyTypes cpt = session.getRepositoryInfo().getCapabilities().getCreatablePropertyTypes(); if (cpt == null || cpt.canCreate() == null || cpt.canCreate().isEmpty()) { addResult(createResult(FAILURE, "Repository Info does not indicate, which property types can be created!"));
private void runContentTest(Session session, Folder testFolder) { if (session.getRepositoryInfo().getCapabilities().getContentStreamUpdatesCapability() != CapabilityContentStreamUpdates.ANYTIME) { addResult(createResult(SKIPPED, "Repository doesn't allow to replace content. Test skipped!")); return;
public RepositoryInfoImpl(RepositoryInfo data) { id = data.getId(); name = data.getName(); description = data.getDescription(); versionSupported = data.getCmisVersionSupported(); capabilities = data.getCapabilities(); rootFolderId = data.getRootFolderId(); aclCapabilities = data.getAclCapabilities(); principalAnonymous = data.getPrincipalIdAnonymous(); principalAnyone = data.getPrincipalIdAnyone(); thinClientUri = data.getThinClientUri(); changesIncomplete = data.getChangesIncomplete(); changesOnType = data.getChangesOnType(); latestChangeLogToken = data.getLatestChangeLogToken(); vendorName = data.getVendorName(); productName = data.getProductName(); productVersion = data.getProductVersion(); extensionFeatures = data.getExtensionFeatures(); setExtensions(data.getExtensions()); }
result.setCapabilities(convert(repositoryInfo.getCapabilities(), cmisVersion)); result.setChangesIncomplete(repositoryInfo.getChangesIncomplete()); result.setCmisVersionSupported(repositoryInfo.getCmisVersionSupported());
public RepositoryInfoImpl(RepositoryInfo data) { id = data.getId(); name = data.getName(); description = data.getDescription(); versionSupported = data.getCmisVersionSupported(); capabilities = data.getCapabilities(); rootFolderId = data.getRootFolderId(); aclCapabilities = data.getAclCapabilities(); principalAnonymous = data.getPrincipalIdAnonymous(); principalAnyone = data.getPrincipalIdAnyone(); thinClientUri = data.getThinClientUri(); changesIncomplete = data.getChangesIncomplete(); changesOnType = data.getChangesOnType(); latestChangeLogToken = data.getLatestChangeLogToken(); vendorName = data.getVendorName(); productName = data.getProductName(); productVersion = data.getProductVersion(); extensionFeatures = data.getExtensionFeatures(); setExtensions(data.getExtensions()); }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_REPINFO_CHANGE_LOG_TOKEN, source.getLatestChangeLogToken()); writeRepositoryCapabilities(writer, cmisVersion, source.getCapabilities()); writeAclCapabilities(writer, cmisVersion, source.getAclCapabilities()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_REPINFO_CMIS_VERSION_SUPPORTED,
/** * Creates a new type. */ protected ObjectType createType(Session session, TypeDefinition typeDef) { NewTypeSettableAttributes settableAttributes = session.getRepositoryInfo().getCapabilities() .getNewTypeSettableAttributes(); if (settableAttributes == null) { addResult(createResult(WARNING, "Repository Info does not indicate, which type attributes can be set!")); } else { // TODO: add more tests } ObjectType newType = null; try { newType = session.createType(typeDef); addResult(createInfoResult("Created type '" + typeDef.getId() + "'. Repository assigned the following type ID: " + newType.getId())); } catch (CmisBaseException e) { addResult(createResult(FAILURE, "Creating type '" + typeDef.getId() + "' failed: " + e.getMessage(), e, false)); return null; } addResult(checkTypeDefinition(session, newType, "Newly created type spec compliance.")); if (newType.getTypeMutability() == null) { addResult(createResult(FAILURE, "Newly created type does not provide type mutability data! ID: " + newType.getId())); } return newType; }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_REPINFO_CHANGE_LOG_TOKEN, source.getLatestChangeLogToken()); writeRepositoryCapabilities(writer, cmisVersion, source.getCapabilities()); writeAclCapabilities(writer, cmisVersion, source.getAclCapabilities()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_REPINFO_CMIS_VERSION_SUPPORTED,
result.put(JSON_REPINFO_PRODUCT_VERSION, repositoryInfo.getProductVersion()); result.put(JSON_REPINFO_ROOT_FOLDER_ID, repositoryInfo.getRootFolderId()); result.put(JSON_REPINFO_CAPABILITIES, convert(repositoryInfo.getCapabilities())); setIfNotNull(JSON_REPINFO_ACL_CAPABILITIES, convert(repositoryInfo.getAclCapabilities()), result); result.put(JSON_REPINFO_CHANGE_LOG_TOKEN, repositoryInfo.getLatestChangeLogToken());