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