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 public static com.liferay.portal.model.ResourceAction addResourceAction( 044 java.lang.String name, java.lang.String actionId, long bitwiseValue) { 045 return getService().addResourceAction(name, actionId, bitwiseValue); 046 } 047 048 /** 049 * Adds the resource action to the database. Also notifies the appropriate model listeners. 050 * 051 * @param resourceAction the resource action 052 * @return the resource action that was added 053 */ 054 public static com.liferay.portal.model.ResourceAction addResourceAction( 055 com.liferay.portal.model.ResourceAction resourceAction) { 056 return getService().addResourceAction(resourceAction); 057 } 058 059 public static void checkResourceActions() { 060 getService().checkResourceActions(); 061 } 062 063 public static void checkResourceActions(java.lang.String name, 064 java.util.List<java.lang.String> actionIds) { 065 getService().checkResourceActions(name, actionIds); 066 } 067 068 public static void checkResourceActions(java.lang.String name, 069 java.util.List<java.lang.String> actionIds, boolean addDefaultActions) { 070 getService().checkResourceActions(name, actionIds, addDefaultActions); 071 } 072 073 /** 074 * Creates a new resource action with the primary key. Does not add the resource action to the database. 075 * 076 * @param resourceActionId the primary key for the new resource action 077 * @return the new resource action 078 */ 079 public static com.liferay.portal.model.ResourceAction createResourceAction( 080 long resourceActionId) { 081 return getService().createResourceAction(resourceActionId); 082 } 083 084 /** 085 * @throws PortalException 086 */ 087 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 088 com.liferay.portal.model.PersistedModel persistedModel) 089 throws com.liferay.portal.kernel.exception.PortalException { 090 return getService().deletePersistedModel(persistedModel); 091 } 092 093 /** 094 * Deletes the resource action from the database. Also notifies the appropriate model listeners. 095 * 096 * @param resourceAction the resource action 097 * @return the resource action that was removed 098 */ 099 public static com.liferay.portal.model.ResourceAction deleteResourceAction( 100 com.liferay.portal.model.ResourceAction resourceAction) { 101 return getService().deleteResourceAction(resourceAction); 102 } 103 104 /** 105 * Deletes the resource action with the primary key from the database. Also notifies the appropriate model listeners. 106 * 107 * @param resourceActionId the primary key of the resource action 108 * @return the resource action that was removed 109 * @throws PortalException if a resource action with the primary key could not be found 110 */ 111 public static com.liferay.portal.model.ResourceAction deleteResourceAction( 112 long resourceActionId) 113 throws com.liferay.portal.kernel.exception.PortalException { 114 return getService().deleteResourceAction(resourceActionId); 115 } 116 117 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 118 return getService().dynamicQuery(); 119 } 120 121 /** 122 * Performs a dynamic query on the database and returns the matching rows. 123 * 124 * @param dynamicQuery the dynamic query 125 * @return the matching rows 126 */ 127 public static <T> java.util.List<T> dynamicQuery( 128 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 129 return getService().dynamicQuery(dynamicQuery); 130 } 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.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. 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 static <T> java.util.List<T> dynamicQuery( 145 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 146 int end) { 147 return getService().dynamicQuery(dynamicQuery, start, end); 148 } 149 150 /** 151 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 152 * 153 * <p> 154 * 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. 155 * </p> 156 * 157 * @param dynamicQuery the dynamic query 158 * @param start the lower bound of the range of model instances 159 * @param end the upper bound of the range of model instances (not inclusive) 160 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 161 * @return the ordered range of matching rows 162 */ 163 public static <T> java.util.List<T> dynamicQuery( 164 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 165 int end, 166 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 167 return getService() 168 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 169 } 170 171 /** 172 * Returns the number of rows matching the dynamic query. 173 * 174 * @param dynamicQuery the dynamic query 175 * @return the number of rows matching the dynamic query 176 */ 177 public static long dynamicQueryCount( 178 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 179 return getService().dynamicQueryCount(dynamicQuery); 180 } 181 182 /** 183 * Returns the number of rows matching the dynamic query. 184 * 185 * @param dynamicQuery the dynamic query 186 * @param projection the projection to apply to the query 187 * @return the number of rows matching the dynamic query 188 */ 189 public static long dynamicQueryCount( 190 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 191 com.liferay.portal.kernel.dao.orm.Projection projection) { 192 return getService().dynamicQueryCount(dynamicQuery, projection); 193 } 194 195 public static com.liferay.portal.model.ResourceAction fetchResourceAction( 196 java.lang.String name, java.lang.String actionId) { 197 return getService().fetchResourceAction(name, actionId); 198 } 199 200 public static com.liferay.portal.model.ResourceAction fetchResourceAction( 201 long resourceActionId) { 202 return getService().fetchResourceAction(resourceActionId); 203 } 204 205 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 206 return getService().getActionableDynamicQuery(); 207 } 208 209 public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() { 210 return getService().getIndexableActionableDynamicQuery(); 211 } 212 213 /** 214 * Returns the OSGi service identifier. 215 * 216 * @return the OSGi service identifier 217 */ 218 public static java.lang.String getOSGiServiceIdentifier() { 219 return getService().getOSGiServiceIdentifier(); 220 } 221 222 public static com.liferay.portal.model.PersistedModel getPersistedModel( 223 java.io.Serializable primaryKeyObj) 224 throws com.liferay.portal.kernel.exception.PortalException { 225 return getService().getPersistedModel(primaryKeyObj); 226 } 227 228 public static com.liferay.portal.model.ResourceAction getResourceAction( 229 java.lang.String name, java.lang.String actionId) 230 throws com.liferay.portal.kernel.exception.PortalException { 231 return getService().getResourceAction(name, actionId); 232 } 233 234 /** 235 * Returns the resource action with the primary key. 236 * 237 * @param resourceActionId the primary key of the resource action 238 * @return the resource action 239 * @throws PortalException if a resource action with the primary key could not be found 240 */ 241 public static com.liferay.portal.model.ResourceAction getResourceAction( 242 long resourceActionId) 243 throws com.liferay.portal.kernel.exception.PortalException { 244 return getService().getResourceAction(resourceActionId); 245 } 246 247 public static java.util.List<com.liferay.portal.model.ResourceAction> getResourceActions( 248 java.lang.String name) { 249 return getService().getResourceActions(name); 250 } 251 252 /** 253 * Returns a range of all the resource actions. 254 * 255 * <p> 256 * 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. 257 * </p> 258 * 259 * @param start the lower bound of the range of resource actions 260 * @param end the upper bound of the range of resource actions (not inclusive) 261 * @return the range of resource actions 262 */ 263 public static java.util.List<com.liferay.portal.model.ResourceAction> getResourceActions( 264 int start, int end) { 265 return getService().getResourceActions(start, end); 266 } 267 268 /** 269 * Returns the number of resource actions. 270 * 271 * @return the number of resource actions 272 */ 273 public static int getResourceActionsCount() { 274 return getService().getResourceActionsCount(); 275 } 276 277 public static int getResourceActionsCount(java.lang.String name) { 278 return getService().getResourceActionsCount(name); 279 } 280 281 /** 282 * Updates the resource action in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 283 * 284 * @param resourceAction the resource action 285 * @return the resource action that was updated 286 */ 287 public static com.liferay.portal.model.ResourceAction updateResourceAction( 288 com.liferay.portal.model.ResourceAction resourceAction) { 289 return getService().updateResourceAction(resourceAction); 290 } 291 292 public static ResourceActionLocalService getService() { 293 if (_service == null) { 294 _service = (ResourceActionLocalService)PortalBeanLocatorUtil.locate(ResourceActionLocalService.class.getName()); 295 296 ReferenceRegistry.registerReference(ResourceActionLocalServiceUtil.class, 297 "_service"); 298 } 299 300 return _service; 301 } 302 303 private static ResourceActionLocalService _service; 304 }