001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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                    throws com.liferay.portal.kernel.exception.PortalException,
276                            com.liferay.portal.kernel.exception.SystemException {
277                    getService()
278                            .completeOrder(number, ppTxnId, ppPaymentStatus, ppPaymentGross,
279                            ppReceiverEmail, ppPayerEmail, updateInventory);
280            }
281    
282            public static void deleteOrder(long orderId)
283                    throws com.liferay.portal.kernel.exception.PortalException,
284                            com.liferay.portal.kernel.exception.SystemException {
285                    getService().deleteOrder(orderId);
286            }
287    
288            public static void deleteOrder(
289                    com.liferay.portlet.shopping.model.ShoppingOrder order)
290                    throws com.liferay.portal.kernel.exception.PortalException,
291                            com.liferay.portal.kernel.exception.SystemException {
292                    getService().deleteOrder(order);
293            }
294    
295            public static void deleteOrders(long groupId)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    getService().deleteOrders(groupId);
299            }
300    
301            public static com.liferay.portlet.shopping.model.ShoppingOrder getLatestOrder(
302                    long userId, long groupId)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    return getService().getLatestOrder(userId, groupId);
306            }
307    
308            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
309                    long orderId)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    return getService().getOrder(orderId);
313            }
314    
315            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
316                    java.lang.String number)
317                    throws com.liferay.portal.kernel.exception.PortalException,
318                            com.liferay.portal.kernel.exception.SystemException {
319                    return getService().getOrder(number);
320            }
321    
322            public static com.liferay.portlet.shopping.model.ShoppingOrder getPayPalTxnIdOrder(
323                    java.lang.String ppTxnId)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException {
326                    return getService().getPayPalTxnIdOrder(ppTxnId);
327            }
328    
329            public static com.liferay.portlet.shopping.model.ShoppingOrder saveLatestOrder(
330                    com.liferay.portlet.shopping.model.ShoppingCart cart)
331                    throws com.liferay.portal.kernel.exception.PortalException,
332                            com.liferay.portal.kernel.exception.SystemException {
333                    return getService().saveLatestOrder(cart);
334            }
335    
336            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> search(
337                    long groupId, long companyId, long userId, java.lang.String number,
338                    java.lang.String billingFirstName, java.lang.String billingLastName,
339                    java.lang.String billingEmailAddress,
340                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
341                    java.lang.String shippingEmailAddress,
342                    java.lang.String ppPaymentStatus, boolean andOperator, int start,
343                    int end) throws com.liferay.portal.kernel.exception.SystemException {
344                    return getService()
345                                       .search(groupId, companyId, userId, number,
346                            billingFirstName, billingLastName, billingEmailAddress,
347                            shippingFirstName, shippingLastName, shippingEmailAddress,
348                            ppPaymentStatus, andOperator, start, end);
349            }
350    
351            public static int searchCount(long groupId, long companyId, long userId,
352                    java.lang.String number, java.lang.String billingFirstName,
353                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
354                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
355                    java.lang.String shippingEmailAddress,
356                    java.lang.String ppPaymentStatus, boolean andOperator)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getService()
359                                       .searchCount(groupId, companyId, userId, number,
360                            billingFirstName, billingLastName, billingEmailAddress,
361                            shippingFirstName, shippingLastName, shippingEmailAddress,
362                            ppPaymentStatus, andOperator);
363            }
364    
365            public static void sendEmail(long orderId, java.lang.String emailType)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    getService().sendEmail(orderId, emailType);
369            }
370    
371            public static void sendEmail(
372                    com.liferay.portlet.shopping.model.ShoppingOrder order,
373                    java.lang.String emailType)
374                    throws com.liferay.portal.kernel.exception.PortalException,
375                            com.liferay.portal.kernel.exception.SystemException {
376                    getService().sendEmail(order, emailType);
377            }
378    
379            public static com.liferay.portlet.shopping.model.ShoppingOrder updateLatestOrder(
380                    long userId, long groupId, java.lang.String billingFirstName,
381                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
382                    java.lang.String billingCompany, java.lang.String billingStreet,
383                    java.lang.String billingCity, java.lang.String billingState,
384                    java.lang.String billingZip, java.lang.String billingCountry,
385                    java.lang.String billingPhone, boolean shipToBilling,
386                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
387                    java.lang.String shippingEmailAddress,
388                    java.lang.String shippingCompany, java.lang.String shippingStreet,
389                    java.lang.String shippingCity, java.lang.String shippingState,
390                    java.lang.String shippingZip, java.lang.String shippingCountry,
391                    java.lang.String shippingPhone, java.lang.String ccName,
392                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
393                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
394                    throws com.liferay.portal.kernel.exception.PortalException,
395                            com.liferay.portal.kernel.exception.SystemException {
396                    return getService()
397                                       .updateLatestOrder(userId, groupId, billingFirstName,
398                            billingLastName, billingEmailAddress, billingCompany,
399                            billingStreet, billingCity, billingState, billingZip,
400                            billingCountry, billingPhone, shipToBilling, shippingFirstName,
401                            shippingLastName, shippingEmailAddress, shippingCompany,
402                            shippingStreet, shippingCity, shippingState, shippingZip,
403                            shippingCountry, shippingPhone, ccName, ccType, ccNumber,
404                            ccExpMonth, ccExpYear, ccVerNumber, comments);
405            }
406    
407            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
408                    long orderId, java.lang.String ppTxnId,
409                    java.lang.String ppPaymentStatus, double ppPaymentGross,
410                    java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail)
411                    throws com.liferay.portal.kernel.exception.PortalException,
412                            com.liferay.portal.kernel.exception.SystemException {
413                    return getService()
414                                       .updateOrder(orderId, ppTxnId, ppPaymentStatus,
415                            ppPaymentGross, ppReceiverEmail, ppPayerEmail);
416            }
417    
418            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
419                    long orderId, java.lang.String billingFirstName,
420                    java.lang.String billingLastName, java.lang.String billingEmailAddress,
421                    java.lang.String billingCompany, java.lang.String billingStreet,
422                    java.lang.String billingCity, java.lang.String billingState,
423                    java.lang.String billingZip, java.lang.String billingCountry,
424                    java.lang.String billingPhone, boolean shipToBilling,
425                    java.lang.String shippingFirstName, java.lang.String shippingLastName,
426                    java.lang.String shippingEmailAddress,
427                    java.lang.String shippingCompany, java.lang.String shippingStreet,
428                    java.lang.String shippingCity, java.lang.String shippingState,
429                    java.lang.String shippingZip, java.lang.String shippingCountry,
430                    java.lang.String shippingPhone, java.lang.String ccName,
431                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
432                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
433                    throws com.liferay.portal.kernel.exception.PortalException,
434                            com.liferay.portal.kernel.exception.SystemException {
435                    return getService()
436                                       .updateOrder(orderId, billingFirstName, billingLastName,
437                            billingEmailAddress, billingCompany, billingStreet, billingCity,
438                            billingState, billingZip, billingCountry, billingPhone,
439                            shipToBilling, shippingFirstName, shippingLastName,
440                            shippingEmailAddress, shippingCompany, shippingStreet,
441                            shippingCity, shippingState, shippingZip, shippingCountry,
442                            shippingPhone, ccName, ccType, ccNumber, ccExpMonth, ccExpYear,
443                            ccVerNumber, comments);
444            }
445    
446            public static ShoppingOrderLocalService getService() {
447                    if (_service == null) {
448                            _service = (ShoppingOrderLocalService)PortalBeanLocatorUtil.locate(ShoppingOrderLocalService.class.getName());
449    
450                            ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
451                                    "_service");
452                            MethodCache.remove(ShoppingOrderLocalService.class);
453                    }
454    
455                    return _service;
456            }
457    
458            public void setService(ShoppingOrderLocalService service) {
459                    MethodCache.remove(ShoppingOrderLocalService.class);
460    
461                    _service = service;
462    
463                    ReferenceRegistry.registerReference(ShoppingOrderLocalServiceUtil.class,
464                            "_service");
465                    MethodCache.remove(ShoppingOrderLocalService.class);
466            }
467    
468            private static ShoppingOrderLocalService _service;
469    }