001    /**
002     * Copyright (c) 2000-2011 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.portlet.shopping.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the shopping order local service. This utility wraps {@link com.liferay.portlet.shopping.service.impl.ShoppingOrderLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ShoppingOrderLocalService
030     * @see com.liferay.portlet.shopping.service.base.ShoppingOrderLocalServiceBaseImpl
031     * @see com.liferay.portlet.shopping.service.impl.ShoppingOrderLocalServiceImpl
032     * @generated
033     */
034    public class ShoppingOrderLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.shopping.service.impl.ShoppingOrderLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the shopping order to the database. Also notifies the appropriate model listeners.
043            *
044            * @param shoppingOrder the shopping order
045            * @return the shopping order that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.shopping.model.ShoppingOrder addShoppingOrder(
049                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addShoppingOrder(shoppingOrder);
052            }
053    
054            /**
055            * Creates a new shopping order with the primary key. Does not add the shopping order to the database.
056            *
057            * @param orderId the primary key for the new shopping order
058            * @return the new shopping order
059            */
060            public static com.liferay.portlet.shopping.model.ShoppingOrder createShoppingOrder(
061                    long orderId) {
062                    return getService().createShoppingOrder(orderId);
063            }
064    
065            /**
066            * Deletes the shopping order with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param orderId the primary key of the shopping order
069            * @throws PortalException if a shopping order with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteShoppingOrder(long orderId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteShoppingOrder(orderId);
076            }
077    
078            /**
079            * Deletes the shopping order from the database. Also notifies the appropriate model listeners.
080            *
081            * @param shoppingOrder the shopping order
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteShoppingOrder(
085                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteShoppingOrder(shoppingOrder);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the shopping order with the primary key.
163            *
164            * @param orderId the primary key of the shopping order
165            * @return the shopping order
166            * @throws PortalException if a shopping order with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portlet.shopping.model.ShoppingOrder getShoppingOrder(
170                    long orderId)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getService().getShoppingOrder(orderId);
174            }
175    
176            public static com.liferay.portal.model.PersistedModel getPersistedModel(
177                    java.io.Serializable primaryKeyObj)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    return getService().getPersistedModel(primaryKeyObj);
181            }
182    
183            /**
184            * Returns a range of all the shopping orders.
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.
188            * </p>
189            *
190            * @param start the lower bound of the range of shopping orders
191            * @param end the upper bound of the range of shopping orders (not inclusive)
192            * @return the range of shopping orders
193            * @throws SystemException if a system exception occurred
194            */
195            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> getShoppingOrders(
196                    int start, int end)
197                    throws com.liferay.portal.kernel.exception.SystemException {
198                    return getService().getShoppingOrders(start, end);
199            }
200    
201            /**
202            * Returns the number of shopping orders.
203            *
204            * @return the number of shopping orders
205            * @throws SystemException if a system exception occurred
206            */
207            public static int getShoppingOrdersCount()
208                    throws com.liferay.portal.kernel.exception.SystemException {
209                    return getService().getShoppingOrdersCount();
210            }
211    
212            /**
213            * Updates the shopping order in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
214            *
215            * @param shoppingOrder the shopping order
216            * @return the shopping order that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portlet.shopping.model.ShoppingOrder updateShoppingOrder(
220                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateShoppingOrder(shoppingOrder);
223            }
224    
225            /**
226            * Updates the shopping order in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
227            *
228            * @param shoppingOrder the shopping order
229            * @param merge whether to merge the shopping order with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
230            * @return the shopping order that was updated
231            * @throws SystemException if a system exception occurred
232            */
233            public static com.liferay.portlet.shopping.model.ShoppingOrder updateShoppingOrder(
234                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder,
235                    boolean merge)
236                    throws com.liferay.portal.kernel.exception.SystemException {
237                    return getService().updateShoppingOrder(shoppingOrder, merge);
238            }
239    
240            /**
241            * Returns the Spring bean ID for this bean.
242            *
243            * @return the Spring bean ID for this bean
244            */
245            public static java.lang.String getBeanIdentifier() {
246                    return getService().getBeanIdentifier();
247            }
248    
249            /**
250            * Sets the Spring bean ID for this bean.
251            *
252            * @param beanIdentifier the Spring bean ID for this bean
253            */
254            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
255                    getService().setBeanIdentifier(beanIdentifier);
256            }
257    
258            public static com.liferay.portlet.shopping.model.ShoppingOrder addLatestOrder(
259                    long userId, long groupId)
260                    throws com.liferay.portal.kernel.exception.PortalException,
261                            com.liferay.portal.kernel.exception.SystemException {
262                    return getService().addLatestOrder(userId, groupId);
263            }
264    
265            public static void completeOrder(java.lang.String number,
266                    java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
267                    double ppPaymentGross, java.lang.String ppReceiverEmail,
268                    java.lang.String ppPayerEmail, boolean updateInventory)
269                    throws com.liferay.portal.kernel.exception.PortalException,
270                            com.liferay.portal.kernel.exception.SystemException {
271                    getService()
272                            .completeOrder(number, ppTxnId, ppPaymentStatus, ppPaymentGross,
273                            ppReceiverEmail, ppPayerEmail, updateInventory);
274            }
275    
276            public static void deleteOrder(long orderId)
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException {
279                    getService().deleteOrder(orderId);
280            }
281    
282            public static void deleteOrder(
283                    com.liferay.portlet.shopping.model.ShoppingOrder order)
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    getService().deleteOrder(order);
287            }
288    
289            public static void deleteOrders(long groupId)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    getService().deleteOrders(groupId);
293            }
294    
295            public static com.liferay.portlet.shopping.model.ShoppingOrder getLatestOrder(
296                    long userId, long groupId)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    return getService().getLatestOrder(userId, groupId);
300            }
301    
302            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
303                    long orderId)
304                    throws com.liferay.portal.kernel.exception.PortalException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    return getService().getOrder(orderId);
307            }
308    
309            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
310                    java.lang.String number)
311                    throws com.liferay.portal.kernel.exception.PortalException,
312                            com.liferay.portal.kernel.exception.SystemException {
313                    return getService().getOrder(number);
314            }
315    
316            public static com.liferay.portlet.shopping.model.ShoppingOrder getPayPalTxnIdOrder(
317                    java.lang.String ppTxnId)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService().getPayPalTxnIdOrder(ppTxnId);
321            }
322    
323            public static com.liferay.portlet.shopping.model.ShoppingOrder saveLatestOrder(
324                    com.liferay.portlet.shopping.model.ShoppingCart cart)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    return getService().saveLatestOrder(cart);
328            }
329    
330            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> search(
331                    long groupId, long companyId, long userId, java.lang.String number,
332                    java.lang.String billingFirstName, java.lang.String billingLastName,
333                    java.lang.String billingEmailAddress,
334                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
335                    java.lang.String shippingEmailAddress,
336                    java.lang.String ppPaymentStatus, boolean andOperator, int start,
337                    int end) throws com.liferay.portal.kernel.exception.SystemException {
338                    return getService()
339                                       .search(groupId, companyId, userId, number,
340                            billingFirstName, billingLastName, billingEmailAddress,
341                            shippingFirstName, shippingLastName, shippingEmailAddress,
342                            ppPaymentStatus, andOperator, start, end);
343            }
344    
345            public static int searchCount(long groupId, long companyId, long userId,
346                    java.lang.String number, java.lang.String billingFirstName,
347                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
348                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
349                    java.lang.String shippingEmailAddress,
350                    java.lang.String ppPaymentStatus, boolean andOperator)
351                    throws com.liferay.portal.kernel.exception.SystemException {
352                    return getService()
353                                       .searchCount(groupId, companyId, userId, number,
354                            billingFirstName, billingLastName, billingEmailAddress,
355                            shippingFirstName, shippingLastName, shippingEmailAddress,
356                            ppPaymentStatus, andOperator);
357            }
358    
359            public static void sendEmail(long orderId, java.lang.String emailType)
360                    throws com.liferay.portal.kernel.exception.PortalException,
361                            com.liferay.portal.kernel.exception.SystemException {
362                    getService().sendEmail(orderId, emailType);
363            }
364    
365            public static void sendEmail(
366                    com.liferay.portlet.shopping.model.ShoppingOrder order,
367                    java.lang.String emailType)
368                    throws com.liferay.portal.kernel.exception.PortalException,
369                            com.liferay.portal.kernel.exception.SystemException {
370                    getService().sendEmail(order, emailType);
371            }
372    
373            public static com.liferay.portlet.shopping.model.ShoppingOrder updateLatestOrder(
374                    long userId, long groupId, java.lang.String billingFirstName,
375                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
376                    java.lang.String billingCompany, java.lang.String billingStreet,
377                    java.lang.String billingCity, java.lang.String billingState,
378                    java.lang.String billingZip, java.lang.String billingCountry,
379                    java.lang.String billingPhone, boolean shipToBilling,
380                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
381                    java.lang.String shippingEmailAddress,
382                    java.lang.String shippingCompany, java.lang.String shippingStreet,
383                    java.lang.String shippingCity, java.lang.String shippingState,
384                    java.lang.String shippingZip, java.lang.String shippingCountry,
385                    java.lang.String shippingPhone, java.lang.String ccName,
386                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
387                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
388                    throws com.liferay.portal.kernel.exception.PortalException,
389                            com.liferay.portal.kernel.exception.SystemException {
390                    return getService()
391                                       .updateLatestOrder(userId, groupId, billingFirstName,
392                            billingLastName, billingEmailAddress, billingCompany,
393                            billingStreet, billingCity, billingState, billingZip,
394                            billingCountry, billingPhone, shipToBilling, shippingFirstName,
395                            shippingLastName, shippingEmailAddress, shippingCompany,
396                            shippingStreet, shippingCity, shippingState, shippingZip,
397                            shippingCountry, shippingPhone, ccName, ccType, ccNumber,
398                            ccExpMonth, ccExpYear, ccVerNumber, comments);
399            }
400    
401            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
402                    long orderId, java.lang.String ppTxnId,
403                    java.lang.String ppPaymentStatus, double ppPaymentGross,
404                    java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail)
405                    throws com.liferay.portal.kernel.exception.PortalException,
406                            com.liferay.portal.kernel.exception.SystemException {
407                    return getService()
408                                       .updateOrder(orderId, ppTxnId, ppPaymentStatus,
409                            ppPaymentGross, ppReceiverEmail, ppPayerEmail);
410            }
411    
412            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
413                    long orderId, java.lang.String billingFirstName,
414                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
415                    java.lang.String billingCompany, java.lang.String billingStreet,
416                    java.lang.String billingCity, java.lang.String billingState,
417                    java.lang.String billingZip, java.lang.String billingCountry,
418                    java.lang.String billingPhone, boolean shipToBilling,
419                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
420                    java.lang.String shippingEmailAddress,
421                    java.lang.String shippingCompany, java.lang.String shippingStreet,
422                    java.lang.String shippingCity, java.lang.String shippingState,
423                    java.lang.String shippingZip, java.lang.String shippingCountry,
424                    java.lang.String shippingPhone, java.lang.String ccName,
425                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
426                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
427                    throws com.liferay.portal.kernel.exception.PortalException,
428                            com.liferay.portal.kernel.exception.SystemException {
429                    return getService()
430                                       .updateOrder(orderId, billingFirstName, billingLastName,
431                            billingEmailAddress, billingCompany, billingStreet, billingCity,
432                            billingState, billingZip, billingCountry, billingPhone,
433                            shipToBilling, shippingFirstName, shippingLastName,
434                            shippingEmailAddress, shippingCompany, shippingStreet,
435                            shippingCity, shippingState, shippingZip, shippingCountry,
436                            shippingPhone, ccName, ccType, ccNumber, ccExpMonth, ccExpYear,
437                            ccVerNumber, comments);
438            }
439    
440            public static ShoppingOrderLocalService getService() {
441                    if (_service == null) {
442                            _service = (ShoppingOrderLocalService)PortalBeanLocatorUtil.locate(ShoppingOrderLocalService.class.getName());
443    
444                            ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
445                                    "_service");
446                            MethodCache.remove(ShoppingOrderLocalService.class);
447                    }
448    
449                    return _service;
450            }
451    
452            public void setService(ShoppingOrderLocalService service) {
453                    MethodCache.remove(ShoppingOrderLocalService.class);
454    
455                    _service = service;
456    
457                    ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
458                            "_service");
459                    MethodCache.remove(ShoppingOrderLocalService.class);
460            }
461    
462            private static ShoppingOrderLocalService _service;
463    }