本文整理汇总了Java中org.apache.chemistry.opencmis.commons.enums.AclPropagation类的典型用法代码示例。如果您正苦于以下问题:Java AclPropagation类的具体用法?Java AclPropagation怎么用?Java AclPropagation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AclPropagation类属于org.apache.chemistry.opencmis.commons.enums包,在下文中一共展示了AclPropagation类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyAcl
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Override
public Acl applyAcl(
String repositoryId, String objectId, final Acl addAces, final Acl removeAces,
AclPropagation aclPropagation, ExtensionsData extension)
{
checkRepositoryId(repositoryId);
// We are spec compliant if we just let it through and the tck will not fail
CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");
// relationships don't have ACLs
if (info.isVariant(CMISObjectVariant.ASSOC))
{
throw new CmisConstraintException("Relationships are not ACL controllable!");
}
final NodeRef nodeRef = info.getCurrentNodeNodeRef();
final TypeDefinitionWrapper type = info.getType();
connector.applyACL(nodeRef, type, addAces, removeAces);
return connector.getACL(nodeRef, false);
}
示例2: testCreate
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
public void testCreate()
{
Session session = getSession("admin", "admin");
String folderName = getRootFolderName();
Folder root = session.getRootFolder();
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
properties.put(PropertyIds.NAME, folderName);
// create the folder
Folder newFolder = root.createFolder(properties);
for(int i = 0; i < 50; i++)
{
AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl("user"+i);
List<String> permissions = new ArrayList<String>(1);
permissions.add(BasicPermissions.READ);
List<Ace> addAces = new ArrayList<Ace>(1);
addAces.add(new AccessControlEntryImpl(principal, permissions));
newFolder.addAcl(addAces, AclPropagation.PROPAGATE);
Map<String, Object> updateProperties = new HashMap<String, Object>();
updateProperties.put("cm:title", "Update title "+i);
newFolder.updateProperties(properties);
if(i % 10 == 0)
{
System.out.println("@ "+i);
}
}
ItemIterable<QueryResult> result = session.query("select * from cmis:folder", false);
assertTrue(result.getTotalNumItems() > 0);
result = session.query("select * from cmis:folder where cmis:name = '"+folderName+"'", false);
assertTrue(result.getTotalNumItems() > 0);
}
示例3: createRepositoryInfo
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
/**
* 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;
}
示例4: testRemoveAllPermissions_WEBSERVICE_10
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
/**
* cmisws?wsdl is not available using jetty in automated test suite should
* be runned using an external alfresco server
*
*/
// @Test
public void testRemoveAllPermissions_WEBSERVICE_10()
{
Folder testFolder = null;
try
{
Session session = getWEBSERVICE_10_Session();
if (session == null)
{
fail("WEBSERVICE 1.0 session cannot be null");
}
testFolder = createFolder(session, "testRemoveAllPermissions_WEBSERVICE_10");
List<Ace> acl = create2TestACLs(session);
// adding new ACE
testFolder.addAcl(acl, AclPropagation.PROPAGATE);
Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
int oldSize = allacl.getAces().size();
// Removing ALL ACEs
Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);
int newsize = newAcl.getAces().size();
System.out.println("Old ace size -->" + oldSize);
System.out.println("New ace size --> " + newsize);
assertTrue(newsize == oldSize - acl.size());
}
catch (Exception ex)
{
fail(ex.getMessage());
}
finally
{
if (testFolder != null)
{
testFolder.delete();
}
}
}
示例5: testRemoveAllPermissions_ATOMPUB_10
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Test
public void testRemoveAllPermissions_ATOMPUB_10()
{
Folder testFolder = null;
try
{
Session session = getATOMPUB_10_Session();
if (session == null)
{
fail("ATOMPUB 1.0 session cannot be null");
}
testFolder = createFolder(session, "testRemoveAllPermissions_ATOMPUB_10");
List<Ace> acl = create2TestACLs(session);
// adding new ACE
testFolder.addAcl(acl, AclPropagation.PROPAGATE);
Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
int oldSize = allacl.getAces().size();
// Removing ALL ACEs
Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);
int newsize = newAcl.getAces().size();
System.out.println("Old ace size -->" + oldSize);
System.out.println("New ace size --> " + newsize);
assertTrue(newsize == oldSize - acl.size());
}
catch (Exception ex)
{
fail(ex.getMessage());
}
finally
{
if (testFolder != null)
{
testFolder.delete();
}
}
}
示例6: testRemoveAllPermissions_ATOMPUB_11
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Test
public void testRemoveAllPermissions_ATOMPUB_11()
{
Folder testFolder = null;
try
{
Session session = getATOMPUB_11_Session();
if (session == null)
{
fail("ATOMPUB 1.1 session cannot be null");
}
testFolder = createFolder(session, "testRemoveAllPermissions_ATOMPUB_11");
List<Ace> acl = create2TestACLs(session);
// adding new ACE
testFolder.addAcl(acl, AclPropagation.PROPAGATE);
Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
int oldSize = allacl.getAces().size();
// Removing ALL ACEs
Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);
int newsize = newAcl.getAces().size();
System.out.println("Old ace size -->" + oldSize);
System.out.println("New ace size --> " + newsize);
assertTrue(newsize == oldSize - acl.size());
}
catch (Exception ex)
{
fail(ex.getMessage());
}
finally
{
if (testFolder != null)
{
testFolder.delete();
}
}
}
示例7: testRemoveAllPermissions_BROWSER_11
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Test
public void testRemoveAllPermissions_BROWSER_11()
{
Folder testFolder = null;
try
{
Session session = getBROWSER_11_Session();
if (session == null)
{
fail("ATOMPUB 1.1 session cannot be null");
}
testFolder = createFolder(session, "testRemoveAllPermissions_BROWSER_11");
List<Ace> acl = create2TestACLs(session);
// adding new ACE
testFolder.addAcl(acl, AclPropagation.PROPAGATE);
Acl allacl = session.getAcl(session.createObjectId(testFolder.getId()), false);
int oldSize = allacl.getAces().size();
// Removing ALL ACEs
Acl newAcl = testFolder.removeAcl(allacl.getAces(), AclPropagation.PROPAGATE);
int newsize = newAcl.getAces().size();
System.out.println("Old ace size -->" + oldSize);
System.out.println("New ace size --> " + newsize);
assertTrue(newsize == oldSize - acl.size());
}
catch (Exception ex)
{
fail(ex.getMessage());
}
finally
{
if (testFolder != null)
{
testFolder.delete();
}
}
}
示例8: applyAcl
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Override
public Acl applyAcl(List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation) {
return null;
}
示例9: addAcl
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Override
public Acl addAcl(List<Ace> addAces, AclPropagation aclPropagation) {
return null;
}
示例10: removeAcl
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Override
public Acl removeAcl(List<Ace> removeAces, AclPropagation aclPropagation) {
return null;
}
示例11: applyAcl
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
@Override
public Acl applyAcl(ObjectId objectId, List<Ace> addAces, List<Ace> removeAces, AclPropagation aclPropagation) {
throw new RuntimeException("not implemented");
}
示例12: testCreateLots
import org.apache.chemistry.opencmis.commons.enums.AclPropagation; //导入依赖的package包/类
public void testCreateLots() throws Exception
{
Session session = getSession("admin", "admin");
Folder root = session.getRootFolder();
String folderNameBase = getRootFolderName();
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "cmis:folder");
properties.put(PropertyIds.NAME, folderNameBase);
Folder base = root.createFolder(properties);
for(int i = 0; i < 10; i++)
{
AccessControlPrincipalDataImpl principal = new AccessControlPrincipalDataImpl(""+i+i+i);
List<String> permissions = new ArrayList<String>(1);
permissions.add(BasicPermissions.ALL);
List<Ace> addAces = new ArrayList<Ace>(1);
addAces.add(new AccessControlEntryImpl(principal, permissions));
base.addAcl(addAces, AclPropagation.PROPAGATE);
}
Thread last = null;
for(int i = 0; i < 10; i++)
{
Creator creator = new Creator(base.getPath(), i);
Thread thread = new Thread(creator);
thread.start();
last = thread;
}
if(last != null)
{
last.join();
}
ItemIterable<QueryResult> result = session.query("select * from cmis:folder", false);
assertTrue(result.getTotalNumItems() > 0);
//result = session.query("select * from cmis:folder where cmis:name = '"+folderName+"'", false);
//assertTrue(result.getTotalNumItems() > 0);
}