Search in sources :

Example 21 with PropertyMap

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

the class RemoteAlfrescoTicketServiceTest method createUser.

private void createUser(String userName) {
    // if user with given user name doesn't already exist then create user
    if (this.authenticationService.authenticationExists(userName) == false) {
        // create user
        this.authenticationService.createAuthentication(userName, PASSWORD.toCharArray());
        // create person properties
        PropertyMap personProps = new PropertyMap();
        personProps.put(ContentModel.PROP_USERNAME, userName);
        personProps.put(ContentModel.PROP_FIRSTNAME, "First");
        personProps.put(ContentModel.PROP_LASTNAME, "Last");
        personProps.put(ContentModel.PROP_EMAIL, "FirstName123.LastName123@email.com");
        personProps.put(ContentModel.PROP_JOBTITLE, "JobTitle123");
        personProps.put(ContentModel.PROP_JOBTITLE, "Organisation123");
        // create person node for user
        this.personService.createPerson(personProps);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 22 with PropertyMap

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

the class SubscriptionServiceRestApiTest 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 23 with PropertyMap

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

the class TaggingServiceTest method createUser.

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

Example 24 with PropertyMap

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

the class ThumbnailServiceTest method createUser.

private void createUser(String userName) {
    // if user with given user name doesn't already exist then create user
    if (this.authenticationService.authenticationExists(userName) == false) {
        // create user
        this.authenticationService.createAuthentication(userName, "password".toCharArray());
        // create person properties
        PropertyMap personProps = new PropertyMap();
        personProps.put(ContentModel.PROP_USERNAME, userName);
        personProps.put(ContentModel.PROP_FIRSTNAME, "First");
        personProps.put(ContentModel.PROP_LASTNAME, "Last");
        personProps.put(ContentModel.PROP_EMAIL, "FirstName123.LastName123@email.com");
        personProps.put(ContentModel.PROP_JOBTITLE, "JobTitle123");
        personProps.put(ContentModel.PROP_JOBTITLE, "Organisation123");
        // create person node for user
        this.personService.createPerson(personProps);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 25 with PropertyMap

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

the class InvitationWebScriptTest method createUser.

private void createUser(String userName, String firstName, String lastName) {
    this.authenticationService.createAuthentication(userName, "PWD".toCharArray());
    PropertyMap ppOne = new PropertyMap(5);
    ppOne.put(ContentModel.PROP_USERNAME, userName);
    ppOne.put(ContentModel.PROP_FIRSTNAME, firstName);
    ppOne.put(ContentModel.PROP_LASTNAME, lastName);
    String email = firstName + "@email.com";
    ppOne.put(ContentModel.PROP_EMAIL, email);
    ppOne.put(ContentModel.PROP_JOBTITLE, "jobTitle");
    NodeRef person = personService.createPerson(ppOne);
    String avatarUrl = makeAvatar(nodeService, person);
    // Create expected user properties
    HashMap<String, String> properties = new HashMap<String, String>(4);
    properties.put("firstName", firstName);
    properties.put("lastName", lastName);
    properties.put("email", email);
    properties.put("avatar", avatarUrl);
    userProperties.put(userName, properties);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) PropertyMap(org.alfresco.util.PropertyMap) HashMap(java.util.HashMap)

Aggregations

PropertyMap (org.alfresco.util.PropertyMap)38 NodeRef (org.alfresco.service.cmr.repository.NodeRef)6 Serializable (java.io.Serializable)3 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)3 HashMap (java.util.HashMap)2 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)2 ContentWriter (org.alfresco.service.cmr.repository.ContentWriter)2 Version (org.alfresco.service.cmr.version.Version)2 QName (org.alfresco.service.namespace.QName)2 Date (java.util.Date)1 Map (java.util.Map)1 Set (java.util.Set)1 Relationship (org.alfresco.module.org_alfresco_module_rm.relationship.Relationship)1 Role (org.alfresco.module.org_alfresco_module_rm.role.Role)1 Repository (org.alfresco.repo.model.Repository)1 AuthenticationComponent (org.alfresco.repo.security.authentication.AuthenticationComponent)1 RunAsWork (org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork)1 ContentService (org.alfresco.service.cmr.repository.ContentService)1 NodeService (org.alfresco.service.cmr.repository.NodeService)1 MutableAuthenticationService (org.alfresco.service.cmr.security.MutableAuthenticationService)1