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