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