02-28-2012 08:43 AM
String alfrescoUser = "usr0000000123";
String alfrescoFirstName = "José Miguel";
String alfrescoLastName = "Español";
String alfrescoEmail = "pruebas@mail_pruebas123.com";
JSONObject personaJSON = new JSONObject();
personaJSON.put("userName", alfrescoUser);
personaJSON.put("firstName", alfrescoFirstName);
personaJSON.put("lastName", alfrescoLastName);
personaJSON.put("email", alfrescoEmail);
postRequest = new HttpPost("http://'+ host + ":" + port + "/alfresco/service/api/people?alf_ticket=" + alfTicket);
input = new StringEntity(personaJSON.toString());
input.setContentType("application/json; charset=UTF-8");
input.setContentEncoding("UTF-8");
postRequest.setHeader("Content-Type","application/json; charset=UTF-8");
postRequest.setEntity(input);
response = httpClient.execute(postRequest);
set JAVA_HOME=C:\Alfresco\java
set JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF-8 -Djava.file.encoding=UTF-8 -Duser.languaje=es -Duser.region=ES -XX:PermSize=256m
set CATALINA_OPTS=%CATALINA_OPTS% -Dfile.encoding="UTF-8"
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>fileEncoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Datos de la persona : {"password":"nadadenada","userName":"usuario_pruebas04","email":"pruebas@mail_pruebas123.com","firstName":"Usuario","lastName":"Pruebás"}Codigo: 200
Respuesta del servidor ….
<< Response: HTTP/1.1 200 OK
{
"url": "\/alfresco\/service\/api\/person\/usuario_pruebas06",
"userName": "usuario_pruebas06",
"enabled": true,
"firstName": "Usuario",
"lastName": "Prueb\ufffds",
"jobtitle": null,
"organization": null,
"location": null,
"telephone": null,
"mobile": null,
"email": "pruebas@mail_pruebas123.com",
"companyaddress1": null,
"companyaddress2": null,
"companyaddress3": null,
"companypostcode": null,
"companytelephone": null,
"companyfax": null,
"companyemail": null,
"skype": null,
"instantmsg": null,
"userStatus": null,
"userStatusTime": null,
"googleusername": null,
"quota": -1,
"sizeCurrent": 0,
"emailFeedDisabled": false,
"persondescription": null
}
02-28-2012 09:19 AM
02-28-2012 09:56 AM
String alfrescoUser = "usr_001";
String alfrescoFirstName = "María";
String alfrescoLastName = "López";
String alfrescoEmail = "pruebas@mail_pruebas123.com";
String alfrescoPassword = "———";
{"password":"———","userName":"usr_001","email":"pruebas@mail_pruebas123.com","firstName":"María","lastName":"López"}
{
"url": "\/alfresco\/service\/api\/person\/usr_001",
"userName": "usr_001",
"enabled": true,
"firstName": "Mar\ufffda",
"lastName": "L\ufffdpez",
"jobtitle": null,
"organization": null,
"location": null,
"telephone": null,
"mobile": null,
"email": "pruebas@mail_pruebas123.com",
"companyaddress1": null,
"companyaddress2": null,
"companyaddress3": null,
"companypostcode": null,
"companytelephone": null,
"companyfax": null,
"companyemail": null,
"skype": null,
"instantmsg": null,
"userStatus": null,
"userStatusTime": null,
"googleusername": null,
"quota": -1,
"sizeCurrent": 0,
"emailFeedDisabled": false,
"persondescription": null
}
Activada
Mar�a L�pez
usr_001
pruebas@mail_pruebas123.com
02-28-2012 10:24 AM
02-28-2012 12:32 PM
02-29-2012 03:05 AM
postRequest.setHeader("Content-Type","application/json; charset=UTF-8");
postRequest = new HttpPost("http://'+ host + ":" + port + "/alfresco/service/api/people?alf_ticket=" + finder.getValue());
String persona = "{\"password\":\"welcome\",\"userName\":\"usr_0023\",\"email\":\"pruebas@mail_pruebas123.com\",\"firstName\":\"Usuário\",\"lastName\":\"Pruebás\"}";
byte[] utf81 = persona.getBytes("UTF-8");
String personaUTF = new String(utf81, "UTF8");
System.out.print("Persona UTF : " + personaUTF);
input = new StringEntity(personaUTF);
input.setContentEncoding("UTF-8");
input.setContentType("application/json;charset=UTF-8");
postRequest.setEntity(input);
response = httpClient.execute(postRequest);
response.addHeader("Content-Type","application/json; charset=UTF-8");
Persona UTF : {"password":"welcome","userName":"usr_0023","email":"pruebas@mail_pruebas123.com","firstName":"Usuário","lastName":"Pruebás"}
Codigo: 200
Respuesta del servidor ….
<< Response: HTTP/1.1 200 OK
{
"url": "\/alfresco\/service\/api\/person\/usr_0023",
"userName": "usr_0023",
"enabled": true,
"firstName": "Usu\ufffdrio",
"lastName": "Prueb\ufffds",
"jobtitle": null,
"organization": null,
"location": null,
"telephone": null,
"mobile": null,
"email": "pruebas@mail_pruebas123.com",
"companyaddress1": null,
"companyaddress2": null,
"companyaddress3": null,
"companypostcode": null,
"companytelephone": null,
"companyfax": null,
"companyemail": null,
"skype": null,
"instantmsg": null,
"userStatus": null,
"userStatusTime": null,
"googleusername": null,
"quota": -1,
"sizeCurrent": 0,
"emailFeedDisabled": false,
"persondescription": null
}
05-21-2012 09:47 AM
08-13-2015 09:20 AM
09-28-2015 02:40 AM
06-06-2017 08:47 AM
Hi all,
We are seeing this topic is interesting (and useful) for a lot of people but it is starting to contain many questions (and use cases) in one thread.
Please open new questions to continue the discussion on single use cases and issues.
Many thanks.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.