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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations