Search in sources :

Example 61 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 62 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 63 with PropertyMap

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

the class PersonServiceTest method createUser.

private void createUser(String userName) {
    if (this.authenticationService.authenticationExists(userName) == false) {
        this.authenticationService.createAuthentication(userName, "password".toCharArray());
        PropertyMap personProps = new PropertyMap();
        personProps.put(ContentModel.PROP_USERNAME, userName);
        personProps.put(ContentModel.PROP_FIRSTNAME, "myFirstName");
        personProps.put(ContentModel.PROP_LASTNAME, "myLastName");
        personProps.put(ContentModel.PROP_EMAIL, "myFirstName.myLastName@email.com");
        personProps.put(ContentModel.PROP_JOBTITLE, "myJobTitle");
        personProps.put(ContentModel.PROP_JOBTITLE, "myOrganisation");
        this.personService.createPerson(personProps);
        this.createdPeople.add(userName);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 64 with PropertyMap

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

the class PreferenceServiceTest 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 65 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)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