como logro agregar archivos al Alfresco a travez de java?
he realizado este codigo, pero aun no logro insertar documentos
mi correo es :hernandez.jorge51@gmail.com
Gracias
public void uploadDocument(String authTicket, File fileobj, String filename, String filetype, String description, String destination) {
try {
String urlString = "http://172.16.0.222:8080/alfresco/s/api/upload?alf_ticket=" + authTicket;
System.out.println("The upload url:::" + urlString);
HttpClient client = new HttpClient();
PostMethod mPost = new PostMethod(urlString);
Part[] parts = {
new FilePart("filedata", filename, fileobj, filetype, null),
new StringPart("filename", filename),
new StringPart("description", "description"),
new StringPart("siteid", "demo"),
new StringPart("containerid", "documentlibrary"),
};
mPost.setRequestEntity(
new MultipartRequestEntity(parts, mPost.getParams())
);
int statusCode1 = client.executeMethod(mPost);
System.out.println("statusLine>>>" + statusCode1 + "......" + mPost.getStatusLine() + mPost.getResponseBodyAsString());
mPost.releaseConnection();
} catch (Exception e) {
System.out.println(e);
}
}
¿Este código produce algún error? En cliente o en servidor.
Alfresco es la version 5
run:
<?xml version="1.0" encoding="UTF-8"?>
<ticket>TICKET_18fd97bc07172a581bd85bbac85dacb3fc242c7b</ticket>
: <?xml version="1.0" encoding="UTF-8"?>
<ticket>TICKET_18fd97bc07172a581bd85bbac85dacb3fc242c7b</ticket>
numero : 47 -- 94
The upload url:::http://172.16.0.222:8080/alfresco/s/api/upload?alf_ticket=TICKET_18fd97bc07172a581bd85bbac85dacb3fc2...
statusLine>>>404......HTTP/1.1 404 Not Found{
"status" :
{
"code" : 404,
"name" : "Not Found",
"description" : "Requested resource is not available."
},
"message" : "Site (demo) not found.",
"exception" : "",
"callstack" :
[
],
"server" : "Community v5.2.0 (r135134-b14) schema 10,005",
"time" : "Jun 6, 2017 9:29:33 AM"
}
BUILD SUCCESSFUL (total time: 0 seconds)
Gracias por tu ayuda Angel
¿Tienes un sitio con el shortname demo creado en Alfresco?
te envio la Imagen Angel
Eso no es un sitio, pero si una carpeta normal.
Usted necesita crear un sitio usando el menu sitios en el menú principal.
Para veer los sitios creados, usted puede acceder la carpeta Sites.
Gracias Douglas y Angel, me salio graciassssssssssss
Discussions about Alfresco Content Services and Alfresco Process Services in Spanish
Related:
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.