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