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.dao.orm.ActionableDynamicQuery;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.Projection;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.model.PersistedModel;
026    import com.liferay.portal.kernel.model.PortletItem;
027    import com.liferay.portal.kernel.search.Indexable;
028    import com.liferay.portal.kernel.search.IndexableType;
029    import com.liferay.portal.kernel.transaction.Isolation;
030    import com.liferay.portal.kernel.transaction.Propagation;
031    import com.liferay.portal.kernel.transaction.Transactional;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    
034    import java.io.Serializable;
035    
036    import java.util.List;
037    
038    /**
039     * Provides the local service interface for PortletItem. Methods of this
040     * service will not have security checks based on the propagated JAAS
041     * credentials because this service can only be accessed from within the same
042     * VM.
043     *
044     * @author Brian Wing Shun Chan
045     * @see PortletItemLocalServiceUtil
046     * @see com.liferay.portal.service.base.PortletItemLocalServiceBaseImpl
047     * @see com.liferay.portal.service.impl.PortletItemLocalServiceImpl
048     * @generated
049     */
050    @ProviderType
051    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
052            PortalException.class, SystemException.class})
053    public interface PortletItemLocalService extends BaseLocalService,
054            PersistedModelLocalService {
055            /*
056             * NOTE FOR DEVELOPERS:
057             *
058             * Never modify or reference this interface directly. Always use {@link PortletItemLocalServiceUtil} to access the portlet item local service. Add custom service methods to {@link com.liferay.portal.service.impl.PortletItemLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
059             */
060    
061            /**
062            * Adds the portlet item to the database. Also notifies the appropriate model listeners.
063            *
064            * @param portletItem the portlet item
065            * @return the portlet item that was added
066            */
067            @Indexable(type = IndexableType.REINDEX)
068            public PortletItem addPortletItem(PortletItem portletItem);
069    
070            public PortletItem addPortletItem(long userId, long groupId,
071                    java.lang.String name, java.lang.String portletId,
072                    java.lang.String className) throws PortalException;
073    
074            /**
075            * Creates a new portlet item with the primary key. Does not add the portlet item to the database.
076            *
077            * @param portletItemId the primary key for the new portlet item
078            * @return the new portlet item
079            */
080            public PortletItem createPortletItem(long portletItemId);
081    
082            /**
083            * @throws PortalException
084            */
085            @Override
086            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
087                    throws PortalException;
088    
089            /**
090            * Deletes the portlet item from the database. Also notifies the appropriate model listeners.
091            *
092            * @param portletItem the portlet item
093            * @return the portlet item that was removed
094            */
095            @Indexable(type = IndexableType.DELETE)
096            public PortletItem deletePortletItem(PortletItem portletItem);
097    
098            /**
099            * Deletes the portlet item with the primary key from the database. Also notifies the appropriate model listeners.
100            *
101            * @param portletItemId the primary key of the portlet item
102            * @return the portlet item that was removed
103            * @throws PortalException if a portlet item with the primary key could not be found
104            */
105            @Indexable(type = IndexableType.DELETE)
106            public PortletItem deletePortletItem(long portletItemId)
107                    throws PortalException;
108    
109            public DynamicQuery dynamicQuery();
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 <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
118    
119            /**
120            * Performs a dynamic query on the database and returns a range of the matching rows.
121            *
122            * <p>
123            * 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.
124            * </p>
125            *
126            * @param dynamicQuery the dynamic query
127            * @param start the lower bound of the range of model instances
128            * @param end the upper bound of the range of model instances (not inclusive)
129            * @return the range of matching rows
130            */
131            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
132                    int end);
133    
134            /**
135            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
136            *
137            * <p>
138            * 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.
139            * </p>
140            *
141            * @param dynamicQuery the dynamic query
142            * @param start the lower bound of the range of model instances
143            * @param end the upper bound of the range of model instances (not inclusive)
144            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
145            * @return the ordered range of matching rows
146            */
147            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
148                    int end, OrderByComparator<T> orderByComparator);
149    
150            /**
151            * Returns the number of rows matching the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows matching the dynamic query
155            */
156            public long dynamicQueryCount(DynamicQuery dynamicQuery);
157    
158            /**
159            * Returns the number of rows matching the dynamic query.
160            *
161            * @param dynamicQuery the dynamic query
162            * @param projection the projection to apply to the query
163            * @return the number of rows matching the dynamic query
164            */
165            public long dynamicQueryCount(DynamicQuery dynamicQuery,
166                    Projection projection);
167    
168            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
169            public PortletItem fetchPortletItem(long portletItemId);
170    
171            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172            public ActionableDynamicQuery getActionableDynamicQuery();
173    
174            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
176    
177            /**
178            * Returns the OSGi service identifier.
179            *
180            * @return the OSGi service identifier
181            */
182            public java.lang.String getOSGiServiceIdentifier();
183    
184            @Override
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
187                    throws PortalException;
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public PortletItem getPortletItem(long groupId, java.lang.String name,
191                    java.lang.String portletId, java.lang.String className)
192                    throws PortalException;
193    
194            /**
195            * Returns the portlet item with the primary key.
196            *
197            * @param portletItemId the primary key of the portlet item
198            * @return the portlet item
199            * @throws PortalException if a portlet item with the primary key could not be found
200            */
201            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
202            public PortletItem getPortletItem(long portletItemId)
203                    throws PortalException;
204    
205            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
206            public List<PortletItem> getPortletItems(long groupId,
207                    java.lang.String className);
208    
209            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
210            public List<PortletItem> getPortletItems(long groupId,
211                    java.lang.String portletId, java.lang.String className);
212    
213            /**
214            * Returns a range of all the portlet items.
215            *
216            * <p>
217            * 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.
218            * </p>
219            *
220            * @param start the lower bound of the range of portlet items
221            * @param end the upper bound of the range of portlet items (not inclusive)
222            * @return the range of portlet items
223            */
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public List<PortletItem> getPortletItems(int start, int end);
226    
227            /**
228            * Returns the number of portlet items.
229            *
230            * @return the number of portlet items
231            */
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public int getPortletItemsCount();
234    
235            /**
236            * Updates the portlet item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
237            *
238            * @param portletItem the portlet item
239            * @return the portlet item that was updated
240            */
241            @Indexable(type = IndexableType.REINDEX)
242            public PortletItem updatePortletItem(PortletItem portletItem);
243    
244            public PortletItem updatePortletItem(long userId, long groupId,
245                    java.lang.String name, java.lang.String portletId,
246                    java.lang.String className) throws PortalException;
247    }