Java Code Examples for org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl#setName()
The following examples show how to use
org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryInfoImpl#setName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CmisUtils.java From iaf with Apache License 2.0 | 6 votes |
public static RepositoryInfo xml2repositoryInfo(Element cmisResult) { RepositoryInfoImpl repositoryInfo = new RepositoryInfoImpl(); repositoryInfo.setCmisVersion(CmisVersion.fromValue(cmisResult.getAttribute("cmisVersion"))); repositoryInfo.setCmisVersionSupported(cmisResult.getAttribute("cmisVersionSupported")); repositoryInfo.setDescription(cmisResult.getAttribute("description")); repositoryInfo.setId(cmisResult.getAttribute("id")); repositoryInfo.setLatestChangeLogToken(cmisResult.getAttribute("latestChangeLogToken")); repositoryInfo.setName(cmisResult.getAttribute("name")); repositoryInfo.setPrincipalAnonymous(cmisResult.getAttribute("principalIdAnonymous")); repositoryInfo.setPrincipalAnyone(cmisResult.getAttribute("principalIdAnyone")); repositoryInfo.setProductName(cmisResult.getAttribute("productName")); repositoryInfo.setProductVersion(cmisResult.getAttribute("productVersion")); repositoryInfo.setRootFolder(cmisResult.getAttribute("rootFolderId")); repositoryInfo.setThinClientUri(cmisResult.getAttribute("thinClientUri")); repositoryInfo.setVendorName(cmisResult.getAttribute("vendorName")); repositoryInfo.setChangesIncomplete(CmisUtils.parseBooleanAttr(cmisResult, "changesIncomplete")); repositoryInfo.setAclCapabilities(CmisUtils.xml2aclCapabilities(cmisResult)); repositoryInfo.setCapabilities(CmisUtils.xml2capabilities(cmisResult)); repositoryInfo.setChangesOnType(CmisUtils.xml2changesOnType(cmisResult)); return repositoryInfo; }
Example 2
Source File: CMISConnector.java From alfresco-repository with GNU Lesser General Public License v3.0 | 4 votes |
/** * Creates the repository info object. */ private RepositoryInfo createRepositoryInfo(CmisVersion cmisVersion) { Descriptor currentDescriptor = descriptorService.getCurrentRepositoryDescriptor(); // get change token boolean auditEnabled = auditService.isAuditEnabled(CMIS_CHANGELOG_AUDIT_APPLICATION, "/" + CMIS_CHANGELOG_AUDIT_APPLICATION); String latestChangeLogToken = null; if (auditEnabled) { EntryIdCallback auditQueryCallback = new EntryIdCallback(false); AuditQueryParameters params = new AuditQueryParameters(); params.setApplicationName(CMIS_CHANGELOG_AUDIT_APPLICATION); params.setForward(false); auditService.auditQuery(auditQueryCallback, params, 1); String entryId = auditQueryCallback.getEntryId(); // MNT-13529 // add initial change log token latestChangeLogToken = entryId == null ? "0" : entryId; } // compile repository info RepositoryInfoImpl ri = new RepositoryInfoImpl(); ri.setId(currentDescriptor.getId()); ri.setName(currentDescriptor.getName()); ri.setDescription(currentDescriptor.getName()); ri.setVendorName("Alfresco"); ri.setProductName("Alfresco " + descriptorService.getServerDescriptor().getEdition()); ri.setProductVersion(currentDescriptor.getVersion()); NodeRef rootNodeRef = getRootNodeRef(); ri.setRootFolder(constructObjectId(rootNodeRef, null)); ri.setCmisVersion(cmisVersion); ri.setChangesIncomplete(true); ri.setChangesOnType(Arrays.asList(new BaseTypeId[] { BaseTypeId.CMIS_DOCUMENT, BaseTypeId.CMIS_FOLDER })); ri.setLatestChangeLogToken(latestChangeLogToken); ri.setPrincipalAnonymous(AuthenticationUtil.getGuestUserName()); ri.setPrincipalAnyone(PermissionService.ALL_AUTHORITIES); RepositoryCapabilitiesImpl repCap = new RepositoryCapabilitiesImpl(); ri.setCapabilities(repCap); repCap.setAllVersionsSearchable(false); repCap.setCapabilityAcl(CapabilityAcl.MANAGE); repCap.setCapabilityChanges(auditEnabled ? CapabilityChanges.OBJECTIDSONLY : CapabilityChanges.NONE); repCap.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.ANYTIME); repCap.setCapabilityJoin(CapabilityJoin.NONE); repCap.setCapabilityQuery(CapabilityQuery.BOTHCOMBINED); repCap.setCapabilityRendition(CapabilityRenditions.READ); repCap.setIsPwcSearchable(false); repCap.setIsPwcUpdatable(true); repCap.setSupportsGetDescendants(true); repCap.setSupportsGetFolderTree(true); repCap.setSupportsMultifiling(true); repCap.setSupportsUnfiling(false); repCap.setSupportsVersionSpecificFiling(false); AclCapabilitiesDataImpl aclCap = new AclCapabilitiesDataImpl(); ri.setAclCapabilities(aclCap); aclCap.setAclPropagation(AclPropagation.PROPAGATE); aclCap.setSupportedPermissions(SupportedPermissions.BOTH); aclCap.setPermissionDefinitionData(repositoryPermissions); aclCap.setPermissionMappingData(permissionMappings); return ri; }