@Override public String doWork() throws Exception { return (String) nodeService.getProperty(contextNodeRef, ImapModel.PROP_CHANGE_TOKEN); } }, AuthenticationUtil.getSystemUserName());
@Override public boolean isDraftBlogPost(NodeRef blogPostNode) { return nodeService.getProperty(blogPostNode, ContentModel.PROP_PUBLISHED) == null; }
public String getName(NodeRef nodeRef) { try { Object name = nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); return (name instanceof String ? (String) name : null); } catch(InvalidNodeRefException inre) { return null; } }
public boolean isClientControlled(NodeRef nodeRef) { Boolean clientControlled = (Boolean)nodeService.getProperty(nodeRef, ContentModel.PROP_CLIENT_CONTROLLED); return clientControlled != null && clientControlled.booleanValue(); }
public boolean isCancelled(NodeRef downloadNodeRef) { validateNode(downloadNodeRef); return (Boolean)nodeService.getProperty(downloadNodeRef, DownloadModel.PROP_CANCELLED); }
/** * @see org.alfresco.repo.node.NodeServicePolicies.OnAddAspectPolicy#onAddAspect(org.alfresco.service.cmr.repository.NodeRef, org.alfresco.service.namespace.QName) * @exception AlfrescoRuntimeException Throws if the <b>alias</b> property is duplicated. */ public void onAddAspect(NodeRef nodeRef, QName aspectTypeQName) { Object alias = nodeService.getProperty(nodeRef, EmailServerModel.PROP_ALIAS); if (alias != null) { addAlias(nodeRef, alias.toString()); } }
public long getUserQuota(String userName) { Long currentQuota = null; NodeRef personNodeRef = getPerson(userName); if (personNodeRef != null) { currentQuota = (Long)nodeService.getProperty(personNodeRef, ContentModel.PROP_SIZE_QUOTA); } return (currentQuota == null ? -1 : currentQuota); }
/** * Gets a scipt processor based on the node reference of a script * * @param scriptNode the node reference of the script * @return ScriptProcessor the script processor */ protected ScriptProcessor getScriptProcessor(NodeRef scriptNode) { String scriptName = (String)this.nodeService.getProperty(scriptNode, ContentModel.PROP_NAME); return getScriptProcessorImpl(scriptName); }
@Override public List<BlogPostInfo> getPage() { List<BlogPostInfo> blogPostInfos = new ArrayList<BlogPostInfo>(nodeRefs.size()); for (NodeRef nodeRef : nodeRefs) { String postName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME); blogPostInfos.add(new BlogPostInfoImpl(nodeRef, blogContainerNode, postName)); } return blogPostInfos; }
private boolean isUserInGroup(String username, NodeRef group) { // Get the group name String name = (String)nodeService.getProperty(group, ContentModel.PROP_AUTHORITY_NAME); // Get all group members Set<String> groupMembers = authorityService.getContainedAuthorities(AuthorityType.USER, name, false); // Chekc if the user is a group member. return groupMembers != null && groupMembers.contains(username); }
@Override public Serializable getProperty(NodeRef nodeRef, QName qname) { return apiFacet.getNodeService().getProperty(nodeRef, qname); }
@Override public void beforeDeleteNode(NodeRef nodeRef) { String userName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_USER_USERNAME); if (userName != null) { removeAuthenticationFromCache(userName); } }
/** * This method checks if the current fully authenticated user is the cm:creator of the specified node. */ private boolean isCurrentUserNodeCreator(NodeRef targetNode) { final String currentUser = AuthenticationUtil.getFullyAuthenticatedUser(); Serializable creator = nodeService.getProperty(targetNode, ContentModel.PROP_CREATOR); return currentUser.equals(creator); }
private boolean canEditPermission(NodeRef commentNodeRef) { String creator = (String)nodeService.getProperty(commentNodeRef, ContentModel.PROP_CREATOR); Serializable owner = nodeService.getProperty(commentNodeRef, ContentModel.PROP_OWNER); String currentUser = AuthenticationUtil.getFullyAuthenticatedUser(); boolean isSiteManager = permissionService.hasPermission(commentNodeRef, SiteModel.SITE_MANAGER) == (AccessStatus.ALLOWED); boolean isCoordinator = permissionService.hasPermission(commentNodeRef, PermissionService.COORDINATOR) == (AccessStatus.ALLOWED); return (isSiteManager || isCoordinator || currentUser.equals(creator) || currentUser.equals(owner)); }
public Void execute() throws Throwable { NodeRef person = personService.getPerson(username); NodeRef homeFolder = DefaultTypeConverter.INSTANCE.convert(NodeRef.class, nodeService.getProperty(person, ContentModel.PROP_HOMEFOLDER)); if (homeFolder == null) { throw new IllegalStateException("Home folder not created lazily"); } return null; } }, true, true);
public void beforeDeleteNodeSite(NodeRef siteNodeRef) { String siteId = (String)nodeService.getProperty(siteNodeRef, ContentModel.PROP_NAME); Set<String> deletedSiteIds = (Set<String>)AlfrescoTransactionSupport.getResource(KEY_DELETED_SITE_IDS); if (deletedSiteIds == null) { deletedSiteIds = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>()); // Java 6 AlfrescoTransactionSupport.bindResource(KEY_DELETED_SITE_IDS, deletedSiteIds); } deletedSiteIds.add(siteId); AlfrescoTransactionSupport.bindListener(deleteSiteTransactionListener); }
private ContentData getContentData(NodeRef nodeRef) { // Checks if the node is content and if so gets the ContentData QName type = this.nodeService.getType(nodeRef); ContentData content = null; if (this.dictionaryService.isSubClass(type, ContentModel.TYPE_CONTENT)) { content = (ContentData) this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT); } return content; }
private void testCancelled(NodeRef transferRecord) throws TransferFatalException { Status currentStatus = Status.valueOf((String)nodeService.getProperty(transferRecord, TransferModel.PROP_TRANSFER_STATUS)); if (Status.CANCELLED.equals(currentStatus)) { throw new TransferFatalException(MSG_TRANSFER_CANCELLED, new Object[] { transferRecord.toString() }); } }
private void updateTagProperty() { Serializable tags = this.services.getNodeService().getProperty(this.nodeRef, ContentModel.PROP_TAGS); if (this.properties != null) { this.properties.put(ContentModel.PROP_TAGS.toString(), getValueConverter().convertValueForScript(ContentModel.PROP_TAGS, tags)); } }
public boolean isDefinitionDeployed(NodeRef workflowDefinition) { if (!nodeService.getType(workflowDefinition).equals(WorkflowModel.TYPE_WORKFLOW_DEF)) { throw new WorkflowException( "Node " + workflowDefinition + " is not of type 'bpm:workflowDefinition'"); } String engineId = (String) nodeService.getProperty(workflowDefinition, WorkflowModel.PROP_WORKFLOW_DEF_ENGINE_ID); ContentReader contentReader = contentService.getReader(workflowDefinition, ContentModel.PROP_CONTENT); return isDefinitionDeployed(engineId, contentReader.getContentInputStream(), contentReader.getMimetype()); }