001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="PortletUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class PortletUtil {
030: public static com.liferay.portal.model.Portlet create(long id) {
031: return getPersistence().create(id);
032: }
033:
034: public static com.liferay.portal.model.Portlet remove(long id)
035: throws com.liferay.portal.SystemException,
036: com.liferay.portal.NoSuchPortletException {
037: return getPersistence().remove(id);
038: }
039:
040: public static com.liferay.portal.model.Portlet remove(
041: com.liferay.portal.model.Portlet portlet)
042: throws com.liferay.portal.SystemException {
043: return getPersistence().remove(portlet);
044: }
045:
046: public static com.liferay.portal.model.Portlet update(
047: com.liferay.portal.model.Portlet portlet)
048: throws com.liferay.portal.SystemException {
049: return getPersistence().update(portlet);
050: }
051:
052: public static com.liferay.portal.model.Portlet update(
053: com.liferay.portal.model.Portlet portlet, boolean merge)
054: throws com.liferay.portal.SystemException {
055: return getPersistence().update(portlet, merge);
056: }
057:
058: public static com.liferay.portal.model.Portlet updateImpl(
059: com.liferay.portal.model.Portlet portlet, boolean merge)
060: throws com.liferay.portal.SystemException {
061: return getPersistence().updateImpl(portlet, merge);
062: }
063:
064: public static com.liferay.portal.model.Portlet findByPrimaryKey(
065: long id) throws com.liferay.portal.SystemException,
066: com.liferay.portal.NoSuchPortletException {
067: return getPersistence().findByPrimaryKey(id);
068: }
069:
070: public static com.liferay.portal.model.Portlet fetchByPrimaryKey(
071: long id) throws com.liferay.portal.SystemException {
072: return getPersistence().fetchByPrimaryKey(id);
073: }
074:
075: public static java.util.List findByCompanyId(long companyId)
076: throws com.liferay.portal.SystemException {
077: return getPersistence().findByCompanyId(companyId);
078: }
079:
080: public static java.util.List findByCompanyId(long companyId,
081: int begin, int end)
082: throws com.liferay.portal.SystemException {
083: return getPersistence().findByCompanyId(companyId, begin, end);
084: }
085:
086: public static java.util.List findByCompanyId(long companyId,
087: int begin, int end,
088: com.liferay.portal.kernel.util.OrderByComparator obc)
089: throws com.liferay.portal.SystemException {
090: return getPersistence().findByCompanyId(companyId, begin, end,
091: obc);
092: }
093:
094: public static com.liferay.portal.model.Portlet findByCompanyId_First(
095: long companyId,
096: com.liferay.portal.kernel.util.OrderByComparator obc)
097: throws com.liferay.portal.SystemException,
098: com.liferay.portal.NoSuchPortletException {
099: return getPersistence().findByCompanyId_First(companyId, obc);
100: }
101:
102: public static com.liferay.portal.model.Portlet findByCompanyId_Last(
103: long companyId,
104: com.liferay.portal.kernel.util.OrderByComparator obc)
105: throws com.liferay.portal.SystemException,
106: com.liferay.portal.NoSuchPortletException {
107: return getPersistence().findByCompanyId_Last(companyId, obc);
108: }
109:
110: public static com.liferay.portal.model.Portlet[] findByCompanyId_PrevAndNext(
111: long id, long companyId,
112: com.liferay.portal.kernel.util.OrderByComparator obc)
113: throws com.liferay.portal.SystemException,
114: com.liferay.portal.NoSuchPortletException {
115: return getPersistence().findByCompanyId_PrevAndNext(id,
116: companyId, obc);
117: }
118:
119: public static com.liferay.portal.model.Portlet findByC_P(
120: long companyId, java.lang.String portletId)
121: throws com.liferay.portal.SystemException,
122: com.liferay.portal.NoSuchPortletException {
123: return getPersistence().findByC_P(companyId, portletId);
124: }
125:
126: public static com.liferay.portal.model.Portlet fetchByC_P(
127: long companyId, java.lang.String portletId)
128: throws com.liferay.portal.SystemException {
129: return getPersistence().fetchByC_P(companyId, portletId);
130: }
131:
132: public static java.util.List findWithDynamicQuery(
133: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
134: throws com.liferay.portal.SystemException {
135: return getPersistence().findWithDynamicQuery(queryInitializer);
136: }
137:
138: public static java.util.List findWithDynamicQuery(
139: com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
140: int begin, int end)
141: throws com.liferay.portal.SystemException {
142: return getPersistence().findWithDynamicQuery(queryInitializer,
143: begin, end);
144: }
145:
146: public static java.util.List findAll()
147: throws com.liferay.portal.SystemException {
148: return getPersistence().findAll();
149: }
150:
151: public static java.util.List findAll(int begin, int end)
152: throws com.liferay.portal.SystemException {
153: return getPersistence().findAll(begin, end);
154: }
155:
156: public static java.util.List findAll(int begin, int end,
157: com.liferay.portal.kernel.util.OrderByComparator obc)
158: throws com.liferay.portal.SystemException {
159: return getPersistence().findAll(begin, end, obc);
160: }
161:
162: public static void removeByCompanyId(long companyId)
163: throws com.liferay.portal.SystemException {
164: getPersistence().removeByCompanyId(companyId);
165: }
166:
167: public static void removeByC_P(long companyId,
168: java.lang.String portletId)
169: throws com.liferay.portal.SystemException,
170: com.liferay.portal.NoSuchPortletException {
171: getPersistence().removeByC_P(companyId, portletId);
172: }
173:
174: public static void removeAll()
175: throws com.liferay.portal.SystemException {
176: getPersistence().removeAll();
177: }
178:
179: public static int countByCompanyId(long companyId)
180: throws com.liferay.portal.SystemException {
181: return getPersistence().countByCompanyId(companyId);
182: }
183:
184: public static int countByC_P(long companyId,
185: java.lang.String portletId)
186: throws com.liferay.portal.SystemException {
187: return getPersistence().countByC_P(companyId, portletId);
188: }
189:
190: public static int countAll()
191: throws com.liferay.portal.SystemException {
192: return getPersistence().countAll();
193: }
194:
195: public static PortletPersistence getPersistence() {
196: return _getUtil()._persistence;
197: }
198:
199: public void setPersistence(PortletPersistence persistence) {
200: _persistence = persistence;
201: }
202:
203: private static PortletUtil _getUtil() {
204: if (_util == null) {
205: _util = (PortletUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
206: .locate(_UTIL);
207: }
208:
209: return _util;
210: }
211:
212: private static final String _UTIL = PortletUtil.class.getName();
213: private static PortletUtil _util;
214: private PortletPersistence _persistence;
215: }
|