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.dynamicdatalists.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 d d l record remote service. This utility wraps {@link com.liferay.portlet.dynamicdatalists.service.impl.DDLRecordServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see DDLRecordService
030     * @see com.liferay.portlet.dynamicdatalists.service.base.DDLRecordServiceBaseImpl
031     * @see com.liferay.portlet.dynamicdatalists.service.impl.DDLRecordServiceImpl
032     * @generated
033     */
034    public class DDLRecordServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.dynamicdatalists.service.impl.DDLRecordServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
041                    long groupId, long recordSetId, int displayIndex,
042                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
043                    com.liferay.portal.service.ServiceContext serviceContext)
044                    throws com.liferay.portal.kernel.exception.PortalException,
045                            com.liferay.portal.kernel.exception.SystemException {
046                    return getService()
047                                       .addRecord(groupId, recordSetId, displayIndex, fields,
048                            serviceContext);
049            }
050    
051            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord addRecord(
052                    long groupId, long recordSetId, int displayIndex,
053                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
054                    com.liferay.portal.service.ServiceContext serviceContext)
055                    throws com.liferay.portal.kernel.exception.PortalException,
056                            com.liferay.portal.kernel.exception.SystemException {
057                    return getService()
058                                       .addRecord(groupId, recordSetId, displayIndex, fieldsMap,
059                            serviceContext);
060            }
061    
062            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord getRecord(
063                    long recordId)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    return getService().getRecord(recordId);
067            }
068    
069            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
070                    long recordId, boolean majorVersion, int displayIndex,
071                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
072                    boolean mergeFields,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException {
076                    return getService()
077                                       .updateRecord(recordId, majorVersion, displayIndex, fields,
078                            mergeFields, serviceContext);
079            }
080    
081            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
082                    long recordId, int displayIndex,
083                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
084                    boolean mergeFields,
085                    com.liferay.portal.service.ServiceContext serviceContext)
086                    throws com.liferay.portal.kernel.exception.PortalException,
087                            com.liferay.portal.kernel.exception.SystemException {
088                    return getService()
089                                       .updateRecord(recordId, displayIndex, fieldsMap,
090                            mergeFields, serviceContext);
091            }
092    
093            public static DDLRecordService getService() {
094                    if (_service == null) {
095                            _service = (DDLRecordService)PortalBeanLocatorUtil.locate(DDLRecordService.class.getName());
096    
097                            ReferenceRegistry.registerReference(DDLRecordServiceUtil.class,
098                                    "_service");
099                            MethodCache.remove(DDLRecordService.class);
100                    }
101    
102                    return _service;
103            }
104    
105            public void setService(DDLRecordService service) {
106                    MethodCache.remove(DDLRecordService.class);
107    
108                    _service = service;
109    
110                    ReferenceRegistry.registerReference(DDLRecordServiceUtil.class,
111                            "_service");
112                    MethodCache.remove(DDLRecordService.class);
113            }
114    
115            private static DDLRecordService _service;
116    }