Search in sources :

Example 1 with AlfrescoType

use of org.alfresco.cmis.client.type.AlfrescoType in project alfresco-remote-api by Alfresco.

the class TestCMIS method testMNT10430.

@Test
public void testMNT10430() throws Exception {
    final TestNetwork network1 = getTestFixture().getRandomNetwork();
    String username = "user" + System.currentTimeMillis();
    PersonInfo personInfo = new PersonInfo(username, username, username, TEST_PASSWORD, null, null, null, null, null, null, null);
    TestPerson person1 = network1.createUser(personInfo);
    String person1Id = person1.getId();
    publicApiClient.setRequestContext(new RequestContext(network1.getId(), person1Id));
    CmisSession cmisSession = publicApiClient.createPublicApiCMISSession(Binding.browser, CMIS_VERSION_11, AlfrescoObjectFactoryImpl.class.getName());
    ObjectType objectType = cmisSession.getTypeDefinition("D:testcmis:maDoc");
    // try and get the mandatory aspects
    List<String> mandatoryAspects = ((AlfrescoType) objectType).getMandatoryAspects();
    System.out.println("Mandatory Aspects");
    for (String mandatoryAspect : mandatoryAspects) {
        System.out.println(mandatoryAspect);
    }
    assertTrue("The aspects should have P:cm:generalclassifiable", mandatoryAspects.contains("P:cm:generalclassifiable"));
}
Also used : ObjectType(org.apache.chemistry.opencmis.client.api.ObjectType) AlfrescoType(org.alfresco.cmis.client.type.AlfrescoType) AlfrescoObjectFactoryImpl(org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl) CmisSession(org.alfresco.rest.api.tests.client.PublicApiClient.CmisSession) TestNetwork(org.alfresco.rest.api.tests.RepoService.TestNetwork) RequestContext(org.alfresco.rest.api.tests.client.RequestContext) TestPerson(org.alfresco.rest.api.tests.RepoService.TestPerson) VersionableAspectTest(org.alfresco.repo.version.VersionableAspectTest) Test(org.junit.Test)

Aggregations

AlfrescoObjectFactoryImpl (org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl)1 AlfrescoType (org.alfresco.cmis.client.type.AlfrescoType)1 VersionableAspectTest (org.alfresco.repo.version.VersionableAspectTest)1 TestNetwork (org.alfresco.rest.api.tests.RepoService.TestNetwork)1 TestPerson (org.alfresco.rest.api.tests.RepoService.TestPerson)1 CmisSession (org.alfresco.rest.api.tests.client.PublicApiClient.CmisSession)1 RequestContext (org.alfresco.rest.api.tests.client.RequestContext)1 ObjectType (org.apache.chemistry.opencmis.client.api.ObjectType)1 Test (org.junit.Test)1