02-28-2012 08:29 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 02:07 PM
02-29-2012 12:30 AM
02-29-2012 03:19 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");
09-05-2024 03:38 PM
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.
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.