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