001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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    }