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.document.library.kernel.model.DLFileShortcut; 020 021 import com.liferay.exportimport.kernel.lar.PortletDataContext; 022 023 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 024 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 025 import com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery; 026 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 027 import com.liferay.portal.kernel.dao.orm.Projection; 028 import com.liferay.portal.kernel.exception.PortalException; 029 import com.liferay.portal.kernel.exception.SystemException; 030 import com.liferay.portal.kernel.model.PersistedModel; 031 import com.liferay.portal.kernel.model.SystemEventConstants; 032 import com.liferay.portal.kernel.search.Indexable; 033 import com.liferay.portal.kernel.search.IndexableType; 034 import com.liferay.portal.kernel.service.BaseLocalService; 035 import com.liferay.portal.kernel.service.PersistedModelLocalService; 036 import com.liferay.portal.kernel.service.ServiceContext; 037 import com.liferay.portal.kernel.service.permission.ModelPermissions; 038 import com.liferay.portal.kernel.systemevent.SystemEvent; 039 import com.liferay.portal.kernel.transaction.Isolation; 040 import com.liferay.portal.kernel.transaction.Propagation; 041 import com.liferay.portal.kernel.transaction.Transactional; 042 import com.liferay.portal.kernel.util.OrderByComparator; 043 044 import java.io.Serializable; 045 046 import java.util.List; 047 048 /** 049 * Provides the local service interface for DLFileShortcut. Methods of this 050 * service will not have security checks based on the propagated JAAS 051 * credentials because this service can only be accessed from within the same 052 * VM. 053 * 054 * @author Brian Wing Shun Chan 055 * @see DLFileShortcutLocalServiceUtil 056 * @see com.liferay.portlet.documentlibrary.service.base.DLFileShortcutLocalServiceBaseImpl 057 * @see com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl 058 * @generated 059 */ 060 @ProviderType 061 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 062 PortalException.class, SystemException.class}) 063 public interface DLFileShortcutLocalService extends BaseLocalService, 064 PersistedModelLocalService { 065 /* 066 * NOTE FOR DEVELOPERS: 067 * 068 * Never modify or reference this interface directly. Always use {@link DLFileShortcutLocalServiceUtil} to access the document library file shortcut local service. Add custom service methods to {@link com.liferay.portlet.documentlibrary.service.impl.DLFileShortcutLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 069 */ 070 071 /** 072 * Adds the document library file shortcut to the database. Also notifies the appropriate model listeners. 073 * 074 * @param dlFileShortcut the document library file shortcut 075 * @return the document library file shortcut that was added 076 */ 077 @Indexable(type = IndexableType.REINDEX) 078 public DLFileShortcut addDLFileShortcut(DLFileShortcut dlFileShortcut); 079 080 public DLFileShortcut addFileShortcut(long userId, long groupId, 081 long repositoryId, long folderId, long toFileEntryId, 082 ServiceContext serviceContext) throws PortalException; 083 084 /** 085 * Creates a new document library file shortcut with the primary key. Does not add the document library file shortcut to the database. 086 * 087 * @param fileShortcutId the primary key for the new document library file shortcut 088 * @return the new document library file shortcut 089 */ 090 public DLFileShortcut createDLFileShortcut(long fileShortcutId); 091 092 /** 093 * Deletes the document library file shortcut from the database. Also notifies the appropriate model listeners. 094 * 095 * @param dlFileShortcut the document library file shortcut 096 * @return the document library file shortcut that was removed 097 */ 098 @Indexable(type = IndexableType.DELETE) 099 public DLFileShortcut deleteDLFileShortcut(DLFileShortcut dlFileShortcut); 100 101 /** 102 * Deletes the document library file shortcut with the primary key from the database. Also notifies the appropriate model listeners. 103 * 104 * @param fileShortcutId the primary key of the document library file shortcut 105 * @return the document library file shortcut that was removed 106 * @throws PortalException if a document library file shortcut with the primary key could not be found 107 */ 108 @Indexable(type = IndexableType.DELETE) 109 public DLFileShortcut deleteDLFileShortcut(long fileShortcutId) 110 throws PortalException; 111 112 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 113 public DLFileShortcut fetchDLFileShortcut(long fileShortcutId); 114 115 /** 116 * Returns the document library file shortcut matching the UUID and group. 117 * 118 * @param uuid the document library file shortcut's UUID 119 * @param groupId the primary key of the group 120 * @return the matching document library file shortcut, or <code>null</code> if a matching document library file shortcut could not be found 121 */ 122 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 123 public DLFileShortcut fetchDLFileShortcutByUuidAndGroupId( 124 java.lang.String uuid, long groupId); 125 126 /** 127 * Returns the document library file shortcut with the primary key. 128 * 129 * @param fileShortcutId the primary key of the document library file shortcut 130 * @return the document library file shortcut 131 * @throws PortalException if a document library file shortcut with the primary key could not be found 132 */ 133 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 134 public DLFileShortcut getDLFileShortcut(long fileShortcutId) 135 throws PortalException; 136 137 /** 138 * Returns the document library file shortcut matching the UUID and group. 139 * 140 * @param uuid the document library file shortcut's UUID 141 * @param groupId the primary key of the group 142 * @return the matching document library file shortcut 143 * @throws PortalException if a matching document library file shortcut could not be found 144 */ 145 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 146 public DLFileShortcut getDLFileShortcutByUuidAndGroupId( 147 java.lang.String uuid, long groupId) throws PortalException; 148 149 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 150 public DLFileShortcut getFileShortcut(long fileShortcutId) 151 throws PortalException; 152 153 /** 154 * Updates the document library file shortcut in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 155 * 156 * @param dlFileShortcut the document library file shortcut 157 * @return the document library file shortcut that was updated 158 */ 159 @Indexable(type = IndexableType.REINDEX) 160 public DLFileShortcut updateDLFileShortcut(DLFileShortcut dlFileShortcut); 161 162 public DLFileShortcut updateFileShortcut(long userId, long fileShortcutId, 163 long repositoryId, long folderId, long toFileEntryId, 164 ServiceContext serviceContext) throws PortalException; 165 166 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 167 public ActionableDynamicQuery getActionableDynamicQuery(); 168 169 public DynamicQuery dynamicQuery(); 170 171 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 172 public ExportActionableDynamicQuery getExportActionableDynamicQuery( 173 PortletDataContext portletDataContext); 174 175 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 176 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 177 178 /** 179 * @throws PortalException 180 */ 181 @Override 182 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 183 throws PortalException; 184 185 @Override 186 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 187 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 188 throws PortalException; 189 190 /** 191 * Returns the number of document library file shortcuts. 192 * 193 * @return the number of document library file shortcuts 194 */ 195 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 196 public int getDLFileShortcutsCount(); 197 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public int getFileShortcutsCount(long groupId, long folderId, 200 boolean active, int status); 201 202 /** 203 * Returns the OSGi service identifier. 204 * 205 * @return the OSGi service identifier 206 */ 207 public java.lang.String getOSGiServiceIdentifier(); 208 209 /** 210 * Performs a dynamic query on the database and returns the matching rows. 211 * 212 * @param dynamicQuery the dynamic query 213 * @return the matching rows 214 */ 215 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 216 217 /** 218 * Performs a dynamic query on the database and returns a range of the matching rows. 219 * 220 * <p> 221 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.documentlibrary.model.impl.DLFileShortcutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 222 * </p> 223 * 224 * @param dynamicQuery the dynamic query 225 * @param start the lower bound of the range of model instances 226 * @param end the upper bound of the range of model instances (not inclusive) 227 * @return the range of matching rows 228 */ 229 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 230 int end); 231 232 /** 233 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 234 * 235 * <p> 236 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.documentlibrary.model.impl.DLFileShortcutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 237 * </p> 238 * 239 * @param dynamicQuery the dynamic query 240 * @param start the lower bound of the range of model instances 241 * @param end the upper bound of the range of model instances (not inclusive) 242 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 243 * @return the ordered range of matching rows 244 */ 245 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 246 int end, OrderByComparator<T> orderByComparator); 247 248 /** 249 * Returns a range of all the document library file shortcuts. 250 * 251 * <p> 252 * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.documentlibrary.model.impl.DLFileShortcutModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. 253 * </p> 254 * 255 * @param start the lower bound of the range of document library file shortcuts 256 * @param end the upper bound of the range of document library file shortcuts (not inclusive) 257 * @return the range of document library file shortcuts 258 */ 259 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 260 public List<DLFileShortcut> getDLFileShortcuts(int start, int end); 261 262 /** 263 * Returns all the document library file shortcuts matching the UUID and company. 264 * 265 * @param uuid the UUID of the document library file shortcuts 266 * @param companyId the primary key of the company 267 * @return the matching document library file shortcuts, or an empty list if no matches were found 268 */ 269 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 270 public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId( 271 java.lang.String uuid, long companyId); 272 273 /** 274 * Returns a range of document library file shortcuts matching the UUID and company. 275 * 276 * @param uuid the UUID of the document library file shortcuts 277 * @param companyId the primary key of the company 278 * @param start the lower bound of the range of document library file shortcuts 279 * @param end the upper bound of the range of document library file shortcuts (not inclusive) 280 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 281 * @return the range of matching document library file shortcuts, or an empty list if no matches were found 282 */ 283 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 284 public List<DLFileShortcut> getDLFileShortcutsByUuidAndCompanyId( 285 java.lang.String uuid, long companyId, int start, int end, 286 OrderByComparator<DLFileShortcut> orderByComparator); 287 288 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 289 public List<DLFileShortcut> getFileShortcuts(long groupId, long folderId, 290 boolean active, int status, int start, int end); 291 292 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 293 public List<DLFileShortcut> getFileShortcuts(long toFileEntryId); 294 295 /** 296 * Returns the number of rows matching the dynamic query. 297 * 298 * @param dynamicQuery the dynamic query 299 * @return the number of rows matching the dynamic query 300 */ 301 public long dynamicQueryCount(DynamicQuery dynamicQuery); 302 303 /** 304 * Returns the number of rows matching the dynamic query. 305 * 306 * @param dynamicQuery the dynamic query 307 * @param projection the projection to apply to the query 308 * @return the number of rows matching the dynamic query 309 */ 310 public long dynamicQueryCount(DynamicQuery dynamicQuery, 311 Projection projection); 312 313 public void addFileShortcutResources(DLFileShortcut fileShortcut, 314 boolean addGroupPermissions, boolean addGuestPermissions) 315 throws PortalException; 316 317 public void addFileShortcutResources(DLFileShortcut fileShortcut, 318 ModelPermissions modelPermissions) throws PortalException; 319 320 public void addFileShortcutResources(long fileShortcutId, 321 boolean addGroupPermissions, boolean addGuestPermissions) 322 throws PortalException; 323 324 public void addFileShortcutResources(long fileShortcutId, 325 ModelPermissions modelPermissions) throws PortalException; 326 327 @SystemEvent(type = SystemEventConstants.TYPE_DELETE) 328 public void deleteFileShortcut(DLFileShortcut fileShortcut) 329 throws PortalException; 330 331 public void deleteFileShortcut(long fileShortcutId) 332 throws PortalException; 333 334 public void deleteFileShortcuts(long groupId, long folderId) 335 throws PortalException; 336 337 public void deleteFileShortcuts(long groupId, long folderId, 338 boolean includeTrashedEntries) throws PortalException; 339 340 public void deleteFileShortcuts(long toFileEntryId) 341 throws PortalException; 342 343 public void disableFileShortcuts(long toFileEntryId); 344 345 public void enableFileShortcuts(long toFileEntryId); 346 347 public void rebuildTree(long companyId) throws PortalException; 348 349 public void setTreePaths(long folderId, java.lang.String treePath) 350 throws PortalException; 351 352 public void updateAsset(long userId, DLFileShortcut fileShortcut, 353 long[] assetCategoryIds, java.lang.String[] assetTagNames) 354 throws PortalException; 355 356 public void updateFileShortcuts(long oldToFileEntryId, long newToFileEntryId); 357 358 public void updateFileShortcutsActive(long toFileEntryId, boolean active); 359 360 public void updateStatus(long userId, long fileShortcutId, int status, 361 ServiceContext serviceContext) throws PortalException; 362 }