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