1
19
20 package com.liferay.portlet.imagegallery.service.http;
21
22 import com.liferay.portal.kernel.json.JSONArray;
23 import com.liferay.portal.kernel.json.JSONObject;
24
25 import com.liferay.portlet.imagegallery.service.IGFolderServiceUtil;
26
27
73 public class IGFolderServiceJSON {
74 public static JSONObject addFolder(long plid, long parentFolderId,
75 java.lang.String name, java.lang.String description,
76 boolean addCommunityPermissions, boolean addGuestPermissions)
77 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
78 com.liferay.portal.SystemException {
79 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.addFolder(plid,
80 parentFolderId, name, description, addCommunityPermissions,
81 addGuestPermissions);
82
83 return IGFolderJSONSerializer.toJSONObject(returnValue);
84 }
85
86 public static JSONObject addFolder(long plid, long parentFolderId,
87 java.lang.String name, java.lang.String description,
88 java.lang.String[] communityPermissions,
89 java.lang.String[] guestPermissions)
90 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
91 com.liferay.portal.SystemException {
92 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.addFolder(plid,
93 parentFolderId, name, description, communityPermissions,
94 guestPermissions);
95
96 return IGFolderJSONSerializer.toJSONObject(returnValue);
97 }
98
99 public static JSONObject copyFolder(long plid, long sourceFolderId,
100 long parentFolderId, java.lang.String name,
101 java.lang.String description, boolean addCommunityPermissions,
102 boolean addGuestPermissions)
103 throws com.liferay.portal.PortalException,
104 com.liferay.portal.SystemException, java.rmi.RemoteException {
105 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.copyFolder(plid,
106 sourceFolderId, parentFolderId, name, description,
107 addCommunityPermissions, addGuestPermissions);
108
109 return IGFolderJSONSerializer.toJSONObject(returnValue);
110 }
111
112 public static void deleteFolder(long folderId)
113 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
114 com.liferay.portal.SystemException {
115 IGFolderServiceUtil.deleteFolder(folderId);
116 }
117
118 public static JSONObject getFolder(long folderId)
119 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
120 com.liferay.portal.SystemException {
121 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.getFolder(folderId);
122
123 return IGFolderJSONSerializer.toJSONObject(returnValue);
124 }
125
126 public static JSONObject getFolder(long groupId, long parentFolderId,
127 java.lang.String name)
128 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
129 com.liferay.portal.SystemException {
130 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.getFolder(groupId,
131 parentFolderId, name);
132
133 return IGFolderJSONSerializer.toJSONObject(returnValue);
134 }
135
136 public static JSONArray getFolders(long groupId, long parentFolderId)
137 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
138 com.liferay.portal.SystemException {
139 java.util.List<com.liferay.portlet.imagegallery.model.IGFolder> returnValue =
140 IGFolderServiceUtil.getFolders(groupId, parentFolderId);
141
142 return IGFolderJSONSerializer.toJSONArray(returnValue);
143 }
144
145 public static JSONObject updateFolder(long folderId, long parentFolderId,
146 java.lang.String name, java.lang.String description,
147 boolean mergeWithParentFolder)
148 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
149 com.liferay.portal.SystemException {
150 com.liferay.portlet.imagegallery.model.IGFolder returnValue = IGFolderServiceUtil.updateFolder(folderId,
151 parentFolderId, name, description, mergeWithParentFolder);
152
153 return IGFolderJSONSerializer.toJSONObject(returnValue);
154 }
155 }