001 /** 002 * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 013 */ 014 015 package com.liferay.portal.service; 016 017 import com.liferay.portal.kernel.annotation.Isolation; 018 import com.liferay.portal.kernel.annotation.Propagation; 019 import com.liferay.portal.kernel.annotation.Transactional; 020 import com.liferay.portal.kernel.exception.PortalException; 021 import com.liferay.portal.kernel.exception.SystemException; 022 023 /** 024 * The interface for the resource code local service. 025 * 026 * <p> 027 * 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. 028 * </p> 029 * 030 * <p> 031 * 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. 032 * </p> 033 * 034 * @author Brian Wing Shun Chan 035 * @see ResourceCodeLocalServiceUtil 036 * @see com.liferay.portal.service.base.ResourceCodeLocalServiceBaseImpl 037 * @see com.liferay.portal.service.impl.ResourceCodeLocalServiceImpl 038 * @generated 039 */ 040 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 041 PortalException.class, SystemException.class}) 042 public interface ResourceCodeLocalService { 043 /** 044 * Adds the resource code to the database. Also notifies the appropriate model listeners. 045 * 046 * @param resourceCode the resource code to add 047 * @return the resource code that was added 048 * @throws SystemException if a system exception occurred 049 */ 050 public com.liferay.portal.model.ResourceCode addResourceCode( 051 com.liferay.portal.model.ResourceCode resourceCode) 052 throws com.liferay.portal.kernel.exception.SystemException; 053 054 /** 055 * Creates a new resource code with the primary key. Does not add the resource code to the database. 056 * 057 * @param codeId the primary key for the new resource code 058 * @return the new resource code 059 */ 060 public com.liferay.portal.model.ResourceCode createResourceCode(long codeId); 061 062 /** 063 * Deletes the resource code with the primary key from the database. Also notifies the appropriate model listeners. 064 * 065 * @param codeId the primary key of the resource code to delete 066 * @throws PortalException if a resource code with the primary key could not be found 067 * @throws SystemException if a system exception occurred 068 */ 069 public void deleteResourceCode(long codeId) 070 throws com.liferay.portal.kernel.exception.PortalException, 071 com.liferay.portal.kernel.exception.SystemException; 072 073 /** 074 * Deletes the resource code from the database. Also notifies the appropriate model listeners. 075 * 076 * @param resourceCode the resource code to delete 077 * @throws SystemException if a system exception occurred 078 */ 079 public void deleteResourceCode( 080 com.liferay.portal.model.ResourceCode resourceCode) 081 throws com.liferay.portal.kernel.exception.SystemException; 082 083 /** 084 * Performs a dynamic query on the database and returns the matching rows. 085 * 086 * @param dynamicQuery the dynamic query to search with 087 * @return the matching rows 088 * @throws SystemException if a system exception occurred 089 */ 090 @SuppressWarnings("rawtypes") 091 public java.util.List dynamicQuery( 092 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 093 throws com.liferay.portal.kernel.exception.SystemException; 094 095 /** 096 * Performs a dynamic query on the database and returns a range of the matching rows. 097 * 098 * <p> 099 * 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. 100 * </p> 101 * 102 * @param dynamicQuery the dynamic query to search with 103 * @param start the lower bound of the range of model instances to return 104 * @param end the upper bound of the range of model instances to return (not inclusive) 105 * @return the range of matching rows 106 * @throws SystemException if a system exception occurred 107 */ 108 @SuppressWarnings("rawtypes") 109 public java.util.List dynamicQuery( 110 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 111 int end) throws com.liferay.portal.kernel.exception.SystemException; 112 113 /** 114 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 115 * 116 * <p> 117 * 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. 118 * </p> 119 * 120 * @param dynamicQuery the dynamic query to search with 121 * @param start the lower bound of the range of model instances to return 122 * @param end the upper bound of the range of model instances to return (not inclusive) 123 * @param orderByComparator the comparator to order the results by 124 * @return the ordered range of matching rows 125 * @throws SystemException if a system exception occurred 126 */ 127 @SuppressWarnings("rawtypes") 128 public java.util.List dynamicQuery( 129 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 130 int end, 131 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 132 throws com.liferay.portal.kernel.exception.SystemException; 133 134 /** 135 * Counts the number of rows that match the dynamic query. 136 * 137 * @param dynamicQuery the dynamic query to search with 138 * @return the number of rows that match the dynamic query 139 * @throws SystemException if a system exception occurred 140 */ 141 public long dynamicQueryCount( 142 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) 143 throws com.liferay.portal.kernel.exception.SystemException; 144 145 /** 146 * Gets the resource code with the primary key. 147 * 148 * @param codeId the primary key of the resource code to get 149 * @return the resource code 150 * @throws PortalException if a resource code with the primary key could not be found 151 * @throws SystemException if a system exception occurred 152 */ 153 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 154 public com.liferay.portal.model.ResourceCode getResourceCode(long codeId) 155 throws com.liferay.portal.kernel.exception.PortalException, 156 com.liferay.portal.kernel.exception.SystemException; 157 158 /** 159 * Gets a range of all the resource codes. 160 * 161 * <p> 162 * 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. 163 * </p> 164 * 165 * @param start the lower bound of the range of resource codes to return 166 * @param end the upper bound of the range of resource codes to return (not inclusive) 167 * @return the range of resource codes 168 * @throws SystemException if a system exception occurred 169 */ 170 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 171 public java.util.List<com.liferay.portal.model.ResourceCode> getResourceCodes( 172 int start, int end) 173 throws com.liferay.portal.kernel.exception.SystemException; 174 175 /** 176 * Gets the number of resource codes. 177 * 178 * @return the number of resource codes 179 * @throws SystemException if a system exception occurred 180 */ 181 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 182 public int getResourceCodesCount() 183 throws com.liferay.portal.kernel.exception.SystemException; 184 185 /** 186 * Updates the resource code in the database. Also notifies the appropriate model listeners. 187 * 188 * @param resourceCode the resource code to update 189 * @return the resource code that was updated 190 * @throws SystemException if a system exception occurred 191 */ 192 public com.liferay.portal.model.ResourceCode updateResourceCode( 193 com.liferay.portal.model.ResourceCode resourceCode) 194 throws com.liferay.portal.kernel.exception.SystemException; 195 196 /** 197 * Updates the resource code in the database. Also notifies the appropriate model listeners. 198 * 199 * @param resourceCode the resource code to update 200 * @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. 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, boolean merge) 206 throws com.liferay.portal.kernel.exception.SystemException; 207 208 public com.liferay.portal.model.ResourceCode addResourceCode( 209 long companyId, java.lang.String name, int scope) 210 throws com.liferay.portal.kernel.exception.SystemException; 211 212 public void checkResourceCodes() 213 throws com.liferay.portal.kernel.exception.SystemException; 214 215 public void checkResourceCodes(long companyId, java.lang.String name) 216 throws com.liferay.portal.kernel.exception.SystemException; 217 218 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 219 public com.liferay.portal.model.ResourceCode getResourceCode( 220 long companyId, java.lang.String name, int scope) 221 throws com.liferay.portal.kernel.exception.SystemException; 222 }