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