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