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            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
195                    return getService().getIndexableActionableDynamicQuery();
196            }
197    
198            /**
199            * Returns the OSGi service identifier.
200            *
201            * @return the OSGi service identifier
202            */
203            public static java.lang.String getOSGiServiceIdentifier() {
204                    return getService().getOSGiServiceIdentifier();
205            }
206    
207            public static com.liferay.portal.model.PersistedModel getPersistedModel(
208                    java.io.Serializable primaryKeyObj)
209                    throws com.liferay.portal.kernel.exception.PortalException {
210                    return getService().getPersistedModel(primaryKeyObj);
211            }
212    
213            public static com.liferay.portal.model.PortletItem getPortletItem(
214                    long groupId, java.lang.String name, java.lang.String portletId,
215                    java.lang.String className)
216                    throws com.liferay.portal.kernel.exception.PortalException {
217                    return getService().getPortletItem(groupId, name, portletId, className);
218            }
219    
220            /**
221            * Returns the portlet item with the primary key.
222            *
223            * @param portletItemId the primary key of the portlet item
224            * @return the portlet item
225            * @throws PortalException if a portlet item with the primary key could not be found
226            */
227            public static com.liferay.portal.model.PortletItem getPortletItem(
228                    long portletItemId)
229                    throws com.liferay.portal.kernel.exception.PortalException {
230                    return getService().getPortletItem(portletItemId);
231            }
232    
233            public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems(
234                    long groupId, java.lang.String className) {
235                    return getService().getPortletItems(groupId, className);
236            }
237    
238            public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems(
239                    long groupId, java.lang.String portletId, java.lang.String className) {
240                    return getService().getPortletItems(groupId, portletId, className);
241            }
242    
243            /**
244            * Returns a range of all the portlet items.
245            *
246            * <p>
247            * 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.
248            * </p>
249            *
250            * @param start the lower bound of the range of portlet items
251            * @param end the upper bound of the range of portlet items (not inclusive)
252            * @return the range of portlet items
253            */
254            public static java.util.List<com.liferay.portal.model.PortletItem> getPortletItems(
255                    int start, int end) {
256                    return getService().getPortletItems(start, end);
257            }
258    
259            /**
260            * Returns the number of portlet items.
261            *
262            * @return the number of portlet items
263            */
264            public static int getPortletItemsCount() {
265                    return getService().getPortletItemsCount();
266            }
267    
268            /**
269            * Updates the portlet item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
270            *
271            * @param portletItem the portlet item
272            * @return the portlet item that was updated
273            */
274            public static com.liferay.portal.model.PortletItem updatePortletItem(
275                    com.liferay.portal.model.PortletItem portletItem) {
276                    return getService().updatePortletItem(portletItem);
277            }
278    
279            public static com.liferay.portal.model.PortletItem updatePortletItem(
280                    long userId, long groupId, java.lang.String name,
281                    java.lang.String portletId, java.lang.String className)
282                    throws com.liferay.portal.kernel.exception.PortalException {
283                    return getService()
284                                       .updatePortletItem(userId, groupId, name, portletId,
285                            className);
286            }
287    
288            public static PortletItemLocalService getService() {
289                    if (_service == null) {
290                            _service = (PortletItemLocalService)PortalBeanLocatorUtil.locate(PortletItemLocalService.class.getName());
291    
292                            ReferenceRegistry.registerReference(PortletItemLocalServiceUtil.class,
293                                    "_service");
294                    }
295    
296                    return _service;
297            }
298    
299            private static PortletItemLocalService _service;
300    }