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 getDLFileEntryControlPanelLink(
141 PortletRequest portletRequest, long fileEntryId)
142 throws PortalException, SystemException {
143
144 return getDL().getDLFileEntryControlPanelLink(
145 portletRequest, fileEntryId);
146 }
147
148 public static String getDLFolderControlPanelLink(
149 PortletRequest portletRequest, long folderId)
150 throws PortalException, SystemException {
151
152 return getDL().getDLFolderControlPanelLink(portletRequest, folderId);
153 }
154
155 public static Map<Locale, String> getEmailFileEntryAddedBodyMap(
156 PortletPreferences preferences) {
157
158 return getDL().getEmailFileEntryAddedBodyMap(preferences);
159 }
160
161 public static boolean getEmailFileEntryAddedEnabled(
162 PortletPreferences preferences) {
163
164 return getDL().getEmailFileEntryAddedEnabled(preferences);
165 }
166
167 public static Map<Locale, String> getEmailFileEntryAddedSubjectMap(
168 PortletPreferences preferences) {
169
170 return getDL().getEmailFileEntryAddedSubjectMap(preferences);
171 }
172
173 public static Map<Locale, String> getEmailFileEntryUpdatedBodyMap(
174 PortletPreferences preferences) {
175
176 return getDL().getEmailFileEntryUpdatedBodyMap(preferences);
177 }
178
179 public static boolean getEmailFileEntryUpdatedEnabled(
180 PortletPreferences preferences) {
181
182 return getDL().getEmailFileEntryUpdatedEnabled(preferences);
183 }
184
185 public static Map<Locale, String> getEmailFileEntryUpdatedSubjectMap(
186 PortletPreferences preferences) {
187
188 return getDL().getEmailFileEntryUpdatedSubjectMap(preferences);
189 }
190
191 public static String getEmailFromAddress(
192 PortletPreferences preferences, long companyId)
193 throws SystemException {
194
195 return getDL().getEmailFromAddress(preferences, companyId);
196 }
197
198 public static String getEmailFromName(
199 PortletPreferences preferences, long companyId)
200 throws SystemException {
201
202 return getDL().getEmailFromName(preferences, companyId);
203 }
204
205 public static List<Object> getEntries(Hits hits) {
206 return getDL().getEntries(hits);
207 }
208
209 public static String getFileEntryImage(
210 FileEntry fileEntry, ThemeDisplay themeDisplay) {
211
212 return getDL().getFileEntryImage(fileEntry, themeDisplay);
213 }
214
215 public static Set<Long> getFileEntryTypeSubscriptionClassPKs(long userId)
216 throws SystemException {
217
218 return getDL().getFileEntryTypeSubscriptionClassPKs(userId);
219 }
220
221 public static String getFileIcon(String extension) {
222 return getDL().getFileIcon(extension);
223 }
224
225 public static String getGenericName(String extension) {
226 return getDL().getGenericName(extension);
227 }
228
229 public static String getImagePreviewURL(
230 FileEntry fileEntry, FileVersion fileVersion,
231 ThemeDisplay themeDisplay)
232 throws Exception {
233
234 return getDL().getImagePreviewURL(fileEntry, fileVersion, themeDisplay);
235 }
236
237 public static String getImagePreviewURL(
238 FileEntry fileEntry, ThemeDisplay themeDisplay)
239 throws Exception {
240
241 return getDL().getImagePreviewURL(fileEntry, themeDisplay);
242 }
243
244 public static String[] getMediaGalleryMimeTypes(
245 PortletPreferences portletPreferences, PortletRequest portletRequest) {
246
247 return getDL().getMediaGalleryMimeTypes(
248 portletPreferences, portletRequest);
249 }
250
251 public static String getPreviewURL(
252 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
253 String queryString) {
254
255 return getDL().getPreviewURL(
256 fileEntry, fileVersion, themeDisplay, queryString);
257 }
258
259
263 public static String getPreviewURL(
264 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
265 String queryString, boolean appendToken) {
266
267 return getDL().getPreviewURL(
268 fileEntry, fileVersion, themeDisplay, queryString, appendToken);
269 }
270
271 public static String getPreviewURL(
272 FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
273 String queryString, boolean appendVersion, boolean absoluteURL) {
274
275 return getDL().getPreviewURL(
276 fileEntry, fileVersion, themeDisplay, queryString, appendVersion,
277 absoluteURL);
278 }
279
280 public static OrderByComparator getRepositoryModelOrderByComparator(
281 String orderByCol, String orderByType) {
282
283 return getDL().getRepositoryModelOrderByComparator(
284 orderByCol, orderByType);
285 }
286
287 public static String getTempFileId(long id, String version) {
288 return getDL().getTempFileId(id, version);
289 }
290
291 public static String getTempFileId(
292 long id, String version, String languageId) {
293
294 return getDL().getTempFileId(id, version, languageId);
295 }
296
297 public static String getThumbnailSrc(
298 FileEntry fileEntry, DLFileShortcut dlFileShortcut,
299 ThemeDisplay themeDisplay)
300 throws Exception {
301
302 return getDL().getThumbnailSrc(fileEntry, dlFileShortcut, themeDisplay);
303 }
304
305 public static String getThumbnailSrc(
306 FileEntry fileEntry, FileVersion fileVersion,
307 DLFileShortcut dlFileShortcut, ThemeDisplay themeDisplay)
308 throws Exception {
309
310 return getDL().getThumbnailSrc(
311 fileEntry, fileVersion, dlFileShortcut, themeDisplay);
312 }
313
314 public static String getThumbnailStyle() throws Exception {
315 return getDL().getThumbnailStyle();
316 }
317
318 public static String getThumbnailStyle(boolean max, int margin)
319 throws Exception {
320
321 return getDL().getThumbnailStyle(max, margin);
322 }
323
324 public static String getTitleWithExtension(FileEntry fileEntry) {
325 return getDL().getTitleWithExtension(fileEntry);
326 }
327
328 public static String getTitleWithExtension(String title, String extension) {
329 return getDL().getTitleWithExtension(title, extension);
330 }
331
332 public static String getWebDavURL(
333 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry)
334 throws PortalException, SystemException {
335
336 return getDL().getWebDavURL(themeDisplay, folder, fileEntry);
337 }
338
339 public static String getWebDavURL(
340 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry,
341 boolean manualCheckInRequired)
342 throws PortalException, SystemException {
343
344 return getDL().getWebDavURL(
345 themeDisplay, folder, fileEntry, manualCheckInRequired);
346 }
347
348 public static String getWebDavURL(
349 ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry,
350 boolean manualCheckInRequired, boolean officeExtensionRequired)
351 throws PortalException, SystemException {
352
353 return getDL().getWebDavURL(
354 themeDisplay, folder, fileEntry, manualCheckInRequired,
355 officeExtensionRequired);
356 }
357
358 public static boolean hasWorkflowDefinitionLink(
359 long companyId, long groupId, long folderId, long fileEntryTypeId)
360 throws Exception {
361
362 return getDL().hasWorkflowDefinitionLink(
363 companyId, groupId, folderId, fileEntryTypeId);
364 }
365
366 public static boolean isAutoGeneratedDLFileEntryTypeDDMStructureKey(
367 String ddmStructureKey) {
368
369 return getDL().isAutoGeneratedDLFileEntryTypeDDMStructureKey(
370 ddmStructureKey);
371 }
372
373 public static boolean isOfficeExtension(String extension) {
374 return getDL().isOfficeExtension(extension);
375 }
376
377 public static boolean isSubscribedToFileEntryType(
378 long companyId, long groupId, long userId, long fileEntryTypeId)
379 throws SystemException {
380
381 return getDL().isSubscribedToFileEntryType(
382 companyId, groupId, userId, fileEntryTypeId);
383 }
384
385 public static boolean isSubscribedToFolder(
386 long companyId, long groupId, long userId, long folderId)
387 throws PortalException, SystemException {
388
389 return getDL().isSubscribedToFolder(
390 companyId, groupId, userId, folderId);
391 }
392
393 public static boolean isSubscribedToFolder(
394 long companyId, long groupId, long userId, long folderId,
395 boolean recursive)
396 throws PortalException, SystemException {
397
398 return getDL().isSubscribedToFolder(
399 companyId, groupId, userId, folderId, recursive);
400 }
401
402 public static boolean isValidVersion(String version) {
403 return getDL().isValidVersion(version);
404 }
405
406 public void setDL(DL dl) {
407 PortalRuntimePermission.checkSetBeanProperty(getClass());
408
409 _dl = dl;
410 }
411
412 private static DL _dl;
413
414 }