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.dynamicdatamapping.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 m structure remote service. This utility wraps {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl} 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 DDMStructureService
030     * @see com.liferay.portlet.dynamicdatamapping.service.base.DDMStructureServiceBaseImpl
031     * @see com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl
032     * @generated
033     */
034    public class DDMStructureServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.dynamicdatamapping.service.impl.DDMStructureServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure addStructure(
041                    long groupId, long classNameId, java.lang.String structureKey,
042                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
043                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
044                    java.lang.String xsd, java.lang.String storageType,
045                    com.liferay.portal.service.ServiceContext serviceContext)
046                    throws com.liferay.portal.kernel.exception.PortalException,
047                            com.liferay.portal.kernel.exception.SystemException {
048                    return getService()
049                                       .addStructure(groupId, classNameId, structureKey, nameMap,
050                            descriptionMap, xsd, storageType, serviceContext);
051            }
052    
053            public static void deleteStructure(long structureId)
054                    throws com.liferay.portal.kernel.exception.PortalException,
055                            com.liferay.portal.kernel.exception.SystemException {
056                    getService().deleteStructure(structureId);
057            }
058    
059            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure fetchStructure(
060                    long groupId, java.lang.String structureKey)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    return getService().fetchStructure(groupId, structureKey);
064            }
065    
066            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure(
067                    long structureId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    return getService().getStructure(structureId);
071            }
072    
073            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
074                    long structureId,
075                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
076                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
077                    java.lang.String xsd,
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                                       .updateStructure(structureId, nameMap, descriptionMap, xsd,
083                            serviceContext);
084            }
085    
086            public static com.liferay.portlet.dynamicdatamapping.model.DDMStructure updateStructure(
087                    long groupId, java.lang.String structureKey,
088                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
089                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
090                    java.lang.String xsd,
091                    com.liferay.portal.service.ServiceContext serviceContext)
092                    throws com.liferay.portal.kernel.exception.PortalException,
093                            com.liferay.portal.kernel.exception.SystemException {
094                    return getService()
095                                       .updateStructure(groupId, structureKey, nameMap,
096                            descriptionMap, xsd, serviceContext);
097            }
098    
099            public static DDMStructureService getService() {
100                    if (_service == null) {
101                            _service = (DDMStructureService)PortalBeanLocatorUtil.locate(DDMStructureService.class.getName());
102    
103                            ReferenceRegistry.registerReference(DDMStructureServiceUtil.class,
104                                    "_service");
105                            MethodCache.remove(DDMStructureService.class);
106                    }
107    
108                    return _service;
109            }
110    
111            public void setService(DDMStructureService service) {
112                    MethodCache.remove(DDMStructureService.class);
113    
114                    _service = service;
115    
116                    ReferenceRegistry.registerReference(DDMStructureServiceUtil.class,
117                            "_service");
118                    MethodCache.remove(DDMStructureService.class);
119            }
120    
121            private static DDMStructureService _service;
122    }