001    /**
002     * Copyright (c) 2000-2012 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            public static com.liferay.portlet.shopping.model.ShoppingOrder fetchShoppingOrder(
162                    long orderId)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().fetchShoppingOrder(orderId);
165            }
166    
167            /**
168            * Returns the shopping order with the primary key.
169            *
170            * @param orderId the primary key of the shopping order
171            * @return the shopping order
172            * @throws PortalException if a shopping order with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.shopping.model.ShoppingOrder getShoppingOrder(
176                    long orderId)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getShoppingOrder(orderId);
180            }
181    
182            public static com.liferay.portal.model.PersistedModel getPersistedModel(
183                    java.io.Serializable primaryKeyObj)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getPersistedModel(primaryKeyObj);
187            }
188    
189            /**
190            * Returns a range of all the shopping orders.
191            *
192            * <p>
193            * 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.
194            * </p>
195            *
196            * @param start the lower bound of the range of shopping orders
197            * @param end the upper bound of the range of shopping orders (not inclusive)
198            * @return the range of shopping orders
199            * @throws SystemException if a system exception occurred
200            */
201            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> getShoppingOrders(
202                    int start, int end)
203                    throws com.liferay.portal.kernel.exception.SystemException {
204                    return getService().getShoppingOrders(start, end);
205            }
206    
207            /**
208            * Returns the number of shopping orders.
209            *
210            * @return the number of shopping orders
211            * @throws SystemException if a system exception occurred
212            */
213            public static int getShoppingOrdersCount()
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return getService().getShoppingOrdersCount();
216            }
217    
218            /**
219            * Updates the shopping order in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
220            *
221            * @param shoppingOrder the shopping order
222            * @return the shopping order that was updated
223            * @throws SystemException if a system exception occurred
224            */
225            public static com.liferay.portlet.shopping.model.ShoppingOrder updateShoppingOrder(
226                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getService().updateShoppingOrder(shoppingOrder);
229            }
230    
231            /**
232            * Updates the shopping order in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
233            *
234            * @param shoppingOrder the shopping order
235            * @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.
236            * @return the shopping order that was updated
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portlet.shopping.model.ShoppingOrder updateShoppingOrder(
240                    com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder,
241                    boolean merge)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().updateShoppingOrder(shoppingOrder, merge);
244            }
245    
246            /**
247            * Returns the Spring bean ID for this bean.
248            *
249            * @return the Spring bean ID for this bean
250            */
251            public static java.lang.String getBeanIdentifier() {
252                    return getService().getBeanIdentifier();
253            }
254    
255            /**
256            * Sets the Spring bean ID for this bean.
257            *
258            * @param beanIdentifier the Spring bean ID for this bean
259            */
260            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
261                    getService().setBeanIdentifier(beanIdentifier);
262            }
263    
264            public static com.liferay.portlet.shopping.model.ShoppingOrder addLatestOrder(
265                    long userId, long groupId)
266                    throws com.liferay.portal.kernel.exception.PortalException,
267                            com.liferay.portal.kernel.exception.SystemException {
268                    return getService().addLatestOrder(userId, groupId);
269            }
270    
271            public static void completeOrder(java.lang.String number,
272                    java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
273                    double ppPaymentGross, java.lang.String ppReceiverEmail,
274                    java.lang.String ppPayerEmail, boolean updateInventory,
275                    com.liferay.portal.service.ServiceContext serviceContext)
276                    throws com.liferay.portal.kernel.exception.PortalException,
277                            com.liferay.portal.kernel.exception.SystemException {
278                    getService()
279                            .completeOrder(number, ppTxnId, ppPaymentStatus, ppPaymentGross,
280                            ppReceiverEmail, ppPayerEmail, updateInventory, serviceContext);
281            }
282    
283            public static void deleteOrder(long orderId)
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    getService().deleteOrder(orderId);
287            }
288    
289            public static void deleteOrder(
290                    com.liferay.portlet.shopping.model.ShoppingOrder order)
291                    throws com.liferay.portal.kernel.exception.PortalException,
292                            com.liferay.portal.kernel.exception.SystemException {
293                    getService().deleteOrder(order);
294            }
295    
296            public static void deleteOrders(long groupId)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    getService().deleteOrders(groupId);
300            }
301    
302            public static com.liferay.portlet.shopping.model.ShoppingOrder getLatestOrder(
303                    long userId, long groupId)
304                    throws com.liferay.portal.kernel.exception.PortalException,
305                            com.liferay.portal.kernel.exception.SystemException {
306                    return getService().getLatestOrder(userId, groupId);
307            }
308    
309            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
310                    long orderId)
311                    throws com.liferay.portal.kernel.exception.PortalException,
312                            com.liferay.portal.kernel.exception.SystemException {
313                    return getService().getOrder(orderId);
314            }
315    
316            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
317                    java.lang.String number)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService().getOrder(number);
321            }
322    
323            public static com.liferay.portlet.shopping.model.ShoppingOrder getPayPalTxnIdOrder(
324                    java.lang.String ppTxnId)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    return getService().getPayPalTxnIdOrder(ppTxnId);
328            }
329    
330            public static com.liferay.portlet.shopping.model.ShoppingOrder saveLatestOrder(
331                    com.liferay.portlet.shopping.model.ShoppingCart cart)
332                    throws com.liferay.portal.kernel.exception.PortalException,
333                            com.liferay.portal.kernel.exception.SystemException {
334                    return getService().saveLatestOrder(cart);
335            }
336    
337            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> search(
338                    long groupId, long companyId, long userId, java.lang.String number,
339                    java.lang.String billingFirstName, java.lang.String billingLastName,
340                    java.lang.String billingEmailAddress,
341                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
342                    java.lang.String shippingEmailAddress,
343                    java.lang.String ppPaymentStatus, boolean andOperator, int start,
344                    int end) throws com.liferay.portal.kernel.exception.SystemException {
345                    return getService()
346                                       .search(groupId, companyId, userId, number,
347                            billingFirstName, billingLastName, billingEmailAddress,
348                            shippingFirstName, shippingLastName, shippingEmailAddress,
349                            ppPaymentStatus, andOperator, start, end);
350            }
351    
352            public static int searchCount(long groupId, long companyId, long userId,
353                    java.lang.String number, java.lang.String billingFirstName,
354                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
355                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
356                    java.lang.String shippingEmailAddress,
357                    java.lang.String ppPaymentStatus, boolean andOperator)
358                    throws com.liferay.portal.kernel.exception.SystemException {
359                    return getService()
360                                       .searchCount(groupId, companyId, userId, number,
361                            billingFirstName, billingLastName, billingEmailAddress,
362                            shippingFirstName, shippingLastName, shippingEmailAddress,
363                            ppPaymentStatus, andOperator);
364            }
365    
366            public static void sendEmail(long orderId, java.lang.String emailType,
367                    com.liferay.portal.service.ServiceContext serviceContext)
368                    throws com.liferay.portal.kernel.exception.PortalException,
369                            com.liferay.portal.kernel.exception.SystemException {
370                    getService().sendEmail(orderId, emailType, serviceContext);
371            }
372    
373            public static void sendEmail(
374                    com.liferay.portlet.shopping.model.ShoppingOrder order,
375                    java.lang.String emailType,
376                    com.liferay.portal.service.ServiceContext serviceContext)
377                    throws com.liferay.portal.kernel.exception.PortalException,
378                            com.liferay.portal.kernel.exception.SystemException {
379                    getService().sendEmail(order, emailType, serviceContext);
380            }
381    
382            public static com.liferay.portlet.shopping.model.ShoppingOrder updateLatestOrder(
383                    long userId, long groupId, java.lang.String billingFirstName,
384                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
385                    java.lang.String billingCompany, java.lang.String billingStreet,
386                    java.lang.String billingCity, java.lang.String billingState,
387                    java.lang.String billingZip, java.lang.String billingCountry,
388                    java.lang.String billingPhone, boolean shipToBilling,
389                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
390                    java.lang.String shippingEmailAddress,
391                    java.lang.String shippingCompany, java.lang.String shippingStreet,
392                    java.lang.String shippingCity, java.lang.String shippingState,
393                    java.lang.String shippingZip, java.lang.String shippingCountry,
394                    java.lang.String shippingPhone, java.lang.String ccName,
395                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
396                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
397                    throws com.liferay.portal.kernel.exception.PortalException,
398                            com.liferay.portal.kernel.exception.SystemException {
399                    return getService()
400                                       .updateLatestOrder(userId, groupId, billingFirstName,
401                            billingLastName, billingEmailAddress, billingCompany,
402                            billingStreet, billingCity, billingState, billingZip,
403                            billingCountry, billingPhone, shipToBilling, shippingFirstName,
404                            shippingLastName, shippingEmailAddress, shippingCompany,
405                            shippingStreet, shippingCity, shippingState, shippingZip,
406                            shippingCountry, shippingPhone, ccName, ccType, ccNumber,
407                            ccExpMonth, ccExpYear, ccVerNumber, comments);
408            }
409    
410            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
411                    long orderId, java.lang.String ppTxnId,
412                    java.lang.String ppPaymentStatus, double ppPaymentGross,
413                    java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail)
414                    throws com.liferay.portal.kernel.exception.PortalException,
415                            com.liferay.portal.kernel.exception.SystemException {
416                    return getService()
417                                       .updateOrder(orderId, ppTxnId, ppPaymentStatus,
418                            ppPaymentGross, ppReceiverEmail, ppPayerEmail);
419            }
420    
421            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
422                    long orderId, java.lang.String billingFirstName,
423                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
424                    java.lang.String billingCompany, java.lang.String billingStreet,
425                    java.lang.String billingCity, java.lang.String billingState,
426                    java.lang.String billingZip, java.lang.String billingCountry,
427                    java.lang.String billingPhone, boolean shipToBilling,
428                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
429                    java.lang.String shippingEmailAddress,
430                    java.lang.String shippingCompany, java.lang.String shippingStreet,
431                    java.lang.String shippingCity, java.lang.String shippingState,
432                    java.lang.String shippingZip, java.lang.String shippingCountry,
433                    java.lang.String shippingPhone, java.lang.String ccName,
434                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
435                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
436                    throws com.liferay.portal.kernel.exception.PortalException,
437                            com.liferay.portal.kernel.exception.SystemException {
438                    return getService()
439                                       .updateOrder(orderId, billingFirstName, billingLastName,
440                            billingEmailAddress, billingCompany, billingStreet, billingCity,
441                            billingState, billingZip, billingCountry, billingPhone,
442                            shipToBilling, shippingFirstName, shippingLastName,
443                            shippingEmailAddress, shippingCompany, shippingStreet,
444                            shippingCity, shippingState, shippingZip, shippingCountry,
445                            shippingPhone, ccName, ccType, ccNumber, ccExpMonth, ccExpYear,
446                            ccVerNumber, comments);
447            }
448    
449            public static ShoppingOrderLocalService getService() {
450                    if (_service == null) {
451                            _service = (ShoppingOrderLocalService)PortalBeanLocatorUtil.locate(ShoppingOrderLocalService.class.getName());
452    
453                            ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
454                                    "_service");
455                            MethodCache.remove(ShoppingOrderLocalService.class);
456                    }
457    
458                    return _service;
459            }
460    
461            public void setService(ShoppingOrderLocalService service) {
462                    MethodCache.remove(ShoppingOrderLocalService.class);
463    
464                    _service = service;
465    
466                    ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
467                            "_service");
468                    MethodCache.remove(ShoppingOrderLocalService.class);
469            }
470    
471            private static ShoppingOrderLocalService _service;
472    }