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            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
245            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
246    
247            /**
248            * Returns the OSGi service identifier.
249            *
250            * @return the OSGi service identifier
251            */
252            public java.lang.String getOSGiServiceIdentifier();
253    
254            @Override
255            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256            public com.liferay.portal.model.PersistedModel getPersistedModel(
257                    java.io.Serializable primaryKeyObj) throws PortalException;
258    
259            /**
260            * Returns the portlet with the primary key.
261            *
262            * @param id the primary key of the portlet
263            * @return the portlet
264            * @throws PortalException if a portlet with the primary key could not be found
265            */
266            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
267            public com.liferay.portal.model.Portlet getPortlet(long id)
268                    throws PortalException;
269    
270            @com.liferay.portal.kernel.spring.aop.Skip
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public com.liferay.portal.model.PortletApp getPortletApp(
273                    java.lang.String servletContextName);
274    
275            @com.liferay.portal.kernel.spring.aop.Skip
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.Portlet getPortletById(long companyId,
278                    java.lang.String portletId);
279    
280            @com.liferay.portal.kernel.spring.aop.Skip
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public com.liferay.portal.model.Portlet getPortletById(
283                    java.lang.String portletId);
284    
285            @com.liferay.portal.kernel.spring.aop.Skip
286            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
287            public com.liferay.portal.model.Portlet getPortletByStrutsPath(
288                    long companyId, java.lang.String strutsPath);
289    
290            @com.liferay.portal.kernel.spring.aop.Skip
291            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
292            public java.util.List<com.liferay.portal.model.Portlet> getPortlets();
293    
294            @com.liferay.portal.kernel.spring.aop.Skip
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
297                    long companyId);
298    
299            @com.liferay.portal.kernel.spring.aop.Skip
300            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
301            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
302                    long companyId, boolean showSystem, boolean showPortal);
303    
304            /**
305            * Returns a range of all the portlets.
306            *
307            * <p>
308            * 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.
309            * </p>
310            *
311            * @param start the lower bound of the range of portlets
312            * @param end the upper bound of the range of portlets (not inclusive)
313            * @return the range of portlets
314            */
315            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316            public java.util.List<com.liferay.portal.model.Portlet> getPortlets(
317                    int start, int end);
318    
319            /**
320            * Returns the number of portlets.
321            *
322            * @return the number of portlets
323            */
324            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325            public int getPortletsCount();
326    
327            @com.liferay.portal.kernel.spring.aop.Skip
328            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
329            public java.util.List<com.liferay.portal.model.Portlet> getScopablePortlets();
330    
331            @com.liferay.portal.kernel.spring.aop.Skip
332            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
333            public com.liferay.portal.model.PortletCategory getWARDisplay(
334                    java.lang.String servletContextName, java.lang.String xml);
335    
336            @com.liferay.portal.kernel.spring.aop.Skip
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public boolean hasPortlet(long companyId, java.lang.String portletId);
339    
340            @com.liferay.portal.kernel.spring.aop.Skip
341            public void initEAR(javax.servlet.ServletContext servletContext,
342                    java.lang.String[] xmls,
343                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
344    
345            @com.liferay.portal.kernel.spring.aop.Skip
346            public java.util.List<com.liferay.portal.model.Portlet> initWAR(
347                    java.lang.String servletContextName,
348                    javax.servlet.ServletContext servletContext, java.lang.String[] xmls,
349                    com.liferay.portal.kernel.plugin.PluginPackage pluginPackage);
350    
351            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
352            public java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsMap(
353                    long companyId);
354    
355            /**
356            * @deprecated As of 7.0.0, replaced by {@link #loadGetPortletsMap(long))}
357            */
358            @java.lang.Deprecated
359            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
360            public java.util.Map<java.lang.String, com.liferay.portal.model.Portlet> loadGetPortletsPool(
361                    long companyId);
362    
363            @com.liferay.portal.kernel.cluster.Clusterable
364            @Transactional(enabled = false)
365            public void removeCompanyPortletsPool(long companyId);
366    
367            public com.liferay.portal.model.Portlet updatePortlet(long companyId,
368                    java.lang.String portletId, java.lang.String roles, boolean active);
369    
370            /**
371            * Updates the portlet in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
372            *
373            * @param portlet the portlet
374            * @return the portlet that was updated
375            */
376            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
377            public com.liferay.portal.model.Portlet updatePortlet(
378                    com.liferay.portal.model.Portlet portlet);
379    }