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