001/* 002 * Copyright 2019 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.plugins.webcontentio.archive; 017 018import java.io.IOException; 019import java.nio.file.Path; 020import java.util.zip.ZipOutputStream; 021 022import javax.jcr.Node; 023 024import org.ametys.plugins.contentio.archive.ContentsArchiverHelper; 025import org.ametys.plugins.contentio.archive.DefaultPluginArchiver; 026import org.ametys.plugins.contentio.archive.ImportReport; 027import org.ametys.plugins.contentio.archive.Merger; 028import org.ametys.web.repository.site.Site; 029 030/** 031 * Default implementation of a {@link SitePluginArchiver}. It uses the JCR system view for all data but contents. 032 * For contents, the {@link ContentsArchiverHelper} is used. 033 */ 034public class DefaultSitePluginArchiver extends DefaultPluginArchiver implements SitePluginArchiver 035{ 036 @Override 037 public void export(Site site, String pluginName, Node pluginNode, ZipOutputStream zos, String prefix) throws IOException 038 { 039 export(pluginName, pluginNode, zos, prefix); 040 } 041 042 @Override 043 public ImportReport partialImport(Site site, String pluginName, Node allPluginsNode, Path zipPath, String zipEntryPath, Merger merger) throws IOException 044 { 045 return partialImport(pluginName, allPluginsNode, zipPath, zipEntryPath, merger); 046 } 047}