public Boolean hasAspect(NodeRef nodeRef, QName typeQName) { return nodeService.hasAspect(nodeRef, typeQName); } }
/** * @see org.alfresco.service.cmr.tagging.TaggingService#isTagScope(org.alfresco.service.cmr.repository.NodeRef) */ public boolean isTagScope(NodeRef nodeRef) { // Determines whether the node has the tag scope aspect return this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE); }
@Override public Boolean doWork() throws Exception { return new Boolean(nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE)); } }, AuthenticationUtil.getSystemUserName());
@Override public boolean hasAspect(final NodeRef nodeRef, final QName aspectTypeQName) { return apiFacet.getNodeService().hasAspect(nodeRef, aspectTypeQName); }
/** * @return <code>true</code> if this node is a working copy */ public boolean getIsWorkingCopy() { return this.services.getNodeService().hasAspect(this.nodeRef, ContentModel.ASPECT_WORKING_COPY); }
/** * Fired once per node that was copied, after the copy has completed. * We need to add in all the tags to the scope. */ public void onCopyComplete(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef, boolean copyToNewNode, Map<NodeRef, NodeRef> copyMap) { if (this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE)) { updateAllScopeTags(targetNodeRef, Boolean.TRUE); } }
@Override @Extend(traitAPI=CheckOutCheckInServiceTrait.class,extensionAPI=CheckOutCheckInServiceExtension.class) public boolean isWorkingCopy(NodeRef nodeRef) { return nodeService.hasAspect(nodeRef, ContentModel.ASPECT_WORKING_COPY); }
public boolean isCreatedByRenditionService2(NodeRef sourceNodeRef, String renditionName) { boolean result = false; NodeRef renditionNode = getRenditionNode(sourceNodeRef, renditionName); if (renditionNode != null) { result = nodeService.hasAspect(renditionNode, RenditionModel.ASPECT_RENDITION2); } return result; }
/** * Fired once per node, before a copy overrides one node (which is possibly newly created) with the contents * of another one. * We should remove any tags from the scope, as they'll shortly be overwritten. */ public void beforeCopy(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef) { if (this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE)) { updateAllScopeTags(targetNodeRef, Boolean.FALSE); } }
/** * @see org.alfresco.service.cmr.tagging.TaggingService#removeTagScope(org.alfresco.service.cmr.repository.NodeRef) */ public void removeTagScope(NodeRef nodeRef) { if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE) == true) { this.nodeService.removeAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE); } }
private void checkPackage(NodeRef packageRef) { if (packageRef == null || nodeService.hasAspect(packageRef, PCKG_ASPECT) == false) { String msg = "The package NodeRef must implement the aspect: " + PCKG_ASPECT; throw new WorkflowException(msg); } }
/** * @return <code>true</code> if this node is a working copy */ public boolean getIsWorkingCopy() { return this.services.getNodeService().hasAspect(this.nodeRef, ContentModel.ASPECT_WORKING_COPY); }
/** * @see org.alfresco.service.cmr.tagging.TaggingService#removeTagScope(org.alfresco.service.cmr.repository.NodeRef) */ public void removeTagScope(NodeRef nodeRef) { if (this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE) == true) { this.nodeService.removeAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE); } }
public void afterCheckOut(NodeRef workingCopy) { if (this.nodeService.exists(workingCopy) == true && this.nodeService.hasAspect(workingCopy, ContentModel.ASPECT_TAGGABLE) == true && this.nodeService.hasAspect(workingCopy, ContentModel.ASPECT_WORKING_COPY)) { updateAllScopeTags(workingCopy, Boolean.FALSE); } }
@Override public boolean isVersioned(NodeRef nodeRef) { if (logger.isDebugEnabled()) { logger.debug("Run as user " + AuthenticationUtil.getRunAsUser()); logger.debug("Fully authenticated " + AuthenticationUtil.getFullyAuthenticatedUser()); } return this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE); } }
public void deleteRendition(NodeRef sourceNodeRef, String renditionName) { NodeRef renditionNode = getRenditionNode(sourceNodeRef, renditionName); if (renditionNode != null) { if (nodeService.hasAspect(renditionNode, RenditionModel.ASPECT_RENDITION2)) { nodeService.deleteNode(renditionNode); } } }
@Override public void onDeleteAssociation(AssociationRef nodeAssocRef) { // The act:actionSchedule type must have the association, so remove the source when the // association is deleted. NodeRef actionScheduleNodeRef = nodeAssocRef.getSourceRef(); if (nodeService.exists(actionScheduleNodeRef) && !nodeService.hasAspect(actionScheduleNodeRef, ContentModel.ASPECT_PENDING_DELETE)) { // Delete the source nodeService.deleteNode(actionScheduleNodeRef); } }
/** * @see org.alfresco.service.cmr.tagging.TaggingService#refreshTagScope(org.alfresco.service.cmr.repository.NodeRef, boolean) */ public void refreshTagScope(NodeRef nodeRef, boolean async) { if (this.nodeService.exists(nodeRef) == true && this.nodeService.hasAspect(nodeRef, ContentModel.ASPECT_TAGSCOPE) == true) { Action action = this.actionService.createAction(RefreshTagScopeActionExecuter.NAME); this.actionService.executeAction(action, nodeRef, false, async); } }
@Override public Void execute() throws Throwable { NodeRef shuffledNodeRef = getNodeForPath(testConnection, TEST_DIR + "\\" + FILE_NAME); assertTrue("node is not versionable", nodeService.hasAspect(shuffledNodeRef, ContentModel.ASPECT_VERSIONABLE)); assertEquals("shuffledNode ref is different", shuffledNodeRef, testContext.testNodeRef); assertEquals("Unexpected content size", contentService.getReader(shuffledNodeRef, ContentModel.PROP_CONTENT).getSize(), UPDATED_TEXT.length()); return null; } };
@Override public Void execute() throws Throwable { NodeRef file2NodeRef = getNodeForPath(testConnection, FILE_PATH2); assertNotNull("file2 node ref is null", file2NodeRef); //assertEquals(nodeService.getProperty(file2NodeRef, ContentModel.PROP_LASTNAME), LAST_NAME); assertTrue("does not have versionable aspect", nodeService.hasAspect(file2NodeRef, ContentModel.ASPECT_VERSIONABLE)); assertTrue("sample property is null", nodeService.getProperty(file2NodeRef, TransferModel.PROP_ENDPOINT_PROTOCOL) != null); return null; } };