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 PortletItem. This utility wraps 024 * {@link com.liferay.portal.service.impl.PortletItemLocalServiceImpl} 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 PortletItemLocalService 032 * @see com.liferay.portal.service.base.PortletItemLocalServiceBaseImpl 033 * @see com.liferay.portal.service.impl.PortletItemLocalServiceImpl 034 * @generated 035 */ 036 @ProviderType 037 public class PortletItemLocalServiceUtil { 038 /* 039 * NOTE FOR DEVELOPERS: 040 * 041 * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PortletItemLocalServiceImpl} and rerun ServiceBuilder to regenerate this class. 042 */ 043 044 /** 045 * Adds the portlet item to the database. Also notifies the appropriate model listeners. 046 * 047 * @param portletItem the portlet item 048 * @return the portlet item that was added 049 */ 050 public static com.liferay.portal.model.PortletItem addPortletItem( 051 com.liferay.portal.model.PortletItem portletItem) { 052 return getService().addPortletItem(portletItem); 053 } 054 055 public static com.liferay.portal.model.PortletItem addPortletItem( 056 long userId, long groupId, java.lang.String name, 057 java.lang.String portletId, java.lang.String className) 058 throws com.liferay.portal.kernel.exception.PortalException { 059 return getService() 060 .addPortletItem(userId, groupId, name, portletId, className); 061 } 062 063 /** 064 * Creates a new portlet item with the primary key. Does not add the portlet item to the database. 065 * 066 * @param portletItemId the primary key for the new portlet item 067 * @return the new portlet item 068 */ 069 public static com.liferay.portal.model.PortletItem createPortletItem( 070 long portletItemId) { 071 return getService().createPortletItem(portletItemId); 072 } 073 074 /** 075 * @throws PortalException 076 */ 077 public static com.liferay.portal.model.PersistedModel deletePersistedModel( 078 com.liferay.portal.model.PersistedModel persistedModel) 079 throws com.liferay.portal.kernel.exception.PortalException { 080 return getService().deletePersistedModel(persistedModel); 081 } 082 083 /** 084 * Deletes the portlet item from the database. Also notifies the appropriate model listeners. 085 * 086 * @param portletItem the portlet item 087 * @return the portlet item that was removed 088 */ 089 public static com.liferay.portal.model.PortletItem deletePortletItem( 090 com.liferay.portal.model.PortletItem portletItem) { 091 return getService().deletePortletItem(portletItem); 092 } 093 094 /** 095 * Deletes the portlet item with the primary key from the database. Also notifies the appropriate model listeners. 096 * 097 * @param portletItemId the primary key of the portlet item 098 * @return the portlet item that was removed 099 * @throws PortalException if a portlet item with the primary key could not be found 100 */ 101 public static com.liferay.portal.model.PortletItem deletePortletItem( 102 long portletItemId) 103 throws com.liferay.portal.kernel.exception.PortalException { 104 return getService().deletePortletItem(portletItemId); 105 } 106 107 public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() { 108 return getService().dynamicQuery(); 109 } 110 111 /** 112 * Performs a dynamic query on the database and returns the matching rows. 113 * 114 * @param dynamicQuery the dynamic query 115 * @return the matching rows 116 */ 117 public static <T> java.util.List<T> dynamicQuery( 118 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 119 return getService().dynamicQuery(dynamicQuery); 120 } 121 122 /** 123 * Performs a dynamic query on the database and returns a range of the matching rows. 124 * 125 * <p> 126 * 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.PortletItemModelImpl}. 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. 127 * </p> 128 * 129 * @param dynamicQuery the dynamic query 130 * @param start the lower bound of the range of model instances 131 * @param end the upper bound of the range of model instances (not inclusive) 132 * @return the range of matching rows 133 */ 134 public static <T> java.util.List<T> dynamicQuery( 135 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 136 int end) { 137 return getService().dynamicQuery(dynamicQuery, start, end); 138 } 139 140 /** 141 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 142 * 143 * <p> 144 * 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.PortletItemModelImpl}. 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. 145 * </p> 146 * 147 * @param dynamicQuery the dynamic query 148 * @param start the lower bound of the range of model instances 149 * @param end the upper bound of the range of model instances (not inclusive) 150 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 151 * @return the ordered range of matching rows 152 */ 153 public static <T> java.util.List<T> dynamicQuery( 154 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 155 int end, 156 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) { 157 return getService() 158 .dynamicQuery(dynamicQuery, start, end, orderByComparator); 159 } 160 161 /** 162 * Returns the number of rows matching the dynamic query. 163 * 164 * @param dynamicQuery the dynamic query 165 * @return the number of rows matching the dynamic query 166 */ 167 public static long dynamicQueryCount( 168 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) { 169 return getService().dynamicQueryCount(dynamicQuery); 170 } 171 172 /** 173 * Returns the number of rows matching the dynamic query. 174 * 175 * @param dynamicQuery the dynamic query 176 * @param projection the projection to apply to the query 177 * @return the number of rows matching the dynamic query 178 */ 179 public static long dynamicQueryCount( 180 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 181 com.liferay.portal.kernel.dao.orm.Projection projection) { 182 return getService().dynamicQueryCount(dynamicQuery, projection); 183 } 184 185 public static com.liferay.portal.model.PortletItem fetchPortletItem( 186 long portletItemId) { 187 return getService().fetchPortletItem(portletItemId); 188 } 189 190 public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() { 191 return getService().getActionableDynamicQuery(); 192 } 193 194 /** 195 * Returns the Spring bean ID for this bean. 196 * 197 * @return the Spring bean ID for this bean 198 */ 199 public static java.lang.String getBeanIdentifier() { 200 return getService().getBeanIdentifier(); 201 } 202 203 public static com.liferay.portal.model.PersistedModel getPersistedModel( 204 java.io.Serializable primaryKeyObj) 205 throws com.liferay.portal.kernel.exception.PortalException { 206 return getService().getPersistedModel(primaryKeyObj); 207 } 208 209 public static com.liferay.portal.model.PortletItem getPortletItem( 210 long groupId, java.lang.String name, java.lang.String portletId, 211 java.lang.String className) 212 throws com.liferay.portal.kernel.exception.PortalException { 213 return getService().getPortletItem(groupId, name, portletId, className); 214 } 215 216 /** 217 * Returns the portlet item with the primary key. 218 * 219 * @param portletItemId the primary key of the portlet item 220 * @return the portlet item 221 * @throws PortalException if a portlet item with the primary key could not be found 222 */ 223 public static com.liferay.portal.model.PortletItem getPortletItem( 224 long portletItemId) 225 throws com.liferay.portal.kernel.exception.PortalException { 226 return getService().getPortletItem(portletItemId); 227 } 228 229 public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems( 230 long groupId, java.lang.String className) { 231 return getService().getPortletItems(groupId, className); 232 } 233 234 public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems( 235 long groupId, java.lang.String portletId, java.lang.String className) { 236 return getService().getPortletItems(groupId, portletId, className); 237 } 238 239 /** 240 * Returns a range of all the portlet items. 241 * 242 * <p> 243 * 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.PortletItemModelImpl}. 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. 244 * </p> 245 * 246 * @param start the lower bound of the range of portlet items 247 * @param end the upper bound of the range of portlet items (not inclusive) 248 * @return the range of portlet items 249 */ 250 public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems( 251 int start, int end) { 252 return getService().getPortletItems(start, end); 253 } 254 255 /** 256 * Returns the number of portlet items. 257 * 258 * @return the number of portlet items 259 */ 260 public static int getPortletItemsCount() { 261 return getService().getPortletItemsCount(); 262 } 263 264 /** 265 * Sets the Spring bean ID for this bean. 266 * 267 * @param beanIdentifier the Spring bean ID for this bean 268 */ 269 public static void setBeanIdentifier(java.lang.String beanIdentifier) { 270 getService().setBeanIdentifier(beanIdentifier); 271 } 272 273 /** 274 * Updates the portlet item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 275 * 276 * @param portletItem the portlet item 277 * @return the portlet item that was updated 278 */ 279 public static com.liferay.portal.model.PortletItem updatePortletItem( 280 com.liferay.portal.model.PortletItem portletItem) { 281 return getService().updatePortletItem(portletItem); 282 } 283 284 public static com.liferay.portal.model.PortletItem updatePortletItem( 285 long userId, long groupId, java.lang.String name, 286 java.lang.String portletId, java.lang.String className) 287 throws com.liferay.portal.kernel.exception.PortalException { 288 return getService() 289 .updatePortletItem(userId, groupId, name, portletId, 290 className); 291 } 292 293 public static PortletItemLocalService getService() { 294 if (_service == null) { 295 _service = (PortletItemLocalService)PortalBeanLocatorUtil.locate(PortletItemLocalService.class.getName()); 296 297 ReferenceRegistry.registerReference(PortletItemLocalServiceUtil.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(PortletItemLocalService service) { 309 } 310 311 private static PortletItemLocalService _service; 312 }