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.dao.orm.ActionableDynamicQuery; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery; 022 import com.liferay.portal.kernel.dao.orm.Projection; 023 import com.liferay.portal.kernel.exception.PortalException; 024 import com.liferay.portal.kernel.exception.SystemException; 025 import com.liferay.portal.kernel.search.Indexable; 026 import com.liferay.portal.kernel.search.IndexableType; 027 import com.liferay.portal.kernel.transaction.Isolation; 028 import com.liferay.portal.kernel.transaction.Propagation; 029 import com.liferay.portal.kernel.transaction.Transactional; 030 import com.liferay.portal.kernel.util.OrderByComparator; 031 import com.liferay.portal.model.PersistedModel; 032 import com.liferay.portal.service.BaseLocalService; 033 import com.liferay.portal.service.PersistedModelLocalService; 034 035 import com.liferay.portlet.asset.model.AssetCategoryProperty; 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 public void deleteCategoryProperties(long entryId); 109 110 public void deleteCategoryProperty(AssetCategoryProperty categoryProperty); 111 112 public void deleteCategoryProperty(long categoryPropertyId) 113 throws PortalException; 114 115 /** 116 * @throws PortalException 117 */ 118 @Override 119 public PersistedModel deletePersistedModel(PersistedModel persistedModel) 120 throws PortalException; 121 122 public DynamicQuery dynamicQuery(); 123 124 /** 125 * Performs a dynamic query on the database and returns the matching rows. 126 * 127 * @param dynamicQuery the dynamic query 128 * @return the matching rows 129 */ 130 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery); 131 132 /** 133 * Performs a dynamic query on the database and returns a range of the matching rows. 134 * 135 * <p> 136 * 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. 137 * </p> 138 * 139 * @param dynamicQuery the dynamic query 140 * @param start the lower bound of the range of model instances 141 * @param end the upper bound of the range of model instances (not inclusive) 142 * @return the range of matching rows 143 */ 144 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 145 int end); 146 147 /** 148 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 149 * 150 * <p> 151 * 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. 152 * </p> 153 * 154 * @param dynamicQuery the dynamic query 155 * @param start the lower bound of the range of model instances 156 * @param end the upper bound of the range of model instances (not inclusive) 157 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 158 * @return the ordered range of matching rows 159 */ 160 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, 161 int end, OrderByComparator<T> orderByComparator); 162 163 /** 164 * Returns the number of rows matching the dynamic query. 165 * 166 * @param dynamicQuery the dynamic query 167 * @return the number of rows matching the dynamic query 168 */ 169 public long dynamicQueryCount(DynamicQuery dynamicQuery); 170 171 /** 172 * Returns the number of rows matching the dynamic query. 173 * 174 * @param dynamicQuery the dynamic query 175 * @param projection the projection to apply to the query 176 * @return the number of rows matching the dynamic query 177 */ 178 public long dynamicQueryCount(DynamicQuery dynamicQuery, 179 Projection projection); 180 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public AssetCategoryProperty fetchAssetCategoryProperty( 183 long categoryPropertyId); 184 185 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 186 public ActionableDynamicQuery getActionableDynamicQuery(); 187 188 /** 189 * Returns a range of all the asset category properties. 190 * 191 * <p> 192 * 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. 193 * </p> 194 * 195 * @param start the lower bound of the range of asset category properties 196 * @param end the upper bound of the range of asset category properties (not inclusive) 197 * @return the range of asset category properties 198 */ 199 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 200 public List<AssetCategoryProperty> getAssetCategoryProperties(int start, 201 int end); 202 203 /** 204 * Returns the number of asset category properties. 205 * 206 * @return the number of asset category properties 207 */ 208 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 209 public int getAssetCategoryPropertiesCount(); 210 211 /** 212 * Returns the asset category property with the primary key. 213 * 214 * @param categoryPropertyId the primary key of the asset category property 215 * @return the asset category property 216 * @throws PortalException if a asset category property with the primary key could not be found 217 */ 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public AssetCategoryProperty getAssetCategoryProperty( 220 long categoryPropertyId) throws PortalException; 221 222 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 223 public List<AssetCategoryProperty> getCategoryProperties(); 224 225 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 226 public List<AssetCategoryProperty> getCategoryProperties(long entryId); 227 228 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 229 public AssetCategoryProperty getCategoryProperty(long categoryId, 230 java.lang.String key) throws PortalException; 231 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public AssetCategoryProperty getCategoryProperty(long categoryPropertyId) 234 throws PortalException; 235 236 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 237 public List<AssetCategoryProperty> getCategoryPropertyValues(long groupId, 238 java.lang.String key); 239 240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 241 public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 242 243 /** 244 * Returns the OSGi service identifier. 245 * 246 * @return the OSGi service identifier 247 */ 248 public java.lang.String getOSGiServiceIdentifier(); 249 250 @Override 251 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 252 public PersistedModel getPersistedModel(Serializable primaryKeyObj) 253 throws PortalException; 254 255 /** 256 * Updates the asset category property in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 257 * 258 * @param assetCategoryProperty the asset category property 259 * @return the asset category property that was updated 260 */ 261 @Indexable(type = IndexableType.REINDEX) 262 public AssetCategoryProperty updateAssetCategoryProperty( 263 AssetCategoryProperty assetCategoryProperty); 264 265 public AssetCategoryProperty updateCategoryProperty( 266 long categoryPropertyId, java.lang.String key, java.lang.String value) 267 throws PortalException; 268 269 public AssetCategoryProperty updateCategoryProperty(long userId, 270 long categoryPropertyId, java.lang.String key, java.lang.String value) 271 throws PortalException; 272 }