1
19
20 package com.liferay.portlet.documentlibrary.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.documentlibrary.service.DLFileEntryServiceUtil;
26
27
73 public class DLFileEntryServiceJSON {
74 public static JSONObject addFileEntry(long folderId, java.lang.String name,
75 java.lang.String title, java.lang.String description,
76 java.lang.String[] tagsEntries, java.lang.String extraSettings,
77 byte[] bytes, boolean addCommunityPermissions,
78 boolean addGuestPermissions)
79 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
80 com.liferay.portal.SystemException {
81 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
82 name, title, description, tagsEntries, extraSettings, bytes,
83 addCommunityPermissions, addGuestPermissions);
84
85 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
86 }
87
88 public static JSONObject addFileEntry(long folderId, java.lang.String name,
89 java.lang.String title, java.lang.String description,
90 java.lang.String[] tagsEntries, java.lang.String extraSettings,
91 byte[] bytes, java.lang.String[] communityPermissions,
92 java.lang.String[] guestPermissions)
93 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
94 com.liferay.portal.SystemException {
95 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.addFileEntry(folderId,
96 name, title, description, tagsEntries, extraSettings, bytes,
97 communityPermissions, guestPermissions);
98
99 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
100 }
101
102 public static void deleteFileEntry(long folderId, java.lang.String name)
103 throws com.liferay.portal.PortalException,
104 com.liferay.portal.SystemException, java.rmi.RemoteException {
105 DLFileEntryServiceUtil.deleteFileEntry(folderId, name);
106 }
107
108 public static void deleteFileEntry(long folderId, java.lang.String name,
109 double version)
110 throws com.liferay.portal.PortalException,
111 com.liferay.portal.SystemException, java.rmi.RemoteException {
112 DLFileEntryServiceUtil.deleteFileEntry(folderId, name, version);
113 }
114
115 public static void deleteFileEntryByTitle(long folderId,
116 java.lang.String titleWithExtension)
117 throws com.liferay.portal.PortalException,
118 com.liferay.portal.SystemException, java.rmi.RemoteException {
119 DLFileEntryServiceUtil.deleteFileEntryByTitle(folderId,
120 titleWithExtension);
121 }
122
123 public static JSONArray getFileEntries(long folderId)
124 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
125 com.liferay.portal.SystemException {
126 java.util.List<com.liferay.portlet.documentlibrary.model.DLFileEntry> returnValue =
127 DLFileEntryServiceUtil.getFileEntries(folderId);
128
129 return DLFileEntryJSONSerializer.toJSONArray(returnValue);
130 }
131
132 public static JSONObject getFileEntry(long folderId, java.lang.String name)
133 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
134 com.liferay.portal.SystemException {
135 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntry(folderId,
136 name);
137
138 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
139 }
140
141 public static JSONObject getFileEntryByTitle(long folderId,
142 java.lang.String titleWithExtension)
143 throws java.rmi.RemoteException, com.liferay.portal.PortalException,
144 com.liferay.portal.SystemException {
145 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.getFileEntryByTitle(folderId,
146 titleWithExtension);
147
148 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
149 }
150
151 public static com.liferay.lock.model.Lock getFileEntryLock(long folderId,
152 java.lang.String name)
153 throws com.liferay.portal.PortalException, java.rmi.RemoteException {
154 com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.getFileEntryLock(folderId,
155 name);
156
157 return returnValue;
158 }
159
160 public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
161 java.lang.String name)
162 throws com.liferay.portal.PortalException,
163 com.liferay.portal.SystemException, java.rmi.RemoteException {
164 com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
165 name);
166
167 return returnValue;
168 }
169
170 public static com.liferay.lock.model.Lock lockFileEntry(long folderId,
171 java.lang.String name, java.lang.String owner, long expirationTime)
172 throws com.liferay.portal.PortalException,
173 com.liferay.portal.SystemException, java.rmi.RemoteException {
174 com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.lockFileEntry(folderId,
175 name, owner, expirationTime);
176
177 return returnValue;
178 }
179
180 public static com.liferay.lock.model.Lock refreshFileEntryLock(
181 java.lang.String lockUuid, long expirationTime)
182 throws com.liferay.portal.PortalException, java.rmi.RemoteException {
183 com.liferay.lock.model.Lock returnValue = DLFileEntryServiceUtil.refreshFileEntryLock(lockUuid,
184 expirationTime);
185
186 return returnValue;
187 }
188
189 public static void unlockFileEntry(long folderId, java.lang.String name)
190 throws java.rmi.RemoteException {
191 DLFileEntryServiceUtil.unlockFileEntry(folderId, name);
192 }
193
194 public static void unlockFileEntry(long folderId, java.lang.String name,
195 java.lang.String lockUuid)
196 throws com.liferay.portal.PortalException, java.rmi.RemoteException {
197 DLFileEntryServiceUtil.unlockFileEntry(folderId, name, lockUuid);
198 }
199
200 public static JSONObject updateFileEntry(long folderId, long newFolderId,
201 java.lang.String name, java.lang.String sourceFileName,
202 java.lang.String title, java.lang.String description,
203 java.lang.String[] tagsEntries, java.lang.String extraSettings,
204 byte[] bytes)
205 throws com.liferay.portal.PortalException,
206 com.liferay.portal.SystemException, java.rmi.RemoteException {
207 com.liferay.portlet.documentlibrary.model.DLFileEntry returnValue = DLFileEntryServiceUtil.updateFileEntry(folderId,
208 newFolderId, name, sourceFileName, title, description,
209 tagsEntries, extraSettings, bytes);
210
211 return DLFileEntryJSONSerializer.toJSONObject(returnValue);
212 }
213 }