Fórum

Save json file in Liferay

Alex Filia, modificado 10 Anos atrás.

Save json file in Liferay

New Member Postagens: 24 Data de Entrada: 15/04/13 Postagens Recentes
Hi all!emoticon I have JSONArray object than I need save as .json file on server. Of course I can call
toJSONString()
and write to file. But what location of this file i should set to see that file in Documents and Media in Control Panel?
What is the best way to do this?
thumbnail
Joaquin Cabal, modificado 10 Anos atrás.

RE: Save json file in Liferay

Regular Member Postagens: 106 Data de Entrada: 07/09/09 Postagens Recentes
Hi Alex,
Are you working on a portlet with this file?
If it is, you can crate a folder and then add the file with the DLFileEntryLocalServiceUtil service. You have to see the parameters you need to pass.

Hope this helps
Alex Filia, modificado 10 Anos atrás.

RE: Save json file in Liferay

New Member Postagens: 24 Data de Entrada: 15/04/13 Postagens Recentes
Joaquin Cabal:
Hi Alex,
Are you working on a portlet with this file?
If it is, you can crate a folder and then add the file with the DLFileEntryLocalServiceUtil service. You have to see the parameters you need to pass.

Hope this helps

The problem is I haven't request and I don't know how get repositoryId and folderId params for DLAppServiceUtil.addFileEntry(...)
How I can get default value of repositoryId and folderId?
thumbnail
Joaquin Cabal, modificado 10 Anos atrás.

RE: Save json file in Liferay

Regular Member Postagens: 106 Data de Entrada: 07/09/09 Postagens Recentes
Hi Alex,
RepositoryId = scopeGroupId (in default liferay repository), and the folder you can obtein by name

Regards!