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