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