001 /** 002 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portlet.asset.service; 016 017 import com.liferay.portal.kernel.exception.PortalException; 018 import com.liferay.portal.kernel.exception.SystemException; 019 import com.liferay.portal.kernel.transaction.Isolation; 020 import com.liferay.portal.kernel.transaction.Propagation; 021 import com.liferay.portal.kernel.transaction.Transactional; 022 import com.liferay.portal.service.BaseLocalService; 023 import com.liferay.portal.service.PersistedModelLocalService; 024 025 /** 026 * Provides the local service interface for AssetLink. Methods of this 027 * service will not have security checks based on the propagated JAAS 028 * credentials because this service can only be accessed from within the same 029 * VM. 030 * 031 * @author Brian Wing Shun Chan 032 * @see AssetLinkLocalServiceUtil 033 * @see com.liferay.portlet.asset.service.base.AssetLinkLocalServiceBaseImpl 034 * @see com.liferay.portlet.asset.service.impl.AssetLinkLocalServiceImpl 035 * @generated 036 */ 037 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 038 PortalException.class, SystemException.class}) 039 public interface AssetLinkLocalService extends BaseLocalService, 040 PersistedModelLocalService { 041 /* 042 * NOTE FOR DEVELOPERS: 043 * 044 * Never modify or reference this interface directly. Always use {@link AssetLinkLocalServiceUtil} to access the asset link local service. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetLinkLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 045 */ 046 047 /** 048 * Adds the asset link to the database. Also notifies the appropriate model listeners. 049 * 050 * @param assetLink the asset link 051 * @return the asset link that was added 052 * @throws SystemException if a system exception occurred 053 */ 054 public com.liferay.portlet.asset.model.AssetLink addAssetLink( 055 com.liferay.portlet.asset.model.AssetLink assetLink) 056 throws com.liferay.portal.kernel.exception.SystemException; 057 058 /** 059 * Creates a new asset link with the primary key. Does not add the asset link to the database. 060 * 061 * @param linkId the primary key for the new asset link 062 * @return the new asset link 063 */ 064 public com.liferay.portlet.asset.model.AssetLink createAssetLink( 065 long linkId); 066 067 /** 068 * Deletes the asset link with the primary key from the database. Also notifies the appropriate model listeners. 069 * 070 * @param linkId the primary key of the asset link 071 * @return the asset link that was removed 072 * @throws PortalException if a asset link with the primary key could not be found 073 * @throws SystemException if a system exception occurred 074 */ 075 public com.liferay.portlet.asset.model.AssetLink deleteAssetLink( 076 long linkId) 077 throws com.liferay.portal.kernel.exception.PortalException, 078 com.liferay.portal.kernel.exception.SystemException; 079 080 /** 081 * Deletes the asset link from the database. Also notifies the appropriate model listeners. 082 * 083 * @param assetLink the asset link 084 * @return the asset link that was removed 085 * @throws SystemException if a system exception occurred 086 */ 087 public com.liferay.portlet.asset.model.AssetLink deleteAssetLink( 088 com.liferay.portlet.asset.model.AssetLink assetLink) 089 throws com.liferay.portal.kernel.exception.SystemException; 090 091 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 092 093 /** 094 * Performs a dynamic query on the database and returns the matching rows. 095 * 096 * @param dynamicQuery the dynamic query 097 * @return the matching rows 098 * @throws SystemException if a system exception occurred 099 */ 100 @SuppressWarnings("rawtypes") 101 public java.util.List dynamicQuery( 102 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 103 throws com.liferay.portal.kernel.exception.SystemException; 104 105 /** 106 * Performs a dynamic query on the database and returns a range of the matching rows. 107 * 108 * <p> 109 * 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.asset.model.impl.AssetLinkModelImpl}. 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. 110 * </p> 111 * 112 * @param dynamicQuery the dynamic query 113 * @param start the lower bound of the range of model instances 114 * @param end the upper bound of the range of model instances (not inclusive) 115 * @return the range of matching rows 116 * @throws SystemException if a system exception occurred 117 */ 118 @SuppressWarnings("rawtypes") 119 public java.util.List dynamicQuery( 120 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 121 int end) throws com.liferay.portal.kernel.exception.SystemException; 122 123 /** 124 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 125 * 126 * <p> 127 * 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.asset.model.impl.AssetLinkModelImpl}. 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. 128 * </p> 129 * 130 * @param dynamicQuery the dynamic query 131 * @param start the lower bound of the range of model instances 132 * @param end the upper bound of the range of model instances (not inclusive) 133 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 134 * @return the ordered range of matching rows 135 * @throws SystemException if a system exception occurred 136 */ 137 @SuppressWarnings("rawtypes") 138 public java.util.List dynamicQuery( 139 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 140 int end, 141 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 142 throws com.liferay.portal.kernel.exception.SystemException; 143 144 /** 145 * Returns the number of rows that match the dynamic query. 146 * 147 * @param dynamicQuery the dynamic query 148 * @return the number of rows that match the dynamic query 149 * @throws SystemException if a system exception occurred 150 */ 151 public long dynamicQueryCount( 152 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 153 throws com.liferay.portal.kernel.exception.SystemException; 154 155 /** 156 * Returns the number of rows that match the dynamic query. 157 * 158 * @param dynamicQuery the dynamic query 159 * @param projection the projection to apply to the query 160 * @return the number of rows that match the dynamic query 161 * @throws SystemException if a system exception occurred 162 */ 163 public long dynamicQueryCount( 164 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 165 com.liferay.portal.kernel.dao.orm.Projection projection) 166 throws com.liferay.portal.kernel.exception.SystemException; 167 168 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 169 public com.liferay.portlet.asset.model.AssetLink fetchAssetLink(long linkId) 170 throws com.liferay.portal.kernel.exception.SystemException; 171 172 /** 173 * Returns the asset link with the primary key. 174 * 175 * @param linkId the primary key of the asset link 176 * @return the asset link 177 * @throws PortalException if a asset link with the primary key could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 181 public com.liferay.portlet.asset.model.AssetLink getAssetLink(long linkId) 182 throws com.liferay.portal.kernel.exception.PortalException, 183 com.liferay.portal.kernel.exception.SystemException; 184 185 @Override 186 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 187 public com.liferay.portal.model.PersistedModel getPersistedModel( 188 java.io.Serializable primaryKeyObj) 189 throws com.liferay.portal.kernel.exception.PortalException, 190 com.liferay.portal.kernel.exception.SystemException; 191 192 /** 193 * Returns a range of all the asset links. 194 * 195 * <p> 196 * 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.asset.model.impl.AssetLinkModelImpl}. 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. 197 * </p> 198 * 199 * @param start the lower bound of the range of asset links 200 * @param end the upper bound of the range of asset links (not inclusive) 201 * @return the range of asset links 202 * @throws SystemException if a system exception occurred 203 */ 204 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 205 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getAssetLinks( 206 int start, int end) 207 throws com.liferay.portal.kernel.exception.SystemException; 208 209 /** 210 * Returns the number of asset links. 211 * 212 * @return the number of asset links 213 * @throws SystemException if a system exception occurred 214 */ 215 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 216 public int getAssetLinksCount() 217 throws com.liferay.portal.kernel.exception.SystemException; 218 219 /** 220 * Updates the asset link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 221 * 222 * @param assetLink the asset link 223 * @return the asset link that was updated 224 * @throws SystemException if a system exception occurred 225 */ 226 public com.liferay.portlet.asset.model.AssetLink updateAssetLink( 227 com.liferay.portlet.asset.model.AssetLink assetLink) 228 throws com.liferay.portal.kernel.exception.SystemException; 229 230 /** 231 * Returns the Spring bean ID for this bean. 232 * 233 * @return the Spring bean ID for this bean 234 */ 235 public java.lang.String getBeanIdentifier(); 236 237 /** 238 * Sets the Spring bean ID for this bean. 239 * 240 * @param beanIdentifier the Spring bean ID for this bean 241 */ 242 public void setBeanIdentifier(java.lang.String beanIdentifier); 243 244 /** 245 * Adds a new asset link. 246 * 247 * @param userId the primary key of the link's creator 248 * @param entryId1 the primary key of the first asset entry 249 * @param entryId2 the primary key of the second asset entry 250 * @param type the link type. Acceptable values include {@link 251 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_RELATED} 252 which is a bidirectional relationship and {@link 253 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_CHILD} 254 which is a unidirectional relationship. For more information see 255 {@link com.liferay.portlet.asset.model.AssetLinkConstants} 256 * @param weight the weight of the relationship, allowing precedence 257 ordering of links 258 * @return the asset link 259 * @throws PortalException if the user could not be found 260 * @throws SystemException if a system exception occurred 261 */ 262 public com.liferay.portlet.asset.model.AssetLink addLink(long userId, 263 long entryId1, long entryId2, int type, int weight) 264 throws com.liferay.portal.kernel.exception.PortalException, 265 com.liferay.portal.kernel.exception.SystemException; 266 267 /** 268 * Deletes the asset link. 269 * 270 * @param link the asset link 271 * @throws SystemException if a system exception occurred 272 */ 273 public void deleteLink(com.liferay.portlet.asset.model.AssetLink link) 274 throws com.liferay.portal.kernel.exception.SystemException; 275 276 /** 277 * Deletes the asset link. 278 * 279 * @param linkId the primary key of the asset link 280 * @throws PortalException if the asset link could not be found 281 * @throws SystemException if a system exception occurred 282 */ 283 public void deleteLink(long linkId) 284 throws com.liferay.portal.kernel.exception.PortalException, 285 com.liferay.portal.kernel.exception.SystemException; 286 287 /** 288 * Deletes all links associated with the asset entry. 289 * 290 * @param entryId the primary key of the asset entry 291 * @throws SystemException if a system exception occurred 292 */ 293 public void deleteLinks(long entryId) 294 throws com.liferay.portal.kernel.exception.SystemException; 295 296 /** 297 * Delete all links that associate the two asset entries. 298 * 299 * @param entryId1 the primary key of the first asset entry 300 * @param entryId2 the primary key of the second asset entry 301 * @throws SystemException if a system exception occurred 302 */ 303 public void deleteLinks(long entryId1, long entryId2) 304 throws com.liferay.portal.kernel.exception.SystemException; 305 306 /** 307 * Returns all the asset links whose first entry ID is the given entry ID. 308 * 309 * @param entryId the primary key of the asset entry 310 * @return the asset links whose first entry ID is the given entry ID 311 * @throws SystemException if a system exception occurred 312 */ 313 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 314 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getDirectLinks( 315 long entryId) 316 throws com.liferay.portal.kernel.exception.SystemException; 317 318 /** 319 * Returns all the asset links of the given link type whose first entry ID 320 * is the given entry ID. 321 * 322 * @param entryId the primary key of the asset entry 323 * @param typeId the link type. Acceptable values include {@link 324 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_RELATED} 325 which is a bidirectional relationship and {@link 326 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_CHILD} 327 which is a unidirectional relationship. For more information see 328 {@link com.liferay.portlet.asset.model.AssetLinkConstants} 329 * @return the asset links of the given link type whose first entry ID is 330 the given entry ID 331 * @throws SystemException if a system exception occurred 332 */ 333 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 334 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getDirectLinks( 335 long entryId, int typeId) 336 throws com.liferay.portal.kernel.exception.SystemException; 337 338 /** 339 * Returns all the asset links whose first or second entry ID is the given 340 * entry ID. 341 * 342 * @param entryId the primary key of the asset entry 343 * @return the asset links whose first or second entry ID is the given entry 344 ID 345 * @throws SystemException if a system exception occurred 346 */ 347 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 348 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getLinks( 349 long entryId) 350 throws com.liferay.portal.kernel.exception.SystemException; 351 352 /** 353 * Returns all the asset links of the given link type whose first or second 354 * entry ID is the given entry ID. 355 * 356 * @param entryId the primary key of the asset entry 357 * @param typeId the link type. Acceptable values include {@link 358 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_RELATED} 359 which is a bidirectional relationship and {@link 360 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_CHILD} 361 which is a unidirectional relationship. For more information see 362 {@link com.liferay.portlet.asset.model.AssetLinkConstants} 363 * @return the asset links of the given link type whose first or second 364 entry ID is the given entry ID 365 * @throws SystemException if a system exception occurred 366 */ 367 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 368 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getLinks( 369 long entryId, int typeId) 370 throws com.liferay.portal.kernel.exception.SystemException; 371 372 /** 373 * Returns all the asset links of the given link type whose second entry ID 374 * is the given entry ID. 375 * 376 * @param entryId the primary key of the asset entry 377 * @param typeId the link type. Acceptable values include {@link 378 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_RELATED} 379 which is a bidirectional relationship and {@link 380 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_CHILD} 381 which is a unidirectional relationship. For more information see 382 {@link com.liferay.portlet.asset.model.AssetLinkConstants} 383 * @return the asset links of the given link type whose second entry ID is 384 the given entry ID 385 * @throws SystemException if a system exception occurred 386 */ 387 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 388 public java.util.List<com.liferay.portlet.asset.model.AssetLink> getReverseLinks( 389 long entryId, int typeId) 390 throws com.liferay.portal.kernel.exception.SystemException; 391 392 public com.liferay.portlet.asset.model.AssetLink updateLink(long userId, 393 long entryId1, long entryId2, int typeId, int weight) 394 throws com.liferay.portal.kernel.exception.PortalException, 395 com.liferay.portal.kernel.exception.SystemException; 396 397 /** 398 * Updates all links of the asset entry, replacing them with links 399 * associating the asset entry with the asset entries of the given link 400 * entry IDs. 401 * 402 * <p> 403 * If no link exists with a given link entry ID, a new link is created 404 * associating the current asset entry with the asset entry of that link 405 * entry ID. An existing link is deleted if either of its entry IDs is not 406 * contained in the given link entry IDs. 407 * </p> 408 * 409 * @param userId the primary key of the user updating the links 410 * @param entryId the primary key of the asset entry to be managed 411 * @param linkEntryIds the primary keys of the asset entries to be linked 412 with the asset entry to be managed 413 * @param typeId the type of the asset links to be created. Acceptable 414 values include {@link 415 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_RELATED} 416 which is a bidirectional relationship and {@link 417 com.liferay.portlet.asset.model.AssetLinkConstants#TYPE_CHILD} 418 which is a unidirectional relationship. For more information see 419 {@link com.liferay.portlet.asset.model.AssetLinkConstants} 420 * @throws PortalException if the user could not be found 421 * @throws SystemException if a system exception occurred 422 */ 423 public void updateLinks(long userId, long entryId, long[] linkEntryIds, 424 int typeId) 425 throws com.liferay.portal.kernel.exception.PortalException, 426 com.liferay.portal.kernel.exception.SystemException; 427 }