--- LibresourceSubversionServiceBean.java-org 2008-04-14 16:09:40.000000000 +0200 +++ LibresourceSubversionServiceBean.java-xml 2008-04-14 16:32:37.000000000 +0200 @@ -1,14 +1,10 @@ /** * LibreSource - * Copyright (C) 2004-2008 Artenum SARL / INRIA - * http://www.libresource.org - contact@artenum.com + * Copyright (C) 2004-2007 Artenum SARL / INRIA + * http://www.libresource.org - contact@libresource.org * - * This file is part of the LibreSource software, - * which can be used and distributed under license conditions. - * The license conditions are provided in the LICENSE.TXT file - * at the root path of the packaging that enclose this file. - * More information can be found at - * - http://dev.libresource.org/home/license + * This software is free software; you can redistribute it and/or + * modify it under the terms of QPL. See licenses details in QPL.txt * * Initial authors : * @@ -59,6 +55,9 @@ import org.libresource.xml.LibresourceExportHandler; import org.libresource.xml.LibresourceImportHandler; +import org.libresource.subversion.SubversionExportHandler; +import org.libresource.subversion.SubversionImportHandler; + import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; @@ -347,7 +346,23 @@ */ public LibresourceExportHandler getXmlExportHandlerForResource(URI uri) throws LibresourceException { - return super.getXmlExportHandlerForResource(uri); + try { + KernelService kernelService = (KernelService) Libresource.getService(KernelConstants.SERVICE); + LibresourceResourceIdentifier resourceIdentifier = kernelService.lookup(uri); + + try { + Libresource.checkType(resourceIdentifier, + SubversionRepositoryResourceLocal.class); + + return new SubversionExportHandler(uri); + } catch (Exception e) { + // + } + + return super.getXmlExportHandlerForResource(uri); + } catch (Exception e) { + throw new LibresourceException("Can't obtain exportHandler for uri " + uri, e); + } } /** @@ -356,7 +371,10 @@ */ public LibresourceImportHandler getXmlImportHandler(String type) throws LibresourceException { - return super.getXmlImportHandler(type); + if (type.equals(SubversionConstants.RESOURCE)) { + return new SubversionImportHandler(); + } + return super.getXmlImportHandler(type); } /**