留言板

Save json file in Liferay

Alex Filia,修改在10 年前。

Save json file in Liferay

New Member 帖子: 24 加入日期: 13-4-15 最近的帖子
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,修改在10 年前。

RE: Save json file in Liferay

Regular Member 帖子: 106 加入日期: 09-9-7 最近的帖子
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,修改在10 年前。

RE: Save json file in Liferay

New Member 帖子: 24 加入日期: 13-4-15 最近的帖子
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,修改在10 年前。

RE: Save json file in Liferay

Regular Member 帖子: 106 加入日期: 09-9-7 最近的帖子
Hi Alex,
RepositoryId = scopeGroupId (in default liferay repository), and the folder you can obtein by name

Regards!