001
014
015 package com.liferay.portlet.documentlibrary.util;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
020 import com.liferay.portal.kernel.repository.model.FileEntry;
021 import com.liferay.portal.kernel.repository.model.FileVersion;
022 import com.liferay.portal.kernel.repository.model.Folder;
023 import com.liferay.portal.kernel.search.Hits;
024 import com.liferay.portal.kernel.security.pacl.permission.PortalRuntimePermission;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.theme.ThemeDisplay;
027 import com.liferay.portlet.documentlibrary.model.DLFileEntryType;
028 import com.liferay.portlet.documentlibrary.model.DLFileShortcut;
029
030 import java.util.List;
031 import java.util.Locale;
032 import java.util.Map;
033 import java.util.Set;
034
035 import javax.portlet.PortletPreferences;
036 import javax.portlet.PortletRequest;
037 import javax.portlet.PortletURL;
038 import javax.portlet.RenderResponse;
039
040 import javax.servlet.http.HttpServletRequest;
041
042
046 public class DLUtil {
047
048 public static void addPortletBreadcrumbEntries(
049 DLFileShortcut dlFileShortcut, HttpServletRequest request,
050 RenderResponse renderResponse)
051 throws Exception {
052
053 getDL().addPortletBreadcrumbEntries(
054 dlFileShortcut, request, renderResponse);
055 }
056
057 public static void addPortletBreadcrumbEntries(
058 FileEntry fileEntry, HttpServletRequest request,
059 RenderResponse renderResponse)
060 throws Exception {
061
062 getDL().addPortletBreadcrumbEntries(fileEntry, request, renderResponse);
063 }
064
065 public static void addPortletBreadcrumbEntries(
066 Folder folder, HttpServletRequest request,
067 LiferayPortletResponse liferayPortletResponse)
068 throws Exception {
069
070 getDL().addPortletBreadcrumbEntries(
071 folder, request, liferayPortletResponse);
072 }
073
074 public static void addPortletBreadcrumbEntries(
075 Folder folder, HttpServletRequest request, PortletURL portletURL)
076 throws Exception {
077
078 getDL().addPortletBreadcrumbEntries(folder, request, portletURL);
079 }
080
081 public static void addPortletBreadcrumbEntries(
082 Folder folder, HttpServletRequest request,
083 RenderResponse renderResponse)
084 throws Exception {
085
086 getDL().addPortletBreadcrumbEntries(folder, request, renderResponse);
087 }
088
089 public static void addPortletBreadcrumbEntries(
090 long folderId, HttpServletRequest request,
091 RenderResponse renderResponse)
092 throws Exception {
093
094 getDL().addPortletBreadcrumbEntries(folderId, request, renderResponse);
095 }
096
097 public static int compareVersions(String version1, String version2) {
098 return getDL().compareVersions(version1, version2);
099 }
100
101 public static String getAbsolutePath(
102 PortletRequest portletRequest, long folderId)
103 throws PortalException, SystemException {
104
105 return getDL().getAbsolutePath(portletRequest, folderId);
106 }
107
108 public static Set<String> getAllMediaGalleryMimeTypes() {
109 return getDL().getAllMediaGalleryMimeTypes();
110 }
111
112 public static String getDDMStructureKey(DLFileEntryType dlFileEntryType) {
113 return getDL().getDDMStructureKey(dlFileEntryType);
114 }
115
116 public static String getDDMStructureKey(String fileEntryTypeUuid) {
117 return getDL().getDDMStructureKey(fileEntryTypeUuid);
118 }
119
120 public static String getDeprecatedDDMStructureKey(
121 DLFileEntryType dlFileEntryType) {
122
123 return getDL().getDeprecatedDDMStructureKey(dlFileEntryType);
124 }
125
126 public static String getDeprecatedDDMStructureKey(long fileEntryTypeId) {
127 return getDL().getDeprecatedDDMStructureKey(fileEntryTypeId);
128 }
129
130 public static String getDividedPath(long id) {
131 return getDL().getDividedPath(id);
132 }
133
134 public static DL getDL() {
135 PortalRuntimePermission.checkGetBeanProperty(DLUtil.class);
136
137 return _dl;
138 }
139
140 public static String getDLControlPanelLink(
141 PortletRequest portletRequest, long folderId)
142 throws PortalException, SystemException {
143
144 return getDL().getDLControlPanelLink(portletRequest, folderId);
145 }
146
147 public static Map<Locale, String> getEmailFileEntryAddedBodyMap(
148 PortletPreferences preferences) {
149
150 return getDL().getEmailFileEntryAddedBodyMap(preferences);
151 }
152
153 public static boolean getEmailFileEntryAddedEnabled(
154 PortletPreferences preferences) {
155
156 return getDL().getEmailFileEntryAddedEnabled(preferences);
157 }
158
159 public static Map<Locale, String> getEmailFileEntryAddedSubjectMap(
160 PortletPreferences preferences) {
161
162 return getDL().getEmailFileEntryAddedSubjectMap(preferences);
163 }
164
165 public static Map<Locale, String> getEmailFileEntryUpdatedBodyMap(
166 PortletPreferences preferences) {
167
168 return getDL().getEmailFileEntryUpdatedBodyMap(preferences);
169 }
170
171 public static boolean getEmailFileEntryUpdatedEnabled(
172 PortletPreferences preferences) {
173
174 return getDL().getEmailFileEntryUpdatedEnabled(preferences);
175 }
176
177 public static Map<Locale, String> getEmailFileEntryUpdatedSubjectMap(
178 PortletPreferences preferences) {
179
180 return getDL().getEmailFileEntryUpdatedSubjectMap(preferences);
181 }
182
183 public static String getEmailFromAddress(
184 PortletPreferences preferences, long companyId)
185 throws SystemException {
186
187 return getDL().getEmailFromAddress(preferences, companyId);
188 }
189
190 public static String getEmailFromName(
191 PortletPreferences preferences, long companyId)
192 throws SystemException {
193
194 return getDL().getEmailFromName(preferences, companyId);
195 }
196
197 public static List<Object> getEntries(Hits hits) {
198 return getDL().getEntries(hits);
199 }
200
201 public static String getFileEntryImage(
202 FileEntry fileEntry, ThemeDisplay themeDisplay) {
203
204 return getDL().getFileEntryImage(fileEntry, themeDisplay);
205 }
206
207 public static Set<Long> getFileEntryTypeSubscriptionClassPKs(long userId)
208 throws SystemException {
209
210 return getDL().getFileEntryTypeSubscriptionClassPKs(userId);
211 }
212
213 public static String getFileIcon(String extension) {
214 return getDL().getFileIcon(extension);
215 }
216
217 public static String getGenericName(String extension) {
218 return getDL().getGenericName(extension);
219 }
220
221 public static String getImagePreviewURL(
222 FileEntry fileEntry, FileVersion fileVersion,
223 ThemeDisplay themeDisplay)
224 throws Exception {
225
226 return getDL().getImagePreviewURL(fileEntry, fileVersion, themeDisplay);
227 }
228
229 public static String getImagePreviewURL(
230 FileEntry fileEntry, ThemeDisplay themeDisplay)
231 throws Exception {
232
233 return getDL().getImagePreviewURL(fileEntry, themeDisplay);
234 }
235
236 public static String[] getMediaGalleryMimeTypes(
237 PortletPreferences portletPreferences, PortletRequest portletRequest) {
238
239 return getDL().getMediaGalleryMimeTypes(
240 portletPreferences, portletRequest);
241 }
242
243 public static String getPreviewURL(
244 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
245 String queryString) {
246
247 return getDL().getPreviewURL(
248 fileEntry, fileVersion, themeDisplay, queryString);
249 }
250
251
255 public static String getPreviewURL(
256 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
257 String queryString, boolean appendToken) {
258
259 return getDL().getPreviewURL(
260 fileEntry, fileVersion, themeDisplay, queryString, appendToken);
261 }
262
263 public static String getPreviewURL(
264 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
265 String queryString, boolean appendVersion, boolean absoluteURL) {
266
267 return getDL().getPreviewURL(
268 fileEntry, fileVersion, themeDisplay, queryString, appendVersion,
269 absoluteURL);
270 }
271
272 public static OrderByComparator getRepositoryModelOrderByComparator(
273 String orderByCol, String orderByType) {
274
275 return getDL().getRepositoryModelOrderByComparator(
276 orderByCol, orderByType);
277 }
278
279 public static String getTempFileId(long id, String version) {
280 return getDL().getTempFileId(id, version);
281 }
282
283 public static String getTempFileId(
284 long id, String version, String languageId) {
285
286 return getDL().getTempFileId(id, version, languageId);
287 }
288
289 public static String getThumbnailSrc(
290 FileEntry fileEntry, DLFileShortcut dlFileShortcut,
291 ThemeDisplay themeDisplay)
292 throws Exception {
293
294 return getDL().getThumbnailSrc(fileEntry, dlFileShortcut, themeDisplay);
295 }
296
297 public static String getThumbnailSrc(
298 FileEntry fileEntry, FileVersion fileVersion,
299 DLFileShortcut dlFileShortcut, ThemeDisplay themeDisplay)
300 throws Exception {
301
302 return getDL().getThumbnailSrc(
303 fileEntry, fileVersion, dlFileShortcut, themeDisplay);
304 }
305
306 public static String getThumbnailStyle() throws Exception {
307 return getDL().getThumbnailStyle();
308 }
309
310 public static String getThumbnailStyle(boolean max, int margin)
311 throws Exception {
312
313 return getDL().getThumbnailStyle(max, margin);
314 }
315
316 public static String getTitleWithExtension(FileEntry fileEntry) {
317 return getDL().getTitleWithExtension(fileEntry);
318 }
319
320 public static String getTitleWithExtension(String title, String extension) {
321 return getDL().getTitleWithExtension(title, extension);
322 }
323
324 public static String getWebDavURL(
325 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry)
326 throws PortalException, SystemException {
327
328 return getDL().getWebDavURL(themeDisplay, folder, fileEntry);
329 }
330
331 public static String getWebDavURL(
332 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry,
333 boolean manualCheckInRequired)
334 throws PortalException, SystemException {
335
336 return getDL().getWebDavURL(
337 themeDisplay, folder, fileEntry, manualCheckInRequired);
338 }
339
340 public static String getWebDavURL(
341 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry,
342 boolean manualCheckInRequired, boolean officeExtensionRequired)
343 throws PortalException, SystemException {
344
345 return getDL().getWebDavURL(
346 themeDisplay, folder, fileEntry, manualCheckInRequired,
347 officeExtensionRequired);
348 }
349
350 public static boolean hasWorkflowDefinitionLink(
351 long companyId, long groupId, long folderId, long fileEntryTypeId)
352 throws Exception {
353
354 return getDL().hasWorkflowDefinitionLink(
355 companyId, groupId, folderId, fileEntryTypeId);
356 }
357
358 public static boolean isAutoGeneratedDLFileEntryTypeDDMStructureKey(
359 String ddmStructureKey) {
360
361 return getDL().isAutoGeneratedDLFileEntryTypeDDMStructureKey(
362 ddmStructureKey);
363 }
364
365 public static boolean isOfficeExtension(String extension) {
366 return getDL().isOfficeExtension(extension);
367 }
368
369 public static boolean isSubscribedToFileEntryType(
370 long companyId, long groupId, long userId, long fileEntryTypeId)
371 throws SystemException {
372
373 return getDL().isSubscribedToFileEntryType(
374 companyId, groupId, userId, fileEntryTypeId);
375 }
376
377 public static boolean isSubscribedToFolder(
378 long companyId, long groupId, long userId, long folderId)
379 throws PortalException, SystemException {
380
381 return getDL().isSubscribedToFolder(
382 companyId, groupId, userId, folderId);
383 }
384
385 public static boolean isSubscribedToFolder(
386 long companyId, long groupId, long userId, long folderId,
387 boolean recursive)
388 throws PortalException, SystemException {
389
390 return getDL().isSubscribedToFolder(
391 companyId, groupId, userId, folderId, recursive);
392 }
393
394 public void setDL(DL dl) {
395 PortalRuntimePermission.checkSetBeanProperty(getClass());
396
397 _dl = dl;
398 }
399
400 private static DL _dl;
401
402 }