001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the portlet local service.
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see PortletLocalServiceUtil
032     * @see com.liferay.portal.service.base.PortletLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PortletLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface PortletLocalService extends BaseLocalService,
039            PersistedModelLocalService {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify or reference this interface directly. Always use {@link PortletLocalServiceUtil} to access the portlet local service. Add custom service methods to {@link com.liferay.portal.service.impl.PortletLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
044             */
045    
046            /**
047            * Adds the portlet to the database. Also notifies the appropriate model listeners.
048            *
049            * @param portlet the portlet
050            * @return the portlet that was added
051            * @throws SystemException if a system exception occurred
052            */
053            public com.liferay.portal.model.Portlet addPortlet(
054                    com.liferay.portal.model.Portlet portlet)
055                    throws com.liferay.portal.kernel.exception.SystemException;
056    
057            /**
058            * Creates a new portlet with the primary key. Does not add the portlet to the database.
059            *
060            * @param id the primary key for the new portlet
061            * @return the new portlet
062            */
063            public com.liferay.portal.model.Portlet createPortlet(long id);
064    
065            /**
066            * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param id the primary key of the portlet
069            * @return the portlet that was removed
070            * @throws PortalException if a portlet with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public com.liferay.portal.model.Portlet deletePortlet(long id)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Deletes the portlet from the database. Also notifies the appropriate model listeners.
079            *
080            * @param portlet the portlet
081            * @return the portlet that was removed
082            * @throws SystemException if a system exception occurred
083            */
084            public com.liferay.portal.model.Portlet deletePortlet(
085                    com.liferay.portal.model.Portlet portlet)
086                    throws com.liferay.portal.kernel.exception.SystemException;
087    
088            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException;
101    
102            /**
103            * Performs a dynamic query on the database and returns a range of the matching rows.
104            *
105            * <p>
106            * 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.
107            * </p>
108            *
109            * @param dynamicQuery the dynamic query
110            * @param start the lower bound of the range of model instances
111            * @param end the upper bound of the range of model instances (not inclusive)
112            * @return the range of matching rows
113            * @throws SystemException if a system exception occurred
114            */
115            @SuppressWarnings("rawtypes")
116            public java.util.List dynamicQuery(
117                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
118                    int end) throws com.liferay.portal.kernel.exception.SystemException;
119    
120            /**
121            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
122            *
123            * <p>
124            * 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.
125            * </p>
126            *
127            * @param dynamicQuery the dynamic query
128            * @param start the lower bound of the range of model instances
129            * @param end the upper bound of the range of model instances (not inclusive)
130            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
131            * @return the ordered range of matching rows
132            * @throws SystemException if a system exception occurred
133            */
134            @SuppressWarnings("rawtypes")
135            public java.util.List dynamicQuery(
136                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
137                    int end,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException;
140    
141            /**
142            * Returns the number of rows that match the dynamic query.
143            *
144            * @param dynamicQuery the dynamic query
145            * @return the number of rows that match the dynamic query
146            * @throws SystemException if a system exception occurred
147            */
148            public long dynamicQueryCount(
149                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153            public com.liferay.portal.model.Portlet fetchPortlet(long id)
154                    throws com.liferay.portal.kernel.exception.SystemException;
155    
156            /**
157            * Returns the portlet with the primary key.
158            *
159            * @param id the primary key of the portlet
160            * @return the portlet
161            * @throws PortalException if a portlet with the primary key could not be found
162            * @throws SystemException if a system exception occurred
163            */
164            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165            public com.liferay.portal.model.Portlet getPortlet(long id)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException;
168    
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public com.liferay.portal.model.PersistedModel getPersistedModel(
171                    java.io.Serializable primaryKeyObj)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException;
174    
175            /**
176            * Returns a range of all the portlets.
177            *
178            * <p>
179            * 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.
180            * </p>
181            *
182            * @param start the lower bound of the range of portlets
183            * @param end the upper bound of the range of portlets (not inclusive)
184            * @return the range of portlets
185            * @throws SystemException if a system exception occurred
186            */
187            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
188            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
189                    int start, int end)
190                    throws com.liferay.portal.kernel.exception.SystemException;
191    
192            /**
193            * Returns the number of portlets.
194            *
195            * @return the number of portlets
196            * @throws SystemException if a system exception occurred
197            */
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public int getPortletsCount()
200                    throws com.liferay.portal.kernel.exception.SystemException;
201    
202            /**
203            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
204            *
205            * @param portlet the portlet
206            * @return the portlet that was updated
207            * @throws SystemException if a system exception occurred
208            */
209            public com.liferay.portal.model.Portlet updatePortlet(
210                    com.liferay.portal.model.Portlet portlet)
211                    throws com.liferay.portal.kernel.exception.SystemException;
212    
213            /**
214            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
215            *
216            * @param portlet the portlet
217            * @param merge whether to merge the portlet with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
218            * @return the portlet that was updated
219            * @throws SystemException if a system exception occurred
220            */
221            public com.liferay.portal.model.Portlet updatePortlet(
222                    com.liferay.portal.model.Portlet portlet, boolean merge)
223                    throws com.liferay.portal.kernel.exception.SystemException;
224    
225            /**
226            * Returns the Spring bean ID for this bean.
227            *
228            * @return the Spring bean ID for this bean
229            */
230            public java.lang.String getBeanIdentifier();
231    
232            /**
233            * Sets the Spring bean ID for this bean.
234            *
235            * @param beanIdentifier the Spring bean ID for this bean
236            */
237            public void setBeanIdentifier(java.lang.String beanIdentifier);
238    
239            public void addPortletCategory(long companyId, java.lang.String categoryName);
240    
241            public void checkPortlet(com.liferay.portal.model.Portlet portlet)
242                    throws com.liferay.portal.kernel.exception.PortalException,
243                            com.liferay.portal.kernel.exception.SystemException;
244    
245            public void checkPortlets(long companyId)
246                    throws com.liferay.portal.kernel.exception.PortalException,
247                            com.liferay.portal.kernel.exception.SystemException;
248    
249            public void clearCache();
250    
251            public void clearCompanyPortletsPool();
252    
253            /**
254            * @deprecated {@link #clonePortlet(String)}
255            */
256            public com.liferay.portal.model.Portlet clonePortlet(long companyId,
257                    java.lang.String portletId);
258    
259            public com.liferay.portal.model.Portlet clonePortlet(
260                    java.lang.String portletId);
261    
262            public com.liferay.portal.model.Portlet deployRemotePortlet(
263                    com.liferay.portal.model.Portlet portlet, java.lang.String categoryName)
264                    throws com.liferay.portal.kernel.exception.PortalException,
265                            com.liferay.portal.kernel.exception.SystemException;
266    
267            public com.liferay.portal.model.Portlet deployRemotePortlet(
268                    com.liferay.portal.model.Portlet portlet,
269                    java.lang.String[] categoryNames)
270                    throws com.liferay.portal.kernel.exception.PortalException,
271                            com.liferay.portal.kernel.exception.SystemException;
272    
273            public void destroyPortlet(com.liferay.portal.model.Portlet portlet);
274    
275            public void destroyRemotePortlet(com.liferay.portal.model.Portlet portlet);
276    
277            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
278            public java.util.List<com.liferay.portlet.expando.model.CustomAttributesDisplay> getCustomAttributesDisplays();
279    
280            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
281            public com.liferay.portal.model.PortletCategory getEARDisplay(
282                    java.lang.String xml)
283                    throws com.liferay.portal.kernel.exception.SystemException;
284    
285            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286            public java.util.List<com.liferay.portal.model.Portlet> getFriendlyURLMapperPortlets();
287    
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers();
290    
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public com.liferay.portal.model.PortletApp getPortletApp(
293                    java.lang.String servletContextName);
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public com.liferay.portal.model.Portlet getPortletById(long companyId,
297                    java.lang.String portletId)
298                    throws com.liferay.portal.kernel.exception.SystemException;
299    
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public com.liferay.portal.model.Portlet getPortletById(
302                    java.lang.String portletId);
303    
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public com.liferay.portal.model.Portlet getPortletByStrutsPath(
306                    long companyId, java.lang.String strutsPath)
307                    throws com.liferay.portal.kernel.exception.SystemException;
308    
309            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310            public java.util.List<com.liferay.portal.model.Portlet> getPortlets();
311    
312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
313            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
314                    long companyId)
315                    throws com.liferay.portal.kernel.exception.SystemException;
316    
317            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
318            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
319                    long companyId, boolean showSystem, boolean showPortal)
320                    throws com.liferay.portal.kernel.exception.SystemException;
321    
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public java.util.List<com.liferay.portal.model.Portlet> getScopablePortlets();
324    
325            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326            public com.liferay.portal.model.PortletCategory getWARDisplay(
327                    java.lang.String servletContextName, java.lang.String xml)
328                    throws com.liferay.portal.kernel.exception.SystemException;
329    
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public boolean hasPortlet(long companyId, java.lang.String portletId)
332                    throws com.liferay.portal.kernel.exception.SystemException;
333    
334            public void initEAR(javax.servlet.ServletContext servletContext,
335                    java.lang.String[] xmls,
336                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
337    
338            public java.util.List<com.liferay.portal.model.Portlet> initWAR(
339                    java.lang.String servletContextName,
340                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
341                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
342    
343            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344            public java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsPool(
345                    long companyId)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            public void removeCompanyPortletsPool(long companyId);
349    
350            public com.liferay.portal.model.Portlet updatePortlet(long companyId,
351                    java.lang.String portletId, java.lang.String roles, boolean active)
352                    throws com.liferay.portal.kernel.exception.SystemException;
353    }