001    /**
002     * Copyright (c) 2000-present 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;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.util.ProxyFactory;
019    import com.liferay.portal.service.ServiceContext;
020    
021    /**
022     * @author Rafael Praxedes
023     */
024    public class StorageEngineManagerUtil {
025    
026            public static long create(
027                            long companyId, long ddmStructureId, DDMFormValues ddmFormValues,
028                            ServiceContext serviceContext)
029                    throws PortalException {
030    
031                    return _storageEngineManager.create(
032                            companyId, ddmStructureId, ddmFormValues, serviceContext);
033            }
034    
035            public static void deleteByClass(long classPK) throws PortalException {
036                    _storageEngineManager.deleteByClass(classPK);
037            }
038    
039            public static DDMFormValues getDDMFormValues(long classPK)
040                    throws PortalException {
041    
042                    return _storageEngineManager.getDDMFormValues(classPK);
043            }
044    
045            public static DDMFormValues getDDMFormValues(
046                            long ddmStructureId, String fieldNamespace,
047                            ServiceContext serviceContext)
048                    throws PortalException {
049    
050                    return _storageEngineManager.getDDMFormValues(
051                            ddmStructureId, fieldNamespace, serviceContext);
052            }
053    
054            public static void update(
055                            long classPK, DDMFormValues ddmFormValues,
056                            ServiceContext serviceContext)
057                    throws PortalException {
058    
059                    _storageEngineManager.update(classPK, ddmFormValues, serviceContext);
060            }
061    
062            private static final StorageEngineManager _storageEngineManager =
063                    ProxyFactory.newServiceTrackedInstance(StorageEngineManager.class);
064    
065    }