001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for DLApp. This utility wraps
024     * {@link com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see DLAppLocalService
032     * @see com.liferay.portlet.documentlibrary.service.base.DLAppLocalServiceBaseImpl
033     * @see com.liferay.portlet.documentlibrary.service.impl.DLAppLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class DLAppLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * 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.
042             */
043            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
044                    long userId, long repositoryId, long folderId,
045                    java.lang.String sourceFileName, java.lang.String mimeType,
046                    byte[] bytes, com.liferay.portal.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException {
048                    return getService()
049                                       .addFileEntry(userId, repositoryId, folderId,
050                            sourceFileName, mimeType, bytes, serviceContext);
051            }
052    
053            /**
054            * Adds a file entry and associated metadata based on a byte array.
055            *
056            * <p>
057            * This method takes two file names, the <code>sourceFileName</code> and the
058            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
059            * name of the actual file being uploaded. The <code>title</code>
060            * corresponds to a name the client wishes to assign this file after it has
061            * been uploaded to the portal. If it is <code>null</code>, the <code>
062            * sourceFileName</code> will be used.
063            * </p>
064            *
065            * @param userId the primary key of the file entry's creator/owner
066            * @param repositoryId the primary key of the file entry's repository
067            * @param folderId the primary key of the file entry's parent folder
068            * @param sourceFileName the original file's name
069            * @param mimeType the file's MIME type
070            * @param title the name to be assigned to the file (optionally <code>null
071            </code>)
072            * @param description the file's description
073            * @param changeLog the file's version change log
074            * @param bytes the file's data (optionally <code>null</code>)
075            * @param serviceContext the service context to be applied. Can set the
076            asset category IDs, asset tag names, and expando bridge
077            attributes for the file entry. In a Liferay repository, it may
078            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
079            type </li> <li> fieldsMap - mapping for fields associated with a
080            custom file entry type </li> </ul>
081            * @return the file entry
082            * @throws PortalException if the parent folder could not be found or if the
083            file entry's information was invalid
084            */
085            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
086                    long userId, long repositoryId, long folderId,
087                    java.lang.String sourceFileName, java.lang.String mimeType,
088                    java.lang.String title, java.lang.String description,
089                    java.lang.String changeLog, byte[] bytes,
090                    com.liferay.portal.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException {
092                    return getService()
093                                       .addFileEntry(userId, repositoryId, folderId,
094                            sourceFileName, mimeType, title, description, changeLog, bytes,
095                            serviceContext);
096            }
097    
098            /**
099            * Adds a file entry and associated metadata based on a {@link File} object.
100            *
101            * <p>
102            * This method takes two file names, the <code>sourceFileName</code> and the
103            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
104            * name of the actual file being uploaded. The <code>title</code>
105            * corresponds to a name the client wishes to assign this file after it has
106            * been uploaded to the portal. If it is <code>null</code>, the <code>
107            * sourceFileName</code> will be used.
108            * </p>
109            *
110            * @param userId the primary key of the file entry's creator/owner
111            * @param repositoryId the primary key of the repository
112            * @param folderId the primary key of the file entry's parent folder
113            * @param sourceFileName the original file's name
114            * @param mimeType the file's MIME type
115            * @param title the name to be assigned to the file (optionally <code>null
116            </code>)
117            * @param description the file's description
118            * @param changeLog the file's version change log
119            * @param file the file's data (optionally <code>null</code>)
120            * @param serviceContext the service context to be applied. Can set the
121            asset category IDs, asset tag names, and expando bridge
122            attributes for the file entry. In a Liferay repository, it may
123            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
124            type </li> <li> fieldsMap - mapping for fields associated with a
125            custom file entry type </li> </ul>
126            * @return the file entry
127            * @throws PortalException if the parent folder could not be found or if the
128            file entry's information was invalid
129            */
130            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
131                    long userId, long repositoryId, long folderId,
132                    java.lang.String sourceFileName, java.lang.String mimeType,
133                    java.lang.String title, java.lang.String description,
134                    java.lang.String changeLog, java.io.File file,
135                    com.liferay.portal.service.ServiceContext serviceContext)
136                    throws com.liferay.portal.kernel.exception.PortalException {
137                    return getService()
138                                       .addFileEntry(userId, repositoryId, folderId,
139                            sourceFileName, mimeType, title, description, changeLog, file,
140                            serviceContext);
141            }
142    
143            /**
144            * Adds a file entry and associated metadata based on an {@link InputStream}
145            * object.
146            *
147            * <p>
148            * This method takes two file names, the <code>sourceFileName</code> and the
149            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
150            * name of the actual file being uploaded. The <code>title</code>
151            * corresponds to a name the client wishes to assign this file after it has
152            * been uploaded to the portal. If it is <code>null</code>, the <code>
153            * sourceFileName</code> will be used.
154            * </p>
155            *
156            * @param userId the primary key of the file entry's creator/owner
157            * @param repositoryId the primary key of the repository
158            * @param folderId the primary key of the file entry's parent folder
159            * @param sourceFileName the original file's name
160            * @param mimeType the file's MIME type
161            * @param title the name to be assigned to the file (optionally <code>null
162            </code>)
163            * @param description the file's description
164            * @param changeLog the file's version change log
165            * @param is the file's data (optionally <code>null</code>)
166            * @param size the file's size (optionally <code>0</code>)
167            * @param serviceContext the service context to be applied. Can set the
168            asset category IDs, asset tag names, and expando bridge
169            attributes for the file entry. In a Liferay repository, it may
170            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
171            type </li> <li> fieldsMap - mapping for fields associated with a
172            custom file entry type </li> </ul>
173            * @return the file entry
174            * @throws PortalException if the parent folder could not be found or if the
175            file entry's information was invalid
176            */
177            public static com.liferay.portal.kernel.repository.model.FileEntry addFileEntry(
178                    long userId, long repositoryId, long folderId,
179                    java.lang.String sourceFileName, java.lang.String mimeType,
180                    java.lang.String title, java.lang.String description,
181                    java.lang.String changeLog, java.io.InputStream is, long size,
182                    com.liferay.portal.service.ServiceContext serviceContext)
183                    throws com.liferay.portal.kernel.exception.PortalException {
184                    return getService()
185                                       .addFileEntry(userId, repositoryId, folderId,
186                            sourceFileName, mimeType, title, description, changeLog, is, size,
187                            serviceContext);
188            }
189    
190            /**
191            * Adds the file rank to the existing file entry. This method is only
192            * supported by the Liferay repository.
193            *
194            * @param repositoryId the primary key of the repository
195            * @param companyId the primary key of the company
196            * @param userId the primary key of the file rank's creator/owner
197            * @param fileEntryId the primary key of the file entry
198            * @param serviceContext the service context to be applied
199            * @return the file rank
200            */
201            public static com.liferay.portlet.documentlibrary.model.DLFileRank addFileRank(
202                    long repositoryId, long companyId, long userId, long fileEntryId,
203                    com.liferay.portal.service.ServiceContext serviceContext) {
204                    return getService()
205                                       .addFileRank(repositoryId, companyId, userId, fileEntryId,
206                            serviceContext);
207            }
208    
209            /**
210            * Adds the file shortcut to the existing file entry. This method is only
211            * supported by the Liferay repository.
212            *
213            * @param userId the primary key of the file shortcut's creator/owner
214            * @param repositoryId the primary key of the repository
215            * @param folderId the primary key of the file shortcut's parent folder
216            * @param toFileEntryId the primary key of the file entry to point to
217            * @param serviceContext the service context to be applied. Can set the
218            asset category IDs, asset tag names, and expando bridge
219            attributes for the file entry.
220            * @return the file shortcut
221            * @throws PortalException if the parent folder or file entry could not be
222            found, or if the file shortcut's information was invalid
223            */
224            public static com.liferay.portal.kernel.repository.model.FileShortcut addFileShortcut(
225                    long userId, long repositoryId, long folderId, long toFileEntryId,
226                    com.liferay.portal.service.ServiceContext serviceContext)
227                    throws com.liferay.portal.kernel.exception.PortalException {
228                    return getService()
229                                       .addFileShortcut(userId, repositoryId, folderId,
230                            toFileEntryId, serviceContext);
231            }
232    
233            /**
234            * Adds a folder.
235            *
236            * @param userId the primary key of the folder's creator/owner
237            * @param repositoryId the primary key of the repository
238            * @param parentFolderId the primary key of the folder's parent folder
239            * @param name the folder's name
240            * @param description the folder's description
241            * @param serviceContext the service context to be applied. In a Liferay
242            repository, it may include mountPoint which is a boolean
243            specifying whether the folder is a facade for mounting a
244            third-party repository
245            * @return the folder
246            * @throws PortalException if the parent folder could not be found or if the
247            new folder's information was invalid
248            */
249            public static com.liferay.portal.kernel.repository.model.Folder addFolder(
250                    long userId, long repositoryId, long parentFolderId,
251                    java.lang.String name, java.lang.String description,
252                    com.liferay.portal.service.ServiceContext serviceContext)
253                    throws com.liferay.portal.kernel.exception.PortalException {
254                    return getService()
255                                       .addFolder(userId, repositoryId, parentFolderId, name,
256                            description, serviceContext);
257            }
258    
259            /**
260            * Delete all data associated to the given repository. This method is only
261            * supported by the Liferay repository.
262            *
263            * @param repositoryId the primary key of the data's repository
264            * @throws PortalException if the repository could not be found
265            */
266            public static void deleteAll(long repositoryId)
267                    throws com.liferay.portal.kernel.exception.PortalException {
268                    getService().deleteAll(repositoryId);
269            }
270    
271            public static void deleteAllRepositories(long groupId)
272                    throws com.liferay.portal.kernel.exception.PortalException {
273                    getService().deleteAllRepositories(groupId);
274            }
275    
276            /**
277            * Deletes the file entry.
278            *
279            * @param fileEntryId the primary key of the file entry
280            * @throws PortalException if the file entry could not be found
281            */
282            public static void deleteFileEntry(long fileEntryId)
283                    throws com.liferay.portal.kernel.exception.PortalException {
284                    getService().deleteFileEntry(fileEntryId);
285            }
286    
287            /**
288            * Deletes the file ranks associated to a given file entry. This method is
289            * only supported by the Liferay repository.
290            *
291            * @param fileEntryId the primary key of the file entry
292            */
293            public static void deleteFileRanksByFileEntryId(long fileEntryId) {
294                    getService().deleteFileRanksByFileEntryId(fileEntryId);
295            }
296    
297            /**
298            * Deletes the file ranks associated to a given user. This method is only
299            * supported by the Liferay repository.
300            *
301            * @param userId the primary key of the user
302            */
303            public static void deleteFileRanksByUserId(long userId) {
304                    getService().deleteFileRanksByUserId(userId);
305            }
306    
307            /**
308            * Deletes the file shortcut. This method is only supported by the Liferay
309            * repository.
310            *
311            * @param fileShortcut the file shortcut
312            * @throws PortalException if the file shortcut could not be found
313            */
314            public static void deleteFileShortcut(
315                    com.liferay.portal.kernel.repository.model.FileShortcut fileShortcut)
316                    throws com.liferay.portal.kernel.exception.PortalException {
317                    getService().deleteFileShortcut(fileShortcut);
318            }
319    
320            /**
321            * Deletes the file shortcut. This method is only supported by the Liferay
322            * repository.
323            *
324            * @param fileShortcutId the primary key of the file shortcut
325            * @throws PortalException if the file shortcut could not be found
326            */
327            public static void deleteFileShortcut(long fileShortcutId)
328                    throws com.liferay.portal.kernel.exception.PortalException {
329                    getService().deleteFileShortcut(fileShortcutId);
330            }
331    
332            /**
333            * Deletes all file shortcuts associated to the file entry. This method is
334            * only supported by the Liferay repository.
335            *
336            * @param toFileEntryId the primary key of the associated file entry
337            * @throws PortalException if the file shortcut for the file entry could not
338            be found
339            */
340            public static void deleteFileShortcuts(long toFileEntryId)
341                    throws com.liferay.portal.kernel.exception.PortalException {
342                    getService().deleteFileShortcuts(toFileEntryId);
343            }
344    
345            /**
346            * Deletes the folder and all of its subfolders and file entries.
347            *
348            * @param folderId the primary key of the folder
349            * @throws PortalException if the folder could not be found
350            */
351            public static void deleteFolder(long folderId)
352                    throws com.liferay.portal.kernel.exception.PortalException {
353                    getService().deleteFolder(folderId);
354            }
355    
356            /**
357            * Returns the Spring bean ID for this bean.
358            *
359            * @return the Spring bean ID for this bean
360            */
361            public static java.lang.String getBeanIdentifier() {
362                    return getService().getBeanIdentifier();
363            }
364    
365            /**
366            * Returns the file entry with the primary key.
367            *
368            * @param fileEntryId the primary key of the file entry
369            * @return the file entry with the primary key
370            * @throws PortalException if the file entry could not be found
371            */
372            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntry(
373                    long fileEntryId)
374                    throws com.liferay.portal.kernel.exception.PortalException {
375                    return getService().getFileEntry(fileEntryId);
376            }
377    
378            /**
379            * Returns the file entry with the title in the folder.
380            *
381            * @param groupId the primary key of the file entry's group
382            * @param folderId the primary key of the file entry's folder
383            * @param title the file entry's title
384            * @return the file entry with the title in the folder
385            * @throws PortalException if the file entry could not be found
386            */
387            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntry(
388                    long groupId, long folderId, java.lang.String title)
389                    throws com.liferay.portal.kernel.exception.PortalException {
390                    return getService().getFileEntry(groupId, folderId, title);
391            }
392    
393            /**
394            * Returns the file entry with the UUID and group.
395            *
396            * @param uuid the file entry's UUID
397            * @param groupId the primary key of the file entry's group
398            * @return the file entry with the UUID and group
399            * @throws PortalException if the file entry could not be found
400            */
401            public static com.liferay.portal.kernel.repository.model.FileEntry getFileEntryByUuidAndGroupId(
402                    java.lang.String uuid, long groupId)
403                    throws com.liferay.portal.kernel.exception.PortalException {
404                    return getService().getFileEntryByUuidAndGroupId(uuid, groupId);
405            }
406    
407            /**
408            * Returns the file ranks from the user. This method is only supported by
409            * the Liferay repository.
410            *
411            * @param repositoryId the primary key of the repository
412            * @param userId the primary key of the user
413            * @return the file ranks from the user
414            */
415            public static java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> getFileRanks(
416                    long repositoryId, long userId) {
417                    return getService().getFileRanks(repositoryId, userId);
418            }
419    
420            /**
421            * Returns the file shortcut with the primary key. This method is only
422            * supported by the Liferay repository.
423            *
424            * @param fileShortcutId the primary key of the file shortcut
425            * @return the file shortcut with the primary key
426            * @throws PortalException if the file shortcut could not be found
427            */
428            public static com.liferay.portal.kernel.repository.model.FileShortcut getFileShortcut(
429                    long fileShortcutId)
430                    throws com.liferay.portal.kernel.exception.PortalException {
431                    return getService().getFileShortcut(fileShortcutId);
432            }
433    
434            /**
435            * Returns the file version with the primary key.
436            *
437            * @param fileVersionId the primary key of the file version
438            * @return the file version with the primary key
439            * @throws PortalException if the file version could not be found
440            */
441            public static com.liferay.portal.kernel.repository.model.FileVersion getFileVersion(
442                    long fileVersionId)
443                    throws com.liferay.portal.kernel.exception.PortalException {
444                    return getService().getFileVersion(fileVersionId);
445            }
446    
447            /**
448            * Returns the folder with the primary key.
449            *
450            * @param folderId the primary key of the folder
451            * @return the folder with the primary key
452            * @throws PortalException if the folder could not be found
453            */
454            public static com.liferay.portal.kernel.repository.model.Folder getFolder(
455                    long folderId)
456                    throws com.liferay.portal.kernel.exception.PortalException {
457                    return getService().getFolder(folderId);
458            }
459    
460            /**
461            * Returns the folder with the name in the parent folder.
462            *
463            * @param repositoryId the primary key of the folder's repository
464            * @param parentFolderId the primary key of the folder's parent folder
465            * @param name the folder's name
466            * @return the folder with the name in the parent folder
467            * @throws PortalException if the folder could not be found
468            */
469            public static com.liferay.portal.kernel.repository.model.Folder getFolder(
470                    long repositoryId, long parentFolderId, java.lang.String name)
471                    throws com.liferay.portal.kernel.exception.PortalException {
472                    return getService().getFolder(repositoryId, parentFolderId, name);
473            }
474    
475            /**
476            * Returns the mount folder of the repository with the primary key. This
477            * method is only supported by the Liferay repository.
478            *
479            * @param repositoryId the primary key of the repository
480            * @return the folder used for mounting third-party repositories
481            * @throws PortalException if the repository or mount folder could not be
482            found
483            */
484            public static com.liferay.portal.kernel.repository.model.Folder getMountFolder(
485                    long repositoryId)
486                    throws com.liferay.portal.kernel.exception.PortalException {
487                    return getService().getMountFolder(repositoryId);
488            }
489    
490            /**
491            * Moves the file entry to the new folder.
492            *
493            * @param userId the primary key of the user
494            * @param fileEntryId the primary key of the file entry
495            * @param newFolderId the primary key of the new folder
496            * @param serviceContext the service context to be applied
497            * @return the file entry
498            * @throws PortalException if the file entry or the new folder could not be
499            found
500            */
501            public static com.liferay.portal.kernel.repository.model.FileEntry moveFileEntry(
502                    long userId, long fileEntryId, long newFolderId,
503                    com.liferay.portal.service.ServiceContext serviceContext)
504                    throws com.liferay.portal.kernel.exception.PortalException {
505                    return getService()
506                                       .moveFileEntry(userId, fileEntryId, newFolderId,
507                            serviceContext);
508            }
509    
510            /**
511            * @deprecated As of 7.0.0, replaced by {@link
512            RepositoryTrashUtil#moveFileEntryFromTrash(long, long, long,
513            long, ServiceContext)}
514            */
515            @Deprecated
516            public static com.liferay.portal.kernel.repository.model.FileEntry moveFileEntryFromTrash(
517                    long userId, long fileEntryId, long newFolderId,
518                    com.liferay.portal.service.ServiceContext serviceContext)
519                    throws com.liferay.portal.kernel.exception.PortalException {
520                    return getService()
521                                       .moveFileEntryFromTrash(userId, fileEntryId, newFolderId,
522                            serviceContext);
523            }
524    
525            /**
526            * @deprecated As of 7.0.0, replaced by {@link
527            RepositoryTrashUtil#moveFileEntryToTrash(long, long, long)}
528            */
529            @Deprecated
530            public static com.liferay.portal.kernel.repository.model.FileEntry moveFileEntryToTrash(
531                    long userId, long fileEntryId)
532                    throws com.liferay.portal.kernel.exception.PortalException {
533                    return getService().moveFileEntryToTrash(userId, fileEntryId);
534            }
535    
536            public static com.liferay.portal.kernel.repository.model.Folder moveFolder(
537                    long userId, long folderId, long parentFolderId,
538                    com.liferay.portal.service.ServiceContext serviceContext)
539                    throws com.liferay.portal.kernel.exception.PortalException {
540                    return getService()
541                                       .moveFolder(userId, folderId, parentFolderId, serviceContext);
542            }
543    
544            /**
545            * @deprecated As of 7.0.0, replaced by {@link
546            RepositoryTrashUtil#restoreFileEntryFromTrash(long, long,
547            long)}
548            */
549            @Deprecated
550            public static void restoreFileEntryFromTrash(long userId, long fileEntryId)
551                    throws com.liferay.portal.kernel.exception.PortalException {
552                    getService().restoreFileEntryFromTrash(userId, fileEntryId);
553            }
554    
555            /**
556            * Sets the Spring bean ID for this bean.
557            *
558            * @param beanIdentifier the Spring bean ID for this bean
559            */
560            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
561                    getService().setBeanIdentifier(beanIdentifier);
562            }
563    
564            /**
565            * Subscribe the user to changes in documents of the file entry type. This
566            * method is only supported by the Liferay repository.
567            *
568            * @param userId the primary key of the user
569            * @param groupId the primary key of the file entry type's group
570            * @param fileEntryTypeId the primary key of the file entry type
571            * @throws PortalException if the user or group could not be found
572            */
573            public static void subscribeFileEntryType(long userId, long groupId,
574                    long fileEntryTypeId)
575                    throws com.liferay.portal.kernel.exception.PortalException {
576                    getService().subscribeFileEntryType(userId, groupId, fileEntryTypeId);
577            }
578    
579            /**
580            * Subscribe the user to document changes in the folder. This method is only
581            * supported by the Liferay repository.
582            *
583            * @param userId the primary key of the user
584            * @param groupId the primary key of the folder's group
585            * @param folderId the primary key of the folder
586            * @throws PortalException if the user or group could not be found
587            */
588            public static void subscribeFolder(long userId, long groupId, long folderId)
589                    throws com.liferay.portal.kernel.exception.PortalException {
590                    getService().subscribeFolder(userId, groupId, folderId);
591            }
592    
593            /**
594            * Unsubscribe the user from changes in documents of the file entry type.
595            * This method is only supported by the Liferay repository.
596            *
597            * @param userId the primary key of the user
598            * @param groupId the primary key of the file entry type's group
599            * @param fileEntryTypeId the primary key of the file entry type
600            * @throws PortalException if the user or group could not be found
601            */
602            public static void unsubscribeFileEntryType(long userId, long groupId,
603                    long fileEntryTypeId)
604                    throws com.liferay.portal.kernel.exception.PortalException {
605                    getService().unsubscribeFileEntryType(userId, groupId, fileEntryTypeId);
606            }
607    
608            /**
609            * Unsubscribe the user from document changes in the folder. This method is
610            * only supported by the Liferay repository.
611            *
612            * @param userId the primary key of the user
613            * @param groupId the primary key of the folder's group
614            * @param folderId the primary key of the folder
615            * @throws PortalException if the user or group could not be found
616            */
617            public static void unsubscribeFolder(long userId, long groupId,
618                    long folderId)
619                    throws com.liferay.portal.kernel.exception.PortalException {
620                    getService().unsubscribeFolder(userId, groupId, folderId);
621            }
622    
623            /**
624            * Updates the file entry's asset replacing its asset categories, tags, and
625            * links.
626            *
627            * @param userId the primary key of the user
628            * @param fileEntry the file entry to update
629            * @param fileVersion the file version to update
630            * @param assetCategoryIds the primary keys of the new asset categories
631            * @param assetTagNames the new asset tag names
632            * @param assetLinkEntryIds the primary keys of the new asset link entries
633            * @throws PortalException if the file entry or version could not be found
634            */
635            public static void updateAsset(long userId,
636                    com.liferay.portal.kernel.repository.model.FileEntry fileEntry,
637                    com.liferay.portal.kernel.repository.model.FileVersion fileVersion,
638                    long[] assetCategoryIds, java.lang.String[] assetTagNames,
639                    long[] assetLinkEntryIds)
640                    throws com.liferay.portal.kernel.exception.PortalException {
641                    getService()
642                            .updateAsset(userId, fileEntry, fileVersion, assetCategoryIds,
643                            assetTagNames, assetLinkEntryIds);
644            }
645    
646            /**
647            * Updates a file entry and associated metadata based on a byte array
648            * object. If the file data is <code>null</code>, then only the associated
649            * metadata (i.e., <code>title</code>, <code>description</code>, and
650            * parameters in the <code>serviceContext</code>) will be updated.
651            *
652            * <p>
653            * This method takes two file names, the <code>sourceFileName</code> and the
654            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
655            * name of the actual file being uploaded. The <code>title</code>
656            * corresponds to a name the client wishes to assign this file after it has
657            * been uploaded to the portal.
658            * </p>
659            *
660            * @param userId the primary key of the user
661            * @param fileEntryId the primary key of the file entry
662            * @param sourceFileName the original file's name (optionally
663            <code>null</code>)
664            * @param mimeType the file's MIME type (optionally <code>null</code>)
665            * @param title the new name to be assigned to the file (optionally <code>
666            <code>null</code></code>)
667            * @param description the file's new description
668            * @param changeLog the file's version change log (optionally
669            <code>null</code>)
670            * @param majorVersion whether the new file version is a major version
671            * @param bytes the file's data (optionally <code>null</code>)
672            * @param serviceContext the service context to be applied. Can set the
673            asset category IDs, asset tag names, and expando bridge
674            attributes for the file entry. In a Liferay repository, it may
675            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
676            type </li> <li> fieldsMap - mapping for fields associated with a
677            custom file entry type </li> </ul>
678            * @return the file entry
679            * @throws PortalException if the file entry could not be found
680            */
681            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
682                    long userId, long fileEntryId, java.lang.String sourceFileName,
683                    java.lang.String mimeType, java.lang.String title,
684                    java.lang.String description, java.lang.String changeLog,
685                    boolean majorVersion, byte[] bytes,
686                    com.liferay.portal.service.ServiceContext serviceContext)
687                    throws com.liferay.portal.kernel.exception.PortalException {
688                    return getService()
689                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
690                            mimeType, title, description, changeLog, majorVersion, bytes,
691                            serviceContext);
692            }
693    
694            /**
695            * Updates a file entry and associated metadata based on a {@link File}
696            * object. If the file data is <code>null</code>, then only the associated
697            * metadata (i.e., <code>title</code>, <code>description</code>, and
698            * parameters in the <code>serviceContext</code>) will be updated.
699            *
700            * <p>
701            * This method takes two file names, the <code>sourceFileName</code> and the
702            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
703            * name of the actual file being uploaded. The <code>title</code>
704            * corresponds to a name the client wishes to assign this file after it has
705            * been uploaded to the portal.
706            * </p>
707            *
708            * @param userId the primary key of the user
709            * @param fileEntryId the primary key of the file entry
710            * @param sourceFileName the original file's name (optionally
711            <code>null</code>)
712            * @param mimeType the file's MIME type (optionally <code>null</code>)
713            * @param title the new name to be assigned to the file (optionally <code>
714            <code>null</code></code>)
715            * @param description the file's new description
716            * @param changeLog the file's version change log (optionally
717            <code>null</code>)
718            * @param majorVersion whether the new file version is a major version
719            * @param file the file's data (optionally <code>null</code>)
720            * @param serviceContext the service context to be applied. Can set the
721            asset category IDs, asset tag names, and expando bridge
722            attributes for the file entry. In a Liferay repository, it may
723            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
724            type </li> <li> fieldsMap - mapping for fields associated with a
725            custom file entry type </li> </ul>
726            * @return the file entry
727            * @throws PortalException if the file entry could not be found
728            */
729            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
730                    long userId, long fileEntryId, java.lang.String sourceFileName,
731                    java.lang.String mimeType, java.lang.String title,
732                    java.lang.String description, java.lang.String changeLog,
733                    boolean majorVersion, java.io.File file,
734                    com.liferay.portal.service.ServiceContext serviceContext)
735                    throws com.liferay.portal.kernel.exception.PortalException {
736                    return getService()
737                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
738                            mimeType, title, description, changeLog, majorVersion, file,
739                            serviceContext);
740            }
741    
742            /**
743            * Updates a file entry and associated metadata based on an {@link
744            * InputStream} object. If the file data is <code>null</code>, then only the
745            * associated metadata (i.e., <code>title</code>, <code>description</code>,
746            * and parameters in the <code>serviceContext</code>) will be updated.
747            *
748            * <p>
749            * This method takes two file names, the <code>sourceFileName</code> and the
750            * <code>title</code>. The <code>sourceFileName</code> corresponds to the
751            * name of the actual file being uploaded. The <code>title</code>
752            * corresponds to a name the client wishes to assign this file after it has
753            * been uploaded to the portal.
754            * </p>
755            *
756            * @param userId the primary key of the user
757            * @param fileEntryId the primary key of the file entry
758            * @param sourceFileName the original file's name (optionally
759            <code>null</code>)
760            * @param mimeType the file's MIME type (optionally <code>null</code>)
761            * @param title the new name to be assigned to the file (optionally <code>
762            <code>null</code></code>)
763            * @param description the file's new description
764            * @param changeLog the file's version change log (optionally
765            <code>null</code>)
766            * @param majorVersion whether the new file version is a major version
767            * @param is the file's data (optionally <code>null</code>)
768            * @param size the file's size (optionally <code>0</code>)
769            * @param serviceContext the service context to be applied. Can set the
770            asset category IDs, asset tag names, and expando bridge
771            attributes for the file entry. In a Liferay repository, it may
772            include:  <ul> <li> fileEntryTypeId - ID for a custom file entry
773            type </li> <li> fieldsMap - mapping for fields associated with a
774            custom file entry type </li> </ul>
775            * @return the file entry
776            * @throws PortalException if the file entry could not be found
777            */
778            public static com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry(
779                    long userId, long fileEntryId, java.lang.String sourceFileName,
780                    java.lang.String mimeType, java.lang.String title,
781                    java.lang.String description, java.lang.String changeLog,
782                    boolean majorVersion, java.io.InputStream is, long size,
783                    com.liferay.portal.service.ServiceContext serviceContext)
784                    throws com.liferay.portal.kernel.exception.PortalException {
785                    return getService()
786                                       .updateFileEntry(userId, fileEntryId, sourceFileName,
787                            mimeType, title, description, changeLog, majorVersion, is, size,
788                            serviceContext);
789            }
790    
791            /**
792            * Updates a file rank to the existing file entry. This method is only
793            * supported by the Liferay repository.
794            *
795            * @param repositoryId the primary key of the file rank's repository
796            * @param companyId the primary key of the file rank's company
797            * @param userId the primary key of the file rank's creator/owner
798            * @param fileEntryId the primary key of the file rank's file entry
799            * @param serviceContext the service context to be applied
800            * @return the file rank
801            */
802            public static com.liferay.portlet.documentlibrary.model.DLFileRank updateFileRank(
803                    long repositoryId, long companyId, long userId, long fileEntryId,
804                    com.liferay.portal.service.ServiceContext serviceContext) {
805                    return getService()
806                                       .updateFileRank(repositoryId, companyId, userId,
807                            fileEntryId, serviceContext);
808            }
809    
810            /**
811            * Updates a file shortcut to the existing file entry. This method is only
812            * supported by the Liferay repository.
813            *
814            * @param userId the primary key of the file shortcut's creator/owner
815            * @param fileShortcutId the primary key of the file shortcut
816            * @param folderId the primary key of the file shortcut's parent folder
817            * @param toFileEntryId the primary key of the file shortcut's file entry
818            * @param serviceContext the service context to be applied. Can set the
819            asset category IDs, asset tag names, and expando bridge
820            attributes for the file entry.
821            * @return the file shortcut
822            * @throws PortalException if the file shortcut, folder, or file entry could
823            not be found
824            */
825            public static com.liferay.portal.kernel.repository.model.FileShortcut updateFileShortcut(
826                    long userId, long fileShortcutId, long folderId, long toFileEntryId,
827                    com.liferay.portal.service.ServiceContext serviceContext)
828                    throws com.liferay.portal.kernel.exception.PortalException {
829                    return getService()
830                                       .updateFileShortcut(userId, fileShortcutId, folderId,
831                            toFileEntryId, serviceContext);
832            }
833    
834            /**
835            * Updates all file shortcuts to the existing file entry to the new file
836            * entry. This method is only supported by the Liferay repository.
837            *
838            * @param oldToFileEntryId the primary key of the old file entry pointed to
839            * @param newToFileEntryId the primary key of the new file entry to point
840            to
841            * @throws PortalException if a file entry for any one of the primary keys
842            could not be found
843            */
844            public static void updateFileShortcuts(long oldToFileEntryId,
845                    long newToFileEntryId)
846                    throws com.liferay.portal.kernel.exception.PortalException {
847                    getService().updateFileShortcuts(oldToFileEntryId, newToFileEntryId);
848            }
849    
850            /**
851            * Deprecated as of 7.0.0, replaced by {@link #updateFileShortcuts(long,
852            * long)}
853            */
854            @Deprecated
855            public static void updateFileShortcuts(long toRepositoryId,
856                    long oldToFileEntryId, long newToFileEntryId)
857                    throws com.liferay.portal.kernel.exception.PortalException {
858                    getService()
859                            .updateFileShortcuts(toRepositoryId, oldToFileEntryId,
860                            newToFileEntryId);
861            }
862    
863            /**
864            * Updates the folder.
865            *
866            * @param folderId the primary key of the folder
867            * @param parentFolderId the primary key of the folder's new parent folder
868            * @param name the folder's new name
869            * @param description the folder's new description
870            * @param serviceContext the service context to be applied. In a Liferay
871            repository, it may include:  <ul> <li> defaultFileEntryTypeId -
872            the file entry type to default all Liferay file entries to </li>
873            <li> dlFileEntryTypesSearchContainerPrimaryKeys - a
874            comma-delimited list of file entry type primary keys allowed in
875            the given folder and all descendants </li> <li> restrictionType -
876            specifying restriction type of file entry types allowed </li>
877            <li> workflowDefinitionXYZ - the workflow definition name
878            specified per file entry type. The parameter name must be the
879            string <code>workflowDefinition</code> appended by the
880            <code>fileEntryTypeId</code> (optionally <code>0</code>).</li>
881            </ul>
882            * @return the folder
883            * @throws PortalException if the current or new parent folder could not be
884            found, or if the new parent folder's information was invalid
885            */
886            public static com.liferay.portal.kernel.repository.model.Folder updateFolder(
887                    long folderId, long parentFolderId, java.lang.String name,
888                    java.lang.String description,
889                    com.liferay.portal.service.ServiceContext serviceContext)
890                    throws com.liferay.portal.kernel.exception.PortalException {
891                    return getService()
892                                       .updateFolder(folderId, parentFolderId, name, description,
893                            serviceContext);
894            }
895    
896            public static DLAppLocalService getService() {
897                    if (_service == null) {
898                            _service = (DLAppLocalService)PortalBeanLocatorUtil.locate(DLAppLocalService.class.getName());
899    
900                            ReferenceRegistry.registerReference(DLAppLocalServiceUtil.class,
901                                    "_service");
902                    }
903    
904                    return _service;
905            }
906    
907            /**
908             * @deprecated As of 6.2.0
909             */
910            @Deprecated
911            public void setService(DLAppLocalService service) {
912            }
913    
914            private static DLAppLocalService _service;
915    }