Search in sources :

Example 6 with PropertyMap

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

the class PutMethodTest method createUser.

private void createUser(String userName) {
    if (!authenticationService.authenticationExists(userName)) {
        authenticationService.createAuthentication(userName, "PWD".toCharArray());
    }
    if (!personService.personExists(userName)) {
        PropertyMap ppOne = new PropertyMap();
        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");
        personService.createPerson(ppOne);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 7 with PropertyMap

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

the class GroupsTest 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 8 with PropertyMap

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

the class NodeWebScripTest method createUser.

private void createUser(final String userName, boolean contributor) {
    // This ensures a predictable password etc
    if (this.personService.personExists(userName)) {
        this.personService.deletePerson(userName);
    }
    if (this.authenticationService.authenticationExists(userName)) {
        this.authenticationService.deleteAuthentication(userName);
    }
    // Create a fresh user
    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
    personService.createPerson(personProps);
    // Set site permissions as needed
    if (contributor) {
        this.siteService.setMembership(TEST_SITE_NAME, userName, SiteModel.SITE_CONTRIBUTOR);
    } else {
        this.siteService.setMembership(TEST_SITE_NAME, userName, SiteModel.SITE_CONSUMER);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 9 with PropertyMap

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

the class QuickShareRestApiTest method createUser.

private void createUser(String userName) {
    if (!authenticationService.authenticationExists(userName)) {
        authenticationService.createAuthentication(userName, "PWD".toCharArray());
    }
    if (!personService.personExists(userName)) {
        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");
        personService.createPerson(ppOne);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

Example 10 with PropertyMap

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

the class RatingRestApiTest method createUser.

private void createUser(String userName) {
    if (!authenticationService.authenticationExists(userName)) {
        authenticationService.createAuthentication(userName, "PWD".toCharArray());
    }
    if (!personService.personExists(userName)) {
        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");
        personService.createPerson(ppOne);
    }
}
Also used : PropertyMap(org.alfresco.util.PropertyMap)

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