| PortletLocalServiceBaseImpl.java |
1 /**
2 * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
21 */
22
23 package com.liferay.portal.service.base;
24
25 import com.liferay.portal.SystemException;
26 import com.liferay.portal.kernel.dao.DynamicQueryInitializer;
27 import com.liferay.portal.model.Portlet;
28 import com.liferay.portal.model.impl.PortletImpl;
29 import com.liferay.portal.service.PortletLocalService;
30 import com.liferay.portal.service.persistence.PortletUtil;
31
32 import java.util.List;
33
34 /**
35 * <a href="PortletLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
36 *
37 * @author Brian Wing Shun Chan
38 *
39 */
40 public abstract class PortletLocalServiceBaseImpl implements PortletLocalService {
41 public Portlet addPortlet(Portlet model) throws SystemException {
42 Portlet portlet = new PortletImpl();
43 portlet.setNew(true);
44 portlet.setId(model.getId());
45 portlet.setCompanyId(model.getCompanyId());
46 portlet.setPortletId(model.getPortletId());
47 portlet.setRoles(model.getRoles());
48 portlet.setActive(model.getActive());
49
50 return PortletUtil.update(portlet);
51 }
52
53 public List dynamicQuery(DynamicQueryInitializer queryInitializer)
54 throws SystemException {
55 return PortletUtil.findWithDynamicQuery(queryInitializer);
56 }
57
58 public List dynamicQuery(DynamicQueryInitializer queryInitializer,
59 int begin, int end) throws SystemException {
60 return PortletUtil.findWithDynamicQuery(queryInitializer, begin, end);
61 }
62
63 public Portlet updatePortlet(Portlet model) throws SystemException {
64 Portlet portlet = new PortletImpl();
65 portlet.setNew(false);
66 portlet.setId(model.getId());
67 portlet.setCompanyId(model.getCompanyId());
68 portlet.setPortletId(model.getPortletId());
69 portlet.setRoles(model.getRoles());
70 portlet.setActive(model.getActive());
71
72 return PortletUtil.update(portlet);
73 }
74 }