use of org.alfresco.repo.event.v1.model.NodeResource in project alfresco-repository by Alfresco.
the class AbstractContextAwareRepoEvent method getNodeResource.
protected <D extends DataAttributes<NodeResource>> NodeResource getNodeResource(RepoEvent<D> repoEvent) {
assertNotNull(repoEvent);
D eventData = getEventData(repoEvent);
assertNotNull(eventData);
NodeResource resource = eventData.getResource();
assertNotNull(resource);
return resource;
}
use of org.alfresco.repo.event.v1.model.NodeResource in project alfresco-repository by Alfresco.
the class AbstractContextAwareRepoEvent method getNodeResource.
protected NodeResource getNodeResource(int eventSequenceNumber) {
DataAttributes<NodeResource> eventData = getEventData(eventSequenceNumber);
NodeResource resource = eventData.getResource();
assertNotNull(resource);
return resource;
}
use of org.alfresco.repo.event.v1.model.NodeResource in project alfresco-repository by Alfresco.
the class CreateRepoEventIT method testFolderNodeType.
@Test
public void testFolderNodeType() {
createNode(ContentModel.TYPE_FOLDER);
final NodeResource resource = getNodeResource(1);
assertEquals("cm:content node type was not found", "cm:folder", resource.getNodeType());
assertFalse("isFile flag should be FALSE for nodeType=cm:folder. ", resource.isFile());
assertTrue("isFolder flag should be TRUE for nodeType=cm:folder. ", resource.isFolder());
}
use of org.alfresco.repo.event.v1.model.NodeResource in project alfresco-repository by Alfresco.
the class CreateRepoEventIT method testCreateContentInFolderStructure.
@Test
public void testCreateContentInFolderStructure() {
final NodeRef grandParent = createNode(ContentModel.TYPE_FOLDER);
final NodeRef parent = createNode(ContentModel.TYPE_FOLDER, grandParent);
createNode(ContentModel.TYPE_CONTENT, parent);
final NodeResource resource = getNodeResource(3);
List<String> primaryHierarchy = resource.getPrimaryHierarchy();
assertNotNull(primaryHierarchy);
assertEquals("Wrong hierarchy", 3, primaryHierarchy.size());
assertEquals("Wrong parent", parent.getId(), primaryHierarchy.get(0));
}
use of org.alfresco.repo.event.v1.model.NodeResource in project alfresco-repository by Alfresco.
the class CreateRepoEventIT method testFileNodeType.
@Test
public void testFileNodeType() {
createNode(ContentModel.TYPE_CONTENT);
final NodeResource resource = getNodeResource(1);
assertEquals("cm:content node type was not found", "cm:content", resource.getNodeType());
assertTrue("isFile flag should be TRUE for nodeType=cm:content. ", resource.isFile());
assertFalse("isFolder flag should be FALSE for nodeType=cm:content. ", resource.isFolder());
}
Aggregations