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.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 updateRecord(
063                    long recordId, boolean majorVersion, int displayIndex,
064                    com.liferay.portlet.dynamicdatamapping.storage.Fields fields,
065                    boolean mergeFields,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    return getService()
070                                       .updateRecord(recordId, majorVersion, displayIndex, fields,
071                            mergeFields, serviceContext);
072            }
073    
074            public static com.liferay.portlet.dynamicdatalists.model.DDLRecord updateRecord(
075                    long recordId, int displayIndex,
076                    java.util.Map<java.lang.String, java.io.Serializable> fieldsMap,
077                    boolean mergeFields,
078                    com.liferay.portal.service.ServiceContext serviceContext)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException {
081                    return getService()
082                                       .updateRecord(recordId, displayIndex, fieldsMap,
083                            mergeFields, serviceContext);
084            }
085    
086            public static DDLRecordService getService() {
087                    if (_service == null) {
088                            _service = (DDLRecordService)PortalBeanLocatorUtil.locate(DDLRecordService.class.getName());
089    
090                            ReferenceRegistry.registerReference(DDLRecordServiceUtil.class,
091                                    "_service");
092                            MethodCache.remove(DDLRecordService.class);
093                    }
094    
095                    return _service;
096            }
097    
098            public void setService(DDLRecordService service) {
099                    MethodCache.remove(DDLRecordService.class);
100    
101                    _service = service;
102    
103                    ReferenceRegistry.registerReference(DDLRecordServiceUtil.class,
104                            "_service");
105                    MethodCache.remove(DDLRecordService.class);
106            }
107    
108            private static DDLRecordService _service;
109    }