Fórum

Documents Library web Service

Aymane Chakour El Alami, modificado 6 Anos atrás.

Documents Library web Service

New Member Postagens: 9 Data de Entrada: 16/05/17 Postagens Recentes
Hello,

i'm new to liferay and i would like you to help me please, actually i'm trying to developp a Restful web service that needs to upload files to Liferay's Documents Library and also access and search the existing documents, please can you tell me if there is an existing web service that answers my needs.

Thanks,
Aymane
Harsh Kanakhara, modificado 6 Anos atrás.

RE: Documents Library web Service

Junior Member Postagens: 74 Data de Entrada: 06/04/17 Postagens Recentes
Liferay is providing JSON WS. You can find all the registered services provided by Liferay Portal at this URL https://domain/api/jsonws.

DLApp is the web service which you will need to fulfill your requirement.

Regards,
Harsh Kanakhara.
Aymane Chakour El Alami, modificado 6 Anos atrás.

RE: Documents Library web Service

New Member Postagens: 9 Data de Entrada: 16/05/17 Postagens Recentes
Hello,
Thank you so much.

Regards
Aymane Chakour El Alami, modificado 6 Anos atrás.

RE: Documents Library web Service

New Member Postagens: 9 Data de Entrada: 16/05/17 Postagens Recentes
Hello Harsh,

If you don't mind please i have another question, in the DLApp service , the method to upload the files to the documents library is addfileentry, i created succesfully a java client that uploads the file and everything works, but the problem is : the signature of the method addfileentry states that it returns an object FileEntry, when i try to map the Json response of the http post request to a FileEntry object it doesn't work, do you have any idea about it ?

response = client.execute(Auth.getTargetHost(), Post, Auth.getContext());
			
			final BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
			final ObjectMapper mapper = new ObjectMapper();
			final FileEntry file = mapper.readValue(rd, FileEntry.class);
Harsh Kanakhara, modificado 6 Anos atrás.

RE: Documents Library web Service

Junior Member Postagens: 74 Data de Entrada: 06/04/17 Postagens Recentes
What are you passing in JSON Object ?

If it is not working properly then please provide me the exception stack trace.

Regards,
Harsh Kanakhara.
Aymane Chakour El Alami, modificado 6 Anos atrás.

RE: Documents Library web Service

New Member Postagens: 9 Data de Entrada: 16/05/17 Postagens Recentes
Can not construct instance of com.liferay.portal.kernel.repository.model.FileEntry: abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
at [Source: java.io.BufferedReader@3cc2931c; line: 1, column: 1],

he is the message shown in the console. I Try to map the http response to a FileEntry object.
Aymane Chakour El Alami, modificado 6 Anos atrás.

RE: Documents Library web Service

New Member Postagens: 9 Data de Entrada: 16/05/17 Postagens Recentes
Hello,

Please can you reply i really need your answer, can i get the content of a file in the documents library using the liferay json webservice DLApp?

Regards