Search in sources :

Example 46 with PropertyMap

use of org.alfresco.util.PropertyMap in project alfresco-repository by Alfresco.

the class CopyServiceImplTest method testALF11964_part1.

/**
 * Tests copying a folder that contains both a node and a copy of that node.
 */
public void testALF11964_part1() {
    IntegrityChecker integrityChecker = (IntegrityChecker) ctx.getBean("integrityChecker");
    PropertyMap props = new PropertyMap();
    // Need to create a potentially recursive node structure
    props.put(ContentModel.PROP_NODE_UUID, "nodeOne");
    NodeRef nodeOne = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, ContentModel.TYPE_CONTAINER, props).getChildRef();
    props.put(ContentModel.PROP_NODE_UUID, "nodeTwo");
    NodeRef nodeTwo = nodeService.createNode(nodeOne, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, ContentModel.TYPE_CONTENT, props).getChildRef();
    props.put(ContentModel.PROP_NODE_UUID, "nodeThree");
    NodeRef nodeThree = nodeService.createNode(rootNodeRef, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, ContentModel.TYPE_CONTAINER, props).getChildRef();
    copyService.copy(nodeTwo, nodeOne, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, true);
    copyService.copy(nodeOne, nodeThree, ContentModel.ASSOC_CHILDREN, ContentModel.ASSOC_CHILDREN, true);
    integrityChecker.checkIntegrity();
}
Also used : IntegrityChecker(org.alfresco.repo.node.integrity.IntegrityChecker) NodeRef(org.alfresco.service.cmr.repository.NodeRef) PropertyMap(org.alfresco.util.PropertyMap)

Example 47 with PropertyMap

use of org.alfresco.util.PropertyMap in project alfresco-repository by Alfresco.

the class SubscriptionServiceImplTest method createPerson.

protected NodeRef createPerson(String userId) {
    deletePerson(userId);
    PropertyMap properties = new PropertyMap(5);
    properties.put(ContentModel.PROP_USERNAME, userId);
    properties.put(ContentModel.PROP_FIRSTNAME, userId);
    properties.put(ContentModel.PROP_LASTNAME, "Test");
    properties.put(ContentModel.PROP_EMAIL, userId + "@test.demo.alfresco.com");
    return personService.createPerson(properties);
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 48 with PropertyMap

use of org.alfresco.util.PropertyMap in project alfresco-repository by Alfresco.

the class TestPersonManager method makePersonProperties.

public static PropertyMap makePersonProperties(String userName) {
    PropertyMap personProps = new PropertyMap();
    personProps.put(ContentModel.PROP_USERNAME, userName);
    personProps.put(ContentModel.PROP_FIRSTNAME, userName + FIRST_NAME_SUFFIX);
    personProps.put(ContentModel.PROP_LASTNAME, userName + LAST_NAME_SUFFIX);
    personProps.put(ContentModel.PROP_EMAIL, userName + EMAIL_SUFFIX);
    personProps.put(ContentModel.PROP_JOBTITLE, userName + JOB_SUFFIX);
    personProps.put(ContentModel.PROP_JOBTITLE, userName + ORGANISATION_SUFFIX);
    return personProps;
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 49 with PropertyMap

use of org.alfresco.util.PropertyMap in project alfresco-repository by Alfresco.

the class ChainingUserRegistrySynchronizerTest method newGroupWithDisplayName.

/**
 * Constructs a description of a test group with a display name.
 *
 * @param name
 *            the name
 * @param displayName
 *            the display name
 * @param members
 *            the members
 * @return the node description
 */
private NodeDescription newGroupWithDisplayName(String name, String displayName, String... members) {
    String longName = longName(name);
    NodeDescription group = new NodeDescription(longName);
    PropertyMap properties = group.getProperties();
    properties.put(ContentModel.PROP_AUTHORITY_NAME, longName);
    properties.put(ContentModel.PROP_AUTHORITY_DISPLAY_NAME, displayName);
    if (members.length > 0) {
        Set<String> assocs = group.getChildAssociations();
        for (String member : members) {
            assocs.add(longName(member));
        }
    }
    group.setLastModified(new Date());
    return group;
}
Also used : PropertyMap(org.alfresco.util.PropertyMap) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString)

Example 50 with PropertyMap

use of org.alfresco.util.PropertyMap in project alfresco-repository by Alfresco.

the class SiteServiceImplMoreTest method createUser.

private void createUser(String userName, String nameSuffix) {
    if (AUTHENTICATION_SERVICE.authenticationExists(userName)) {
        return;
    }
    AUTHENTICATION_SERVICE.createAuthentication(userName, "PWD".toCharArray());
    PropertyMap ppOne = new PropertyMap(4);
    ppOne.put(ContentModel.PROP_USERNAME, userName);
    ppOne.put(ContentModel.PROP_FIRSTNAME, "firstName" + nameSuffix);
    ppOne.put(ContentModel.PROP_LASTNAME, "lastName" + nameSuffix);
    ppOne.put(ContentModel.PROP_EMAIL, "email" + nameSuffix + "@email.com");
    ppOne.put(ContentModel.PROP_JOBTITLE, "jobTitle");
    PERSON_SERVICE.createPerson(ppOne);
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Aggregations

PropertyMap (org.alfresco.util.PropertyMap)111 NodeRef (org.alfresco.service.cmr.repository.NodeRef)43 ContentWriter (org.alfresco.service.cmr.repository.ContentWriter)15 Test (org.junit.Test)14 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)13 QName (org.alfresco.service.namespace.QName)11 Serializable (java.io.Serializable)9 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)8 ContentReader (org.alfresco.service.cmr.repository.ContentReader)8 BaseSpringTest (org.alfresco.util.BaseSpringTest)8 FileContentReader (org.alfresco.repo.content.filestore.FileContentReader)7 DictionaryException (org.alfresco.service.cmr.dictionary.DictionaryException)7 ExpectedException (org.junit.rules.ExpectedException)7 ApplicationContext (org.springframework.context.ApplicationContext)7 StoreRef (org.alfresco.service.cmr.repository.StoreRef)6 RetryingTransactionHelper (org.alfresco.repo.transaction.RetryingTransactionHelper)5 NodeService (org.alfresco.service.cmr.repository.NodeService)5 Date (java.util.Date)4 HashMap (java.util.HashMap)4 ServiceRegistry (org.alfresco.service.ServiceRegistry)4