001 /** 002 * Copyright (c) 2000-2013 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 File} object. 104 * 105 * <p> 106 * This method takes two file names, the <code>sourceFileName</code> and the 107 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 108 * name of the actual file being uploaded. The <code>title</code> 109 * corresponds to a name the client wishes to assign this file after it has 110 * been uploaded to the portal. If it is <code>null</code>, the <code> 111 * sourceFileName</code> will be used. 112 * </p> 113 * 114 * @param userId the primary key of the file entry's creator/owner 115 * @param repositoryId the primary key of the repository 116 * @param folderId the primary key of the file entry's parent folder 117 * @param sourceFileName the original file's name 118 * @param mimeType the file's MIME type 119 * @param title the name to be assigned to the file (optionally <code>null 120 </code>) 121 * @param description the file's description 122 * @param changeLog the file's version change log 123 * @param file the file's data (optionally <code>null</code>) 124 * @param serviceContext the service context to be applied. Can set the 125 asset category IDs, asset tag names, and expando bridge 126 attributes for the file entry. In a Liferay repository, it may 127 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 128 type </li> <li> fieldsMap - mapping for fields associated with a 129 custom file entry type </li> </ul> 130 * @return the file entry 131 * @throws PortalException if the parent folder could not be found or if the 132 file entry's information was invalid 133 * @throws SystemException if a system exception occurred 134 */ 135 public com.liferay.portal.kernel.repository.model.FileEntry addFileEntry( 136 long userId, long repositoryId, long folderId, 137 java.lang.String sourceFileName, java.lang.String mimeType, 138 java.lang.String title, java.lang.String description, 139 java.lang.String changeLog, java.io.File file, 140 com.liferay.portal.service.ServiceContext serviceContext) 141 throws com.liferay.portal.kernel.exception.PortalException, 142 com.liferay.portal.kernel.exception.SystemException; 143 144 /** 145 * Adds a file entry and associated metadata based on an {@link InputStream} 146 * object. 147 * 148 * <p> 149 * This method takes two file names, the <code>sourceFileName</code> and the 150 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 151 * name of the actual file being uploaded. The <code>title</code> 152 * corresponds to a name the client wishes to assign this file after it has 153 * been uploaded to the portal. If it is <code>null</code>, the <code> 154 * sourceFileName</code> will be used. 155 * </p> 156 * 157 * @param userId the primary key of the file entry's creator/owner 158 * @param repositoryId the primary key of the repository 159 * @param folderId the primary key of the file entry's parent folder 160 * @param sourceFileName the original file's name 161 * @param mimeType the file's MIME type 162 * @param title the name to be assigned to the file (optionally <code>null 163 </code>) 164 * @param description the file's description 165 * @param changeLog the file's version change log 166 * @param is the file's data (optionally <code>null</code>) 167 * @param size the file's size (optionally <code>0</code>) 168 * @param serviceContext the service context to be applied. Can set the 169 asset category IDs, asset tag names, and expando bridge 170 attributes for the file entry. In a Liferay repository, it may 171 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 172 type </li> <li> fieldsMap - mapping for fields associated with a 173 custom file entry type </li> </ul> 174 * @return the file entry 175 * @throws PortalException if the parent folder could not be found or if the 176 file entry's information was invalid 177 * @throws SystemException if a system exception occurred 178 */ 179 public com.liferay.portal.kernel.repository.model.FileEntry addFileEntry( 180 long userId, long repositoryId, long folderId, 181 java.lang.String sourceFileName, java.lang.String mimeType, 182 java.lang.String title, java.lang.String description, 183 java.lang.String changeLog, java.io.InputStream is, long size, 184 com.liferay.portal.service.ServiceContext serviceContext) 185 throws com.liferay.portal.kernel.exception.PortalException, 186 com.liferay.portal.kernel.exception.SystemException; 187 188 /** 189 * Adds the file rank to the existing file entry. This method is only 190 * supported by the Liferay repository. 191 * 192 * @param repositoryId the primary key of the repository 193 * @param companyId the primary key of the company 194 * @param userId the primary key of the file rank's creator/owner 195 * @param fileEntryId the primary key of the file entry 196 * @param serviceContext the service context to be applied 197 * @return the file rank 198 * @throws SystemException if a system exception occurred 199 */ 200 public com.liferay.portlet.documentlibrary.model.DLFileRank addFileRank( 201 long repositoryId, long companyId, long userId, long fileEntryId, 202 com.liferay.portal.service.ServiceContext serviceContext) 203 throws com.liferay.portal.kernel.exception.SystemException; 204 205 /** 206 * Adds the file shortcut to the existing file entry. This method is only 207 * supported by the Liferay repository. 208 * 209 * @param userId the primary key of the file shortcut's creator/owner 210 * @param repositoryId the primary key of the repository 211 * @param folderId the primary key of the file shortcut's parent folder 212 * @param toFileEntryId the primary key of the file entry to point to 213 * @param serviceContext the service context to be applied. Can set the 214 asset category IDs, asset tag names, and expando bridge 215 attributes for the file entry. 216 * @return the file shortcut 217 * @throws PortalException if the parent folder or file entry could not be 218 found, or if the file shortcut's information was invalid 219 * @throws SystemException if a system exception occurred 220 */ 221 public com.liferay.portlet.documentlibrary.model.DLFileShortcut addFileShortcut( 222 long userId, long repositoryId, long folderId, long toFileEntryId, 223 com.liferay.portal.service.ServiceContext serviceContext) 224 throws com.liferay.portal.kernel.exception.PortalException, 225 com.liferay.portal.kernel.exception.SystemException; 226 227 /** 228 * Adds a folder. 229 * 230 * @param userId the primary key of the folder's creator/owner 231 * @param repositoryId the primary key of the repository 232 * @param parentFolderId the primary key of the folder's parent folder 233 * @param name the folder's name 234 * @param description the folder's description 235 * @param serviceContext the service context to be applied. In a Liferay 236 repository, it may include mountPoint which is a boolean 237 specifying whether the folder is a facade for mounting a 238 third-party repository 239 * @return the folder 240 * @throws PortalException if the parent folder could not be found or if the 241 new folder's information was invalid 242 * @throws SystemException if a system exception occurred 243 */ 244 public com.liferay.portal.kernel.repository.model.Folder addFolder( 245 long userId, long repositoryId, long parentFolderId, 246 java.lang.String name, java.lang.String description, 247 com.liferay.portal.service.ServiceContext serviceContext) 248 throws com.liferay.portal.kernel.exception.PortalException, 249 com.liferay.portal.kernel.exception.SystemException; 250 251 /** 252 * Delete all data associated to the given repository. This method is only 253 * supported by the Liferay repository. 254 * 255 * @param repositoryId the primary key of the data's repository 256 * @throws PortalException if the repository could not be found 257 * @throws SystemException if a system exception occurred 258 */ 259 public void deleteAll(long repositoryId) 260 throws com.liferay.portal.kernel.exception.PortalException, 261 com.liferay.portal.kernel.exception.SystemException; 262 263 /** 264 * Deletes the file entry. 265 * 266 * @param fileEntryId the primary key of the file entry 267 * @throws PortalException if the file entry could not be found 268 * @throws SystemException if a system exception occurred 269 */ 270 public void deleteFileEntry(long fileEntryId) 271 throws com.liferay.portal.kernel.exception.PortalException, 272 com.liferay.portal.kernel.exception.SystemException; 273 274 /** 275 * Deletes the file ranks associated to a given file entry. This method is 276 * only supported by the Liferay repository. 277 * 278 * @param fileEntryId the primary key of the file entry 279 * @throws SystemException if a system exception occurred 280 */ 281 public void deleteFileRanksByFileEntryId(long fileEntryId) 282 throws com.liferay.portal.kernel.exception.SystemException; 283 284 /** 285 * Deletes the file ranks associated to a given user. This method is only 286 * supported by the Liferay repository. 287 * 288 * @param userId the primary key of the user 289 * @throws SystemException if a system exception occurred 290 */ 291 public void deleteFileRanksByUserId(long userId) 292 throws com.liferay.portal.kernel.exception.SystemException; 293 294 /** 295 * Deletes the file shortcut. This method is only supported by the Liferay 296 * repository. 297 * 298 * @param dlFileShortcut the file shortcut 299 * @throws PortalException if the file shortcut could not be found 300 * @throws SystemException if a system exception occurred 301 */ 302 public void deleteFileShortcut( 303 com.liferay.portlet.documentlibrary.model.DLFileShortcut dlFileShortcut) 304 throws com.liferay.portal.kernel.exception.PortalException, 305 com.liferay.portal.kernel.exception.SystemException; 306 307 /** 308 * Deletes the file shortcut. This method is only supported by the Liferay 309 * repository. 310 * 311 * @param fileShortcutId the primary key of the file shortcut 312 * @throws PortalException if the file shortcut could not be found 313 * @throws SystemException if a system exception occurred 314 */ 315 public void deleteFileShortcut(long fileShortcutId) 316 throws com.liferay.portal.kernel.exception.PortalException, 317 com.liferay.portal.kernel.exception.SystemException; 318 319 /** 320 * Deletes all file shortcuts associated to the file entry. This method is 321 * only supported by the Liferay repository. 322 * 323 * @param toFileEntryId the primary key of the associated file entry 324 * @throws PortalException if the file shortcut for the file entry could not 325 be found 326 * @throws SystemException if a system exception occurred 327 */ 328 public void deleteFileShortcuts(long toFileEntryId) 329 throws com.liferay.portal.kernel.exception.PortalException, 330 com.liferay.portal.kernel.exception.SystemException; 331 332 /** 333 * Deletes the folder and all of its subfolders and file entries. 334 * 335 * @param folderId the primary key of the folder 336 * @throws PortalException if the folder could not be found 337 * @throws SystemException if a system exception occurred 338 */ 339 public void deleteFolder(long folderId) 340 throws com.liferay.portal.kernel.exception.PortalException, 341 com.liferay.portal.kernel.exception.SystemException; 342 343 /** 344 * Returns the file entries in the folder. 345 * 346 * @param repositoryId the primary key of the file entry's repository 347 * @param folderId the primary key of the file entry's folder 348 * @return the file entries in the folder 349 * @throws PortalException if the folder could not be found 350 * @throws SystemException if a system exception occurred 351 */ 352 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 353 public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries( 354 long repositoryId, long folderId) 355 throws com.liferay.portal.kernel.exception.PortalException, 356 com.liferay.portal.kernel.exception.SystemException; 357 358 /** 359 * Returns a range of all the file entries in the folder. 360 * 361 * <p> 362 * Useful when paginating results. Returns a maximum of <code>end - 363 * start</code> instances. <code>start</code> and <code>end</code> are not 364 * primary keys, they are indexes in the result set. Thus, <code>0</code> 365 * refers to the first result in the set. Setting both <code>start</code> 366 * and <code>end</code> to {@link 367 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 368 * result set. 369 * </p> 370 * 371 * @param repositoryId the primary key of the file entry's repository 372 * @param folderId the primary key of the file entry's folder 373 * @param start the lower bound of the range of results 374 * @param end the upper bound of the range of results (not inclusive) 375 * @return the range of file entries in the folder 376 * @throws PortalException if the folder could not be found 377 * @throws SystemException if a system exception occurred 378 */ 379 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 380 public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries( 381 long repositoryId, long folderId, int start, int end) 382 throws com.liferay.portal.kernel.exception.PortalException, 383 com.liferay.portal.kernel.exception.SystemException; 384 385 /** 386 * Returns an ordered range of all the file entries in the folder. 387 * 388 * <p> 389 * Useful when paginating results. Returns a maximum of <code>end - 390 * start</code> instances. <code>start</code> and <code>end</code> are not 391 * primary keys, they are indexes in the result set. Thus, <code>0</code> 392 * refers to the first result in the set. Setting both <code>start</code> 393 * and <code>end</code> to {@link 394 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 395 * result set. 396 * </p> 397 * 398 * @param repositoryId the primary key of the file entry's repository 399 * @param folderId the primary key of the file entry's folder 400 * @param start the lower bound of the range of results 401 * @param end the upper bound of the range of results (not inclusive) 402 * @param obc the comparator to order the file entries (optionally 403 <code>null</code>) 404 * @return the range of file entries in the folder ordered by comparator 405 <code>obc</code> 406 * @throws PortalException if the folder could not be found 407 * @throws SystemException if a system exception occurred 408 */ 409 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 410 public java.util.List<com.liferay.portal.kernel.repository.model.FileEntry> getFileEntries( 411 long repositoryId, long folderId, int start, int end, 412 com.liferay.portal.kernel.util.OrderByComparator obc) 413 throws com.liferay.portal.kernel.exception.PortalException, 414 com.liferay.portal.kernel.exception.SystemException; 415 416 /** 417 * Returns a range of all the file entries and shortcuts in the folder. 418 * 419 * <p> 420 * Useful when paginating results. Returns a maximum of <code>end - 421 * start</code> instances. <code>start</code> and <code>end</code> are not 422 * primary keys, they are indexes in the result set. Thus, <code>0</code> 423 * refers to the first result in the set. Setting both <code>start</code> 424 * and <code>end</code> to {@link 425 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 426 * result set. 427 * </p> 428 * 429 * @param repositoryId the primary key of the repository 430 * @param folderId the primary key of the folder 431 * @param status the workflow status 432 * @param start the lower bound of the range of results 433 * @param end the upper bound of the range of results (not inclusive) 434 * @return the range of file entries and shortcuts in the folder 435 * @throws PortalException if the folder could not be found 436 * @throws SystemException if a system exception occurred 437 */ 438 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 439 public java.util.List<java.lang.Object> getFileEntriesAndFileShortcuts( 440 long repositoryId, long folderId, int status, int start, int end) 441 throws com.liferay.portal.kernel.exception.PortalException, 442 com.liferay.portal.kernel.exception.SystemException; 443 444 /** 445 * Returns the number of file entries and shortcuts in the folder. 446 * 447 * @param repositoryId the primary key of the repository 448 * @param folderId the primary key of the folder 449 * @param status the workflow status 450 * @return the number of file entries and shortcuts in the folder 451 * @throws PortalException if the folder could not be found 452 * @throws SystemException if a system exception occurred 453 */ 454 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 455 public int getFileEntriesAndFileShortcutsCount(long repositoryId, 456 long folderId, int status) 457 throws com.liferay.portal.kernel.exception.PortalException, 458 com.liferay.portal.kernel.exception.SystemException; 459 460 /** 461 * Returns the number of file entries in the folder. 462 * 463 * @param repositoryId the primary key of the file entry's repository 464 * @param folderId the primary key of the file entry's folder 465 * @return the number of file entries in the folder 466 * @throws PortalException if the folder could not be found 467 * @throws SystemException if a system exception occurred 468 */ 469 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 470 public int getFileEntriesCount(long repositoryId, long folderId) 471 throws com.liferay.portal.kernel.exception.PortalException, 472 com.liferay.portal.kernel.exception.SystemException; 473 474 /** 475 * Returns the file entry with the primary key. 476 * 477 * @param fileEntryId the primary key of the file entry 478 * @return the file entry with the primary key 479 * @throws PortalException if the file entry could not be found 480 * @throws SystemException if a system exception occurred 481 */ 482 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 483 public com.liferay.portal.kernel.repository.model.FileEntry getFileEntry( 484 long fileEntryId) 485 throws com.liferay.portal.kernel.exception.PortalException, 486 com.liferay.portal.kernel.exception.SystemException; 487 488 /** 489 * Returns the file entry with the title in the folder. 490 * 491 * @param groupId the primary key of the file entry's group 492 * @param folderId the primary key of the file entry's folder 493 * @param title the file entry's title 494 * @return the file entry with the title in the folder 495 * @throws PortalException if the file entry could not be found 496 * @throws SystemException if a system exception occurred 497 */ 498 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 499 public com.liferay.portal.kernel.repository.model.FileEntry getFileEntry( 500 long groupId, long folderId, java.lang.String title) 501 throws com.liferay.portal.kernel.exception.PortalException, 502 com.liferay.portal.kernel.exception.SystemException; 503 504 /** 505 * Returns the file entry with the UUID and group. 506 * 507 * @param uuid the file entry's universally unique identifier 508 * @param groupId the primary key of the file entry's group 509 * @return the file entry with the UUID and group 510 * @throws PortalException if the file entry could not be found 511 * @throws SystemException if a system exception occurred 512 */ 513 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 514 public com.liferay.portal.kernel.repository.model.FileEntry getFileEntryByUuidAndGroupId( 515 java.lang.String uuid, long groupId) 516 throws com.liferay.portal.kernel.exception.PortalException, 517 com.liferay.portal.kernel.exception.SystemException; 518 519 /** 520 * Returns the file ranks from the user. This method is only supported by 521 * the Liferay repository. 522 * 523 * @param repositoryId the primary key of the repository 524 * @param userId the primary key of the user 525 * @return the file ranks from the user 526 * @throws SystemException if a system exception occurred 527 */ 528 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 529 public java.util.List<com.liferay.portlet.documentlibrary.model.DLFileRank> getFileRanks( 530 long repositoryId, long userId) 531 throws com.liferay.portal.kernel.exception.SystemException; 532 533 /** 534 * Returns the file shortcut with the primary key. This method is only 535 * supported by the Liferay repository. 536 * 537 * @param fileShortcutId the primary key of the file shortcut 538 * @return the file shortcut with the primary key 539 * @throws PortalException if the file shortcut could not be found 540 * @throws SystemException if a system exception occurred 541 */ 542 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 543 public com.liferay.portlet.documentlibrary.model.DLFileShortcut getFileShortcut( 544 long fileShortcutId) 545 throws com.liferay.portal.kernel.exception.PortalException, 546 com.liferay.portal.kernel.exception.SystemException; 547 548 /** 549 * Returns the file version with the primary key. 550 * 551 * @param fileVersionId the primary key of the file version 552 * @return the file version with the primary key 553 * @throws PortalException if the file version could not be found 554 * @throws SystemException if a system exception occurred 555 */ 556 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 557 public com.liferay.portal.kernel.repository.model.FileVersion getFileVersion( 558 long fileVersionId) 559 throws com.liferay.portal.kernel.exception.PortalException, 560 com.liferay.portal.kernel.exception.SystemException; 561 562 /** 563 * Returns the folder with the primary key. 564 * 565 * @param folderId the primary key of the folder 566 * @return the folder with the primary key 567 * @throws PortalException if the folder could not be found 568 * @throws SystemException if a system exception occurred 569 */ 570 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 571 public com.liferay.portal.kernel.repository.model.Folder getFolder( 572 long folderId) 573 throws com.liferay.portal.kernel.exception.PortalException, 574 com.liferay.portal.kernel.exception.SystemException; 575 576 /** 577 * Returns the folder with the name in the parent folder. 578 * 579 * @param repositoryId the primary key of the folder's repository 580 * @param parentFolderId the primary key of the folder's parent folder 581 * @param name the folder's name 582 * @return the folder with the name in the parent folder 583 * @throws PortalException if the folder could not be found 584 * @throws SystemException if a system exception occurred 585 */ 586 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 587 public com.liferay.portal.kernel.repository.model.Folder getFolder( 588 long repositoryId, long parentFolderId, java.lang.String name) 589 throws com.liferay.portal.kernel.exception.PortalException, 590 com.liferay.portal.kernel.exception.SystemException; 591 592 /** 593 * Returns all immediate subfolders of the parent folder. 594 * 595 * @param repositoryId the primary key of the folder's repository 596 * @param parentFolderId the primary key of the folder's parent folder 597 * @return the immediate subfolders of the parent folder 598 * @throws PortalException if the parent folder could not be found 599 * @throws SystemException if a system exception occurred 600 */ 601 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 602 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 603 long repositoryId, long parentFolderId) 604 throws com.liferay.portal.kernel.exception.PortalException, 605 com.liferay.portal.kernel.exception.SystemException; 606 607 /** 608 * Returns all immediate subfolders of the parent folder, optionally 609 * including mount folders for third-party repositories. 610 * 611 * @param repositoryId the primary key of the folder's repository 612 * @param parentFolderId the primary key of the folder's parent folder 613 * @param includeMountFolders whether to include mount folders for 614 third-party repositories 615 * @return the immediate subfolders of the parent folder 616 * @throws PortalException if the parent folder could not be found 617 * @throws SystemException if a system exception occurred 618 */ 619 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 620 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 621 long repositoryId, long parentFolderId, boolean includeMountFolders) 622 throws com.liferay.portal.kernel.exception.PortalException, 623 com.liferay.portal.kernel.exception.SystemException; 624 625 /** 626 * Returns a range of all the immediate subfolders of the parent folder, 627 * optionally including mount folders for third-party repositories. 628 * 629 * <p> 630 * Useful when paginating results. Returns a maximum of <code>end - 631 * start</code> instances. <code>start</code> and <code>end</code> are not 632 * primary keys, they are indexes in the result set. Thus, <code>0</code> 633 * refers to the first result in the set. Setting both <code>start</code> 634 * and <code>end</code> to {@link 635 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 636 * result set. 637 * </p> 638 * 639 * @param repositoryId the primary key of the folder's repository 640 * @param parentFolderId the primary key of the folder's parent folder 641 * @param includeMountFolders whether to include mount folders for 642 third-party repositories 643 * @param start the lower bound of the range of results 644 * @param end the upper bound of the range of results (not inclusive) 645 * @return the range of immediate subfolders of the parent folder 646 * @throws PortalException if the parent folder could not be found 647 * @throws SystemException if a system exception occurred 648 */ 649 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 650 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 651 long repositoryId, long parentFolderId, boolean includeMountFolders, 652 int start, int end) 653 throws com.liferay.portal.kernel.exception.PortalException, 654 com.liferay.portal.kernel.exception.SystemException; 655 656 /** 657 * Returns an ordered range of all the immediate subfolders of the parent 658 * folder. 659 * 660 * <p> 661 * Useful when paginating results. Returns a maximum of <code>end - 662 * start</code> instances. <code>start</code> and <code>end</code> are not 663 * primary keys, they are indexes in the result set. Thus, <code>0</code> 664 * refers to the first result in the set. Setting both <code>start</code> 665 * and <code>end</code> to {@link 666 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 667 * result set. 668 * </p> 669 * 670 * @param repositoryId the primary key of the folder's repository 671 * @param parentFolderId the primary key of the folder's parent folder 672 * @param includeMountFolders whether to include mount folders for 673 third-party repositories 674 * @param start the lower bound of the range of results 675 * @param end the upper bound of the range of results (not inclusive) 676 * @param obc the comparator to order the folders (optionally 677 <code>null</code>) 678 * @return the range of immediate subfolders of the parent folder ordered by 679 comparator <code>obc</code> 680 * @throws PortalException if the parent folder could not be found 681 * @throws SystemException if a system exception occurred 682 */ 683 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 684 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 685 long repositoryId, long parentFolderId, boolean includeMountFolders, 686 int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc) 687 throws com.liferay.portal.kernel.exception.PortalException, 688 com.liferay.portal.kernel.exception.SystemException; 689 690 /** 691 * Returns a range of all the immediate subfolders of the parent folder. 692 * 693 * <p> 694 * Useful when paginating results. Returns a maximum of <code>end - 695 * start</code> instances. <code>start</code> and <code>end</code> are not 696 * primary keys, they are indexes in the result set. Thus, <code>0</code> 697 * refers to the first result in the set. Setting both <code>start</code> 698 * and <code>end</code> to {@link 699 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 700 * result set. 701 * </p> 702 * 703 * @param repositoryId the primary key of the folder's repository 704 * @param parentFolderId the primary key of the folder's parent folder 705 * @param start the lower bound of the range of results 706 * @param end the upper bound of the range of results (not inclusive) 707 * @return the range of immediate subfolders of the parent folder 708 * @throws PortalException if the parent folder could not be found 709 * @throws SystemException if a system exception occurred 710 */ 711 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 712 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 713 long repositoryId, long parentFolderId, int start, int end) 714 throws com.liferay.portal.kernel.exception.PortalException, 715 com.liferay.portal.kernel.exception.SystemException; 716 717 /** 718 * Returns an ordered range of all the immediate subfolders of the parent 719 * folder. 720 * 721 * <p> 722 * Useful when paginating results. Returns a maximum of <code>end - 723 * start</code> instances. <code>start</code> and <code>end</code> are not 724 * primary keys, they are indexes in the result set. Thus, <code>0</code> 725 * refers to the first result in the set. Setting both <code>start</code> 726 * and <code>end</code> to {@link 727 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 728 * result set. 729 * </p> 730 * 731 * @param repositoryId the primary key of the folder's repository 732 * @param parentFolderId the primary key of the folder's parent folder 733 * @param start the lower bound of the range of results 734 * @param end the upper bound of the range of results (not inclusive) 735 * @param obc the comparator to order the folders (optionally 736 <code>null</code>) 737 * @return the range of immediate subfolders of the parent folder ordered by 738 comparator <code>obc</code> 739 * @throws PortalException if the parent folder could not be found 740 * @throws SystemException if a system exception occurred 741 */ 742 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 743 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getFolders( 744 long repositoryId, long parentFolderId, int start, int end, 745 com.liferay.portal.kernel.util.OrderByComparator obc) 746 throws com.liferay.portal.kernel.exception.PortalException, 747 com.liferay.portal.kernel.exception.SystemException; 748 749 /** 750 * Returns an ordered range of all the immediate subfolders, file entries, 751 * and file shortcuts in the parent folder. 752 * 753 * <p> 754 * Useful when paginating results. Returns a maximum of <code>end - 755 * start</code> instances. <code>start</code> and <code>end</code> are not 756 * primary keys, they are indexes in the result set. Thus, <code>0</code> 757 * refers to the first result in the set. Setting both <code>start</code> 758 * and <code>end</code> to {@link 759 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 760 * result set. 761 * </p> 762 * 763 * @param repositoryId the primary key of the repository 764 * @param folderId the primary key of the parent folder 765 * @param status the workflow status 766 * @param includeMountFolders whether to include mount folders for 767 third-party repositories 768 * @param start the lower bound of the range of results 769 * @param end the upper bound of the range of results (not inclusive) 770 * @param obc the comparator to order the results (optionally 771 <code>null</code>) 772 * @return the range of immediate subfolders, file entries, and file 773 shortcuts in the parent folder ordered by comparator 774 <code>obc</code> 775 * @throws PortalException if the folder could not be found 776 * @throws SystemException if a system exception occurred 777 */ 778 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 779 public java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts( 780 long repositoryId, long folderId, int status, 781 boolean includeMountFolders, int start, int end, 782 com.liferay.portal.kernel.util.OrderByComparator obc) 783 throws com.liferay.portal.kernel.exception.PortalException, 784 com.liferay.portal.kernel.exception.SystemException; 785 786 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 787 public java.util.List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts( 788 long repositoryId, long folderId, int status, 789 java.lang.String[] mimeTypes, boolean includeMountFolders, int start, 790 int end, com.liferay.portal.kernel.util.OrderByComparator obc) 791 throws com.liferay.portal.kernel.exception.PortalException, 792 com.liferay.portal.kernel.exception.SystemException; 793 794 /** 795 * Returns the number of immediate subfolders, file entries, and file 796 * shortcuts in the parent folder. 797 * 798 * @param repositoryId the primary key of the repository 799 * @param folderId the primary key of the parent folder 800 * @param status the workflow status 801 * @param includeMountFolders whether to include mount folders for 802 third-party repositories 803 * @return the number of immediate subfolders, file entries, and file 804 shortcuts in the parent folder 805 * @throws PortalException if the folder could not be found 806 * @throws SystemException if a system exception occurred 807 */ 808 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 809 public int getFoldersAndFileEntriesAndFileShortcutsCount( 810 long repositoryId, long folderId, int status, 811 boolean includeMountFolders) 812 throws com.liferay.portal.kernel.exception.PortalException, 813 com.liferay.portal.kernel.exception.SystemException; 814 815 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 816 public int getFoldersAndFileEntriesAndFileShortcutsCount( 817 long repositoryId, long folderId, int status, 818 java.lang.String[] mimeTypes, boolean includeMountFolders) 819 throws com.liferay.portal.kernel.exception.PortalException, 820 com.liferay.portal.kernel.exception.SystemException; 821 822 /** 823 * Returns the number of immediate subfolders of the parent folder. 824 * 825 * @param repositoryId the primary key of the folder's repository 826 * @param parentFolderId the primary key of the folder's parent folder 827 * @return the number of immediate subfolders of the parent folder 828 * @throws PortalException if the parent folder could not be found 829 * @throws SystemException if a system exception occurred 830 */ 831 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 832 public int getFoldersCount(long repositoryId, long parentFolderId) 833 throws com.liferay.portal.kernel.exception.PortalException, 834 com.liferay.portal.kernel.exception.SystemException; 835 836 /** 837 * Returns the number of immediate subfolders of the parent folder, 838 * optionally including mount folders for third-party repositories. 839 * 840 * @param repositoryId the primary key of the folder's repository 841 * @param parentFolderId the primary key of the folder's parent folder 842 * @param includeMountFolders whether to include mount folders for 843 third-party repositories 844 * @return the number of immediate subfolders of the parent folder 845 * @throws PortalException if the parent folder could not be found 846 * @throws SystemException if a system exception occurred 847 */ 848 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 849 public int getFoldersCount(long repositoryId, long parentFolderId, 850 boolean includeMountFolders) 851 throws com.liferay.portal.kernel.exception.PortalException, 852 com.liferay.portal.kernel.exception.SystemException; 853 854 /** 855 * Returns the number of immediate subfolders and file entries across the 856 * folders. 857 * 858 * @param repositoryId the primary key of the repository 859 * @param folderIds the primary keys of folders from which to count 860 immediate subfolders and file entries 861 * @param status the workflow status 862 * @return the number of immediate subfolders and file entries across the 863 folders 864 * @throws PortalException if the repository could not be found 865 * @throws SystemException if a system exception occurred 866 */ 867 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 868 public int getFoldersFileEntriesCount(long repositoryId, 869 java.util.List<java.lang.Long> folderIds, int status) 870 throws com.liferay.portal.kernel.exception.PortalException, 871 com.liferay.portal.kernel.exception.SystemException; 872 873 /** 874 * Returns the mount folder of the repository with the primary key. This 875 * method is only supported by the Liferay repository. 876 * 877 * @param repositoryId the primary key of the repository 878 * @return the folder used for mounting third-party repositories 879 * @throws PortalException if the repository or mount folder could not be 880 found 881 * @throws SystemException if a system exception occurred 882 */ 883 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 884 public com.liferay.portal.kernel.repository.model.Folder getMountFolder( 885 long repositoryId) 886 throws com.liferay.portal.kernel.exception.PortalException, 887 com.liferay.portal.kernel.exception.SystemException; 888 889 /** 890 * Returns all immediate subfolders of the parent folder that are used for 891 * mounting third-party repositories. This method is only supported by the 892 * Liferay repository. 893 * 894 * @param repositoryId the primary key of the folder's repository 895 * @param parentFolderId the primary key of the folder's parent folder 896 * @return the immediate subfolders of the parent folder that are used for 897 mounting third-party repositories 898 * @throws PortalException if the repository or parent folder could not be 899 found 900 * @throws SystemException if a system exception occurred 901 */ 902 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 903 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders( 904 long repositoryId, long parentFolderId) 905 throws com.liferay.portal.kernel.exception.PortalException, 906 com.liferay.portal.kernel.exception.SystemException; 907 908 /** 909 * Returns a range of all the immediate subfolders of the parent folder that 910 * are used for mounting third-party repositories. This method is only 911 * supported by the Liferay repository. 912 * 913 * <p> 914 * Useful when paginating results. Returns a maximum of <code>end - 915 * start</code> instances. <code>start</code> and <code>end</code> are not 916 * primary keys, they are indexes in the result set. Thus, <code>0</code> 917 * refers to the first result in the set. Setting both <code>start</code> 918 * and <code>end</code> to {@link 919 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 920 * result set. 921 * </p> 922 * 923 * @param repositoryId the primary key of the repository 924 * @param parentFolderId the primary key of the parent folder 925 * @param start the lower bound of the range of results 926 * @param end the upper bound of the range of results (not inclusive) 927 * @return the range of immediate subfolders of the parent folder that are 928 used for mounting third-party repositories 929 * @throws PortalException if the repository or parent folder could not be 930 found 931 * @throws SystemException if a system exception occurred 932 */ 933 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 934 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders( 935 long repositoryId, long parentFolderId, int start, int end) 936 throws com.liferay.portal.kernel.exception.PortalException, 937 com.liferay.portal.kernel.exception.SystemException; 938 939 /** 940 * Returns an ordered range of all the immediate subfolders of the parent 941 * folder that are used for mounting third-party repositories. This method 942 * is only supported by the Liferay repository. 943 * 944 * <p> 945 * Useful when paginating results. Returns a maximum of <code>end - 946 * start</code> instances. <code>start</code> and <code>end</code> are not 947 * primary keys, they are indexes in the result set. Thus, <code>0</code> 948 * refers to the first result in the set. Setting both <code>start</code> 949 * and <code>end</code> to {@link 950 * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full 951 * result set. 952 * </p> 953 * 954 * @param repositoryId the primary key of the folder's repository 955 * @param parentFolderId the primary key of the folder's parent folder 956 * @param start the lower bound of the range of results 957 * @param end the upper bound of the range of results (not inclusive) 958 * @param obc the comparator to order the folders (optionally 959 <code>null</code>) 960 * @return the range of immediate subfolders of the parent folder that are 961 used for mounting third-party repositories ordered by comparator 962 <code>obc</code> 963 * @throws PortalException if the repository or parent folder could not be 964 found 965 * @throws SystemException if a system exception occurred 966 */ 967 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 968 public java.util.List<com.liferay.portal.kernel.repository.model.Folder> getMountFolders( 969 long repositoryId, long parentFolderId, int start, int end, 970 com.liferay.portal.kernel.util.OrderByComparator obc) 971 throws com.liferay.portal.kernel.exception.PortalException, 972 com.liferay.portal.kernel.exception.SystemException; 973 974 /** 975 * Returns the number of immediate subfolders of the parent folder that are 976 * used for mounting third-party repositories. This method is only supported 977 * by the Liferay repository. 978 * 979 * @param repositoryId the primary key of the repository 980 * @param parentFolderId the primary key of the parent folder 981 * @return the number of folders of the parent folder that are used for 982 mounting third-party repositories 983 * @throws PortalException if the repository or parent folder could not be 984 found 985 * @throws SystemException if a system exception occurred 986 */ 987 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 988 public int getMountFoldersCount(long repositoryId, long parentFolderId) 989 throws com.liferay.portal.kernel.exception.PortalException, 990 com.liferay.portal.kernel.exception.SystemException; 991 992 /** 993 * Moves the file entry to the new folder. 994 * 995 * @param userId the primary key of the user 996 * @param fileEntryId the primary key of the file entry 997 * @param newFolderId the primary key of the new folder 998 * @param serviceContext the service context to be applied 999 * @return the file entry 1000 * @throws PortalException if the file entry or the new folder could not be 1001 found 1002 * @throws SystemException if a system exception occurred 1003 */ 1004 public com.liferay.portal.kernel.repository.model.FileEntry moveFileEntry( 1005 long userId, long fileEntryId, long newFolderId, 1006 com.liferay.portal.service.ServiceContext serviceContext) 1007 throws com.liferay.portal.kernel.exception.PortalException, 1008 com.liferay.portal.kernel.exception.SystemException; 1009 1010 /** 1011 * Updates the file entry's asset replacing its asset categories, tags, and 1012 * links. 1013 * 1014 * @param userId the primary key of the user 1015 * @param fileEntry the file entry to update 1016 * @param fileVersion the file version to update 1017 * @param assetCategoryIds the primary keys of the new asset categories 1018 * @param assetTagNames the new asset tag names 1019 * @param assetLinkEntryIds the primary keys of the new asset link entries 1020 * @throws PortalException if the file entry or version could not be found 1021 * @throws SystemException if a system exception occurred 1022 */ 1023 public void updateAsset(long userId, 1024 com.liferay.portal.kernel.repository.model.FileEntry fileEntry, 1025 com.liferay.portal.kernel.repository.model.FileVersion fileVersion, 1026 long[] assetCategoryIds, java.lang.String[] assetTagNames, 1027 long[] assetLinkEntryIds) 1028 throws com.liferay.portal.kernel.exception.PortalException, 1029 com.liferay.portal.kernel.exception.SystemException; 1030 1031 /** 1032 * Updates a file entry and associated metadata based on a byte array 1033 * object. If the file data is <code>null</code>, then only the associated 1034 * metadata (i.e., <code>title</code>, <code>description</code>, and 1035 * parameters in the <code>serviceContext</code>) will be updated. 1036 * 1037 * <p> 1038 * This method takes two file names, the <code>sourceFileName</code> and the 1039 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 1040 * name of the actual file being uploaded. The <code>title</code> 1041 * corresponds to a name the client wishes to assign this file after it has 1042 * been uploaded to the portal. 1043 * </p> 1044 * 1045 * @param userId the primary key of the user 1046 * @param fileEntryId the primary key of the file entry 1047 * @param sourceFileName the original file's name (optionally 1048 <code>null</code>) 1049 * @param mimeType the file's MIME type (optionally <code>null</code>) 1050 * @param title the new name to be assigned to the file (optionally <code> 1051 <code>null</code></code>) 1052 * @param description the file's new description 1053 * @param changeLog the file's version change log (optionally 1054 <code>null</code>) 1055 * @param majorVersion whether the new file version is a major version 1056 * @param bytes the file's data (optionally <code>null</code>) 1057 * @param serviceContext the service context to be applied. Can set the 1058 asset category IDs, asset tag names, and expando bridge 1059 attributes for the file entry. In a Liferay repository, it may 1060 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 1061 type </li> <li> fieldsMap - mapping for fields associated with a 1062 custom file entry type </li> </ul> 1063 * @return the file entry 1064 * @throws PortalException if the file entry could not be found 1065 * @throws SystemException if a system exception occurred 1066 */ 1067 public com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry( 1068 long userId, long fileEntryId, java.lang.String sourceFileName, 1069 java.lang.String mimeType, java.lang.String title, 1070 java.lang.String description, java.lang.String changeLog, 1071 boolean majorVersion, byte[] bytes, 1072 com.liferay.portal.service.ServiceContext serviceContext) 1073 throws com.liferay.portal.kernel.exception.PortalException, 1074 com.liferay.portal.kernel.exception.SystemException; 1075 1076 /** 1077 * Updates a file entry and associated metadata based on a {@link File} 1078 * object. If the file data is <code>null</code>, then only the associated 1079 * metadata (i.e., <code>title</code>, <code>description</code>, and 1080 * parameters in the <code>serviceContext</code>) will be updated. 1081 * 1082 * <p> 1083 * This method takes two file names, the <code>sourceFileName</code> and the 1084 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 1085 * name of the actual file being uploaded. The <code>title</code> 1086 * corresponds to a name the client wishes to assign this file after it has 1087 * been uploaded to the portal. 1088 * </p> 1089 * 1090 * @param userId the primary key of the user 1091 * @param fileEntryId the primary key of the file entry 1092 * @param sourceFileName the original file's name (optionally 1093 <code>null</code>) 1094 * @param mimeType the file's MIME type (optionally <code>null</code>) 1095 * @param title the new name to be assigned to the file (optionally <code> 1096 <code>null</code></code>) 1097 * @param description the file's new description 1098 * @param changeLog the file's version change log (optionally 1099 <code>null</code>) 1100 * @param majorVersion whether the new file version is a major version 1101 * @param file EntryId the primary key of the file entry 1102 * @param serviceContext the service context to be applied. Can set the 1103 asset category IDs, asset tag names, and expando bridge 1104 attributes for the file entry. In a Liferay repository, it may 1105 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 1106 type </li> <li> fieldsMap - mapping for fields associated with a 1107 custom file entry type </li> </ul> 1108 * @return the file entry 1109 * @throws PortalException if the file entry could not be found 1110 * @throws SystemException if a system exception occurred 1111 */ 1112 public com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry( 1113 long userId, long fileEntryId, java.lang.String sourceFileName, 1114 java.lang.String mimeType, java.lang.String title, 1115 java.lang.String description, java.lang.String changeLog, 1116 boolean majorVersion, java.io.File file, 1117 com.liferay.portal.service.ServiceContext serviceContext) 1118 throws com.liferay.portal.kernel.exception.PortalException, 1119 com.liferay.portal.kernel.exception.SystemException; 1120 1121 /** 1122 * Updates a file entry and associated metadata based on an {@link 1123 * InputStream} object. If the file data is <code>null</code>, then only the 1124 * associated metadata (i.e., <code>title</code>, <code>description</code>, 1125 * and parameters in the <code>serviceContext</code>) will be updated. 1126 * 1127 * <p> 1128 * This method takes two file names, the <code>sourceFileName</code> and the 1129 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 1130 * name of the actual file being uploaded. The <code>title</code> 1131 * corresponds to a name the client wishes to assign this file after it has 1132 * been uploaded to the portal. 1133 * </p> 1134 * 1135 * @param userId the primary key of the user 1136 * @param fileEntryId the primary key of the file entry 1137 * @param sourceFileName the original file's name (optionally 1138 <code>null</code>) 1139 * @param mimeType the file's MIME type (optionally <code>null</code>) 1140 * @param title the new name to be assigned to the file (optionally <code> 1141 <code>null</code></code>) 1142 * @param description the file's new description 1143 * @param changeLog the file's version change log (optionally 1144 <code>null</code>) 1145 * @param majorVersion whether the new file version is a major version 1146 * @param is the file's data (optionally <code>null</code>) 1147 * @param size the file's size (optionally <code>0</code>) 1148 * @param serviceContext the service context to be applied. Can set the 1149 asset category IDs, asset tag names, and expando bridge 1150 attributes for the file entry. In a Liferay repository, it may 1151 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 1152 type </li> <li> fieldsMap - mapping for fields associated with a 1153 custom file entry type </li> </ul> 1154 * @return the file entry 1155 * @throws PortalException if the file entry could not be found 1156 * @throws SystemException if a system exception occurred 1157 */ 1158 public com.liferay.portal.kernel.repository.model.FileEntry updateFileEntry( 1159 long userId, long fileEntryId, java.lang.String sourceFileName, 1160 java.lang.String mimeType, java.lang.String title, 1161 java.lang.String description, java.lang.String changeLog, 1162 boolean majorVersion, java.io.InputStream is, long size, 1163 com.liferay.portal.service.ServiceContext serviceContext) 1164 throws com.liferay.portal.kernel.exception.PortalException, 1165 com.liferay.portal.kernel.exception.SystemException; 1166 1167 /** 1168 * Updates a file rank to the existing file entry. This method is only 1169 * supported by the Liferay repository. 1170 * 1171 * @param repositoryId the primary key of the file rank's repository 1172 * @param companyId the primary key of the file rank's company 1173 * @param userId the primary key of the file rank's creator/owner 1174 * @param fileEntryId the primary key of the file rank's file entry 1175 * @param serviceContext the service context to be applied 1176 * @return the file rank 1177 * @throws SystemException if a system exception occurred 1178 */ 1179 public com.liferay.portlet.documentlibrary.model.DLFileRank updateFileRank( 1180 long repositoryId, long companyId, long userId, long fileEntryId, 1181 com.liferay.portal.service.ServiceContext serviceContext) 1182 throws com.liferay.portal.kernel.exception.SystemException; 1183 1184 /** 1185 * Updates a file shortcut to the existing file entry. This method is only 1186 * supported by the Liferay repository. 1187 * 1188 * @param userId the primary key of the file shortcut's creator/owner 1189 * @param fileShortcutId the primary key of the file shortcut 1190 * @param folderId the primary key of the file shortcut's parent folder 1191 * @param toFileEntryId the primary key of the file shortcut's file entry 1192 * @param serviceContext the service context to be applied. Can set the 1193 asset category IDs, asset tag names, and expando bridge 1194 attributes for the file entry. 1195 * @return the file shortcut 1196 * @throws PortalException if the file shortcut, folder, or file entry could 1197 not be found 1198 * @throws SystemException if a system exception occurred 1199 */ 1200 public com.liferay.portlet.documentlibrary.model.DLFileShortcut updateFileShortcut( 1201 long userId, long fileShortcutId, long folderId, long toFileEntryId, 1202 com.liferay.portal.service.ServiceContext serviceContext) 1203 throws com.liferay.portal.kernel.exception.PortalException, 1204 com.liferay.portal.kernel.exception.SystemException; 1205 1206 /** 1207 * Updates all file shortcuts to the existing file entry to the new file 1208 * entry. This method is only supported by the Liferay repository. 1209 * 1210 * @param toRepositoryId the primary key of the repository 1211 * @param oldToFileEntryId the primary key of the old file entry pointed to 1212 * @param newToFileEntryId the primary key of the new file entry to point 1213 to 1214 * @throws SystemException if a system exception occurred 1215 */ 1216 public void updateFileShortcuts(long toRepositoryId, long oldToFileEntryId, 1217 long newToFileEntryId) 1218 throws com.liferay.portal.kernel.exception.SystemException; 1219 1220 /** 1221 * Updates the folder. 1222 * 1223 * @param folderId the primary key of the folder 1224 * @param parentFolderId the primary key of the folder's new parent folder 1225 * @param name the folder's new name 1226 * @param description the folder's new description 1227 * @param serviceContext the service context to be applied. In a Liferay 1228 repository, it may include: <ul> <li> defaultFileEntryTypeId - 1229 the file entry type to default all Liferay file entries to </li> 1230 <li> dlFileEntryTypesSearchContainerPrimaryKeys - a 1231 comma-delimited list of file entry type primary keys allowed in 1232 the given folder and all descendants </li> <li> 1233 overrideFileEntryTypes - boolean specifying whether to override 1234 ancestral folder's restriction of file entry types allowed </li> 1235 <li> workflowDefinitionXYZ - the workflow definition name 1236 specified per file entry type. The parameter name must be the 1237 string <code>workflowDefinition</code> appended by the <code> 1238 fileEntryTypeId</code> (optionally <code>0</code>). </li> </ul> 1239 * @return the folder 1240 * @throws PortalException if the current or new parent folder could not be 1241 found, or if the new parent folder's information was invalid 1242 * @throws SystemException if a system exception occurred 1243 */ 1244 public com.liferay.portal.kernel.repository.model.Folder updateFolder( 1245 long folderId, long parentFolderId, java.lang.String name, 1246 java.lang.String description, 1247 com.liferay.portal.service.ServiceContext serviceContext) 1248 throws com.liferay.portal.kernel.exception.PortalException, 1249 com.liferay.portal.kernel.exception.SystemException; 1250 }