001 /** 002 * Copyright (c) 2000-2011 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 /** 148 * Returns the resource code with the primary key. 149 * 150 * @param codeId the primary key of the resource code 151 * @return the resource code 152 * @throws PortalException if a resource code with the primary key could not be found 153 * @throws SystemException if a system exception occurred 154 */ 155 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 156 public com.liferay.portal.model.ResourceCode getResourceCode(long codeId) 157 throws com.liferay.portal.kernel.exception.PortalException, 158 com.liferay.portal.kernel.exception.SystemException; 159 160 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 161 public com.liferay.portal.model.PersistedModel getPersistedModel( 162 java.io.Serializable primaryKeyObj) 163 throws com.liferay.portal.kernel.exception.PortalException, 164 com.liferay.portal.kernel.exception.SystemException; 165 166 /** 167 * Returns a range of all the resource codes. 168 * 169 * <p> 170 * 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. 171 * </p> 172 * 173 * @param start the lower bound of the range of resource codes 174 * @param end the upper bound of the range of resource codes (not inclusive) 175 * @return the range of resource codes 176 * @throws SystemException if a system exception occurred 177 */ 178 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 179 public java.util.List<com.liferay.portal.model.ResourceCode> getResourceCodes( 180 int start, int end) 181 throws com.liferay.portal.kernel.exception.SystemException; 182 183 /** 184 * Returns the number of resource codes. 185 * 186 * @return the number of resource codes 187 * @throws SystemException if a system exception occurred 188 */ 189 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 190 public int getResourceCodesCount() 191 throws com.liferay.portal.kernel.exception.SystemException; 192 193 /** 194 * Updates the resource code in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 195 * 196 * @param resourceCode the resource code 197 * @return the resource code that was updated 198 * @throws SystemException if a system exception occurred 199 */ 200 public com.liferay.portal.model.ResourceCode updateResourceCode( 201 com.liferay.portal.model.ResourceCode resourceCode) 202 throws com.liferay.portal.kernel.exception.SystemException; 203 204 /** 205 * Updates the resource code in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 206 * 207 * @param resourceCode the resource code 208 * @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. 209 * @return the resource code that was updated 210 * @throws SystemException if a system exception occurred 211 */ 212 public com.liferay.portal.model.ResourceCode updateResourceCode( 213 com.liferay.portal.model.ResourceCode resourceCode, boolean merge) 214 throws com.liferay.portal.kernel.exception.SystemException; 215 216 /** 217 * Returns the Spring bean ID for this bean. 218 * 219 * @return the Spring bean ID for this bean 220 */ 221 public java.lang.String getBeanIdentifier(); 222 223 /** 224 * Sets the Spring bean ID for this bean. 225 * 226 * @param beanIdentifier the Spring bean ID for this bean 227 */ 228 public void setBeanIdentifier(java.lang.String beanIdentifier); 229 230 public com.liferay.portal.model.ResourceCode addResourceCode( 231 long companyId, java.lang.String name, int scope) 232 throws com.liferay.portal.kernel.exception.SystemException; 233 234 public void checkResourceCodes() 235 throws com.liferay.portal.kernel.exception.SystemException; 236 237 public void checkResourceCodes(long companyId, java.lang.String name) 238 throws com.liferay.portal.kernel.exception.SystemException; 239 240 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 241 public com.liferay.portal.model.ResourceCode getResourceCode( 242 long companyId, java.lang.String name, int scope) 243 throws com.liferay.portal.kernel.exception.SystemException; 244 }