001 /** 002 * Copyright (c) 2000-2012 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.portal.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 023 /** 024 * The interface for the resource code local service. 025 * 026 * <p> 027 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM. 028 * </p> 029 * 030 * @author Brian Wing Shun Chan 031 * @see ResourceCodeLocalServiceUtil 032 * @see com.liferay.portal.service.base.ResourceCodeLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.ResourceCodeLocalServiceImpl 034 * @generated 035 */ 036 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 037 PortalException.class, SystemException.class}) 038 public interface ResourceCodeLocalService extends PersistedModelLocalService { 039 /* 040 * NOTE FOR DEVELOPERS: 041 * 042 * Never modify or reference this interface directly. Always use {@link ResourceCodeLocalServiceUtil} to access the resource code local service. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceCodeLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 043 */ 044 045 /** 046 * Adds the resource code to the database. Also notifies the appropriate model listeners. 047 * 048 * @param resourceCode the resource code 049 * @return the resource code that was added 050 * @throws SystemException if a system exception occurred 051 */ 052 public com.liferay.portal.model.ResourceCode addResourceCode( 053 com.liferay.portal.model.ResourceCode resourceCode) 054 throws com.liferay.portal.kernel.exception.SystemException; 055 056 /** 057 * Creates a new resource code with the primary key. Does not add the resource code to the database. 058 * 059 * @param codeId the primary key for the new resource code 060 * @return the new resource code 061 */ 062 public com.liferay.portal.model.ResourceCode createResourceCode(long codeId); 063 064 /** 065 * Deletes the resource code with the primary key from the database. Also notifies the appropriate model listeners. 066 * 067 * @param codeId the primary key of the resource code 068 * @throws PortalException if a resource code with the primary key could not be found 069 * @throws SystemException if a system exception occurred 070 */ 071 public void deleteResourceCode(long codeId) 072 throws com.liferay.portal.kernel.exception.PortalException, 073 com.liferay.portal.kernel.exception.SystemException; 074 075 /** 076 * Deletes the resource code from the database. Also notifies the appropriate model listeners. 077 * 078 * @param resourceCode the resource code 079 * @throws SystemException if a system exception occurred 080 */ 081 public void deleteResourceCode( 082 com.liferay.portal.model.ResourceCode resourceCode) 083 throws com.liferay.portal.kernel.exception.SystemException; 084 085 /** 086 * Performs a dynamic query on the database and returns the matching rows. 087 * 088 * @param dynamicQuery the dynamic query 089 * @return the matching rows 090 * @throws SystemException if a system exception occurred 091 */ 092 @SuppressWarnings("rawtypes") 093 public java.util.List dynamicQuery( 094 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 095 throws com.liferay.portal.kernel.exception.SystemException; 096 097 /** 098 * Performs a dynamic query on the database and returns a range of the matching rows. 099 * 100 * <p> 101 * 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. 102 * </p> 103 * 104 * @param dynamicQuery the dynamic query 105 * @param start the lower bound of the range of model instances 106 * @param end the upper bound of the range of model instances (not inclusive) 107 * @return the range of matching rows 108 * @throws SystemException if a system exception occurred 109 */ 110 @SuppressWarnings("rawtypes") 111 public java.util.List dynamicQuery( 112 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 113 int end) throws com.liferay.portal.kernel.exception.SystemException; 114 115 /** 116 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 117 * 118 * <p> 119 * 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. 120 * </p> 121 * 122 * @param dynamicQuery the dynamic query 123 * @param start the lower bound of the range of model instances 124 * @param end the upper bound of the range of model instances (not inclusive) 125 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 126 * @return the ordered range of matching rows 127 * @throws SystemException if a system exception occurred 128 */ 129 @SuppressWarnings("rawtypes") 130 public java.util.List dynamicQuery( 131 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 132 int end, 133 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 134 throws com.liferay.portal.kernel.exception.SystemException; 135 136 /** 137 * Returns the number of rows that match the dynamic query. 138 * 139 * @param dynamicQuery the dynamic query 140 * @return the number of rows that match the dynamic query 141 * @throws SystemException if a system exception occurred 142 */ 143 public long dynamicQueryCount( 144 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 145 throws com.liferay.portal.kernel.exception.SystemException; 146 147 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 148 public com.liferay.portal.model.ResourceCode fetchResourceCode(long codeId) 149 throws com.liferay.portal.kernel.exception.SystemException; 150 151 /** 152 * Returns the resource code with the primary key. 153 * 154 * @param codeId the primary key of the resource code 155 * @return the resource code 156 * @throws PortalException if a resource code with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 160 public com.liferay.portal.model.ResourceCode getResourceCode(long codeId) 161 throws com.liferay.portal.kernel.exception.PortalException, 162 com.liferay.portal.kernel.exception.SystemException; 163 164 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 165 public com.liferay.portal.model.PersistedModel getPersistedModel( 166 java.io.Serializable primaryKeyObj) 167 throws com.liferay.portal.kernel.exception.PortalException, 168 com.liferay.portal.kernel.exception.SystemException; 169 170 /** 171 * Returns a range of all the resource codes. 172 * 173 * <p> 174 * 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. 175 * </p> 176 * 177 * @param start the lower bound of the range of resource codes 178 * @param end the upper bound of the range of resource codes (not inclusive) 179 * @return the range of resource codes 180 * @throws SystemException if a system exception occurred 181 */ 182 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 183 public java.util.List<com.liferay.portal.model.ResourceCode> getResourceCodes( 184 int start, int end) 185 throws com.liferay.portal.kernel.exception.SystemException; 186 187 /** 188 * Returns the number of resource codes. 189 * 190 * @return the number of resource codes 191 * @throws SystemException if a system exception occurred 192 */ 193 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 194 public int getResourceCodesCount() 195 throws com.liferay.portal.kernel.exception.SystemException; 196 197 /** 198 * Updates the resource code in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 199 * 200 * @param resourceCode the resource code 201 * @return the resource code that was updated 202 * @throws SystemException if a system exception occurred 203 */ 204 public com.liferay.portal.model.ResourceCode updateResourceCode( 205 com.liferay.portal.model.ResourceCode resourceCode) 206 throws com.liferay.portal.kernel.exception.SystemException; 207 208 /** 209 * Updates the resource code in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 210 * 211 * @param resourceCode the resource code 212 * @param merge whether to merge the resource code with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation. 213 * @return the resource code that was updated 214 * @throws SystemException if a system exception occurred 215 */ 216 public com.liferay.portal.model.ResourceCode updateResourceCode( 217 com.liferay.portal.model.ResourceCode resourceCode, boolean merge) 218 throws com.liferay.portal.kernel.exception.SystemException; 219 220 /** 221 * Returns the Spring bean ID for this bean. 222 * 223 * @return the Spring bean ID for this bean 224 */ 225 public java.lang.String getBeanIdentifier(); 226 227 /** 228 * Sets the Spring bean ID for this bean. 229 * 230 * @param beanIdentifier the Spring bean ID for this bean 231 */ 232 public void setBeanIdentifier(java.lang.String beanIdentifier); 233 234 public com.liferay.portal.model.ResourceCode addResourceCode( 235 long companyId, java.lang.String name, int scope) 236 throws com.liferay.portal.kernel.exception.SystemException; 237 238 public void checkResourceCodes() 239 throws com.liferay.portal.kernel.exception.SystemException; 240 241 public void checkResourceCodes(long companyId, java.lang.String name) 242 throws com.liferay.portal.kernel.exception.SystemException; 243 244 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 245 public com.liferay.portal.model.ResourceCode getResourceCode( 246 long companyId, java.lang.String name, int scope) 247 throws com.liferay.portal.kernel.exception.SystemException; 248 }