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.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    
026    /**
027     * Provides the local service interface for Portlet. Methods of this
028     * service will not have security checks based on the propagated JAAS
029     * credentials because this service can only be accessed from within the same
030     * VM.
031     *
032     * @author Brian Wing Shun Chan
033     * @see PortletLocalServiceUtil
034     * @see com.liferay.portal.service.base.PortletLocalServiceBaseImpl
035     * @see com.liferay.portal.service.impl.PortletLocalServiceImpl
036     * @generated
037     */
038    @ProviderType
039    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
040            PortalException.class, SystemException.class})
041    public interface PortletLocalService extends BaseLocalService,
042            PersistedModelLocalService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * 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.
047             */
048    
049            /**
050            * Adds the portlet to the database. Also notifies the appropriate model listeners.
051            *
052            * @param portlet the portlet
053            * @return the portlet that was added
054            */
055            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
056            public com.liferay.portal.model.Portlet addPortlet(
057                    com.liferay.portal.model.Portlet portlet);
058    
059            @com.liferay.portal.kernel.spring.aop.Skip
060            public void addPortletCategory(long companyId, java.lang.String categoryName);
061    
062            public void checkPortlet(com.liferay.portal.model.Portlet portlet)
063                    throws PortalException;
064    
065            public void checkPortlets(long companyId) throws PortalException;
066    
067            @com.liferay.portal.kernel.spring.aop.Skip
068            public void clearCache();
069    
070            /**
071            * @deprecated As of 7.0.0, replaced by {@link #clearPortletsMap)}
072            */
073            @com.liferay.portal.kernel.cluster.Clusterable
074            @java.lang.Deprecated
075            @Transactional(enabled = false)
076            public void clearCompanyPortletsPool();
077    
078            @com.liferay.portal.kernel.cluster.Clusterable
079            @Transactional(enabled = false)
080            public void clearPortletsMap();
081    
082            /**
083            * @deprecated As of 6.1.0, replaced by {@link #clonePortlet(String)}
084            */
085            @java.lang.Deprecated
086            @com.liferay.portal.kernel.spring.aop.Skip
087            public com.liferay.portal.model.Portlet clonePortlet(long companyId,
088                    java.lang.String portletId);
089    
090            @com.liferay.portal.kernel.spring.aop.Skip
091            public com.liferay.portal.model.Portlet clonePortlet(
092                    java.lang.String portletId);
093    
094            /**
095            * Creates a new portlet with the primary key. Does not add the portlet to the database.
096            *
097            * @param id the primary key for the new portlet
098            * @return the new portlet
099            */
100            public com.liferay.portal.model.Portlet createPortlet(long id);
101    
102            /**
103            * @throws PortalException
104            */
105            @Override
106            public com.liferay.portal.model.PersistedModel deletePersistedModel(
107                    com.liferay.portal.model.PersistedModel persistedModel)
108                    throws PortalException;
109    
110            public void deletePortlet(long companyId, java.lang.String portletId,
111                    long plid) throws PortalException;
112    
113            /**
114            * Deletes the portlet with the primary key from the database. Also notifies the appropriate model listeners.
115            *
116            * @param id the primary key of the portlet
117            * @return the portlet that was removed
118            * @throws PortalException if a portlet with the primary key could not be found
119            */
120            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
121            public com.liferay.portal.model.Portlet deletePortlet(long id)
122                    throws PortalException;
123    
124            /**
125            * Deletes the portlet from the database. Also notifies the appropriate model listeners.
126            *
127            * @param portlet the portlet
128            * @return the portlet that was removed
129            */
130            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
131            public com.liferay.portal.model.Portlet deletePortlet(
132                    com.liferay.portal.model.Portlet portlet);
133    
134            public void deletePortlets(long companyId, java.lang.String[] portletIds,
135                    long plid) throws PortalException;
136    
137            public com.liferay.portal.model.Portlet deployRemotePortlet(
138                    com.liferay.portal.model.Portlet portlet, java.lang.String categoryName)
139                    throws PortalException;
140    
141            public com.liferay.portal.model.Portlet deployRemotePortlet(
142                    com.liferay.portal.model.Portlet portlet,
143                    java.lang.String[] categoryNames) throws PortalException;
144    
145            public com.liferay.portal.model.Portlet deployRemotePortlet(
146                    com.liferay.portal.model.Portlet portlet,
147                    java.lang.String[] categoryNames, boolean eagerDestroy)
148                    throws PortalException;
149    
150            @com.liferay.portal.kernel.spring.aop.Skip
151            public void destroyPortlet(com.liferay.portal.model.Portlet portlet);
152    
153            @com.liferay.portal.kernel.spring.aop.Skip
154            public void destroyRemotePortlet(com.liferay.portal.model.Portlet portlet);
155    
156            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
157    
158            /**
159            * Performs a dynamic query on the database and returns the matching rows.
160            *
161            * @param dynamicQuery the dynamic query
162            * @return the matching rows
163            */
164            public <T> java.util.List<T> dynamicQuery(
165                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
166    
167            /**
168            * Performs a dynamic query on the database and returns a range of the matching rows.
169            *
170            * <p>
171            * 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.PortletModelImpl}. 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.
172            * </p>
173            *
174            * @param dynamicQuery the dynamic query
175            * @param start the lower bound of the range of model instances
176            * @param end the upper bound of the range of model instances (not inclusive)
177            * @return the range of matching rows
178            */
179            public <T> java.util.List<T> dynamicQuery(
180                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
181                    int end);
182    
183            /**
184            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
185            *
186            * <p>
187            * 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.PortletModelImpl}. 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.
188            * </p>
189            *
190            * @param dynamicQuery the dynamic query
191            * @param start the lower bound of the range of model instances
192            * @param end the upper bound of the range of model instances (not inclusive)
193            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
194            * @return the ordered range of matching rows
195            */
196            public <T> java.util.List<T> dynamicQuery(
197                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
198                    int end,
199                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
200    
201            /**
202            * Returns the number of rows matching the dynamic query.
203            *
204            * @param dynamicQuery the dynamic query
205            * @return the number of rows matching the dynamic query
206            */
207            public long dynamicQueryCount(
208                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
209    
210            /**
211            * Returns the number of rows matching the dynamic query.
212            *
213            * @param dynamicQuery the dynamic query
214            * @param projection the projection to apply to the query
215            * @return the number of rows matching the dynamic query
216            */
217            public long dynamicQueryCount(
218                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
219                    com.liferay.portal.kernel.dao.orm.Projection projection);
220    
221            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
222            public com.liferay.portal.model.Portlet fetchPortlet(long id);
223    
224            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
225            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
226    
227            @com.liferay.portal.kernel.spring.aop.Skip
228            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
229            public java.util.List<com.liferay.portlet.expando.model.CustomAttributesDisplay> getCustomAttributesDisplays();
230    
231            @com.liferay.portal.kernel.spring.aop.Skip
232            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
233            public com.liferay.portal.model.PortletCategory getEARDisplay(
234                    java.lang.String xml);
235    
236            @com.liferay.portal.kernel.spring.aop.Skip
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public java.util.List<com.liferay.portal.model.Portlet> getFriendlyURLMapperPortlets();
239    
240            @com.liferay.portal.kernel.spring.aop.Skip
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public java.util.List<com.liferay.portal.kernel.portlet.FriendlyURLMapper> getFriendlyURLMappers();
243    
244            /**
245            * Returns the OSGi service identifier.
246            *
247            * @return the OSGi service identifier
248            */
249            public java.lang.String getOSGiServiceIdentifier();
250    
251            @Override
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public com.liferay.portal.model.PersistedModel getPersistedModel(
254                    java.io.Serializable primaryKeyObj) throws PortalException;
255    
256            /**
257            * Returns the portlet with the primary key.
258            *
259            * @param id the primary key of the portlet
260            * @return the portlet
261            * @throws PortalException if a portlet with the primary key could not be found
262            */
263            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264            public com.liferay.portal.model.Portlet getPortlet(long id)
265                    throws PortalException;
266    
267            @com.liferay.portal.kernel.spring.aop.Skip
268            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
269            public com.liferay.portal.model.PortletApp getPortletApp(
270                    java.lang.String servletContextName);
271    
272            @com.liferay.portal.kernel.spring.aop.Skip
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public com.liferay.portal.model.Portlet getPortletById(long companyId,
275                    java.lang.String portletId);
276    
277            @com.liferay.portal.kernel.spring.aop.Skip
278            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
279            public com.liferay.portal.model.Portlet getPortletById(
280                    java.lang.String portletId);
281    
282            @com.liferay.portal.kernel.spring.aop.Skip
283            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
284            public com.liferay.portal.model.Portlet getPortletByStrutsPath(
285                    long companyId, java.lang.String strutsPath);
286    
287            @com.liferay.portal.kernel.spring.aop.Skip
288            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289            public java.util.List<com.liferay.portal.model.Portlet> getPortlets();
290    
291            @com.liferay.portal.kernel.spring.aop.Skip
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
294                    long companyId);
295    
296            @com.liferay.portal.kernel.spring.aop.Skip
297            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
298            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
299                    long companyId, boolean showSystem, boolean showPortal);
300    
301            /**
302            * Returns a range of all the portlets.
303            *
304            * <p>
305            * 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.PortletModelImpl}. 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.
306            * </p>
307            *
308            * @param start the lower bound of the range of portlets
309            * @param end the upper bound of the range of portlets (not inclusive)
310            * @return the range of portlets
311            */
312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
313            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
314                    int start, int end);
315    
316            /**
317            * Returns the number of portlets.
318            *
319            * @return the number of portlets
320            */
321            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
322            public int getPortletsCount();
323    
324            @com.liferay.portal.kernel.spring.aop.Skip
325            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326            public java.util.List<com.liferay.portal.model.Portlet> getScopablePortlets();
327    
328            @com.liferay.portal.kernel.spring.aop.Skip
329            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330            public com.liferay.portal.model.PortletCategory getWARDisplay(
331                    java.lang.String servletContextName, java.lang.String xml);
332    
333            @com.liferay.portal.kernel.spring.aop.Skip
334            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
335            public boolean hasPortlet(long companyId, java.lang.String portletId);
336    
337            @com.liferay.portal.kernel.spring.aop.Skip
338            public void initEAR(javax.servlet.ServletContext servletContext,
339                    java.lang.String[] xmls,
340                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
341    
342            @com.liferay.portal.kernel.spring.aop.Skip
343            public java.util.List<com.liferay.portal.model.Portlet> initWAR(
344                    java.lang.String servletContextName,
345                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
346                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
347    
348            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
349            public java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsMap(
350                    long companyId);
351    
352            /**
353            * @deprecated As of 7.0.0, replaced by {@link #loadGetPortletsMap(long))}
354            */
355            @java.lang.Deprecated
356            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
357            public java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsPool(
358                    long companyId);
359    
360            @com.liferay.portal.kernel.cluster.Clusterable
361            @Transactional(enabled = false)
362            public void removeCompanyPortletsPool(long companyId);
363    
364            public com.liferay.portal.model.Portlet updatePortlet(long companyId,
365                    java.lang.String portletId, java.lang.String roles, boolean active);
366    
367            /**
368            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
369            *
370            * @param portlet the portlet
371            * @return the portlet that was updated
372            */
373            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
374            public com.liferay.portal.model.Portlet updatePortlet(
375                    com.liferay.portal.model.Portlet portlet);
376    }