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