public Void doWork() { nodeService.addAspect(nodeRef, QuickShareModel.ASPECT_QSHARE, props); return null; } });
public Void doWork() { nodeService.addAspect(nodeRef, QuickShareModel.ASPECT_QSHARE, props); return null; } });
private void addIndexControlAspect(NodeRef nodeRef) { Map<QName, Serializable> props = new HashMap<QName, Serializable>(2); props.put(ContentModel.PROP_IS_INDEXED, Boolean.FALSE); props.put(ContentModel.PROP_IS_CONTENT_INDEXED, Boolean.FALSE); nodeService.addAspect(nodeRef, ContentModel.ASPECT_INDEX_CONTROL, props); if (logger.isDebugEnabled()) { logger.debug("Applied index control marker: " + nodeRef); } }
private void addIndexControlAspect(NodeRef nodeRef) { Map<QName, Serializable> props = new HashMap<QName, Serializable>(2); props.put(ContentModel.PROP_IS_INDEXED, Boolean.FALSE); props.put(ContentModel.PROP_IS_CONTENT_INDEXED, Boolean.FALSE); nodeService.addAspect(nodeRef, ContentModel.ASPECT_INDEX_CONTROL, props); if (logger.isDebugEnabled()) { logger.debug("Applied index control marker: " + nodeRef); } }
private void addHiddenAspect(NodeRef nodeRef, int visibilityMask, boolean explicit) { Map<QName, Serializable> props = new HashMap<QName, Serializable>(1); props.put(ContentModel.PROP_VISIBILITY_MASK, visibilityMask); props.put(ContentModel.PROP_HIDDEN_FLAG, explicit); nodeService.addAspect(nodeRef, ContentModel.ASPECT_HIDDEN, props); if (logger.isDebugEnabled()) { logger.debug("Applied hidden marker: " + nodeRef); } }
private void addHiddenAspect(NodeRef nodeRef, int visibilityMask, boolean explicit) { Map<QName, Serializable> props = new HashMap<QName, Serializable>(1); props.put(ContentModel.PROP_VISIBILITY_MASK, visibilityMask); props.put(ContentModel.PROP_HIDDEN_FLAG, explicit); nodeService.addAspect(nodeRef, ContentModel.ASPECT_HIDDEN, props); if (logger.isDebugEnabled()) { logger.debug("Applied hidden marker: " + nodeRef); } }
@Override public Void doWork() throws Exception { if (!nodeService.hasAspect(nodeRef, RemoteCredentialsModel.ASPECT_REMOTE_CREDENTIALS_SYSTEM_CONTAINER)) { // Add the aspect nodeService.addAspect(nodeRef, RemoteCredentialsModel.ASPECT_REMOTE_CREDENTIALS_SYSTEM_CONTAINER, null); if (logger.isDebugEnabled()) logger.debug("Added the Credentials Container aspect to " + nodeRef); } return null; } });
@Override public void addAspect(NodeRef nodeRef, QName aspectTypeQName, Map<QName, Serializable> aspectProperties) throws InvalidNodeRefException, InvalidAspectException { apiFacet.getNodeService().addAspect(nodeRef, aspectTypeQName, aspectProperties); }
@SuppressWarnings("synthetic-access") public Object doWork() throws Exception { NodeRef person = personService.createPerson(properties); //MNT-9101 Share: Cancelling an invitation for a disabled user, the user gets deleted in the process. nodeService.addAspect(person, ContentModel.ASPECT_ANULLABLE, null); permissionService.setPermission(person, finalUserName, PermissionService.ALL_PERMISSIONS, true); return null; }
@SuppressWarnings("synthetic-access") public Object doWork() throws Exception { NodeRef person = personService.createPerson(properties); //MNT-9101 Share: Cancelling an invitation for a disabled user, the user gets deleted in the process. nodeService.addAspect(person, ContentModel.ASPECT_ANULLABLE, null); permissionService.setPermission(person, finalUserName, PermissionService.ALL_PERMISSIONS, true); return null; }
public Void execute() throws Throwable { // add the cm:countable aspect and set the value to 1 Map<QName, Serializable> props = new HashMap<QName, Serializable>(1); props.put(ContentModel.PROP_COUNTER, 1); nodeService.addAspect(testNode, ContentModel.ASPECT_COUNTABLE, props); return null; } });
@Override public Void doWork() throws Exception { Map<QName, Serializable> versionProperties = new HashMap<QName, Serializable>(); versionProperties.put(ContentModel.PROP_VERSION_LABEL, "0.1"); versionProperties.put(ContentModel.PROP_INITIAL_VERSION, true); versionProperties.put(ContentModel.PROP_VERSION_TYPE, VersionType.MINOR); nodeService.addAspect(doc, ContentModel.ASPECT_VERSIONABLE, versionProperties); return null; } };
public Void execute() throws Throwable { nodeService.addAspect(nodeRef, ContentModel.ASPECT_TEMPORARY, null); nodeService.deleteNode(nodeRef); return null; } };
@Commit @Test public void testLocalizedAspect() throws Exception { nodeService.addAspect( rootNodeRef, ContentModel.ASPECT_LOCALIZED, Collections.<QName, Serializable>singletonMap(ContentModel.PROP_LOCALE, Locale.CANADA_FRENCH)); // commit to check }
@Override public void buildMessageInternal() throws MessagingException { setMessageHeaders(); // Add Imap Content Aspect with properties NodeService nodeService = serviceRegistry.getNodeService(); nodeService.addAspect(this.messageFileInfo.getNodeRef(), ImapModel.ASPECT_IMAP_CONTENT, null); imapService.setFlags(messageFileInfo, flags, true); // Write content writeContent(); }
public Object execute() throws Exception { // Check that the version history has been removed VersionHistory versionHistory = versionService.getVersionHistory(nodeRef); assertNull(versionHistory); // Re-add the versionable aspect dbNodeService.addAspect(nodeRef, ContentModel.ASPECT_VERSIONABLE, null); return null; } });
@Override public void buildMessageInternal() throws MessagingException { setMessageHeaders(); // Add Imap Content Aspect with properties NodeService nodeService = serviceRegistry.getNodeService(); nodeService.addAspect(this.messageFileInfo.getNodeRef(), ImapModel.ASPECT_IMAP_CONTENT, null); imapService.setFlags(messageFileInfo, flags, true); // Write content writeContent(); }
@Test public void testDefaultPropertyOverride_AddAspect() throws Exception { Serializable nullValue = nodeService.getProperty(rootNodeRef, PROP_QNAME_PROP2); assertNull("Property should not be present", nullValue); String valueOverride = "VALUE_OVERRIDE"; Map<QName, Serializable> properties = Collections.singletonMap(PROP_QNAME_PROP2, (Serializable)valueOverride); nodeService.addAspect(rootNodeRef, ASPECT_QNAME_WITH_DEFAULT_VALUE, properties); Serializable checkValue = nodeService.getProperty(rootNodeRef, PROP_QNAME_PROP2); assertEquals("Property should not be defaulted", valueOverride, checkValue); }
@Override public Void execute() throws Throwable { NodeRef file1NodeRef = getNodeForPath(testConnection, FILE_PATH1); nodeService.addAspect(file1NodeRef, ContentModel.ASPECT_VERSIONABLE, null); ContentWriter contentWriter2 = contentService.getWriter(file1NodeRef, ContentModel.PROP_CONTENT, true); contentWriter2.putContent("test rename versionable"); nodeService.setProperty(file1NodeRef, ContentModel.PROP_LASTNAME, LAST_NAME); nodeService.setProperty(file1NodeRef, TransferModel.PROP_ENDPOINT_PROTOCOL, "http"); return null; } };
@Test public void testPass() { this.nodeService.addAspect(this.nodeRef, ContentModel.ASPECT_VERSIONABLE, null); ActionCondition condition = new ActionConditionImpl(ID, HasAspectEvaluator.NAME, null); condition.setParameterValue(HasAspectEvaluator.PARAM_ASPECT, ContentModel.ASPECT_VERSIONABLE); assertTrue(this.evaluator.evaluate(condition, this.nodeRef)); }