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.portal.service; 016 017 import aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.util.ReferenceRegistry; 021 022 /** 023 * Provides the local service utility for ResourceAction. This utility wraps 024 * {@link com.liferay.portal.service.impl.ResourceActionLocalServiceImpl} and is the 025 * primary access point for service operations in application layer code running 026 * on the local server. Methods of this service will not have security checks 027 * based on the propagated JAAS credentials because this service can only be 028 * accessed from within the same VM. 029 * 030 * @author Brian Wing Shun Chan 031 * @see ResourceActionLocalService 032 * @see com.liferay.portal.service.base.ResourceActionLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.ResourceActionLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class ResourceActionLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ResourceActionLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the resource action to the database. Also notifies the appropriate model listeners. 046 * 047 * @param resourceAction the resource action 048 * @return the resource action that was added 049 */ 050 public static com.liferay.portal.model.ResourceAction addResourceAction( 051 com.liferay.portal.model.ResourceAction resourceAction) { 052 return getService().addResourceAction(resourceAction); 053 } 054 055 public static void checkResourceActions() { 056 getService().checkResourceActions(); 057 } 058 059 public static void checkResourceActions(java.lang.String name, 060 java.util.List<java.lang.String> actionIds) { 061 getService().checkResourceActions(name, actionIds); 062 } 063 064 public static void checkResourceActions(java.lang.String name, 065 java.util.List<java.lang.String> actionIds, boolean addDefaultActions) { 066 getService().checkResourceActions(name, actionIds, addDefaultActions); 067 } 068 069 /** 070 * Creates a new resource action with the primary key. Does not add the resource action to the database. 071 * 072 * @param resourceActionId the primary key for the new resource action 073 * @return the new resource action 074 */ 075 public static com.liferay.portal.model.ResourceAction createResourceAction( 076 long resourceActionId) { 077 return getService().createResourceAction(resourceActionId); 078 } 079 080 /** 081 * @throws PortalException 082 */ 083 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 084 com.liferay.portal.model.PersistedModel persistedModel) 085 throws com.liferay.portal.kernel.exception.PortalException { 086 return getService().deletePersistedModel(persistedModel); 087 } 088 089 /** 090 * Deletes the resource action from the database. Also notifies the appropriate model listeners. 091 * 092 * @param resourceAction the resource action 093 * @return the resource action that was removed 094 */ 095 public static com.liferay.portal.model.ResourceAction deleteResourceAction( 096 com.liferay.portal.model.ResourceAction resourceAction) { 097 return getService().deleteResourceAction(resourceAction); 098 } 099 100 /** 101 * Deletes the resource action with the primary key from the database. Also notifies the appropriate model listeners. 102 * 103 * @param resourceActionId the primary key of the resource action 104 * @return the resource action that was removed 105 * @throws PortalException if a resource action with the primary key could not be found 106 */ 107 public static com.liferay.portal.model.ResourceAction deleteResourceAction( 108 long resourceActionId) 109 throws com.liferay.portal.kernel.exception.PortalException { 110 return getService().deleteResourceAction(resourceActionId); 111 } 112 113 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 114 return getService().dynamicQuery(); 115 } 116 117 /** 118 * Performs a dynamic query on the database and returns the matching rows. 119 * 120 * @param dynamicQuery the dynamic query 121 * @return the matching rows 122 */ 123 public static <T> java.util.List<T> dynamicQuery( 124 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 125 return getService().dynamicQuery(dynamicQuery); 126 } 127 128 /** 129 * Performs a dynamic query on the database and returns a range of the matching rows. 130 * 131 * <p> 132 * 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.portal.model.impl.ResourceActionModelImpl}. 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. 133 * </p> 134 * 135 * @param dynamicQuery the dynamic query 136 * @param start the lower bound of the range of model instances 137 * @param end the upper bound of the range of model instances (not inclusive) 138 * @return the range of matching rows 139 */ 140 public static <T> java.util.List<T> dynamicQuery( 141 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 142 int end) { 143 return getService().dynamicQuery(dynamicQuery, start, end); 144 } 145 146 /** 147 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 148 * 149 * <p> 150 * 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.portal.model.impl.ResourceActionModelImpl}. 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. 151 * </p> 152 * 153 * @param dynamicQuery the dynamic query 154 * @param start the lower bound of the range of model instances 155 * @param end the upper bound of the range of model instances (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching rows 158 */ 159 public static <T> java.util.List<T> dynamicQuery( 160 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 161 int end, 162 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 163 return getService() 164 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 165 } 166 167 /** 168 * Returns the number of rows matching the dynamic query. 169 * 170 * @param dynamicQuery the dynamic query 171 * @return the number of rows matching the dynamic query 172 */ 173 public static long dynamicQueryCount( 174 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 175 return getService().dynamicQueryCount(dynamicQuery); 176 } 177 178 /** 179 * Returns the number of rows matching the dynamic query. 180 * 181 * @param dynamicQuery the dynamic query 182 * @param projection the projection to apply to the query 183 * @return the number of rows matching the dynamic query 184 */ 185 public static long dynamicQueryCount( 186 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 187 com.liferay.portal.kernel.dao.orm.Projection projection) { 188 return getService().dynamicQueryCount(dynamicQuery, projection); 189 } 190 191 public static com.liferay.portal.model.ResourceAction fetchResourceAction( 192 java.lang.String name, java.lang.String actionId) { 193 return getService().fetchResourceAction(name, actionId); 194 } 195 196 public static com.liferay.portal.model.ResourceAction fetchResourceAction( 197 long resourceActionId) { 198 return getService().fetchResourceAction(resourceActionId); 199 } 200 201 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 202 return getService().getActionableDynamicQuery(); 203 } 204 205 /** 206 * Returns the Spring bean ID for this bean. 207 * 208 * @return the Spring bean ID for this bean 209 */ 210 public static java.lang.String getBeanIdentifier() { 211 return getService().getBeanIdentifier(); 212 } 213 214 public static com.liferay.portal.model.PersistedModel getPersistedModel( 215 java.io.Serializable primaryKeyObj) 216 throws com.liferay.portal.kernel.exception.PortalException { 217 return getService().getPersistedModel(primaryKeyObj); 218 } 219 220 public static com.liferay.portal.model.ResourceAction getResourceAction( 221 java.lang.String name, java.lang.String actionId) 222 throws com.liferay.portal.kernel.exception.PortalException { 223 return getService().getResourceAction(name, actionId); 224 } 225 226 /** 227 * Returns the resource action with the primary key. 228 * 229 * @param resourceActionId the primary key of the resource action 230 * @return the resource action 231 * @throws PortalException if a resource action with the primary key could not be found 232 */ 233 public static com.liferay.portal.model.ResourceAction getResourceAction( 234 long resourceActionId) 235 throws com.liferay.portal.kernel.exception.PortalException { 236 return getService().getResourceAction(resourceActionId); 237 } 238 239 public static java.util.List<com.liferay.portal.model.ResourceAction> getResourceActions( 240 java.lang.String name) { 241 return getService().getResourceActions(name); 242 } 243 244 /** 245 * Returns a range of all the resource actions. 246 * 247 * <p> 248 * 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.portal.model.impl.ResourceActionModelImpl}. 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. 249 * </p> 250 * 251 * @param start the lower bound of the range of resource actions 252 * @param end the upper bound of the range of resource actions (not inclusive) 253 * @return the range of resource actions 254 */ 255 public static java.util.List<com.liferay.portal.model.ResourceAction> getResourceActions( 256 int start, int end) { 257 return getService().getResourceActions(start, end); 258 } 259 260 /** 261 * Returns the number of resource actions. 262 * 263 * @return the number of resource actions 264 */ 265 public static int getResourceActionsCount() { 266 return getService().getResourceActionsCount(); 267 } 268 269 public static int getResourceActionsCount(java.lang.String name) { 270 return getService().getResourceActionsCount(name); 271 } 272 273 /** 274 * Sets the Spring bean ID for this bean. 275 * 276 * @param beanIdentifier the Spring bean ID for this bean 277 */ 278 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 279 getService().setBeanIdentifier(beanIdentifier); 280 } 281 282 /** 283 * Updates the resource action in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 284 * 285 * @param resourceAction the resource action 286 * @return the resource action that was updated 287 */ 288 public static com.liferay.portal.model.ResourceAction updateResourceAction( 289 com.liferay.portal.model.ResourceAction resourceAction) { 290 return getService().updateResourceAction(resourceAction); 291 } 292 293 public static ResourceActionLocalService getService() { 294 if (_service == null) { 295 _service = (ResourceActionLocalService)PortalBeanLocatorUtil.locate(ResourceActionLocalService.class.getName()); 296 297 ReferenceRegistry.registerReference(ResourceActionLocalServiceUtil.class, 298 "_service"); 299 } 300 301 return _service; 302 } 303 304 /** 305 * @deprecated As of 6.2.0 306 */ 307 @Deprecated 308 public void setService(ResourceActionLocalService service) { 309 } 310 311 private static ResourceActionLocalService _service; 312 }