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
}
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");
prueba encriptando los nombres , busca un forma de encriptar y desencriptar algo asi como base64 y asi te quitas del lio de los caracteres especiales de el español ... luego al recibir vuelves a desencriptar y muestras el dato al cliente.
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.