001    /**
002     * Copyright (c) 2000-2013 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.portal.kernel.lar;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.xml.Element;
020    import com.liferay.portal.model.StagedModel;
021    
022    import java.util.Map;
023    
024    /**
025     * @author Mate Thurzo
026     * @author Daniel Kocsis
027     * @author Zsolt Berentey
028     */
029    public interface StagedModelDataHandler<T extends StagedModel> {
030    
031            public void deleteStagedModel(
032                            String uuid, long groupId, String className, String extraData)
033                    throws PortalException, SystemException;
034    
035            public void exportStagedModel(
036                            PortletDataContext portletDataContext, T stagedModel)
037                    throws PortletDataException;
038    
039            public String[] getClassNames();
040    
041            public String getDisplayName(T StagedModel);
042    
043            public int[] getExportableStatuses();
044    
045            public Map<String, String> getReferenceAttributes(
046                    PortletDataContext portletDataContext, T stagedModel);
047    
048            public void importCompanyStagedModel(
049                            PortletDataContext portletDataContext, Element element)
050                    throws PortletDataException;
051    
052            public void importCompanyStagedModel(
053                            PortletDataContext portletDataContext, String uuid, long classPK)
054                    throws PortletDataException;
055    
056            public void importStagedModel(
057                            PortletDataContext portletDataContext, T stagedModel)
058                    throws PortletDataException;
059    
060            public void restoreStagedModel(
061                            PortletDataContext portletDataContext, T stagedModel)
062                    throws PortletDataException;
063    
064            public boolean validateReference(
065                    PortletDataContext portletDataContext, Element referenceElement);
066    
067    }