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