001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the d l app local service. This utility wraps {@link com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see DLAppLocalService
030     * @see com.liferay.portlet.documentlibrary.service.base.DLAppLocalServiceBaseImpl
031     * @see com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl
032     * @generated
033     */
034    public class DLAppLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Returns the Spring bean ID for this bean.
043            *
044            * @return the Spring bean ID for this bean
045            */
046            public static java.lang.String getBeanIdentifier() {
047                    return getService().getBeanIdentifier();
048            }
049    
050            /**
051            * Sets the Spring bean ID for this bean.
052            *
053            * @param beanIdentifier the Spring bean ID for this bean
054            */
055            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
056                    getService().setBeanIdentifier(beanIdentifier);
057            }
058    
059            /**
060            * Adds a file entry and associated metadata based on a byte array.
061            *
062            * <p>
063            * This method takes two file names, the <code>sourceFileName</code> and the
064            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
065            * name of the actual file being uploaded. The <code>title</code>
066            * corresponds to a name the client wishes to assign this file after it has
067            * been uploaded to the portal. If it is <code>null</code>, the <code>
068            * sourceFileName</code> will be used.
069            * </p>
070            *
071            * @param userId the primary key of the file entry's creator/owner
072            * @param repositoryId the primary key of the file entry's repository
073            * @param folderId the primary key of the file entry's parent folder
074            * @param sourceFileName the original file's name
075            * @param mimeType the file's MIME type
076            * @param title the name to be assigned to the file (optionally <code>null
077            </code>)
078            * @param description the file's description
079            * @param changeLog the file's version change log
080            * @param bytes the file's data (optionally <code>null</code>)
081            * @param serviceContext the service context to be applied. Can set the
082            asset category IDs, asset tag names, and expando bridge
083            attributes for the file entry. In a Liferay repository, it may
084            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
085            type </li> <li> fieldsMap - mapping for fields associated with a
086            custom file entry type </li> </ul>
087            * @return the file entry
088            * @throws PortalException if the parent folder could not be found or if the
089            file entry's information was invalid
090            * @throws SystemException if a system exception occurred
091            */
092            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
093                    long userId, long repositoryId, long folderId,
094                    java.lang.String sourceFileName, java.lang.String mimeType,
095                    java.lang.String title, java.lang.String description,
096                    java.lang.String changeLog, byte[] bytes,
097                    com.liferay.portal.service.ServiceContext serviceContext)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    return getService()
101                                       .addFileEntry(userId, repositoryId, folderId,
102                            sourceFileName, mimeType, title, description, changeLog, bytes,
103                            serviceContext);
104            }
105    
106            /**
107            * Adds a file entry and associated metadata based on a {@link File} object.
108            *
109            * <p>
110            * This method takes two file names, the <code>sourceFileName</code> and the
111            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
112            * name of the actual file being uploaded. The <code>title</code>
113            * corresponds to a name the client wishes to assign this file after it has
114            * been uploaded to the portal. If it is <code>null</code>, the <code>
115            * sourceFileName</code> will be used.
116            * </p>
117            *
118            * @param userId the primary key of the file entry's creator/owner
119            * @param repositoryId the primary key of the repository
120            * @param folderId the primary key of the file entry's parent folder
121            * @param sourceFileName the original file's name
122            * @param mimeType the file's MIME type
123            * @param title the name to be assigned to the file (optionally <code>null
124            </code>)
125            * @param description the file's description
126            * @param changeLog the file's version change log
127            * @param file the file's data (optionally <code>null</code>)
128            * @param serviceContext the service context to be applied. Can set the
129            asset category IDs, asset tag names, and expando bridge
130            attributes for the file entry. In a Liferay repository, it may
131            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
132            type </li> <li> fieldsMap - mapping for fields associated with a
133            custom file entry type </li> </ul>
134            * @return the file entry
135            * @throws PortalException if the parent folder could not be found or if the
136            file entry's information was invalid
137            * @throws SystemException if a system exception occurred
138            */
139            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
140                    long userId, long repositoryId, long folderId,
141                    java.lang.String sourceFileName, java.lang.String mimeType,
142                    java.lang.String title, java.lang.String description,
143                    java.lang.String changeLog, java.io.File file,
144                    com.liferay.portal.service.ServiceContext serviceContext)
145                    throws com.liferay.portal.kernel.exception.PortalException,
146                            com.liferay.portal.kernel.exception.SystemException {
147                    return getService()
148                                       .addFileEntry(userId, repositoryId, folderId,
149                            sourceFileName, mimeType, title, description, changeLog, file,
150                            serviceContext);
151            }
152    
153            /**
154            * Adds a file entry and associated metadata based on an {@link InputStream}
155            * object.
156            *
157            * <p>
158            * This method takes two file names, the <code>sourceFileName</code> and the
159            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
160            * name of the actual file being uploaded. The <code>title</code>
161            * corresponds to a name the client wishes to assign this file after it has
162            * been uploaded to the portal. If it is <code>null</code>, the <code>
163            * sourceFileName</code> will be used.
164            * </p>
165            *
166            * @param userId the primary key of the file entry's creator/owner
167            * @param repositoryId the primary key of the repository
168            * @param folderId the primary key of the file entry's parent folder
169            * @param sourceFileName the original file's name
170            * @param mimeType the file's MIME type
171            * @param title the name to be assigned to the file (optionally <code>null
172            </code>)
173            * @param description the file's description
174            * @param changeLog the file's version change log
175            * @param is the file's data (optionally <code>null</code>)
176            * @param size the file's size (optionally <code>0</code>)
177            * @param serviceContext the service context to be applied. Can set the
178            asset category IDs, asset tag names, and expando bridge
179            attributes for the file entry. In a Liferay repository, it may
180            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
181            type </li> <li> fieldsMap - mapping for fields associated with a
182            custom file entry type </li> </ul>
183            * @return the file entry
184            * @throws PortalException if the parent folder could not be found or if the
185            file entry's information was invalid
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
189                    long userId, long repositoryId, long folderId,
190                    java.lang.String sourceFileName, java.lang.String mimeType,
191                    java.lang.String title, java.lang.String description,
192                    java.lang.String changeLog, java.io.InputStream is, long size,
193                    com.liferay.portal.service.ServiceContext serviceContext)
194                    throws com.liferay.portal.kernel.exception.PortalException,
195                            com.liferay.portal.kernel.exception.SystemException {
196                    return getService()
197                                       .addFileEntry(userId, repositoryId, folderId,
198                            sourceFileName, mimeType, title, description, changeLog, is, size,
199                            serviceContext);
200            }
201    
202            /**
203            * Adds the file rank to the existing file entry. This method is only
204            * supported by the Liferay repository.
205            *
206            * @param repositoryId the primary key of the repository
207            * @param companyId the primary key of the company
208            * @param userId the primary key of the file rank's creator/owner
209            * @param fileEntryId the primary key of the file entry
210            * @param serviceContext the service context to be applied
211            * @return the file rank
212            * @throws SystemException if a system exception occurred
213            */
214            public static com.liferay.portlet.documentlibrary.model.DLFileRank addFileRank(
215                    long repositoryId, long companyId, long userId, long fileEntryId,
216                    com.liferay.portal.service.ServiceContext serviceContext)
217                    throws com.liferay.portal.kernel.exception.SystemException {
218                    return getService()
219                                       .addFileRank(repositoryId, companyId, userId, fileEntryId,
220                            serviceContext);
221            }
222    
223            /**
224            * Adds the file shortcut to the existing file entry. This method is only
225            * supported by the Liferay repository.
226            *
227            * @param userId the primary key of the file shortcut's creator/owner
228            * @param repositoryId the primary key of the repository
229            * @param folderId the primary key of the file shortcut's parent folder
230            * @param toFileEntryId the primary key of the file entry to point to
231            * @param serviceContext the service context to be applied. Can set the
232            asset category IDs, asset tag names, and expando bridge
233            attributes for the file entry.
234            * @return the file shortcut
235            * @throws PortalException if the parent folder or file entry could not be
236            found, or if the file shortcut's information was invalid
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut(
240                    long userId, long repositoryId, long folderId, long toFileEntryId,
241                    com.liferay.portal.service.ServiceContext serviceContext)
242                    throws com.liferay.portal.kernel.exception.PortalException,
243                            com.liferay.portal.kernel.exception.SystemException {
244                    return getService()
245                                       .addFileShortcut(userId, repositoryId, folderId,
246                            toFileEntryId, serviceContext);
247            }
248    
249            /**
250            * Adds a folder.
251            *
252            * @param userId the primary key of the folder's creator/owner
253            * @param repositoryId the primary key of the repository
254            * @param parentFolderId the primary key of the folder's parent folder
255            * @param name the folder's name
256            * @param description the folder's description
257            * @param serviceContext the service context to be applied. In a Liferay
258            repository, it may include mountPoint which is a boolean
259            specifying whether the folder is a facade for mounting a
260            third-party repository
261            * @return the folder
262            * @throws PortalException if the parent folder could not be found or if the
263            new folder's information was invalid
264            * @throws SystemException if a system exception occurred
265            */
266            public static com.liferay.portal.kernel.repository.model.Folder addFolder(
267                    long userId, long repositoryId, long parentFolderId,
268                    java.lang.String name, java.lang.String description,
269                    com.liferay.portal.service.ServiceContext serviceContext)
270                    throws com.liferay.portal.kernel.exception.PortalException,
271                            com.liferay.portal.kernel.exception.SystemException {
272                    return getService()
273                                       .addFolder(userId, repositoryId, parentFolderId, name,
274                            description, serviceContext);
275            }
276    
277            /**
278            * Delete all data associated to the given repository. This method is only
279            * supported by the Liferay repository.
280            *
281            * @param repositoryId the primary key of the data's repository
282            * @throws PortalException if the repository could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public static void deleteAll(long repositoryId)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    getService().deleteAll(repositoryId);
289            }
290    
291            /**
292            * Deletes the file entry.
293            *
294            * @param fileEntryId the primary key of the file entry
295            * @throws PortalException if the file entry could not be found
296            * @throws SystemException if a system exception occurred
297            */
298            public static void deleteFileEntry(long fileEntryId)
299                    throws com.liferay.portal.kernel.exception.PortalException,
300                            com.liferay.portal.kernel.exception.SystemException {
301                    getService().deleteFileEntry(fileEntryId);
302            }
303    
304            /**
305            * Deletes the file ranks associated to a given file entry. This method is
306            * only supported by the Liferay repository.
307            *
308            * @param fileEntryId the primary key of the file entry
309            * @throws SystemException if a system exception occurred
310            */
311            public static void deleteFileRanksByFileEntryId(long fileEntryId)
312                    throws com.liferay.portal.kernel.exception.SystemException {
313                    getService().deleteFileRanksByFileEntryId(fileEntryId);
314            }
315    
316            /**
317            * Deletes the file ranks associated to a given user. This method is only
318            * supported by the Liferay repository.
319            *
320            * @param userId the primary key of the user
321            * @throws SystemException if a system exception occurred
322            */
323            public static void deleteFileRanksByUserId(long userId)
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    getService().deleteFileRanksByUserId(userId);
326            }
327    
328            /**
329            * Deletes the file shortcut. This method is only supported by the Liferay
330            * repository.
331            *
332            * @param dlFileShortcut the file shortcut
333            * @throws PortalException if the file shortcut could not be found
334            * @throws SystemException if a system exception occurred
335            */
336            public static void deleteFileShortcut(
337                    com.liferay.portlet.documentlibrary.model.DLFileShortcut dlFileShortcut)
338                    throws com.liferay.portal.kernel.exception.PortalException,
339                            com.liferay.portal.kernel.exception.SystemException {
340                    getService().deleteFileShortcut(dlFileShortcut);
341            }
342    
343            /**
344            * Deletes the file shortcut. This method is only supported by the Liferay
345            * repository.
346            *
347            * @param fileShortcutId the primary key of the file shortcut
348            * @throws PortalException if the file shortcut could not be found
349            * @throws SystemException if a system exception occurred
350            */
351            public static void deleteFileShortcut(long fileShortcutId)
352                    throws com.liferay.portal.kernel.exception.PortalException,
353                            com.liferay.portal.kernel.exception.SystemException {
354                    getService().deleteFileShortcut(fileShortcutId);
355            }
356    
357            /**
358            * Deletes all file shortcuts associated to the file entry. This method is
359            * only supported by the Liferay repository.
360            *
361            * @param toFileEntryId the primary key of the associated file entry
362            * @throws PortalException if the file shortcut for the file entry could not
363            be found
364            * @throws SystemException if a system exception occurred
365            */
366            public static void deleteFileShortcuts(long toFileEntryId)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException {
369                    getService().deleteFileShortcuts(toFileEntryId);
370            }
371    
372            /**
373            * Deletes the folder and all of its subfolders and file entries.
374            *
375            * @param folderId the primary key of the folder
376            * @throws PortalException if the folder could not be found
377            * @throws SystemException if a system exception occurred
378            */
379            public static void deleteFolder(long folderId)
380                    throws com.liferay.portal.kernel.exception.PortalException,
381                            com.liferay.portal.kernel.exception.SystemException {
382                    getService().deleteFolder(folderId);
383            }
384    
385            /**
386            * Returns the file entries in the folder.
387            *
388            * @param repositoryId the primary key of the file entry's repository
389            * @param folderId the primary key of the file entry's folder
390            * @return the file entries in the folder
391            * @throws PortalException if the folder could not be found
392            * @throws SystemException if a system exception occurred
393            */
394            public static java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries(
395                    long repositoryId, long folderId)
396                    throws com.liferay.portal.kernel.exception.PortalException,
397                            com.liferay.portal.kernel.exception.SystemException {
398                    return getService().getFileEntries(repositoryId, folderId);
399            }
400    
401            /**
402            * Returns a range of all the file entries in the folder.
403            *
404            * <p>
405            * Useful when paginating results. Returns a maximum of <code>end -
406            * start</code> instances. <code>start</code> and <code>end</code> are not
407            * primary keys, they are indexes in the result set. Thus, <code>0</code>
408            * refers to the first result in the set. Setting both <code>start</code>
409            * and <code>end</code> to {@link
410            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
411            * result set.
412            * </p>
413            *
414            * @param repositoryId the primary key of the file entry's repository
415            * @param folderId the primary key of the file entry's folder
416            * @param start the lower bound of the range of results
417            * @param end the upper bound of the range of results (not inclusive)
418            * @return the range of file entries in the folder
419            * @throws PortalException if the folder could not be found
420            * @throws SystemException if a system exception occurred
421            */
422            public static java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries(
423                    long repositoryId, long folderId, int start, int end)
424                    throws com.liferay.portal.kernel.exception.PortalException,
425                            com.liferay.portal.kernel.exception.SystemException {
426                    return getService().getFileEntries(repositoryId, folderId, start, end);
427            }
428    
429            /**
430            * Returns an ordered range of all the file entries in the folder.
431            *
432            * <p>
433            * Useful when paginating results. Returns a maximum of <code>end -
434            * start</code> instances. <code>start</code> and <code>end</code> are not
435            * primary keys, they are indexes in the result set. Thus, <code>0</code>
436            * refers to the first result in the set. Setting both <code>start</code>
437            * and <code>end</code> to {@link
438            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
439            * result set.
440            * </p>
441            *
442            * @param repositoryId the primary key of the file entry's repository
443            * @param folderId the primary key of the file entry's folder
444            * @param start the lower bound of the range of results
445            * @param end the upper bound of the range of results (not inclusive)
446            * @param obc the comparator to order the file entries (optionally
447            <code>null</code>)
448            * @return the range of file entries in the folder ordered by comparator
449            <code>obc</code>
450            * @throws PortalException if the folder could not be found
451            * @throws SystemException if a system exception occurred
452            */
453            public static java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries(
454                    long repositoryId, long folderId, int start, int end,
455                    com.liferay.portal.kernel.util.OrderByComparator obc)
456                    throws com.liferay.portal.kernel.exception.PortalException,
457                            com.liferay.portal.kernel.exception.SystemException {
458                    return getService()
459                                       .getFileEntries(repositoryId, folderId, start, end, obc);
460            }
461    
462            /**
463            * Returns a range of all the file entries and shortcuts in the folder.
464            *
465            * <p>
466            * Useful when paginating results. Returns a maximum of <code>end -
467            * start</code> instances. <code>start</code> and <code>end</code> are not
468            * primary keys, they are indexes in the result set. Thus, <code>0</code>
469            * refers to the first result in the set. Setting both <code>start</code>
470            * and <code>end</code> to {@link
471            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
472            * result set.
473            * </p>
474            *
475            * @param repositoryId the primary key of the repository
476            * @param folderId the primary key of the folder
477            * @param status the workflow status
478            * @param start the lower bound of the range of results
479            * @param end the upper bound of the range of results (not inclusive)
480            * @return the range of file entries and shortcuts in the folder
481            * @throws PortalException if the folder could not be found
482            * @throws SystemException if a system exception occurred
483            */
484            public static java.util.List<java.lang.Object> getFileEntriesAndFileShortcuts(
485                    long repositoryId, long folderId, int status, int start, int end)
486                    throws com.liferay.portal.kernel.exception.PortalException,
487                            com.liferay.portal.kernel.exception.SystemException {
488                    return getService()
489                                       .getFileEntriesAndFileShortcuts(repositoryId, folderId,
490                            status, start, end);
491            }
492    
493            /**
494            * Returns the number of file entries and shortcuts in the folder.
495            *
496            * @param repositoryId the primary key of the repository
497            * @param folderId the primary key of the folder
498            * @param status the workflow status
499            * @return the number of file entries and shortcuts in the folder
500            * @throws PortalException if the folder could not be found
501            * @throws SystemException if a system exception occurred
502            */
503            public static int getFileEntriesAndFileShortcutsCount(long repositoryId,
504                    long folderId, int status)
505                    throws com.liferay.portal.kernel.exception.PortalException,
506                            com.liferay.portal.kernel.exception.SystemException {
507                    return getService()
508                                       .getFileEntriesAndFileShortcutsCount(repositoryId, folderId,
509                            status);
510            }
511    
512            /**
513            * Returns the number of file entries in the folder.
514            *
515            * @param repositoryId the primary key of the file entry's repository
516            * @param folderId the primary key of the file entry's folder
517            * @return the number of file entries in the folder
518            * @throws PortalException if the folder could not be found
519            * @throws SystemException if a system exception occurred
520            */
521            public static int getFileEntriesCount(long repositoryId, long folderId)
522                    throws com.liferay.portal.kernel.exception.PortalException,
523                            com.liferay.portal.kernel.exception.SystemException {
524                    return getService().getFileEntriesCount(repositoryId, folderId);
525            }
526    
527            /**
528            * Returns the file entry with the primary key.
529            *
530            * @param fileEntryId the primary key of the file entry
531            * @return the file entry with the primary key
532            * @throws PortalException if the file entry could not be found
533            * @throws SystemException if a system exception occurred
534            */
535            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntry(
536                    long fileEntryId)
537                    throws com.liferay.portal.kernel.exception.PortalException,
538                            com.liferay.portal.kernel.exception.SystemException {
539                    return getService().getFileEntry(fileEntryId);
540            }
541    
542            /**
543            * Returns the file entry with the title in the folder.
544            *
545            * @param groupId the primary key of the file entry's group
546            * @param folderId the primary key of the file entry's folder
547            * @param title the file entry's title
548            * @return the file entry with the title in the folder
549            * @throws PortalException if the file entry could not be found
550            * @throws SystemException if a system exception occurred
551            */
552            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntry(
553                    long groupId, long folderId, java.lang.String title)
554                    throws com.liferay.portal.kernel.exception.PortalException,
555                            com.liferay.portal.kernel.exception.SystemException {
556                    return getService().getFileEntry(groupId, folderId, title);
557            }
558    
559            /**
560            * Returns the file entry with the UUID and group.
561            *
562            * @param uuid the file entry's universally unique identifier
563            * @param groupId the primary key of the file entry's group
564            * @return the file entry with the UUID and group
565            * @throws PortalException if the file entry could not be found
566            * @throws SystemException if a system exception occurred
567            */
568            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntryByUuidAndGroupId(
569                    java.lang.String uuid, long groupId)
570                    throws com.liferay.portal.kernel.exception.PortalException,
571                            com.liferay.portal.kernel.exception.SystemException {
572                    return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
573            }
574    
575            /**
576            * Returns the file ranks from the user. This method is only supported by
577            * the Liferay repository.
578            *
579            * @param repositoryId the primary key of the repository
580            * @param userId the primary key of the user
581            * @return the file ranks from the user
582            * @throws SystemException if a system exception occurred
583            */
584            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> getFileRanks(
585                    long repositoryId, long userId)
586                    throws com.liferay.portal.kernel.exception.SystemException {
587                    return getService().getFileRanks(repositoryId, userId);
588            }
589    
590            /**
591            * Returns the file shortcut with the primary key. This method is only
592            * supported by the Liferay repository.
593            *
594            * @param fileShortcutId the primary key of the file shortcut
595            * @return the file shortcut with the primary key
596            * @throws PortalException if the file shortcut could not be found
597            * @throws SystemException if a system exception occurred
598            */
599            public static com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut(
600                    long fileShortcutId)
601                    throws com.liferay.portal.kernel.exception.PortalException,
602                            com.liferay.portal.kernel.exception.SystemException {
603                    return getService().getFileShortcut(fileShortcutId);
604            }
605    
606            /**
607            * Returns the file version with the primary key.
608            *
609            * @param fileVersionId the primary key of the file version
610            * @return the file version with the primary key
611            * @throws PortalException if the file version could not be found
612            * @throws SystemException if a system exception occurred
613            */
614            public static com.liferay.portal.kernel.repository.model.FileVersion getFileVersion(
615                    long fileVersionId)
616                    throws com.liferay.portal.kernel.exception.PortalException,
617                            com.liferay.portal.kernel.exception.SystemException {
618                    return getService().getFileVersion(fileVersionId);
619            }
620    
621            /**
622            * Returns the folder with the primary key.
623            *
624            * @param folderId the primary key of the folder
625            * @return the folder with the primary key
626            * @throws PortalException if the folder could not be found
627            * @throws SystemException if a system exception occurred
628            */
629            public static com.liferay.portal.kernel.repository.model.Folder getFolder(
630                    long folderId)
631                    throws com.liferay.portal.kernel.exception.PortalException,
632                            com.liferay.portal.kernel.exception.SystemException {
633                    return getService().getFolder(folderId);
634            }
635    
636            /**
637            * Returns the folder with the name in the parent folder.
638            *
639            * @param repositoryId the primary key of the folder's repository
640            * @param parentFolderId the primary key of the folder's parent folder
641            * @param name the folder's name
642            * @return the folder with the name in the parent folder
643            * @throws PortalException if the folder could not be found
644            * @throws SystemException if a system exception occurred
645            */
646            public static com.liferay.portal.kernel.repository.model.Folder getFolder(
647                    long repositoryId, long parentFolderId, java.lang.String name)
648                    throws com.liferay.portal.kernel.exception.PortalException,
649                            com.liferay.portal.kernel.exception.SystemException {
650                    return getService().getFolder(repositoryId, parentFolderId, name);
651            }
652    
653            /**
654            * Returns all immediate subfolders of the parent folder.
655            *
656            * @param repositoryId the primary key of the folder's repository
657            * @param parentFolderId the primary key of the folder's parent folder
658            * @return the immediate subfolders of the parent folder
659            * @throws PortalException if the parent folder could not be found
660            * @throws SystemException if a system exception occurred
661            */
662            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
663                    long repositoryId, long parentFolderId)
664                    throws com.liferay.portal.kernel.exception.PortalException,
665                            com.liferay.portal.kernel.exception.SystemException {
666                    return getService().getFolders(repositoryId, parentFolderId);
667            }
668    
669            /**
670            * Returns all immediate subfolders of the parent folder, optionally
671            * including mount folders for third-party repositories.
672            *
673            * @param repositoryId the primary key of the folder's repository
674            * @param parentFolderId the primary key of the folder's parent folder
675            * @param includeMountFolders whether to include mount folders for
676            third-party repositories
677            * @return the immediate subfolders of the parent folder
678            * @throws PortalException if the parent folder could not be found
679            * @throws SystemException if a system exception occurred
680            */
681            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
682                    long repositoryId, long parentFolderId, boolean includeMountFolders)
683                    throws com.liferay.portal.kernel.exception.PortalException,
684                            com.liferay.portal.kernel.exception.SystemException {
685                    return getService()
686                                       .getFolders(repositoryId, parentFolderId, includeMountFolders);
687            }
688    
689            /**
690            * Returns a range of all the immediate subfolders of the parent folder,
691            * optionally including mount folders for third-party repositories.
692            *
693            * <p>
694            * Useful when paginating results. Returns a maximum of <code>end -
695            * start</code> instances. <code>start</code> and <code>end</code> are not
696            * primary keys, they are indexes in the result set. Thus, <code>0</code>
697            * refers to the first result in the set. Setting both <code>start</code>
698            * and <code>end</code> to {@link
699            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
700            * result set.
701            * </p>
702            *
703            * @param repositoryId the primary key of the folder's repository
704            * @param parentFolderId the primary key of the folder's parent folder
705            * @param includeMountFolders whether to include mount folders for
706            third-party repositories
707            * @param start the lower bound of the range of results
708            * @param end the upper bound of the range of results (not inclusive)
709            * @return the range of immediate subfolders of the parent folder
710            * @throws PortalException if the parent folder could not be found
711            * @throws SystemException if a system exception occurred
712            */
713            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
714                    long repositoryId, long parentFolderId, boolean includeMountFolders,
715                    int start, int end)
716                    throws com.liferay.portal.kernel.exception.PortalException,
717                            com.liferay.portal.kernel.exception.SystemException {
718                    return getService()
719                                       .getFolders(repositoryId, parentFolderId,
720                            includeMountFolders, start, end);
721            }
722    
723            /**
724            * Returns an ordered range of all the immediate subfolders of the parent
725            * folder.
726            *
727            * <p>
728            * Useful when paginating results. Returns a maximum of <code>end -
729            * start</code> instances. <code>start</code> and <code>end</code> are not
730            * primary keys, they are indexes in the result set. Thus, <code>0</code>
731            * refers to the first result in the set. Setting both <code>start</code>
732            * and <code>end</code> to {@link
733            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
734            * result set.
735            * </p>
736            *
737            * @param repositoryId the primary key of the folder's repository
738            * @param parentFolderId the primary key of the folder's parent folder
739            * @param includeMountFolders whether to include mount folders for
740            third-party repositories
741            * @param start the lower bound of the range of results
742            * @param end the upper bound of the range of results (not inclusive)
743            * @param obc the comparator to order the folders (optionally
744            <code>null</code>)
745            * @return the range of immediate subfolders of the parent folder ordered by
746            comparator <code>obc</code>
747            * @throws PortalException if the parent folder could not be found
748            * @throws SystemException if a system exception occurred
749            */
750            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
751                    long repositoryId, long parentFolderId, boolean includeMountFolders,
752                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
753                    throws com.liferay.portal.kernel.exception.PortalException,
754                            com.liferay.portal.kernel.exception.SystemException {
755                    return getService()
756                                       .getFolders(repositoryId, parentFolderId,
757                            includeMountFolders, start, end, obc);
758            }
759    
760            /**
761            * Returns a range of all the immediate subfolders of the parent folder.
762            *
763            * <p>
764            * Useful when paginating results. Returns a maximum of <code>end -
765            * start</code> instances. <code>start</code> and <code>end</code> are not
766            * primary keys, they are indexes in the result set. Thus, <code>0</code>
767            * refers to the first result in the set. Setting both <code>start</code>
768            * and <code>end</code> to {@link
769            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
770            * result set.
771            * </p>
772            *
773            * @param repositoryId the primary key of the folder's repository
774            * @param parentFolderId the primary key of the folder's parent folder
775            * @param start the lower bound of the range of results
776            * @param end the upper bound of the range of results (not inclusive)
777            * @return the range of immediate subfolders of the parent folder
778            * @throws PortalException if the parent folder could not be found
779            * @throws SystemException if a system exception occurred
780            */
781            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
782                    long repositoryId, long parentFolderId, int start, int end)
783                    throws com.liferay.portal.kernel.exception.PortalException,
784                            com.liferay.portal.kernel.exception.SystemException {
785                    return getService().getFolders(repositoryId, parentFolderId, start, end);
786            }
787    
788            /**
789            * Returns an ordered range of all the immediate subfolders of the parent
790            * folder.
791            *
792            * <p>
793            * Useful when paginating results. Returns a maximum of <code>end -
794            * start</code> instances. <code>start</code> and <code>end</code> are not
795            * primary keys, they are indexes in the result set. Thus, <code>0</code>
796            * refers to the first result in the set. Setting both <code>start</code>
797            * and <code>end</code> to {@link
798            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
799            * result set.
800            * </p>
801            *
802            * @param repositoryId the primary key of the folder's repository
803            * @param parentFolderId the primary key of the folder's parent folder
804            * @param start the lower bound of the range of results
805            * @param end the upper bound of the range of results (not inclusive)
806            * @param obc the comparator to order the folders (optionally
807            <code>null</code>)
808            * @return the range of immediate subfolders of the parent folder ordered by
809            comparator <code>obc</code>
810            * @throws PortalException if the parent folder could not be found
811            * @throws SystemException if a system exception occurred
812            */
813            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders(
814                    long repositoryId, long parentFolderId, int start, int end,
815                    com.liferay.portal.kernel.util.OrderByComparator obc)
816                    throws com.liferay.portal.kernel.exception.PortalException,
817                            com.liferay.portal.kernel.exception.SystemException {
818                    return getService()
819                                       .getFolders(repositoryId, parentFolderId, start, end, obc);
820            }
821    
822            /**
823            * Returns an ordered range of all the immediate subfolders, file entries,
824            * and file shortcuts in the parent folder.
825            *
826            * <p>
827            * Useful when paginating results. Returns a maximum of <code>end -
828            * start</code> instances. <code>start</code> and <code>end</code> are not
829            * primary keys, they are indexes in the result set. Thus, <code>0</code>
830            * refers to the first result in the set. Setting both <code>start</code>
831            * and <code>end</code> to {@link
832            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
833            * result set.
834            * </p>
835            *
836            * @param repositoryId the primary key of the repository
837            * @param folderId the primary key of the parent folder
838            * @param status the workflow status
839            * @param includeMountFolders whether to include mount folders for
840            third-party repositories
841            * @param start the lower bound of the range of results
842            * @param end the upper bound of the range of results (not inclusive)
843            * @param obc the comparator to order the results (optionally
844            <code>null</code>)
845            * @return the range of immediate subfolders, file entries, and file
846            shortcuts in the parent folder ordered by comparator
847            <code>obc</code>
848            * @throws PortalException if the folder could not be found
849            * @throws SystemException if a system exception occurred
850            */
851            public static java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts(
852                    long repositoryId, long folderId, int status,
853                    boolean includeMountFolders, int start, int end,
854                    com.liferay.portal.kernel.util.OrderByComparator obc)
855                    throws com.liferay.portal.kernel.exception.PortalException,
856                            com.liferay.portal.kernel.exception.SystemException {
857                    return getService()
858                                       .getFoldersAndFileEntriesAndFileShortcuts(repositoryId,
859                            folderId, status, includeMountFolders, start, end, obc);
860            }
861    
862            public static java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts(
863                    long repositoryId, long folderId, int status,
864                    java.lang.String[] mimeTypes, boolean includeMountFolders, int start,
865                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
866                    throws com.liferay.portal.kernel.exception.PortalException,
867                            com.liferay.portal.kernel.exception.SystemException {
868                    return getService()
869                                       .getFoldersAndFileEntriesAndFileShortcuts(repositoryId,
870                            folderId, status, mimeTypes, includeMountFolders, start, end, obc);
871            }
872    
873            /**
874            * Returns the number of immediate subfolders, file entries, and file
875            * shortcuts in the parent folder.
876            *
877            * @param repositoryId the primary key of the repository
878            * @param folderId the primary key of the parent folder
879            * @param status the workflow status
880            * @param includeMountFolders whether to include mount folders for
881            third-party repositories
882            * @return the number of immediate subfolders, file entries, and file
883            shortcuts in the parent folder
884            * @throws PortalException if the folder could not be found
885            * @throws SystemException if a system exception occurred
886            */
887            public static int getFoldersAndFileEntriesAndFileShortcutsCount(
888                    long repositoryId, long folderId, int status,
889                    boolean includeMountFolders)
890                    throws com.liferay.portal.kernel.exception.PortalException,
891                            com.liferay.portal.kernel.exception.SystemException {
892                    return getService()
893                                       .getFoldersAndFileEntriesAndFileShortcutsCount(repositoryId,
894                            folderId, status, includeMountFolders);
895            }
896    
897            public static int getFoldersAndFileEntriesAndFileShortcutsCount(
898                    long repositoryId, long folderId, int status,
899                    java.lang.String[] mimeTypes, boolean includeMountFolders)
900                    throws com.liferay.portal.kernel.exception.PortalException,
901                            com.liferay.portal.kernel.exception.SystemException {
902                    return getService()
903                                       .getFoldersAndFileEntriesAndFileShortcutsCount(repositoryId,
904                            folderId, status, mimeTypes, includeMountFolders);
905            }
906    
907            /**
908            * Returns the number of immediate subfolders of the parent folder.
909            *
910            * @param repositoryId the primary key of the folder's repository
911            * @param parentFolderId the primary key of the folder's parent folder
912            * @return the number of immediate subfolders of the parent folder
913            * @throws PortalException if the parent folder could not be found
914            * @throws SystemException if a system exception occurred
915            */
916            public static int getFoldersCount(long repositoryId, long parentFolderId)
917                    throws com.liferay.portal.kernel.exception.PortalException,
918                            com.liferay.portal.kernel.exception.SystemException {
919                    return getService().getFoldersCount(repositoryId, parentFolderId);
920            }
921    
922            /**
923            * Returns the number of immediate subfolders of the parent folder,
924            * optionally including mount folders for third-party repositories.
925            *
926            * @param repositoryId the primary key of the folder's repository
927            * @param parentFolderId the primary key of the folder's parent folder
928            * @param includeMountFolders whether to include mount folders for
929            third-party repositories
930            * @return the number of immediate subfolders of the parent folder
931            * @throws PortalException if the parent folder could not be found
932            * @throws SystemException if a system exception occurred
933            */
934            public static int getFoldersCount(long repositoryId, long parentFolderId,
935                    boolean includeMountFolders)
936                    throws com.liferay.portal.kernel.exception.PortalException,
937                            com.liferay.portal.kernel.exception.SystemException {
938                    return getService()
939                                       .getFoldersCount(repositoryId, parentFolderId,
940                            includeMountFolders);
941            }
942    
943            /**
944            * Returns the number of immediate subfolders and file entries across the
945            * folders.
946            *
947            * @param repositoryId the primary key of the repository
948            * @param folderIds the primary keys of folders from which to count
949            immediate subfolders and file entries
950            * @param status the workflow status
951            * @return the number of immediate subfolders and file entries across the
952            folders
953            * @throws PortalException if the repository could not be found
954            * @throws SystemException if a system exception occurred
955            */
956            public static int getFoldersFileEntriesCount(long repositoryId,
957                    java.util.List<java.lang.Long> folderIds, int status)
958                    throws com.liferay.portal.kernel.exception.PortalException,
959                            com.liferay.portal.kernel.exception.SystemException {
960                    return getService()
961                                       .getFoldersFileEntriesCount(repositoryId, folderIds, status);
962            }
963    
964            /**
965            * Returns the mount folder of the repository with the primary key. This
966            * method is only supported by the Liferay repository.
967            *
968            * @param repositoryId the primary key of the repository
969            * @return the folder used for mounting third-party repositories
970            * @throws PortalException if the repository or mount folder could not be
971            found
972            * @throws SystemException if a system exception occurred
973            */
974            public static com.liferay.portal.kernel.repository.model.Folder getMountFolder(
975                    long repositoryId)
976                    throws com.liferay.portal.kernel.exception.PortalException,
977                            com.liferay.portal.kernel.exception.SystemException {
978                    return getService().getMountFolder(repositoryId);
979            }
980    
981            /**
982            * Returns all immediate subfolders of the parent folder that are used for
983            * mounting third-party repositories. This method is only supported by the
984            * Liferay repository.
985            *
986            * @param repositoryId the primary key of the folder's repository
987            * @param parentFolderId the primary key of the folder's parent folder
988            * @return the immediate subfolders of the parent folder that are used for
989            mounting third-party repositories
990            * @throws PortalException if the repository or parent folder could not be
991            found
992            * @throws SystemException if a system exception occurred
993            */
994            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders(
995                    long repositoryId, long parentFolderId)
996                    throws com.liferay.portal.kernel.exception.PortalException,
997                            com.liferay.portal.kernel.exception.SystemException {
998                    return getService().getMountFolders(repositoryId, parentFolderId);
999            }
1000    
1001            /**
1002            * Returns a range of all the immediate subfolders of the parent folder that
1003            * are used for mounting third-party repositories. This method is only
1004            * supported by the Liferay repository.
1005            *
1006            * <p>
1007            * Useful when paginating results. Returns a maximum of <code>end -
1008            * start</code> instances. <code>start</code> and <code>end</code> are not
1009            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1010            * refers to the first result in the set. Setting both <code>start</code>
1011            * and <code>end</code> to {@link
1012            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1013            * result set.
1014            * </p>
1015            *
1016            * @param repositoryId the primary key of the repository
1017            * @param parentFolderId the primary key of the parent folder
1018            * @param start the lower bound of the range of results
1019            * @param end the upper bound of the range of results (not inclusive)
1020            * @return the range of immediate subfolders of the parent folder that are
1021            used for mounting third-party repositories
1022            * @throws PortalException if the repository or parent folder could not be
1023            found
1024            * @throws SystemException if a system exception occurred
1025            */
1026            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders(
1027                    long repositoryId, long parentFolderId, int start, int end)
1028                    throws com.liferay.portal.kernel.exception.PortalException,
1029                            com.liferay.portal.kernel.exception.SystemException {
1030                    return getService()
1031                                       .getMountFolders(repositoryId, parentFolderId, start, end);
1032            }
1033    
1034            /**
1035            * Returns an ordered range of all the immediate subfolders of the parent
1036            * folder that are used for mounting third-party repositories. This method
1037            * is only supported by the Liferay repository.
1038            *
1039            * <p>
1040            * Useful when paginating results. Returns a maximum of <code>end -
1041            * start</code> instances. <code>start</code> and <code>end</code> are not
1042            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1043            * refers to the first result in the set. Setting both <code>start</code>
1044            * and <code>end</code> to {@link
1045            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1046            * result set.
1047            * </p>
1048            *
1049            * @param repositoryId the primary key of the folder's repository
1050            * @param parentFolderId the primary key of the folder's parent folder
1051            * @param start the lower bound of the range of results
1052            * @param end the upper bound of the range of results (not inclusive)
1053            * @param obc the comparator to order the folders (optionally
1054            <code>null</code>)
1055            * @return the range of immediate subfolders of the parent folder that are
1056            used for mounting third-party repositories ordered by comparator
1057            <code>obc</code>
1058            * @throws PortalException if the repository or parent folder could not be
1059            found
1060            * @throws SystemException if a system exception occurred
1061            */
1062            public static java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders(
1063                    long repositoryId, long parentFolderId, int start, int end,
1064                    com.liferay.portal.kernel.util.OrderByComparator obc)
1065                    throws com.liferay.portal.kernel.exception.PortalException,
1066                            com.liferay.portal.kernel.exception.SystemException {
1067                    return getService()
1068                                       .getMountFolders(repositoryId, parentFolderId, start, end,
1069                            obc);
1070            }
1071    
1072            /**
1073            * Returns the number of immediate subfolders of the parent folder that are
1074            * used for mounting third-party repositories. This method is only supported
1075            * by the Liferay repository.
1076            *
1077            * @param repositoryId the primary key of the repository
1078            * @param parentFolderId the primary key of the parent folder
1079            * @return the number of folders of the parent folder that are used for
1080            mounting third-party repositories
1081            * @throws PortalException if the repository or parent folder could not be
1082            found
1083            * @throws SystemException if a system exception occurred
1084            */
1085            public static int getMountFoldersCount(long repositoryId,
1086                    long parentFolderId)
1087                    throws com.liferay.portal.kernel.exception.PortalException,
1088                            com.liferay.portal.kernel.exception.SystemException {
1089                    return getService().getMountFoldersCount(repositoryId, parentFolderId);
1090            }
1091    
1092            /**
1093            * Moves the file entry to the new folder.
1094            *
1095            * @param userId the primary key of the user
1096            * @param fileEntryId the primary key of the file entry
1097            * @param newFolderId the primary key of the new folder
1098            * @param serviceContext the service context to be applied
1099            * @return the file entry
1100            * @throws PortalException if the file entry or the new folder could not be
1101            found
1102            * @throws SystemException if a system exception occurred
1103            */
1104            public static com.liferay.portal.kernel.repository.model.FileEntry moveFileEntry(
1105                    long userId, long fileEntryId, long newFolderId,
1106                    com.liferay.portal.service.ServiceContext serviceContext)
1107                    throws com.liferay.portal.kernel.exception.PortalException,
1108                            com.liferay.portal.kernel.exception.SystemException {
1109                    return getService()
1110                                       .moveFileEntry(userId, fileEntryId, newFolderId,
1111                            serviceContext);
1112            }
1113    
1114            /**
1115            * Updates the file entry's asset replacing its asset categories, tags, and
1116            * links.
1117            *
1118            * @param userId the primary key of the user
1119            * @param fileEntry the file entry to update
1120            * @param fileVersion the file version to update
1121            * @param assetCategoryIds the primary keys of the new asset categories
1122            * @param assetTagNames the new asset tag names
1123            * @param assetLinkEntryIds the primary keys of the new asset link entries
1124            * @throws PortalException if the file entry or version could not be found
1125            * @throws SystemException if a system exception occurred
1126            */
1127            public static void updateAsset(long userId,
1128                    com.liferay.portal.kernel.repository.model.FileEntry fileEntry,
1129                    com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
1130                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
1131                    long[] assetLinkEntryIds)
1132                    throws com.liferay.portal.kernel.exception.PortalException,
1133                            com.liferay.portal.kernel.exception.SystemException {
1134                    getService()
1135                            .updateAsset(userId, fileEntry, fileVersion, assetCategoryIds,
1136                            assetTagNames, assetLinkEntryIds);
1137            }
1138    
1139            /**
1140            * Updates a file entry and associated metadata based on a byte array
1141            * object. If the file data is <code>null</code>, then only the associated
1142            * metadata (i.e., <code>title</code>, <code>description</code>, and
1143            * parameters in the <code>serviceContext</code>) will be updated.
1144            *
1145            * <p>
1146            * This method takes two file names, the <code>sourceFileName</code> and the
1147            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
1148            * name of the actual file being uploaded. The <code>title</code>
1149            * corresponds to a name the client wishes to assign this file after it has
1150            * been uploaded to the portal.
1151            * </p>
1152            *
1153            * @param userId the primary key of the user
1154            * @param fileEntryId the primary key of the file entry
1155            * @param sourceFileName the original file's name (optionally
1156            <code>null</code>)
1157            * @param mimeType the file's MIME type (optionally <code>null</code>)
1158            * @param title the new name to be assigned to the file (optionally <code>
1159            <code>null</code></code>)
1160            * @param description the file's new description
1161            * @param changeLog the file's version change log (optionally
1162            <code>null</code>)
1163            * @param majorVersion whether the new file version is a major version
1164            * @param bytes the file's data (optionally <code>null</code>)
1165            * @param serviceContext the service context to be applied. Can set the
1166            asset category IDs, asset tag names, and expando bridge
1167            attributes for the file entry. In a Liferay repository, it may
1168            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
1169            type </li> <li> fieldsMap - mapping for fields associated with a
1170            custom file entry type </li> </ul>
1171            * @return the file entry
1172            * @throws PortalException if the file entry could not be found
1173            * @throws SystemException if a system exception occurred
1174            */
1175            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
1176                    long userId, long fileEntryId, java.lang.String sourceFileName,
1177                    java.lang.String mimeType, java.lang.String title,
1178                    java.lang.String description, java.lang.String changeLog,
1179                    boolean majorVersion, byte[] bytes,
1180                    com.liferay.portal.service.ServiceContext serviceContext)
1181                    throws com.liferay.portal.kernel.exception.PortalException,
1182                            com.liferay.portal.kernel.exception.SystemException {
1183                    return getService()
1184                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
1185                            mimeType, title, description, changeLog, majorVersion, bytes,
1186                            serviceContext);
1187            }
1188    
1189            /**
1190            * Updates a file entry and associated metadata based on a {@link File}
1191            * object. If the file data is <code>null</code>, then only the associated
1192            * metadata (i.e., <code>title</code>, <code>description</code>, and
1193            * parameters in the <code>serviceContext</code>) will be updated.
1194            *
1195            * <p>
1196            * This method takes two file names, the <code>sourceFileName</code> and the
1197            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
1198            * name of the actual file being uploaded. The <code>title</code>
1199            * corresponds to a name the client wishes to assign this file after it has
1200            * been uploaded to the portal.
1201            * </p>
1202            *
1203            * @param userId the primary key of the user
1204            * @param fileEntryId the primary key of the file entry
1205            * @param sourceFileName the original file's name (optionally
1206            <code>null</code>)
1207            * @param mimeType the file's MIME type (optionally <code>null</code>)
1208            * @param title the new name to be assigned to the file (optionally <code>
1209            <code>null</code></code>)
1210            * @param description the file's new description
1211            * @param changeLog the file's version change log (optionally
1212            <code>null</code>)
1213            * @param majorVersion whether the new file version is a major version
1214            * @param file EntryId the primary key of the file entry
1215            * @param serviceContext the service context to be applied. Can set the
1216            asset category IDs, asset tag names, and expando bridge
1217            attributes for the file entry. In a Liferay repository, it may
1218            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
1219            type </li> <li> fieldsMap - mapping for fields associated with a
1220            custom file entry type </li> </ul>
1221            * @return the file entry
1222            * @throws PortalException if the file entry could not be found
1223            * @throws SystemException if a system exception occurred
1224            */
1225            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
1226                    long userId, long fileEntryId, java.lang.String sourceFileName,
1227                    java.lang.String mimeType, java.lang.String title,
1228                    java.lang.String description, java.lang.String changeLog,
1229                    boolean majorVersion, java.io.File file,
1230                    com.liferay.portal.service.ServiceContext serviceContext)
1231                    throws com.liferay.portal.kernel.exception.PortalException,
1232                            com.liferay.portal.kernel.exception.SystemException {
1233                    return getService()
1234                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
1235                            mimeType, title, description, changeLog, majorVersion, file,
1236                            serviceContext);
1237            }
1238    
1239            /**
1240            * Updates a file entry and associated metadata based on an {@link
1241            * InputStream} object. If the file data is <code>null</code>, then only the
1242            * associated metadata (i.e., <code>title</code>, <code>description</code>,
1243            * and parameters in the <code>serviceContext</code>) will be updated.
1244            *
1245            * <p>
1246            * This method takes two file names, the <code>sourceFileName</code> and the
1247            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
1248            * name of the actual file being uploaded. The <code>title</code>
1249            * corresponds to a name the client wishes to assign this file after it has
1250            * been uploaded to the portal.
1251            * </p>
1252            *
1253            * @param userId the primary key of the user
1254            * @param fileEntryId the primary key of the file entry
1255            * @param sourceFileName the original file's name (optionally
1256            <code>null</code>)
1257            * @param mimeType the file's MIME type (optionally <code>null</code>)
1258            * @param title the new name to be assigned to the file (optionally <code>
1259            <code>null</code></code>)
1260            * @param description the file's new description
1261            * @param changeLog the file's version change log (optionally
1262            <code>null</code>)
1263            * @param majorVersion whether the new file version is a major version
1264            * @param is the file's data (optionally <code>null</code>)
1265            * @param size the file's size (optionally <code>0</code>)
1266            * @param serviceContext the service context to be applied. Can set the
1267            asset category IDs, asset tag names, and expando bridge
1268            attributes for the file entry. In a Liferay repository, it may
1269            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
1270            type </li> <li> fieldsMap - mapping for fields associated with a
1271            custom file entry type </li> </ul>
1272            * @return the file entry
1273            * @throws PortalException if the file entry could not be found
1274            * @throws SystemException if a system exception occurred
1275            */
1276            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
1277                    long userId, long fileEntryId, java.lang.String sourceFileName,
1278                    java.lang.String mimeType, java.lang.String title,
1279                    java.lang.String description, java.lang.String changeLog,
1280                    boolean majorVersion, java.io.InputStream is, long size,
1281                    com.liferay.portal.service.ServiceContext serviceContext)
1282                    throws com.liferay.portal.kernel.exception.PortalException,
1283                            com.liferay.portal.kernel.exception.SystemException {
1284                    return getService()
1285                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
1286                            mimeType, title, description, changeLog, majorVersion, is, size,
1287                            serviceContext);
1288            }
1289    
1290            /**
1291            * Updates a file rank to the existing file entry. This method is only
1292            * supported by the Liferay repository.
1293            *
1294            * @param repositoryId the primary key of the file rank's repository
1295            * @param companyId the primary key of the file rank's company
1296            * @param userId the primary key of the file rank's creator/owner
1297            * @param fileEntryId the primary key of the file rank's file entry
1298            * @param serviceContext the service context to be applied
1299            * @return the file rank
1300            * @throws SystemException if a system exception occurred
1301            */
1302            public static com.liferay.portlet.documentlibrary.model.DLFileRank updateFileRank(
1303                    long repositoryId, long companyId, long userId, long fileEntryId,
1304                    com.liferay.portal.service.ServiceContext serviceContext)
1305                    throws com.liferay.portal.kernel.exception.SystemException {
1306                    return getService()
1307                                       .updateFileRank(repositoryId, companyId, userId,
1308                            fileEntryId, serviceContext);
1309            }
1310    
1311            /**
1312            * Updates a file shortcut to the existing file entry. This method is only
1313            * supported by the Liferay repository.
1314            *
1315            * @param userId the primary key of the file shortcut's creator/owner
1316            * @param fileShortcutId the primary key of the file shortcut
1317            * @param folderId the primary key of the file shortcut's parent folder
1318            * @param toFileEntryId the primary key of the file shortcut's file entry
1319            * @param serviceContext the service context to be applied. Can set the
1320            asset category IDs, asset tag names, and expando bridge
1321            attributes for the file entry.
1322            * @return the file shortcut
1323            * @throws PortalException if the file shortcut, folder, or file entry could
1324            not be found
1325            * @throws SystemException if a system exception occurred
1326            */
1327            public static com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut(
1328                    long userId, long fileShortcutId, long folderId, long toFileEntryId,
1329                    com.liferay.portal.service.ServiceContext serviceContext)
1330                    throws com.liferay.portal.kernel.exception.PortalException,
1331                            com.liferay.portal.kernel.exception.SystemException {
1332                    return getService()
1333                                       .updateFileShortcut(userId, fileShortcutId, folderId,
1334                            toFileEntryId, serviceContext);
1335            }
1336    
1337            /**
1338            * Updates all file shortcuts to the existing file entry to the new file
1339            * entry. This method is only supported by the Liferay repository.
1340            *
1341            * @param toRepositoryId the primary key of the repository
1342            * @param oldToFileEntryId the primary key of the old file entry pointed to
1343            * @param newToFileEntryId the primary key of the new file entry to point
1344            to
1345            * @throws SystemException if a system exception occurred
1346            */
1347            public static void updateFileShortcuts(long toRepositoryId,
1348                    long oldToFileEntryId, long newToFileEntryId)
1349                    throws com.liferay.portal.kernel.exception.SystemException {
1350                    getService()
1351                            .updateFileShortcuts(toRepositoryId, oldToFileEntryId,
1352                            newToFileEntryId);
1353            }
1354    
1355            /**
1356            * Updates the folder.
1357            *
1358            * @param folderId the primary key of the folder
1359            * @param parentFolderId the primary key of the folder's new parent folder
1360            * @param name the folder's new name
1361            * @param description the folder's new description
1362            * @param serviceContext the service context to be applied. In a Liferay
1363            repository, it may include:  <ul> <li> defaultFileEntryTypeId -
1364            the file entry type to default all Liferay file entries to </li>
1365            <li> fileEntryTypeSearchContainerPrimaryKeys - a comma-delimited
1366            list of file entry type primary keys allowed in the given folder
1367            and all descendants </li> <li> mountPoint - boolean specifying
1368            whether folder is a facade for mounting a third-party repository
1369            </li> <li> overrideFileEntryTypes - boolean specifying whether to
1370            override ancestral folder's restriction of file entry types
1371            allowed </li> <li> workflowDefinitionXYZ - the workflow
1372            definition name specified per file entry type. The parameter name
1373            must be the string <code>workflowDefinition</code> appended by
1374            the <code>fileEntryTypeId</code> (optionally <code>0</code>).
1375            </li> </ul>
1376            * @return the folder
1377            * @throws PortalException if the current or new parent folder could not be
1378            found, or if the new parent folder's information was invalid
1379            * @throws SystemException if a system exception occurred
1380            */
1381            public static com.liferay.portal.kernel.repository.model.Folder updateFolder(
1382                    long folderId, long parentFolderId, java.lang.String name,
1383                    java.lang.String description,
1384                    com.liferay.portal.service.ServiceContext serviceContext)
1385                    throws com.liferay.portal.kernel.exception.PortalException,
1386                            com.liferay.portal.kernel.exception.SystemException {
1387                    return getService()
1388                                       .updateFolder(folderId, parentFolderId, name, description,
1389                            serviceContext);
1390            }
1391    
1392            public static DLAppLocalService getService() {
1393                    if (_service == null) {
1394                            _service = (DLAppLocalService)PortalBeanLocatorUtil.locate(DLAppLocalService.class.getName());
1395    
1396                            ReferenceRegistry.registerReference(DLAppLocalServiceUtil.class,
1397                                    "_service");
1398                            MethodCache.remove(DLAppLocalService.class);
1399                    }
1400    
1401                    return _service;
1402            }
1403    
1404            public void setService(DLAppLocalService service) {
1405                    MethodCache.remove(DLAppLocalService.class);
1406    
1407                    _service = service;
1408    
1409                    ReferenceRegistry.registerReference(DLAppLocalServiceUtil.class,
1410                            "_service");
1411                    MethodCache.remove(DLAppLocalService.class);
1412            }
1413    
1414            private static DLAppLocalService _service;
1415    }