use of org.alfresco.util.PropertyMap in project alfresco-remote-api by Alfresco.
the class CalendarRestApiTest method createUser.
private void createUser(String userName, String role) {
// 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, "FirstName123");
personProps.put(ContentModel.PROP_LASTNAME, "LastName123");
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);
}
// add the user as a member with the given role
this.siteService.setMembership(SITE_SHORT_NAME_CALENDAR, userName, role);
}
use of org.alfresco.util.PropertyMap in project alfresco-remote-api by Alfresco.
the class CustomModelImportTest 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 DownloadRestApiTest method setUp.
public void setUp() {
// Resolve required services
authenticationService = getServer().getApplicationContext().getBean("AuthenticationService", MutableAuthenticationService.class);
authenticationComponent = getServer().getApplicationContext().getBean("authenticationComponent", AuthenticationComponent.class);
contentService = getServer().getApplicationContext().getBean("ContentService", ContentService.class);
nodeService = getServer().getApplicationContext().getBean("NodeService", NodeService.class);
personService = getServer().getApplicationContext().getBean("PersonService", PersonService.class);
// Authenticate as user
this.authenticationComponent.setCurrentUser(AuthenticationUtil.getAdminUserName());
// if user with given user name doesn't already exist then create user
if (this.authenticationService.authenticationExists(TEST_USERNAME) == false) {
// create user
this.authenticationService.createAuthentication(TEST_USERNAME, "password".toCharArray());
// create person properties
PropertyMap personProps = new PropertyMap();
personProps.put(ContentModel.PROP_USERNAME, TEST_USERNAME);
personProps.put(ContentModel.PROP_FIRSTNAME, "FirstName123");
personProps.put(ContentModel.PROP_LASTNAME, "LastName123");
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);
}
Repository repositoryHelper = (Repository) getServer().getApplicationContext().getBean("repositoryHelper");
NodeRef companyHome = repositoryHelper.getCompanyHome();
// Create some static test content
rootFolder = createNode(companyHome, "rootFolder", ContentModel.TYPE_FOLDER, AuthenticationUtil.getAdminUserName());
rootFile = createNodeWithTextContent(companyHome, "rootFile", ContentModel.TYPE_CONTENT, AuthenticationUtil.getAdminUserName(), "Root file content");
level1File = createNodeWithTextContent(rootFolder, "level1File", ContentModel.TYPE_CONTENT, AuthenticationUtil.getAdminUserName(), "Level 1 file content");
level1Folder = createNode(rootFolder, "level1Folder", ContentModel.TYPE_FOLDER, AuthenticationUtil.getAdminUserName());
level2File = createNodeWithTextContent(level1Folder, "level2File", ContentModel.TYPE_CONTENT, AuthenticationUtil.getAdminUserName(), "Level 2 file content");
}
use of org.alfresco.util.PropertyMap in project alfresco-remote-api by Alfresco.
the class FacetRestApiTest 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 PersonSearchTest 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);
}
}
Aggregations