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.asset.kernel.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.asset.kernel.model.AssetCategoryProperty; 020 021 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 023 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 024 import com.liferay.portal.kernel.dao.orm.Projection; 025 import com.liferay.portal.kernel.exception.PortalException; 026 import com.liferay.portal.kernel.exception.SystemException; 027 import com.liferay.portal.kernel.model.PersistedModel; 028 import com.liferay.portal.kernel.search.Indexable; 029 import com.liferay.portal.kernel.search.IndexableType; 030 import com.liferay.portal.kernel.service.BaseLocalService; 031 import com.liferay.portal.kernel.service.PersistedModelLocalService; 032 import com.liferay.portal.kernel.transaction.Isolation; 033 import com.liferay.portal.kernel.transaction.Propagation; 034 import com.liferay.portal.kernel.transaction.Transactional; 035 import com.liferay.portal.kernel.util.OrderByComparator; 036 037 import java.io.Serializable; 038 039 import java.util.List; 040 041 /** 042 * Provides the local service interface for AssetCategoryProperty. Methods of this 043 * service will not have security checks based on the propagated JAAS 044 * credentials because this service can only be accessed from within the same 045 * VM. 046 * 047 * @author Brian Wing Shun Chan 048 * @see AssetCategoryPropertyLocalServiceUtil 049 * @see com.liferay.portlet.asset.service.base.AssetCategoryPropertyLocalServiceBaseImpl 050 * @see com.liferay.portlet.asset.service.impl.AssetCategoryPropertyLocalServiceImpl 051 * @generated 052 */ 053 @ProviderType 054 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 055 PortalException.class, SystemException.class}) 056 public interface AssetCategoryPropertyLocalService extends BaseLocalService, 057 PersistedModelLocalService { 058 /* 059 * NOTE FOR DEVELOPERS: 060 * 061 * Never modify or reference this interface directly. Always use {@link AssetCategoryPropertyLocalServiceUtil} to access the asset category property local service. Add custom service methods to {@link com.liferay.portlet.asset.service.impl.AssetCategoryPropertyLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 062 */ 063 064 /** 065 * Adds the asset category property to the database. Also notifies the appropriate model listeners. 066 * 067 * @param assetCategoryProperty the asset category property 068 * @return the asset category property that was added 069 */ 070 @Indexable(type = IndexableType.REINDEX) 071 public AssetCategoryProperty addAssetCategoryProperty( 072 AssetCategoryProperty assetCategoryProperty); 073 074 public AssetCategoryProperty addCategoryProperty(long userId, 075 long categoryId, java.lang.String key, java.lang.String value) 076 throws PortalException; 077 078 /** 079 * Creates a new asset category property with the primary key. Does not add the asset category property to the database. 080 * 081 * @param categoryPropertyId the primary key for the new asset category property 082 * @return the new asset category property 083 */ 084 public AssetCategoryProperty createAssetCategoryProperty( 085 long categoryPropertyId); 086 087 /** 088 * Deletes the asset category property from the database. Also notifies the appropriate model listeners. 089 * 090 * @param assetCategoryProperty the asset category property 091 * @return the asset category property that was removed 092 */ 093 @Indexable(type = IndexableType.DELETE) 094 public AssetCategoryProperty deleteAssetCategoryProperty( 095 AssetCategoryProperty assetCategoryProperty); 096 097 /** 098 * Deletes the asset category property with the primary key from the database. Also notifies the appropriate model listeners. 099 * 100 * @param categoryPropertyId the primary key of the asset category property 101 * @return the asset category property that was removed 102 * @throws PortalException if a asset category property with the primary key could not be found 103 */ 104 @Indexable(type = IndexableType.DELETE) 105 public AssetCategoryProperty deleteAssetCategoryProperty( 106 long categoryPropertyId) throws PortalException; 107 108 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 109 public AssetCategoryProperty fetchAssetCategoryProperty( 110 long categoryPropertyId); 111 112 /** 113 * Returns the asset category property with the primary key. 114 * 115 * @param categoryPropertyId the primary key of the asset category property 116 * @return the asset category property 117 * @throws PortalException if a asset category property with the primary key could not be found 118 */ 119 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 120 public AssetCategoryProperty getAssetCategoryProperty( 121 long categoryPropertyId) throws PortalException; 122 123 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 124 public AssetCategoryProperty getCategoryProperty(long categoryId, 125 java.lang.String key) throws PortalException; 126 127 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 128 public AssetCategoryProperty getCategoryProperty(long categoryPropertyId) 129 throws PortalException; 130 131 /** 132 * Updates the asset category property in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 133 * 134 * @param assetCategoryProperty the asset category property 135 * @return the asset category property that was updated 136 */ 137 @Indexable(type = IndexableType.REINDEX) 138 public AssetCategoryProperty updateAssetCategoryProperty( 139 AssetCategoryProperty assetCategoryProperty); 140 141 public AssetCategoryProperty updateCategoryProperty( 142 long categoryPropertyId, java.lang.String key, java.lang.String value) 143 throws PortalException; 144 145 public AssetCategoryProperty updateCategoryProperty(long userId, 146 long categoryPropertyId, java.lang.String key, java.lang.String value) 147 throws PortalException; 148 149 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 150 public ActionableDynamicQuery getActionableDynamicQuery(); 151 152 public DynamicQuery dynamicQuery(); 153 154 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 155 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 156 157 /** 158 * @throws PortalException 159 */ 160 @Override 161 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 162 throws PortalException; 163 164 @Override 165 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 166 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 167 throws PortalException; 168 169 /** 170 * Returns the number of asset category properties. 171 * 172 * @return the number of asset category properties 173 */ 174 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 175 public int getAssetCategoryPropertiesCount(); 176 177 /** 178 * Returns the OSGi service identifier. 179 * 180 * @return the OSGi service identifier 181 */ 182 public java.lang.String getOSGiServiceIdentifier(); 183 184 /** 185 * Performs a dynamic query on the database and returns the matching rows. 186 * 187 * @param dynamicQuery the dynamic query 188 * @return the matching rows 189 */ 190 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 191 192 /** 193 * Performs a dynamic query on the database and returns a range of the matching rows. 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.AssetCategoryPropertyModelImpl}. 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 dynamicQuery the dynamic query 200 * @param start the lower bound of the range of model instances 201 * @param end the upper bound of the range of model instances (not inclusive) 202 * @return the range of matching rows 203 */ 204 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 205 int end); 206 207 /** 208 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 209 * 210 * <p> 211 * 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.AssetCategoryPropertyModelImpl}. 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. 212 * </p> 213 * 214 * @param dynamicQuery the dynamic query 215 * @param start the lower bound of the range of model instances 216 * @param end the upper bound of the range of model instances (not inclusive) 217 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 218 * @return the ordered range of matching rows 219 */ 220 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 221 int end, OrderByComparator<T> orderByComparator); 222 223 /** 224 * Returns a range of all the asset category properties. 225 * 226 * <p> 227 * 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.AssetCategoryPropertyModelImpl}. 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. 228 * </p> 229 * 230 * @param start the lower bound of the range of asset category properties 231 * @param end the upper bound of the range of asset category properties (not inclusive) 232 * @return the range of asset category properties 233 */ 234 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 235 public List<AssetCategoryProperty> getAssetCategoryProperties(int start, 236 int end); 237 238 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 239 public List<AssetCategoryProperty> getCategoryProperties(); 240 241 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 242 public List<AssetCategoryProperty> getCategoryProperties(long entryId); 243 244 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 245 public List<AssetCategoryProperty> getCategoryPropertyValues(long groupId, 246 java.lang.String key); 247 248 /** 249 * Returns the number of rows matching the dynamic query. 250 * 251 * @param dynamicQuery the dynamic query 252 * @return the number of rows matching the dynamic query 253 */ 254 public long dynamicQueryCount(DynamicQuery dynamicQuery); 255 256 /** 257 * Returns the number of rows matching the dynamic query. 258 * 259 * @param dynamicQuery the dynamic query 260 * @param projection the projection to apply to the query 261 * @return the number of rows matching the dynamic query 262 */ 263 public long dynamicQueryCount(DynamicQuery dynamicQuery, 264 Projection projection); 265 266 public void deleteCategoryProperties(long entryId); 267 268 public void deleteCategoryProperty(AssetCategoryProperty categoryProperty); 269 270 public void deleteCategoryProperty(long categoryPropertyId) 271 throws PortalException; 272 }