001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.document.library.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.exception.PortalException; 020 import com.liferay.portal.kernel.exception.SystemException; 021 import com.liferay.portal.kernel.jsonwebservice.JSONWebService; 022 import com.liferay.portal.kernel.lock.Lock; 023 import com.liferay.portal.kernel.repository.model.FileEntry; 024 import com.liferay.portal.kernel.repository.model.FileShortcut; 025 import com.liferay.portal.kernel.repository.model.FileVersion; 026 import com.liferay.portal.kernel.repository.model.Folder; 027 import com.liferay.portal.kernel.search.Hits; 028 import com.liferay.portal.kernel.search.Query; 029 import com.liferay.portal.kernel.search.SearchContext; 030 import com.liferay.portal.kernel.search.SearchException; 031 import com.liferay.portal.kernel.security.access.control.AccessControlled; 032 import com.liferay.portal.kernel.service.BaseService; 033 import com.liferay.portal.kernel.service.ServiceContext; 034 import com.liferay.portal.kernel.transaction.Isolation; 035 import com.liferay.portal.kernel.transaction.Propagation; 036 import com.liferay.portal.kernel.transaction.Transactional; 037 import com.liferay.portal.kernel.util.OrderByComparator; 038 039 import java.io.File; 040 import java.io.InputStream; 041 042 import java.util.List; 043 044 /** 045 * Provides the remote service interface for DLApp. Methods of this 046 * service are expected to have security checks based on the propagated JAAS 047 * credentials because this service can be accessed remotely. 048 * 049 * @author Brian Wing Shun Chan 050 * @see DLAppServiceUtil 051 * @see com.liferay.portlet.documentlibrary.service.base.DLAppServiceBaseImpl 052 * @see com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl 053 * @generated 054 */ 055 @AccessControlled 056 @JSONWebService 057 @ProviderType 058 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 059 PortalException.class, SystemException.class}) 060 public interface DLAppService extends BaseService { 061 /* 062 * NOTE FOR DEVELOPERS: 063 * 064 * Never modify or reference this interface directly. Always use {@link DLAppServiceUtil} to access the d l app remote service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLAppServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 065 */ 066 067 /** 068 * Returns <code>true</code> if the file entry is checked out. This method 069 * is primarily used by WebDAV. 070 * 071 * @param repositoryId the primary key for the repository 072 * @param fileEntryId the primary key for the file entry 073 * @param lockUuid the lock's UUID 074 * @return <code>true</code> if the file entry is checked out; 075 <code>false</code> otherwise 076 */ 077 public boolean verifyFileEntryCheckOut(long repositoryId, long fileEntryId, 078 java.lang.String lockUuid) throws PortalException; 079 080 public boolean verifyFileEntryLock(long repositoryId, long fileEntryId, 081 java.lang.String lockUuid) throws PortalException; 082 083 /** 084 * Returns <code>true</code> if the inheritable lock exists. This method is 085 * primarily used by WebDAV. 086 * 087 * @param repositoryId the primary key for the repository 088 * @param folderId the primary key for the folder 089 * @param lockUuid the lock's UUID 090 * @return <code>true</code> if the inheritable lock exists; 091 <code>false</code> otherwise 092 */ 093 public boolean verifyInheritableLock(long repositoryId, long folderId, 094 java.lang.String lockUuid) throws PortalException; 095 096 /** 097 * Locks the folder. This method is primarily used by WebDAV. 098 * 099 * @param repositoryId the primary key of the repository 100 * @param folderId the primary key of the folder 101 * @return the lock object 102 */ 103 public Lock lockFolder(long repositoryId, long folderId) 104 throws PortalException; 105 106 /** 107 * Locks the folder. This method is primarily used by WebDAV. 108 * 109 * @param repositoryId the primary key of the repository 110 * @param folderId the primary key of the folder 111 * @param owner the owner string for the checkout (optionally 112 <code>null</code>) 113 * @param inheritable whether the lock must propagate to descendants 114 * @param expirationTime the time in milliseconds before the lock expires. 115 If the value is <code>0</code>, the default expiration time will 116 be used from <code>portal.properties>. 117 * @return the lock object 118 */ 119 public Lock lockFolder(long repositoryId, long folderId, 120 java.lang.String owner, boolean inheritable, long expirationTime) 121 throws PortalException; 122 123 /** 124 * Refreshes the lock for the file entry. This method is primarily used by 125 * WebDAV. 126 * 127 * @param lockUuid the lock's UUID 128 * @param companyId the primary key of the file entry's company 129 * @param expirationTime the time in milliseconds before the lock expires. 130 If the value is <code>0</code>, the default expiration time will 131 be used from <code>portal.properties>. 132 * @return the lock object 133 */ 134 public Lock refreshFileEntryLock(java.lang.String lockUuid, long companyId, 135 long expirationTime) throws PortalException; 136 137 /** 138 * Refreshes the lock for the folder. This method is primarily used by 139 * WebDAV. 140 * 141 * @param lockUuid the lock's UUID 142 * @param companyId the primary key of the file entry's company 143 * @param expirationTime the time in milliseconds before the lock expires. 144 If the value is <code>0</code>, the default expiration time will 145 be used from <code>portal.properties>. 146 * @return the lock object 147 */ 148 public Lock refreshFolderLock(java.lang.String lockUuid, long companyId, 149 long expirationTime) throws PortalException; 150 151 /** 152 * Adds a file entry and associated metadata. It is created based on a byte 153 * array. 154 * 155 * <p> 156 * This method takes two file names, the <code>sourceFileName</code> and the 157 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 158 * name of the actual file being uploaded. The <code>title</code> 159 * corresponds to a name the client wishes to assign this file after it has 160 * been uploaded to the portal. If it is <code>null</code>, the <code> 161 * sourceFileName</code> will be used. 162 * </p> 163 * 164 * @param repositoryId the primary key of the repository 165 * @param folderId the primary key of the file entry's parent folder 166 * @param sourceFileName the original file's name 167 * @param mimeType the file's MIME type 168 * @param title the name to be assigned to the file (optionally <code>null 169 </code>) 170 * @param description the file's description 171 * @param changeLog the file's version change log 172 * @param bytes the file's data (optionally <code>null</code>) 173 * @param serviceContext the service context to be applied. Can set the 174 asset category IDs, asset tag names, and expando bridge 175 attributes for the file entry. In a Liferay repository, it may 176 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 177 type </li> <li> fieldsMap - mapping for fields associated with a 178 custom file entry type </li> </ul> 179 * @return the file entry 180 */ 181 public FileEntry addFileEntry(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, byte[] bytes, ServiceContext serviceContext) 185 throws PortalException; 186 187 /** 188 * Adds a file entry and associated metadata. It is created based on a 189 * {@link File} object. 190 * 191 * <p> 192 * This method takes two file names, the <code>sourceFileName</code> and the 193 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 194 * name of the actual file being uploaded. The <code>title</code> 195 * corresponds to a name the client wishes to assign this file after it has 196 * been uploaded to the portal. If it is <code>null</code>, the <code> 197 * sourceFileName</code> will be used. 198 * </p> 199 * 200 * @param repositoryId the primary key of the repository 201 * @param folderId the primary key of the file entry's parent folder 202 * @param sourceFileName the original file's name 203 * @param mimeType the file's MIME type 204 * @param title the name to be assigned to the file (optionally <code>null 205 </code>) 206 * @param description the file's description 207 * @param changeLog the file's version change log 208 * @param file the file's data (optionally <code>null</code>) 209 * @param serviceContext the service context to be applied. Can set the 210 asset category IDs, asset tag names, and expando bridge 211 attributes for the file entry. In a Liferay repository, it may 212 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 213 type </li> <li> fieldsMap - mapping for fields associated with a 214 custom file entry type </li> </ul> 215 * @return the file entry 216 */ 217 public FileEntry addFileEntry(long repositoryId, long folderId, 218 java.lang.String sourceFileName, java.lang.String mimeType, 219 java.lang.String title, java.lang.String description, 220 java.lang.String changeLog, File file, ServiceContext serviceContext) 221 throws PortalException; 222 223 /** 224 * Adds a file entry and associated metadata. It is created based on a 225 * {@link InputStream} object. 226 * 227 * <p> 228 * This method takes two file names, the <code>sourceFileName</code> and the 229 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 230 * name of the actual file being uploaded. The <code>title</code> 231 * corresponds to a name the client wishes to assign this file after it has 232 * been uploaded to the portal. If it is <code>null</code>, the <code> 233 * sourceFileName</code> will be used. 234 * </p> 235 * 236 * @param repositoryId the primary key of the repository 237 * @param folderId the primary key of the file entry's parent folder 238 * @param sourceFileName the original file's name 239 * @param mimeType the file's MIME type 240 * @param title the name to be assigned to the file (optionally <code>null 241 </code>) 242 * @param description the file's description 243 * @param changeLog the file's version change log 244 * @param is the file's data (optionally <code>null</code>) 245 * @param size the file's size (optionally <code>0</code>) 246 * @param serviceContext the service context to be applied. Can set the 247 asset category IDs, asset tag names, and expando bridge 248 attributes for the file entry. In a Liferay repository, it may 249 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 250 type </li> <li> fieldsMap - mapping for fields associated with a 251 custom file entry type </li> </ul> 252 * @return the file entry 253 */ 254 public FileEntry addFileEntry(long repositoryId, long folderId, 255 java.lang.String sourceFileName, java.lang.String mimeType, 256 java.lang.String title, java.lang.String description, 257 java.lang.String changeLog, InputStream is, long size, 258 ServiceContext serviceContext) throws PortalException; 259 260 /** 261 * Adds a temporary file entry. 262 * 263 * <p> 264 * This allows a client to upload a file into a temporary location and 265 * manipulate its metadata prior to making it available for public usage. 266 * This is different from checking in and checking out a file entry. 267 * </p> 268 * 269 * @param groupId the primary key of the group 270 * @param folderId the primary key of the folder where the file entry will 271 eventually reside 272 * @param folderName the temporary folder's name 273 * @param fileName the file's original name 274 * @param file the file's data (optionally <code>null</code>) 275 * @param mimeType the file's MIME type 276 * @return the temporary file entry 277 * @see TempFileEntryUtil 278 */ 279 public FileEntry addTempFileEntry(long groupId, long folderId, 280 java.lang.String folderName, java.lang.String fileName, File file, 281 java.lang.String mimeType) throws PortalException; 282 283 /** 284 * Adds a temporary file entry. It is created based on the {@link 285 * InputStream} object. 286 * 287 * <p> 288 * This allows a client to upload a file into a temporary location and 289 * manipulate its metadata prior to making it available for public usage. 290 * This is different from checking in and checking out a file entry. 291 * </p> 292 * 293 * @param groupId the primary key of the group 294 * @param folderId the primary key of the folder where the file entry will 295 eventually reside 296 * @param folderName the temporary folder's name 297 * @param fileName the file's original name 298 * @param inputStream the file's data 299 * @param mimeType the file's MIME type 300 * @return the temporary file entry 301 * @see TempFileEntryUtil 302 */ 303 public FileEntry addTempFileEntry(long groupId, long folderId, 304 java.lang.String folderName, java.lang.String fileName, 305 InputStream inputStream, java.lang.String mimeType) 306 throws PortalException; 307 308 /** 309 * Checks out the file entry. This method is primarily used by WebDAV. 310 * 311 * <p> 312 * When a file entry is checked out, a PWC (private working copy) is created 313 * and the original file entry is locked. A client can make as many changes 314 * to the PWC as he desires without those changes being visible to other 315 * users. If the user is satisfied with the changes, he may elect to check 316 * in his changes, resulting in a new file version based on the PWC; the PWC 317 * will be removed and the file entry will be unlocked. If the user is not 318 * satisfied with the changes, he may elect to cancel his check out; this 319 * results in the deletion of the PWC and unlocking of the file entry. 320 * </p> 321 * 322 * @param fileEntryId the file entry to check out 323 * @param owner the owner string for the checkout (optionally 324 <code>null</code>) 325 * @param expirationTime the time in milliseconds before the lock expires. 326 If the value is <code>0</code>, the default expiration time will 327 be used from <code>portal.properties>. 328 * @param serviceContext the service context to be applied 329 * @return the file entry 330 * @see #cancelCheckOut(long) 331 * @see #checkInFileEntry(long, String) 332 */ 333 public FileEntry checkOutFileEntry(long fileEntryId, 334 java.lang.String owner, long expirationTime, 335 ServiceContext serviceContext) throws PortalException; 336 337 /** 338 * Returns the file entry with the primary key. 339 * 340 * @param fileEntryId the primary key of the file entry 341 * @return the file entry with the primary key 342 */ 343 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 344 public FileEntry getFileEntry(long fileEntryId) throws PortalException; 345 346 /** 347 * Returns the file entry with the title in the folder. 348 * 349 * @param groupId the primary key of the file entry's group 350 * @param folderId the primary key of the file entry's folder 351 * @param title the file entry's title 352 * @return the file entry with the title in the folder 353 */ 354 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 355 public FileEntry getFileEntry(long groupId, long folderId, 356 java.lang.String title) throws PortalException; 357 358 /** 359 * Returns the file entry with the UUID and group. 360 * 361 * @param uuid the file entry's UUID 362 * @param groupId the primary key of the file entry's group 363 * @return the file entry with the UUID and group 364 */ 365 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 366 public FileEntry getFileEntryByUuidAndGroupId(java.lang.String uuid, 367 long groupId) throws PortalException; 368 369 /** 370 * Moves the file entry to the new folder. 371 * 372 * @param fileEntryId the primary key of the file entry 373 * @param newFolderId the primary key of the new folder 374 * @param serviceContext the service context to be applied 375 * @return the file entry 376 */ 377 public FileEntry moveFileEntry(long fileEntryId, long newFolderId, 378 ServiceContext serviceContext) throws PortalException; 379 380 /** 381 * Updates a file entry and associated metadata based on a byte array 382 * object. If the file data is <code>null</code>, then only the associated 383 * metadata (i.e., <code>title</code>, <code>description</code>, and 384 * parameters in the <code>serviceContext</code>) will be updated. 385 * 386 * <p> 387 * This method takes two file names, the <code>sourceFileName</code> and the 388 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 389 * name of the actual file being uploaded. The <code>title</code> 390 * corresponds to a name the client wishes to assign this file after it has 391 * been uploaded to the portal. 392 * </p> 393 * 394 * @param fileEntryId the primary key of the file entry 395 * @param sourceFileName the original file's name (optionally 396 <code>null</code>) 397 * @param mimeType the file's MIME type (optionally <code>null</code>) 398 * @param title the new name to be assigned to the file (optionally <code> 399 <code>null</code></code>) 400 * @param description the file's new description 401 * @param changeLog the file's version change log (optionally 402 <code>null</code>) 403 * @param majorVersion whether the new file version is a major version 404 * @param bytes the file's data (optionally <code>null</code>) 405 * @param serviceContext the service context to be applied. Can set the 406 asset category IDs, asset tag names, and expando bridge 407 attributes for the file entry. In a Liferay repository, it may 408 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 409 type </li> <li> fieldsMap - mapping for fields associated with a 410 custom file entry type </li> </ul> 411 * @return the file entry 412 */ 413 public FileEntry updateFileEntry(long fileEntryId, 414 java.lang.String sourceFileName, java.lang.String mimeType, 415 java.lang.String title, java.lang.String description, 416 java.lang.String changeLog, boolean majorVersion, byte[] bytes, 417 ServiceContext serviceContext) throws PortalException; 418 419 /** 420 * Updates a file entry and associated metadata based on a {@link File} 421 * object. If the file data is <code>null</code>, then only the associated 422 * metadata (i.e., <code>title</code>, <code>description</code>, and 423 * parameters in the <code>serviceContext</code>) will be updated. 424 * 425 * <p> 426 * This method takes two file names, the <code>sourceFileName</code> and the 427 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 428 * name of the actual file being uploaded. The <code>title</code> 429 * corresponds to a name the client wishes to assign this file after it has 430 * been uploaded to the portal. 431 * </p> 432 * 433 * @param fileEntryId the primary key of the file entry 434 * @param sourceFileName the original file's name (optionally 435 <code>null</code>) 436 * @param mimeType the file's MIME type (optionally <code>null</code>) 437 * @param title the new name to be assigned to the file (optionally <code> 438 <code>null</code></code>) 439 * @param description the file's new description 440 * @param changeLog the file's version change log (optionally 441 <code>null</code>) 442 * @param majorVersion whether the new file version is a major version 443 * @param file the file's data (optionally <code>null</code>) 444 * @param serviceContext the service context to be applied. Can set the 445 asset category IDs, asset tag names, and expando bridge 446 attributes for the file entry. In a Liferay repository, it may 447 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 448 type </li> <li> fieldsMap - mapping for fields associated with a 449 custom file entry type </li> </ul> 450 * @return the file entry 451 */ 452 public FileEntry updateFileEntry(long fileEntryId, 453 java.lang.String sourceFileName, java.lang.String mimeType, 454 java.lang.String title, java.lang.String description, 455 java.lang.String changeLog, boolean majorVersion, File file, 456 ServiceContext serviceContext) throws PortalException; 457 458 /** 459 * Updates a file entry and associated metadata based on an {@link 460 * InputStream} object. If the file data is <code>null</code>, then only the 461 * associated metadata (i.e., <code>title</code>, <code>description</code>, 462 * and parameters in the <code>serviceContext</code>) will be updated. 463 * 464 * <p> 465 * This method takes two file names, the <code>sourceFileName</code> and the 466 * <code>title</code>. The <code>sourceFileName</code> corresponds to the 467 * name of the actual file being uploaded. The <code>title</code> 468 * corresponds to a name the client wishes to assign this file after it has 469 * been uploaded to the portal. 470 * </p> 471 * 472 * @param fileEntryId the primary key of the file entry 473 * @param sourceFileName the original file's name (optionally 474 <code>null</code>) 475 * @param mimeType the file's MIME type (optionally <code>null</code>) 476 * @param title the new name to be assigned to the file (optionally <code> 477 <code>null</code></code>) 478 * @param description the file's new description 479 * @param changeLog the file's version change log (optionally 480 <code>null</code>) 481 * @param majorVersion whether the new file version is a major version 482 * @param is the file's data (optionally <code>null</code>) 483 * @param size the file's size (optionally <code>0</code>) 484 * @param serviceContext the service context to be applied. Can set the 485 asset category IDs, asset tag names, and expando bridge 486 attributes for the file entry. In a Liferay repository, it may 487 include: <ul> <li> fileEntryTypeId - ID for a custom file entry 488 type </li> <li> fieldsMap - mapping for fields associated with a 489 custom file entry type </li> </ul> 490 * @return the file entry 491 */ 492 public FileEntry updateFileEntry(long fileEntryId, 493 java.lang.String sourceFileName, java.lang.String mimeType, 494 java.lang.String title, java.lang.String description, 495 java.lang.String changeLog, boolean majorVersion, InputStream is, 496 long size, ServiceContext serviceContext) throws PortalException; 497 498 public FileEntry updateFileEntryAndCheckIn(long fileEntryId, 499 java.lang.String sourceFileName, java.lang.String mimeType, 500 java.lang.String title, java.lang.String description, 501 java.lang.String changeLog, boolean majorVersion, File file, 502 ServiceContext serviceContext) throws PortalException; 503 504 public FileEntry updateFileEntryAndCheckIn(long fileEntryId, 505 java.lang.String sourceFileName, java.lang.String mimeType, 506 java.lang.String title, java.lang.String description, 507 java.lang.String changeLog, boolean majorVersion, InputStream is, 508 long size, ServiceContext serviceContext) throws PortalException; 509 510 /** 511 * Adds a file shortcut to the existing file entry. This method is only 512 * supported by the Liferay repository. 513 * 514 * @param repositoryId the primary key of the repository 515 * @param folderId the primary key of the file shortcut's parent folder 516 * @param toFileEntryId the primary key of the file shortcut's file entry 517 * @param serviceContext the service context to be applied. Can set the 518 asset category IDs, asset tag names, and expando bridge 519 attributes for the file entry. 520 * @return the file shortcut 521 */ 522 public FileShortcut addFileShortcut(long repositoryId, long folderId, 523 long toFileEntryId, ServiceContext serviceContext) 524 throws PortalException; 525 526 /** 527 * Returns the file shortcut with the primary key. This method is only 528 * supported by the Liferay repository. 529 * 530 * @param fileShortcutId the primary key of the file shortcut 531 * @return the file shortcut with the primary key 532 */ 533 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 534 public FileShortcut getFileShortcut(long fileShortcutId) 535 throws PortalException; 536 537 /** 538 * Updates a file shortcut to the existing file entry. This method is only 539 * supported by the Liferay repository. 540 * 541 * @param fileShortcutId the primary key of the file shortcut 542 * @param folderId the primary key of the file shortcut's parent folder 543 * @param toFileEntryId the primary key of the file shortcut's file entry 544 * @param serviceContext the service context to be applied. Can set the 545 asset category IDs, asset tag names, and expando bridge 546 attributes for the file entry. 547 * @return the file shortcut 548 */ 549 public FileShortcut updateFileShortcut(long fileShortcutId, long folderId, 550 long toFileEntryId, ServiceContext serviceContext) 551 throws PortalException; 552 553 /** 554 * Returns the file version with the primary key. 555 * 556 * @param fileVersionId the primary key of the file version 557 * @return the file version with the primary key 558 */ 559 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 560 public FileVersion getFileVersion(long fileVersionId) 561 throws PortalException; 562 563 /** 564 * Adds a folder. 565 * 566 * @param repositoryId the primary key of the repository 567 * @param parentFolderId the primary key of the folder's parent folder 568 * @param name the folder's name 569 * @param description the folder's description 570 * @param serviceContext the service context to be applied. In a Liferay 571 repository, it may include boolean mountPoint specifying whether 572 folder is a facade for mounting a third-party repository 573 * @return the folder 574 */ 575 public Folder addFolder(long repositoryId, long parentFolderId, 576 java.lang.String name, java.lang.String description, 577 ServiceContext serviceContext) throws PortalException; 578 579 /** 580 * Performs a deep copy of the folder. 581 * 582 * @param repositoryId the primary key of the repository 583 * @param sourceFolderId the primary key of the folder to copy 584 * @param parentFolderId the primary key of the new folder's parent folder 585 * @param name the new folder's name 586 * @param description the new folder's description 587 * @param serviceContext the service context to be applied 588 * @return the folder 589 */ 590 public Folder copyFolder(long repositoryId, long sourceFolderId, 591 long parentFolderId, java.lang.String name, 592 java.lang.String description, ServiceContext serviceContext) 593 throws PortalException; 594 595 /** 596 * Returns the folder with the primary key. 597 * 598 * @param folderId the primary key of the folder 599 * @return the folder with the primary key 600 */ 601 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 602 public Folder getFolder(long folderId) throws PortalException; 603 604 /** 605 * Returns the folder with the name in the parent folder. 606 * 607 * @param repositoryId the primary key of the folder's repository 608 * @param parentFolderId the primary key of the folder's parent folder 609 * @param name the folder's name 610 * @return the folder with the name in the parent folder 611 */ 612 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 613 public Folder getFolder(long repositoryId, long parentFolderId, 614 java.lang.String name) throws PortalException; 615 616 /** 617 * Moves the folder to the new parent folder with the primary key. 618 * 619 * @param folderId the primary key of the folder 620 * @param parentFolderId the primary key of the new parent folder 621 * @param serviceContext the service context to be applied 622 * @return the file entry 623 */ 624 public Folder moveFolder(long folderId, long parentFolderId, 625 ServiceContext serviceContext) throws PortalException; 626 627 /** 628 * Updates the folder. 629 * 630 * @param folderId the primary key of the folder 631 * @param name the folder's new name 632 * @param description the folder's new description 633 * @param serviceContext the service context to be applied. In a Liferay 634 repository, it may include: <ul> <li> defaultFileEntryTypeId - 635 the file entry type to default all Liferay file entries to </li> 636 <li> dlFileEntryTypesSearchContainerPrimaryKeys - a 637 comma-delimited list of file entry type primary keys allowed in 638 the given folder and all descendants </li> <li> restrictionType - 639 specifying restriction type of file entry types allowed </li> 640 <li> workflowDefinitionXYZ - the workflow definition name 641 specified per file entry type. The parameter name must be the 642 string <code>workflowDefinition</code> appended by the 643 <code>fileEntryTypeId</code> (optionally <code>0</code>).</li> 644 </ul> 645 * @return the folder 646 */ 647 public Folder updateFolder(long folderId, java.lang.String name, 648 java.lang.String description, ServiceContext serviceContext) 649 throws PortalException; 650 651 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 652 public Hits search(long repositoryId, SearchContext searchContext) 653 throws SearchException; 654 655 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 656 public Hits search(long repositoryId, SearchContext searchContext, 657 Query query) throws SearchException; 658 659 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 660 public Hits search(long repositoryId, long creatorUserId, int status, 661 int start, int end) throws PortalException; 662 663 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 664 public Hits search(long repositoryId, long creatorUserId, long folderId, 665 java.lang.String[] mimeTypes, int status, int start, int end) 666 throws PortalException; 667 668 /** 669 * Returns the number of file entries and shortcuts in the folder. 670 * 671 * @param repositoryId the primary key of the repository 672 * @param folderId the primary key of the folder 673 * @param status the workflow status 674 * @return the number of file entries and shortcuts in the folder 675 */ 676 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 677 public int getFileEntriesAndFileShortcutsCount(long repositoryId, 678 long folderId, int status) throws PortalException; 679 680 /** 681 * Returns the number of file entries and shortcuts in the folder. 682 * 683 * @param repositoryId the primary key of the repository 684 * @param folderId the primary key of the folder 685 * @param status the workflow status 686 * @param mimeTypes allowed media types 687 * @return the number of file entries and shortcuts in the folder 688 */ 689 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 690 public int getFileEntriesAndFileShortcutsCount(long repositoryId, 691 long folderId, int status, java.lang.String[] mimeTypes) 692 throws PortalException; 693 694 /** 695 * Returns the number of file entries in the folder. 696 * 697 * @param repositoryId the primary key of the file entry's repository 698 * @param folderId the primary key of the file entry's folder 699 * @return the number of file entries in the folder 700 */ 701 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 702 public int getFileEntriesCount(long repositoryId, long folderId) 703 throws PortalException; 704 705 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 706 public int getFileEntriesCount(long repositoryId, long folderId, 707 java.lang.String[] mimeTypes) throws PortalException; 708 709 /** 710 * Returns the number of file entries with the file entry type in the 711 * folder. 712 * 713 * @param repositoryId the primary key of the file entry's repository 714 * @param folderId the primary key of the file entry's folder 715 * @param fileEntryTypeId the primary key of the file entry type 716 * @return the number of file entries with the file entry type in the folder 717 */ 718 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 719 public int getFileEntriesCount(long repositoryId, long folderId, 720 long fileEntryTypeId) throws PortalException; 721 722 /** 723 * Returns the number of immediate subfolders, file entries, and file 724 * shortcuts in the parent folder. 725 * 726 * @param repositoryId the primary key of the repository 727 * @param folderId the primary key of the parent folder 728 * @param status the workflow status 729 * @param includeMountFolders whether to include mount folders for 730 third-party repositories 731 * @return the number of immediate subfolders, file entries, and file 732 shortcuts in the parent folder 733 */ 734 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 735 public int getFoldersAndFileEntriesAndFileShortcutsCount( 736 long repositoryId, long folderId, int status, 737 boolean includeMountFolders) throws PortalException; 738 739 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 740 public int getFoldersAndFileEntriesAndFileShortcutsCount( 741 long repositoryId, long folderId, int status, 742 java.lang.String[] mimeTypes, boolean includeMountFolders) 743 throws PortalException; 744 745 /** 746 * Returns the number of immediate subfolders of the parent folder. 747 * 748 * @param repositoryId the primary key of the folder's repository 749 * @param parentFolderId the primary key of the folder's parent folder 750 * @return the number of immediate subfolders of the parent folder 751 */ 752 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 753 public int getFoldersCount(long repositoryId, long parentFolderId) 754 throws PortalException; 755 756 /** 757 * Returns the number of immediate subfolders of the parent folder, 758 * optionally including mount folders for third-party repositories. 759 * 760 * @param repositoryId the primary key of the folder's repository 761 * @param parentFolderId the primary key of the folder's parent folder 762 * @param includeMountFolders whether to include mount folders for 763 third-party repositories 764 * @return the number of immediate subfolders of the parent folder 765 */ 766 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 767 public int getFoldersCount(long repositoryId, long parentFolderId, 768 boolean includeMountFolders) throws PortalException; 769 770 /** 771 * Returns the number of immediate subfolders of the parent folder, 772 * optionally including mount folders for third-party repositories. 773 * 774 * @param repositoryId the primary key of the folder's repository 775 * @param parentFolderId the primary key of the folder's parent folder 776 * @param status the workflow status 777 * @param includeMountFolders whether to include mount folders for 778 third-party repositories 779 * @return the number of immediate subfolders of the parent folder 780 */ 781 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 782 public int getFoldersCount(long repositoryId, long parentFolderId, 783 int status, boolean includeMountFolders) throws PortalException; 784 785 /** 786 * Returns the number of immediate subfolders and file entries across the 787 * folders. 788 * 789 * @param repositoryId the primary key of the repository 790 * @param folderIds the primary keys of folders from which to count 791 immediate subfolders and file entries 792 * @param status the workflow status 793 * @return the number of immediate subfolders and file entries across the 794 folders 795 */ 796 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 797 public int getFoldersFileEntriesCount(long repositoryId, 798 List<java.lang.Long> folderIds, int status) throws PortalException; 799 800 /** 801 * Returns the number of file entries in a group starting at the repository 802 * default parent folder that are stored within the Liferay repository. This 803 * method is primarily used to search for recently modified file entries. It 804 * can be limited to the file entries modified by a given user. 805 * 806 * @param groupId the primary key of the group 807 * @param userId the primary key of the user who created the file 808 (optionally <code>0</code>) 809 * @return the number of matching file entries 810 */ 811 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 812 public int getGroupFileEntriesCount(long groupId, long userId) 813 throws PortalException; 814 815 /** 816 * Returns the number of file entries in a group starting at the root folder 817 * that are stored within the Liferay repository. This method is primarily 818 * used to search for recently modified file entries. It can be limited to 819 * the file entries modified by a given user. 820 * 821 * @param groupId the primary key of the group 822 * @param userId the primary key of the user who created the file 823 (optionally <code>0</code>) 824 * @param rootFolderId the primary key of the root folder to begin the 825 search 826 * @return the number of matching file entries 827 */ 828 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 829 public int getGroupFileEntriesCount(long groupId, long userId, 830 long rootFolderId) throws PortalException; 831 832 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 833 public int getGroupFileEntriesCount(long groupId, long userId, 834 long rootFolderId, java.lang.String[] mimeTypes, int status) 835 throws PortalException; 836 837 /** 838 * Returns the number of immediate subfolders of the parent folder that are 839 * used for mounting third-party repositories. This method is only supported 840 * by the Liferay repository. 841 * 842 * @param repositoryId the primary key of the repository 843 * @param parentFolderId the primary key of the parent folder 844 * @return the number of folders of the parent folder that are used for 845 mounting third-party repositories 846 */ 847 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 848 public int getMountFoldersCount(long repositoryId, long parentFolderId) 849 throws PortalException; 850 851 /** 852 * Returns the OSGi service identifier. 853 * 854 * @return the OSGi service identifier 855 */ 856 public java.lang.String getOSGiServiceIdentifier(); 857 858 /** 859 * Returns all the temporary file entry names. 860 * 861 * @param groupId the primary key of the group 862 * @param folderId the primary key of the folder where the file entry will 863 eventually reside 864 * @param folderName the temporary folder's name 865 * @return the temporary file entry names 866 * @see #addTempFileEntry(long, long, String, String, File, String) 867 * @see TempFileEntryUtil 868 */ 869 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 870 public java.lang.String[] getTempFileNames(long groupId, long folderId, 871 java.lang.String folderName) throws PortalException; 872 873 /** 874 * Returns all the file entries in the folder. 875 * 876 * @param repositoryId the primary key of the file entry's repository 877 * @param folderId the primary key of the file entry's folder 878 * @return the file entries in the folder 879 */ 880 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 881 public List<FileEntry> getFileEntries(long repositoryId, long folderId) 882 throws PortalException; 883 884 /** 885 * Returns a name-ordered range of all the file entries in the folder. 886 * 887 * <p> 888 * Useful when paginating results. Returns a maximum of <code>end - 889 * start</code> instances. <code>start</code> and <code>end</code> are not 890 * primary keys, they are indexes in the result set. Thus, <code>0</code> 891 * refers to the first result in the set. Setting both <code>start</code> 892 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 893 * result set. 894 * </p> 895 * 896 * @param repositoryId the primary key of the file entry's repository 897 * @param folderId the primary key of the file entry's folder 898 * @param start the lower bound of the range of results 899 * @param end the upper bound of the range of results (not inclusive) 900 * @return the name-ordered range of file entries in the folder 901 */ 902 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 903 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 904 int start, int end) throws PortalException; 905 906 /** 907 * Returns an ordered range of all the file entries in the folder. 908 * 909 * <p> 910 * Useful when paginating results. Returns a maximum of <code>end - 911 * start</code> instances. <code>start</code> and <code>end</code> are not 912 * primary keys, they are indexes in the result set. Thus, <code>0</code> 913 * refers to the first result in the set. Setting both <code>start</code> 914 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 915 * result set. 916 * </p> 917 * 918 * @param repositoryId the primary key of the file entry's repository 919 * @param folderId the primary key of the file entry's folder 920 * @param start the lower bound of the range of results 921 * @param end the upper bound of the range of results (not inclusive) 922 * @param obc the comparator to order the file entries (optionally 923 <code>null</code>) 924 * @return the range of file entries in the folder ordered by comparator 925 <code>obc</code> 926 */ 927 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 928 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 929 int start, int end, OrderByComparator<FileEntry> obc) 930 throws PortalException; 931 932 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 933 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 934 java.lang.String[] mimeTypes) throws PortalException; 935 936 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 937 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 938 java.lang.String[] mimeTypes, int start, int end, 939 OrderByComparator<FileEntry> obc) throws PortalException; 940 941 /** 942 * Returns the file entries with the file entry type in the folder. 943 * 944 * @param repositoryId the primary key of the file entry's repository 945 * @param folderId the primary key of the file entry's folder 946 * @param fileEntryTypeId the primary key of the file entry type 947 * @return the file entries with the file entry type in the folder 948 */ 949 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 950 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 951 long fileEntryTypeId) throws PortalException; 952 953 /** 954 * Returns a name-ordered range of all the file entries with the file entry 955 * type in the folder. 956 * 957 * @param repositoryId the primary key of the file entry's repository 958 * @param folderId the primary key of the file entry's folder 959 * @param fileEntryTypeId the primary key of the file entry type 960 * @param start the lower bound of the range of results 961 * @param end the upper bound of the range of results (not inclusive) 962 * @return the name-ordered range of the file entries in the folder 963 */ 964 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 965 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 966 long fileEntryTypeId, int start, int end) throws PortalException; 967 968 /** 969 * Returns an ordered range of all the file entries with the file entry type 970 * in the folder. 971 * 972 * @param repositoryId the primary key of the repository 973 * @param folderId the primary key of the folder 974 * @param fileEntryTypeId the primary key of the file entry type 975 * @param start the lower bound of the range of results 976 * @param end the upper bound of the range of results (not inclusive) 977 * @param obc the comparator to order the results by (optionally 978 <code>null</code>) 979 * @return the range of file entries with the file entry type in the folder 980 ordered by <code>null</code> 981 */ 982 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 983 public List<FileEntry> getFileEntries(long repositoryId, long folderId, 984 long fileEntryTypeId, int start, int end, 985 OrderByComparator<FileEntry> obc) throws PortalException; 986 987 /** 988 * Returns a range of all the file entries and shortcuts in the folder. 989 * 990 * <p> 991 * Useful when paginating results. Returns a maximum of <code>end - 992 * start</code> instances. <code>start</code> and <code>end</code> are not 993 * primary keys, they are indexes in the result set. Thus, <code>0</code> 994 * refers to the first result in the set. Setting both <code>start</code> 995 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 996 * result set. 997 * </p> 998 * 999 * @param repositoryId the primary key of the repository 1000 * @param folderId the primary key of the folder 1001 * @param status the workflow status 1002 * @param start the lower bound of the range of results 1003 * @param end the upper bound of the range of results (not inclusive) 1004 * @return the range of file entries and shortcuts in the folder 1005 */ 1006 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1007 public List<java.lang.Object> getFileEntriesAndFileShortcuts( 1008 long repositoryId, long folderId, int status, int start, int end) 1009 throws PortalException; 1010 1011 /** 1012 * Returns all immediate subfolders of the parent folder. 1013 * 1014 * @param repositoryId the primary key of the folder's repository 1015 * @param parentFolderId the primary key of the folder's parent folder 1016 * @return the immediate subfolders of the parent folder 1017 */ 1018 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1019 public List<Folder> getFolders(long repositoryId, long parentFolderId) 1020 throws PortalException; 1021 1022 /** 1023 * Returns all immediate subfolders of the parent folder, optionally 1024 * including mount folders for third-party repositories. 1025 * 1026 * @param repositoryId the primary key of the folder's repository 1027 * @param parentFolderId the primary key of the folder's parent folder 1028 * @param includeMountFolders whether to include mount folders for 1029 third-party repositories 1030 * @return the immediate subfolders of the parent folder 1031 */ 1032 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1033 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1034 boolean includeMountFolders) throws PortalException; 1035 1036 /** 1037 * Returns a name-ordered range of all the immediate subfolders of the 1038 * parent folder, optionally including mount folders for third-party 1039 * repositories. 1040 * 1041 * <p> 1042 * Useful when paginating results. Returns a maximum of <code>end - 1043 * start</code> instances. <code>start</code> and <code>end</code> are not 1044 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1045 * refers to the first result in the set. Setting both <code>start</code> 1046 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1047 * result set. 1048 * </p> 1049 * 1050 * @param repositoryId the primary key of the folder's repository 1051 * @param parentFolderId the primary key of the folder's parent folder 1052 * @param includeMountFolders whether to include mount folders for 1053 third-party repositories 1054 * @param start the lower bound of the range of results 1055 * @param end the upper bound of the range of results (not inclusive) 1056 * @return the name-ordered range of immediate subfolders of the parent 1057 folder 1058 */ 1059 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1060 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1061 boolean includeMountFolders, int start, int end) 1062 throws PortalException; 1063 1064 /** 1065 * Returns an ordered range of all the immediate subfolders of the parent 1066 * folder. 1067 * 1068 * <p> 1069 * Useful when paginating results. Returns a maximum of <code>end - 1070 * start</code> instances. <code>start</code> and <code>end</code> are not 1071 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1072 * refers to the first result in the set. Setting both <code>start</code> 1073 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1074 * result set. 1075 * </p> 1076 * 1077 * @param repositoryId the primary key of the folder's repository 1078 * @param parentFolderId the primary key of the folder's parent folder 1079 * @param includeMountFolders whether to include mount folders for 1080 third-party repositories 1081 * @param start the lower bound of the range of results 1082 * @param end the upper bound of the range of results (not inclusive) 1083 * @param obc the comparator to order the folders (optionally 1084 <code>null</code>) 1085 * @return the range of immediate subfolders of the parent folder ordered by 1086 comparator <code>obc</code> 1087 */ 1088 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1089 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1090 boolean includeMountFolders, int start, int end, 1091 OrderByComparator<Folder> obc) throws PortalException; 1092 1093 /** 1094 * Returns a name-ordered range of all the immediate subfolders of the 1095 * parent folder. 1096 * 1097 * <p> 1098 * Useful when paginating results. Returns a maximum of <code>end - 1099 * start</code> instances. <code>start</code> and <code>end</code> are not 1100 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1101 * refers to the first result in the set. Setting both <code>start</code> 1102 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1103 * result set. 1104 * </p> 1105 * 1106 * @param repositoryId the primary key of the folder's repository 1107 * @param parentFolderId the primary key of the folder's parent folder 1108 * @param start the lower bound of the range of results 1109 * @param end the upper bound of the range of results (not inclusive) 1110 * @return the name-ordered range of immediate subfolders of the parent 1111 folder 1112 */ 1113 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1114 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1115 int start, int end) throws PortalException; 1116 1117 /** 1118 * Returns an ordered range of all the immediate subfolders of the parent 1119 * folder. 1120 * 1121 * <p> 1122 * Useful when paginating results. Returns a maximum of <code>end - 1123 * start</code> instances. <code>start</code> and <code>end</code> are not 1124 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1125 * refers to the first result in the set. Setting both <code>start</code> 1126 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1127 * result set. 1128 * </p> 1129 * 1130 * @param repositoryId the primary key of the folder's repository 1131 * @param parentFolderId the primary key of the folder's parent folder 1132 * @param start the lower bound of the range of results 1133 * @param end the upper bound of the range of results (not inclusive) 1134 * @param obc the comparator to order the folders (optionally 1135 <code>null</code>) 1136 * @return the range of immediate subfolders of the parent folder ordered by 1137 comparator <code>obc</code> 1138 */ 1139 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1140 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1141 int start, int end, OrderByComparator<Folder> obc) 1142 throws PortalException; 1143 1144 /** 1145 * Returns an ordered range of all the immediate subfolders of the parent 1146 * folder. 1147 * 1148 * <p> 1149 * Useful when paginating results. Returns a maximum of <code>end - 1150 * start</code> instances. <code>start</code> and <code>end</code> are not 1151 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1152 * refers to the first result in the set. Setting both <code>start</code> 1153 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1154 * result set. 1155 * </p> 1156 * 1157 * @param repositoryId the primary key of the folder's repository 1158 * @param parentFolderId the primary key of the folder's parent folder 1159 * @param status the workflow status 1160 * @param includeMountFolders whether to include mount folders for 1161 third-party repositories 1162 * @param start the lower bound of the range of results 1163 * @param end the upper bound of the range of results (not inclusive) 1164 * @param obc the comparator to order the folders (optionally 1165 <code>null</code>) 1166 * @return the range of immediate subfolders of the parent folder ordered by 1167 comparator <code>obc</code> 1168 */ 1169 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1170 public List<Folder> getFolders(long repositoryId, long parentFolderId, 1171 int status, boolean includeMountFolders, int start, int end, 1172 OrderByComparator<Folder> obc) throws PortalException; 1173 1174 /** 1175 * Returns a name-ordered range of all the immediate subfolders, file 1176 * entries, and file shortcuts in the parent folder. 1177 * 1178 * <p> 1179 * Useful when paginating results. Returns a maximum of <code>end - 1180 * start</code> instances. <code>start</code> and <code>end</code> are not 1181 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1182 * refers to the first result in the set. Setting both <code>start</code> 1183 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1184 * result set. 1185 * </p> 1186 * 1187 * @param repositoryId the primary key of the repository 1188 * @param folderId the primary key of the parent folder 1189 * @param status the workflow status 1190 * @param includeMountFolders whether to include mount folders for 1191 third-party repositories 1192 * @param start the lower bound of the range of results 1193 * @param end the upper bound of the range of results (not inclusive) 1194 * @return the name-ordered range of immediate subfolders, file entries, and 1195 file shortcuts in the parent folder 1196 */ 1197 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1198 public List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts( 1199 long repositoryId, long folderId, int status, 1200 boolean includeMountFolders, int start, int end) 1201 throws PortalException; 1202 1203 /** 1204 * Returns an ordered range of all the immediate subfolders, file entries, 1205 * and file shortcuts in the parent folder. 1206 * 1207 * <p> 1208 * Useful when paginating results. Returns a maximum of <code>end - 1209 * start</code> instances. <code>start</code> and <code>end</code> are not 1210 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1211 * refers to the first result in the set. Setting both <code>start</code> 1212 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1213 * result set. 1214 * </p> 1215 * 1216 * @param repositoryId the primary key of the repository 1217 * @param folderId the primary key of the parent folder 1218 * @param status the workflow status 1219 * @param includeMountFolders whether to include mount folders for 1220 third-party repositories 1221 * @param start the lower bound of the range of results 1222 * @param end the upper bound of the range of results (not inclusive) 1223 * @param obc the comparator to order the results (optionally 1224 <code>null</code>) 1225 * @return the range of immediate subfolders, file entries, and file 1226 shortcuts in the parent folder ordered by comparator 1227 <code>obc</code> 1228 */ 1229 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1230 public List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts( 1231 long repositoryId, long folderId, int status, 1232 boolean includeMountFolders, int start, int end, 1233 OrderByComparator<?> obc) throws PortalException; 1234 1235 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1236 public List<java.lang.Object> getFoldersAndFileEntriesAndFileShortcuts( 1237 long repositoryId, long folderId, int status, 1238 java.lang.String[] mimeTypes, boolean includeMountFolders, int start, 1239 int end, OrderByComparator<?> obc) throws PortalException; 1240 1241 /** 1242 * Returns an ordered range of all the file entries in the group starting at 1243 * the repository default parent folder that are stored within the Liferay 1244 * repository. This method is primarily used to search for recently modified 1245 * file entries. It can be limited to the file entries modified by a given 1246 * user. 1247 * 1248 * <p> 1249 * Useful when paginating results. Returns a maximum of <code>end - 1250 * start</code> instances. <code>start</code> and <code>end</code> are not 1251 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1252 * refers to the first result in the set. Setting both <code>start</code> 1253 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1254 * result set. 1255 * </p> 1256 * 1257 * @param groupId the primary key of the group 1258 * @param userId the primary key of the user who created the file 1259 (optionally <code>0</code>) 1260 * @param start the lower bound of the range of results 1261 * @param end the upper bound of the range of results (not inclusive) 1262 * @return the range of matching file entries ordered by date modified 1263 */ 1264 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1265 public List<FileEntry> getGroupFileEntries(long groupId, long userId, 1266 int start, int end) throws PortalException; 1267 1268 /** 1269 * Returns an ordered range of all the file entries in the group that are 1270 * stored within the Liferay repository. This method is primarily used to 1271 * search for recently modified file entries. It can be limited to the file 1272 * entries modified by a given user. 1273 * 1274 * <p> 1275 * Useful when paginating results. Returns a maximum of <code>end - 1276 * start</code> instances. <code>start</code> and <code>end</code> are not 1277 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1278 * refers to the first result in the set. Setting both <code>start</code> 1279 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1280 * result set. 1281 * </p> 1282 * 1283 * @param groupId the primary key of the group 1284 * @param userId the primary key of the user who created the file 1285 (optionally <code>0</code>) 1286 * @param start the lower bound of the range of results 1287 * @param end the upper bound of the range of results (not inclusive) 1288 * @param obc the comparator to order the file entries (optionally 1289 <code>null</code>) 1290 * @return the range of matching file entries ordered by comparator 1291 <code>obc</code> 1292 */ 1293 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1294 public List<FileEntry> getGroupFileEntries(long groupId, long userId, 1295 int start, int end, OrderByComparator<FileEntry> obc) 1296 throws PortalException; 1297 1298 /** 1299 * Returns an ordered range of all the file entries in the group starting at 1300 * the root folder that are stored within the Liferay repository. This 1301 * method is primarily used to search for recently modified file entries. It 1302 * can be limited to the file entries modified by a given user. 1303 * 1304 * <p> 1305 * Useful when paginating results. Returns a maximum of <code>end - 1306 * start</code> instances. <code>start</code> and <code>end</code> are not 1307 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1308 * refers to the first result in the set. Setting both <code>start</code> 1309 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1310 * result set. 1311 * </p> 1312 * 1313 * @param groupId the primary key of the group 1314 * @param userId the primary key of the user who created the file 1315 (optionally <code>0</code>) 1316 * @param rootFolderId the primary key of the root folder to begin the 1317 search 1318 * @param start the lower bound of the range of results 1319 * @param end the upper bound of the range of results (not inclusive) 1320 * @return the range of matching file entries ordered by date modified 1321 */ 1322 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1323 public List<FileEntry> getGroupFileEntries(long groupId, long userId, 1324 long rootFolderId, int start, int end) throws PortalException; 1325 1326 /** 1327 * Returns an ordered range of all the file entries in the group starting at 1328 * the root folder that are stored within the Liferay repository. This 1329 * method is primarily used to search for recently modified file entries. It 1330 * can be limited to the file entries modified by a given user. 1331 * 1332 * <p> 1333 * Useful when paginating results. Returns a maximum of <code>end - 1334 * start</code> instances. <code>start</code> and <code>end</code> are not 1335 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1336 * refers to the first result in the set. Setting both <code>start</code> 1337 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1338 * result set. 1339 * </p> 1340 * 1341 * @param groupId the primary key of the group 1342 * @param userId the primary key of the user who created the file 1343 (optionally <code>0</code>) 1344 * @param rootFolderId the primary key of the root folder to begin the 1345 search 1346 * @param start the lower bound of the range of results 1347 * @param end the upper bound of the range of results (not inclusive) 1348 * @param obc the comparator to order the file entries (optionally 1349 <code>null</code>) 1350 * @return the range of matching file entries ordered by comparator 1351 <code>obc</code> 1352 */ 1353 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1354 public List<FileEntry> getGroupFileEntries(long groupId, long userId, 1355 long rootFolderId, int start, int end, OrderByComparator<FileEntry> obc) 1356 throws PortalException; 1357 1358 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1359 public List<FileEntry> getGroupFileEntries(long groupId, long userId, 1360 long rootFolderId, java.lang.String[] mimeTypes, int status, int start, 1361 int end, OrderByComparator<FileEntry> obc) throws PortalException; 1362 1363 /** 1364 * Returns all immediate subfolders of the parent folder that are used for 1365 * mounting third-party repositories. This method is only supported by the 1366 * Liferay repository. 1367 * 1368 * @param repositoryId the primary key of the folder's repository 1369 * @param parentFolderId the primary key of the folder's parent folder 1370 * @return the immediate subfolders of the parent folder that are used for 1371 mounting third-party repositories 1372 */ 1373 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1374 public List<Folder> getMountFolders(long repositoryId, long parentFolderId) 1375 throws PortalException; 1376 1377 /** 1378 * Returns a name-ordered range of all the immediate subfolders of the 1379 * parent folder that are used for mounting third-party repositories. This 1380 * method is only supported by the Liferay repository. 1381 * 1382 * <p> 1383 * Useful when paginating results. Returns a maximum of <code>end - 1384 * start</code> instances. <code>start</code> and <code>end</code> are not 1385 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1386 * refers to the first result in the set. Setting both <code>start</code> 1387 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1388 * result set. 1389 * </p> 1390 * 1391 * @param repositoryId the primary key of the repository 1392 * @param parentFolderId the primary key of the parent folder 1393 * @param start the lower bound of the range of results 1394 * @param end the upper bound of the range of results (not inclusive) 1395 * @return the name-ordered range of immediate subfolders of the parent 1396 folder that are used for mounting third-party repositories 1397 */ 1398 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1399 public List<Folder> getMountFolders(long repositoryId, long parentFolderId, 1400 int start, int end) throws PortalException; 1401 1402 /** 1403 * Returns an ordered range of all the immediate subfolders of the parent 1404 * folder that are used for mounting third-party repositories. This method 1405 * is only supported by the Liferay repository. 1406 * 1407 * <p> 1408 * Useful when paginating results. Returns a maximum of <code>end - 1409 * start</code> instances. <code>start</code> and <code>end</code> are not 1410 * primary keys, they are indexes in the result set. Thus, <code>0</code> 1411 * refers to the first result in the set. Setting both <code>start</code> 1412 * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full 1413 * result set. 1414 * </p> 1415 * 1416 * @param repositoryId the primary key of the folder's repository 1417 * @param parentFolderId the primary key of the folder's parent folder 1418 * @param start the lower bound of the range of results 1419 * @param end the upper bound of the range of results (not inclusive) 1420 * @param obc the comparator to order the folders (optionally 1421 <code>null</code>) 1422 * @return the range of immediate subfolders of the parent folder that are 1423 used for mounting third-party repositories ordered by comparator 1424 <code>obc</code> 1425 */ 1426 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1427 public List<Folder> getMountFolders(long repositoryId, long parentFolderId, 1428 int start, int end, OrderByComparator<Folder> obc) 1429 throws PortalException; 1430 1431 /** 1432 * Returns all the descendant folders of the folder with the primary key. 1433 * 1434 * @param repositoryId the primary key of the repository 1435 * @param folderId the primary key of the folder 1436 * @return the descendant folders of the folder with the primary key 1437 */ 1438 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1439 public List<java.lang.Long> getSubfolderIds(long repositoryId, long folderId) 1440 throws PortalException; 1441 1442 /** 1443 * Returns descendant folders of the folder with the primary key, optionally 1444 * limiting to one level deep. 1445 * 1446 * @param repositoryId the primary key of the repository 1447 * @param folderId the primary key of the folder 1448 * @param recurse whether to recurse through each subfolder 1449 * @return the descendant folders of the folder with the primary key 1450 */ 1451 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1452 public List<java.lang.Long> getSubfolderIds(long repositoryId, 1453 long folderId, boolean recurse) throws PortalException; 1454 1455 /** 1456 * Cancels the check out of the file entry. If a user has not checked out 1457 * the specified file entry, invoking this method will result in no changes. 1458 * 1459 * <p> 1460 * When a file entry is checked out, a PWC (private working copy) is created 1461 * and the original file entry is locked. A client can make as many changes 1462 * to the PWC as he desires without those changes being visible to other 1463 * users. If the user is satisfied with the changes, he may elect to check 1464 * in his changes, resulting in a new file version based on the PWC; the PWC 1465 * will be removed and the file entry will be unlocked. If the user is not 1466 * satisfied with the changes, he may elect to cancel his check out; this 1467 * results in the deletion of the PWC and unlocking of the file entry. 1468 * </p> 1469 * 1470 * @param fileEntryId the primary key of the file entry to cancel the 1471 checkout 1472 * @see #checkInFileEntry(long, boolean, String, ServiceContext) 1473 * @see #checkOutFileEntry(long, ServiceContext) 1474 */ 1475 public void cancelCheckOut(long fileEntryId) throws PortalException; 1476 1477 /** 1478 * Checks in the file entry. If a user has not checked out the specified 1479 * file entry, invoking this method will result in no changes. 1480 * 1481 * <p> 1482 * When a file entry is checked out, a PWC (private working copy) is created 1483 * and the original file entry is locked. A client can make as many changes 1484 * to the PWC as he desires without those changes being visible to other 1485 * users. If the user is satisfied with the changes, he may elect to check 1486 * in his changes, resulting in a new file version based on the PWC; the PWC 1487 * will be removed and the file entry will be unlocked. If the user is not 1488 * satisfied with the changes, he may elect to cancel his check out; this 1489 * results in the deletion of the PWC and unlocking of the file entry. 1490 * </p> 1491 * 1492 * @param fileEntryId the primary key of the file entry to check in 1493 * @param majorVersion whether the new file version is a major version 1494 * @param changeLog the file's version change log 1495 * @param serviceContext the service context to be applied 1496 * @see #cancelCheckOut(long) 1497 * @see #checkOutFileEntry(long, ServiceContext) 1498 */ 1499 public void checkInFileEntry(long fileEntryId, boolean majorVersion, 1500 java.lang.String changeLog, ServiceContext serviceContext) 1501 throws PortalException; 1502 1503 /** 1504 * Checks in the file entry using the lock's UUID. If a user has not checked 1505 * out the specified file entry, invoking this method will result in no 1506 * changes. This method is primarily used by WebDAV. 1507 * 1508 * <p> 1509 * When a file entry is checked out, a PWC (private working copy) is created 1510 * and the original file entry is locked. A client can make as many changes 1511 * to the PWC as he desires without those changes being visible to other 1512 * users. If the user is satisfied with the changes, he may elect to check 1513 * in his changes, resulting in a new file version based on the PWC; the PWC 1514 * will be removed and the file entry will be unlocked. If the user is not 1515 * satisfied with the changes, he may elect to cancel his check out; this 1516 * results in the deletion of the PWC and unlocking of the file entry. 1517 * </p> 1518 * 1519 * @param fileEntryId the primary key of the file entry to check in 1520 * @param lockUuid the lock's UUID 1521 * @param serviceContext the service context to be applied 1522 * @see #cancelCheckOut(long) 1523 * @see #checkOutFileEntry(long, String, long, ServiceContext) 1524 */ 1525 public void checkInFileEntry(long fileEntryId, java.lang.String lockUuid, 1526 ServiceContext serviceContext) throws PortalException; 1527 1528 /** 1529 * Check out a file entry. 1530 * 1531 * <p> 1532 * When a file entry is checked out, a PWC (private working copy) is created 1533 * and the original file entry is locked. A client can make as many changes 1534 * to the PWC as he desires without those changes being visible to other 1535 * users. If the user is satisfied with the changes, he may elect to check 1536 * in his changes, resulting in a new file version based on the PWC; the PWC 1537 * will be removed and the file entry will be unlocked. If the user is not 1538 * satisfied with the changes, he may elect to cancel his check out; this 1539 * results in the deletion of the PWC and unlocking of the file entry. 1540 * </p> 1541 * 1542 * @param fileEntryId the file entry to check out 1543 * @param serviceContext the service context to be applied 1544 * @see #cancelCheckOut(long) 1545 * @see #checkInFileEntry(long, boolean, String, ServiceContext) 1546 */ 1547 public void checkOutFileEntry(long fileEntryId, 1548 ServiceContext serviceContext) throws PortalException; 1549 1550 /** 1551 * Deletes the file entry with the primary key. 1552 * 1553 * @param fileEntryId the primary key of the file entry 1554 */ 1555 public void deleteFileEntry(long fileEntryId) throws PortalException; 1556 1557 /** 1558 * Deletes the file entry with the title in the folder. 1559 * 1560 * @param repositoryId the primary key of the repository 1561 * @param folderId the primary key of the file entry's parent folder 1562 * @param title the file entry's title 1563 */ 1564 public void deleteFileEntryByTitle(long repositoryId, long folderId, 1565 java.lang.String title) throws PortalException; 1566 1567 /** 1568 * Deletes the file shortcut with the primary key. This method is only 1569 * supported by the Liferay repository. 1570 * 1571 * @param fileShortcutId the primary key of the file shortcut 1572 */ 1573 public void deleteFileShortcut(long fileShortcutId) 1574 throws PortalException; 1575 1576 /** 1577 * Deletes the file version. File versions can only be deleted if it is 1578 * approved and there are other approved file versions available. This 1579 * method is only supported by the Liferay repository. 1580 * 1581 * @param fileEntryId the primary key of the file entry 1582 * @param version the version label of the file version 1583 */ 1584 public void deleteFileVersion(long fileEntryId, java.lang.String version) 1585 throws PortalException; 1586 1587 /** 1588 * Deletes the folder with the primary key and all of its subfolders and 1589 * file entries. 1590 * 1591 * @param folderId the primary key of the folder 1592 */ 1593 public void deleteFolder(long folderId) throws PortalException; 1594 1595 /** 1596 * Deletes the folder with the name in the parent folder and all of its 1597 * subfolders and file entries. 1598 * 1599 * @param repositoryId the primary key of the repository 1600 * @param parentFolderId the primary key of the folder's parent folder 1601 * @param name the folder's name 1602 */ 1603 public void deleteFolder(long repositoryId, long parentFolderId, 1604 java.lang.String name) throws PortalException; 1605 1606 /** 1607 * Deletes the temporary file entry. 1608 * 1609 * @param groupId the primary key of the group 1610 * @param folderId the primary key of the folder where the file entry was 1611 eventually to reside 1612 * @param folderName the temporary folder's name 1613 * @param fileName the file's original name 1614 * @see TempFileEntryUtil 1615 */ 1616 public void deleteTempFileEntry(long groupId, long folderId, 1617 java.lang.String folderName, java.lang.String fileName) 1618 throws PortalException; 1619 1620 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 1621 public void getSubfolderIds(long repositoryId, 1622 List<java.lang.Long> folderIds, long folderId) 1623 throws PortalException; 1624 1625 /** 1626 * Reverts the file entry to a previous version. A new version will be 1627 * created based on the previous version and metadata. 1628 * 1629 * @param fileEntryId the primary key of the file entry 1630 * @param version the version to revert back to 1631 * @param serviceContext the service context to be applied 1632 */ 1633 public void revertFileEntry(long fileEntryId, java.lang.String version, 1634 ServiceContext serviceContext) throws PortalException; 1635 1636 /** 1637 * Subscribe the user to changes in documents of the file entry type. This 1638 * method is only supported by the Liferay repository. 1639 * 1640 * @param groupId the primary key of the file entry type's group 1641 * @param fileEntryTypeId the primary key of the file entry type 1642 */ 1643 public void subscribeFileEntryType(long groupId, long fileEntryTypeId) 1644 throws PortalException; 1645 1646 /** 1647 * Subscribe the user to document changes in the folder. This method is only 1648 * supported by the Liferay repository. 1649 * 1650 * @param groupId the primary key of the folder's group 1651 * @param folderId the primary key of the folder 1652 */ 1653 public void subscribeFolder(long groupId, long folderId) 1654 throws PortalException; 1655 1656 /** 1657 * Unlocks the folder. This method is primarily used by WebDAV. 1658 * 1659 * @param repositoryId the primary key of the repository 1660 * @param folderId the primary key of the folder 1661 * @param lockUuid the lock's UUID 1662 */ 1663 public void unlockFolder(long repositoryId, long folderId, 1664 java.lang.String lockUuid) throws PortalException; 1665 1666 /** 1667 * Unlocks the folder. This method is primarily used by WebDAV. 1668 * 1669 * @param repositoryId the primary key of the repository 1670 * @param parentFolderId the primary key of the parent folder 1671 * @param name the folder's name 1672 * @param lockUuid the lock's UUID 1673 */ 1674 public void unlockFolder(long repositoryId, long parentFolderId, 1675 java.lang.String name, java.lang.String lockUuid) 1676 throws PortalException; 1677 1678 /** 1679 * Unsubscribe the user from changes in documents of the file entry type. 1680 * This method is only supported by the Liferay repository. 1681 * 1682 * @param groupId the primary key of the file entry type's group 1683 * @param fileEntryTypeId the primary key of the file entry type 1684 */ 1685 public void unsubscribeFileEntryType(long groupId, long fileEntryTypeId) 1686 throws PortalException; 1687 1688 /** 1689 * Unsubscribe the user from document changes in the folder. This method is 1690 * only supported by the Liferay repository. 1691 * 1692 * @param groupId the primary key of the folder's group 1693 * @param folderId the primary key of the folder 1694 */ 1695 public void unsubscribeFolder(long groupId, long folderId) 1696 throws PortalException; 1697 }