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