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