Java Code Examples for org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryCapabilitiesImpl#setSupportsGetFolderTree()

The following examples show how to use org.apache.chemistry.opencmis.commons.impl.dataobjects.RepositoryCapabilitiesImpl#setSupportsGetFolderTree() . 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 vote down vote up
private static RepositoryCapabilities xml2capabilities(Element cmisResult) {
	Element repositoryCapabilitiesXml = XmlUtils.getFirstChildTag(cmisResult, "repositoryCapabilities");
	RepositoryCapabilitiesImpl repositoryCapabilities = new RepositoryCapabilitiesImpl();

	repositoryCapabilities.setAllVersionsSearchable(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "allVersionsSearchable"));
	repositoryCapabilities.setSupportsGetDescendants(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "supportsGetDescendants"));
	repositoryCapabilities.setSupportsGetFolderTree(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "supportsGetFolderTree"));
	repositoryCapabilities.setSupportsMultifiling(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "supportsMultifiling"));
	repositoryCapabilities.setIsPwcSearchable(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "isPwcSearchable"));
	repositoryCapabilities.setIsPwcUpdatable(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "isPwcUpdatable"));
	repositoryCapabilities.setSupportsUnfiling(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "supportsUnfiling"));
	repositoryCapabilities.setSupportsVersionSpecificFiling(CmisUtils.parseBooleanAttr(repositoryCapabilitiesXml, "supportsVersionSpecificFiling"));
	repositoryCapabilities.setCapabilityAcl(CapabilityAcl.valueOf(repositoryCapabilitiesXml.getAttribute("aclCapability")));
	repositoryCapabilities.setCapabilityChanges(CapabilityChanges.valueOf(repositoryCapabilitiesXml.getAttribute("changesCapability")));
	repositoryCapabilities.setCapabilityContentStreamUpdates(CapabilityContentStreamUpdates.valueOf(repositoryCapabilitiesXml.getAttribute("contentStreamUpdatesCapability")));
	repositoryCapabilities.setCreatablePropertyTypes(CmisUtils.xml2creatablePropertyTypes(repositoryCapabilitiesXml));
	repositoryCapabilities.setCapabilityJoin(CapabilityJoin.valueOf(repositoryCapabilitiesXml.getAttribute("joinCapability")));
	repositoryCapabilities.setNewTypeSettableAttributes(CmisUtils.xml2newTypeSettableAttributes(repositoryCapabilitiesXml));
	repositoryCapabilities.setCapabilityOrderBy(CapabilityOrderBy.valueOf(repositoryCapabilitiesXml.getAttribute("orderByCapability")));
	repositoryCapabilities.setCapabilityQuery(CapabilityQuery.valueOf(repositoryCapabilitiesXml.getAttribute("queryCapability")));
	repositoryCapabilities.setCapabilityRendition(CapabilityRenditions.valueOf(repositoryCapabilitiesXml.getAttribute("renditionsCapability")));

	return repositoryCapabilities;
}
 
Example 2
Source File: CMISConnector.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * 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;
}