Kaydet (Commit) 5acbb755 authored tarafından dkenny's avatar dkenny

Initial Import

üst
<?xml version="1.0" encoding="UTF-8"?>
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<project name="xmerge" default="main" basedir=".">
<!-- ================================================================= -->
<!-- settings -->
<!-- ================================================================= -->
<!-- project prefix, used to generate build.lst -->
<property name="prj.prefix" value="xmrg"/>
<!-- name of this sub target used in recursive builds -->
<property name="target" value="xmerge"/>
<!-- ================================================================= -->
<!-- solar build environment targets -->
<!-- ================================================================= -->
<!-- used by init to set build directory -->
<target name="build_dir" unless="build.dir">
<property name="build.dir" value="${basedir}/${inpath}"/>
</target>
<target name="build_class" depends="build_dir">
<property name="build.class" value="${build.dir}/class"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.class}"/>
<copy file="util/solar.properties" todir="${build.class}"/>
</target>
<!-- used by init to set up 'solar' build environment -->
<target name="solar" depends="build_dir,build_class" if="solar.update">
<property name="solar.properties"
value="${solar.bin}/solar.properties"/>
<property name="build.dir" value="${basedir}/${out}"/>
</target>
<!-- initialize build environment -->
<target name="init" depends="solar">
<property name="build.compiler" value="classic"/>
<property file="${build.dir}/class/solar.properties"/>
<property file="${solar.properties}"/>
</target>
<!-- show information about current sub target in recursive builds -->
<target name="info">
<echo message="----------------------------------------"/>
<echo message="${target}"/>
<echo message="----------------------------------------"/>
</target>
<!-- ================================================================= -->
<!--- custom targets -->
<!-- ================================================================= -->
<!-- names for targets build by release engineering -->
<!-- must start with project prefix and an underscore -->
<!-- the main target, called in recursive builds -->
<target name="main" depends="info,prepare,xmrg_util,xmrg_javadoc"/>
<!-- prepare output directories -->
<target name="prepare" depends="init"/>
<!-- java package -->
<target name="xmrg_joo_xmerge" depends="prepare">
<ant dir="java/org/openoffice/xmerge" target="main">
<property name="target" value="xmrg_joo_xmerge"/>
<property name="prj" value="../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxc_xml" depends="prepare">
<ant dir="java/org/openoffice/xmerge/converter/xml" target="main">
<property name="target" value="xmrg_jooxc_xml"/>
<property name="prj" value="../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxcx_sxc" depends="prepare">
<ant dir="java/org/openoffice/xmerge/converter/xml/sxc" target="main">
<property name="target" value="xmrg_jooxcx_sxc"/>
<property name="prj" value="../../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxcx_sxw" depends="prepare">
<ant dir="java/org/openoffice/xmerge/converter/xml/sxw" target="main">
<property name="target" value="xmrg_jooxcx_sxw"/>
<property name="prj" value="../../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxcx_xslt" depends="prepare">
<ant dir="java/org/openoffice/xmerge/converter/xml/xslt" target="main">
<property name="target" value="xmrg_jooxcx_xslt"/>
<property name="prj" value="../../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_joox_merger" depends="prepare">
<ant dir="java/org/openoffice/xmerge/merger" target="main">
<property name="target" value="xmrg_joox_merger"/>
<property name="prj" value="../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxm_diff" depends="prepare">
<ant dir="java/org/openoffice/xmerge/merger/diff" target="main">
<property name="target" value="xmrg_jooxm_diff"/>
<property name="prj" value="../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxm_merge" depends="prepare">
<ant dir="java/org/openoffice/xmerge/merger/merge" target="main">
<property name="target" value="xmrg_jooxm_merge"/>
<property name="prj" value="../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_joox_test" depends="prepare,xmrg_joox_util,xmrg_joo_xmerge">
<ant dir="java/org/openoffice/xmerge/test" target="main">
<property name="target" value="xmrg_joox_test"/>
<property name="prj" value="../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_joox_util" depends="prepare">
<ant dir="java/org/openoffice/xmerge/util" target="main">
<property name="target" value="xmrg_joox_util"/>
<property name="prj" value="../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxu_registry" depends="prepare">
<ant dir="java/org/openoffice/xmerge/util/registry" target="main">
<property name="target" value="xmrg_jooxu_registry"/>
<property name="prj" value="../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_jooxc_dom" depends="prepare">
<ant dir="java/org/openoffice/xmerge/converter/dom" target="main">
<property name="target" value="xmrg_jooxc_dom"/>
<property name="prj" value="../../../../../.."/>
</ant>
</target>
<!-- java package -->
<target name="xmrg_javadoc" depends="prepare">
<ant dir="java" target="main">
<property name="target" value="javadoc"/>
<property name="prj" value=".."/>
</ant>
</target>
<!-- util -->
<target name="xmrg_util" depends="prepare,xmrg_joo_xmerge,xmrg_jooxc_xml,xmrg_jooxcx_sxc,xmrg_jooxcx_sxw,xmrg_jooxcx_xslt,xmrg_joox_merger,xmrg_jooxm_diff,xmrg_jooxm_merge,xmrg_joox_test,xmrg_joox_util,xmrg_jooxu_registry,xmrg_jooxc_dom,xmrg_javadoc">
<ant dir="util" target="main">
<property name="target" value="xmrg_util"/>
<property name="prj" value="."/>
</ant>
</target>
<!-- clean up -->
<target name="clean" depends="prepare">
<delete includeEmptyDirs="true">
<fileset dir="${build.dir}">
<patternset>
<include name="**"/>
</patternset>
</fileset>
</delete>
</target>
<!-- handle dependencies -->
<target name="depend"/>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<project name="xmrg_java" default="main" basedir=".">
<!-- ================================================================= -->
<!-- settings -->
<!-- ================================================================= -->
<!-- project prefix, used for targets and build.lst -->
<property name="prj.prefix" value="xmrg"/>
<!-- name of this sub target used in recursive builds -->
<property name="target" value="xmrg_java"/>
<!-- relative path to project directory -->
<property name="prj" value=".."/>
<!-- start of java source code package structure -->
<property name="java.dir" value="${prj}/java"/>
<!-- path component for current java package -->
<property name="package" value="."/>
<!-- define how to handle CLASSPATH environment -->
<property name="build.sysclasspath" value="ignore"/>
<!-- classpath settings for javac tasks -->
<path id="classpath">
<pathelement location="${build.class}"/>
<pathelement location="${solar.jar}/parser.jar"/>
<pathelement location="${solar.jar}/jaxp.jar"/>
<pathelement location="${solar.jar}/xalan.jar"/>
<pathelement location="${solar.jar}/jurt.jar"/>
<pathelement location="${solar.jar}/unoil.jar"/>
<pathelement location="${solar.jar}/ridl.jar"/>
<pathelement location="${solar.jar}/sandbox.jar"/>
<pathelement location="${solar.jar}/juh.jar"/>
<pathelement location="${solar.jar}/jmc.jar"/>
</path>
<!-- set wether we want to compile with or without deprecation -->
<property name="deprecation" value="on"/>
<!-- ================================================================= -->
<!-- solar build environment targets -->
<!-- ================================================================= -->
<target name="build_dir" unless="build.dir">
<property name="build.dir" value="${out}"/>
</target>
<target name="solar" depends="build_dir" if="solar.update">
<property name="solar.properties"
value="${solar.bin}/solar.properties"/>
</target>
<target name="init" depends="solar">
<property name="build.compiler" value="classic"/>
<property file="${solar.properties}"/>
<property file="${build.dir}/class/solar.properties"/>
</target>
<target name="info">
<echo message="--------------------"/>
<echo message="${target}"/>
<echo message="--------------------"/>
</target>
<!-- ================================================================= -->
<!-- custom targets -->
<!-- ================================================================= -->
<!-- the main target, called in recursive builds -->
<target name="main" depends="info,prepare,javadoc,zipdoc"/>
<!-- prepare output directories -->
<target name="prepare" depends="init" if="build.class">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.dir}/doc/javadoc"/>
</target>
<!-- compile java sources in ${package} and sub packages -->
<target name="javadoc" depends="prepare" if="build.dir">
<javadoc packagenames="org.openoffice.xmerge.*"
destdir="${build.dir}/doc/javadoc"
verbose="false"
author="false"
nodeprecated="true"
nodeprecatedlist="true"
use="true"
Doctitle="OpenOffice XMerge API"
windowtitle="OpenOffice XMerge API"
sourcepath="${prj}/java"
excludepackagenames="org.openoffice.xmerge.test"
classpathref="classpath">
<link offline="true" href="http://java.sun.com/j2se/1.3/docs/api" packagelistLoc="${solar.doc}/jdk13"/>
<bottom><![CDATA[<i>Copyright &#169 2002 OpenOffice.org</i>]]></bottom>
<header><![CDATA[<b>OpenOffice.org<br>XMerge API</b>]]></header>
</javadoc>
</target>
<!-- zip together all the javadocs -->
<target name="zipdoc" depends="javadoc" if="build.dir">
<zip zipfile="${build.dir}/doc/xmerge_javadoc.zip"
basedir="${build.dir}/doc/javadoc"
update="true"/>
</target>
<!-- clean up -->
<target name="clean" depends="prepare">
<delete includeEmptyDirs="true">
<fileset dir="${build.dir}/doc">
<patternset>
<include name="**"/>
</patternset>
</fileset>
</delete>
</target>
</project>
#***************************************************************************
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#***************************************************************************
TARGET=xmrg_java
PRJ=..
.INCLUDE : ant.mk
ALLTAR: ANTBUILD
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import java.io.InputStream;
import java.io.IOException;
import java.util.Enumeration;
import org.openoffice.xmerge.util.registry.ConverterInfo;
/**
* The <code>Convert</code> class manages a conversion from one
* mime-type to another. The <code>ConvertFactory</code> is
* responsible for returning the appropriate <code>Convert</code>
* class for a specified conversion. This class is responsible
* for all interactions with the <code>PluginFactory</code>
* implementation.
*
* @see ConverterFactory
* @see PluginFactory
* @see org.openoffice.xmerge.util.registry.ConverterInfo
*
* @author Martin Maher
*/
public class Convert implements Cloneable {
/**
* ConvertInfo that corresponds to the from-mime/to-mime
* conversion.
*/
private ConverterInfo ci;
/**
* true if converting to the Office format, false if converting
* to the device format.
*/
private boolean toOffice;
/**
* Holds the convert input data.
*/
private ConvertData inputCD = new ConvertData();
/**
* Construct a Convert class with specified <code>ConvertInfo</code>
* registry information.
*
* @param ci A <code>ConvertInfo</code> object containing
* registry information corresponding to a
* specific plug-in.
* @param toOffice true if converting to the Office format,
* false if converting to the device format.
*/
public Convert(ConverterInfo ci, boolean toOffice) {
this.ci = ci;
this.toOffice = toOffice;
}
/**
* Adds an <code>InputStream</code> to be used as input by the
* <code>Convert</code> class. It is possible that many files
* need to be converted into a single output <code>Documetn</code>,
* so this function may be called more than one time. It is the
* plug-in's responsibility to know how to handle the input.
*
* @param name The name corresponding to the <code>InputStream</code>.
* @param is <code>InputStream</code> to be used as input.
*
* @throws IOException If any I/O error occurs.
*/
public void addInputStream(String name, InputStream is)
throws IOException {
Document inputDoc;
if (toOffice == true) {
inputDoc = ci.getPluginFactory().createDeviceDocument(name, is);
} else {
inputDoc = ci.getPluginFactory().createOfficeDocument(name, is);
}
inputCD.addDocument(inputDoc);
}
/**
* Adds the original Document to the Convert Class. This
* is to be used for merges. If this Document is added then
* it is assumed that a convert with merge is the desired
* operation.
*
* @param name The <code>Document</code> name.
* @param is <code>InputStream</code> object corresponding
* to the <code>Document</code>.
*
* @throws IOException If any I/O error occurs.
*/
public DocumentMerger getDocumentMerger(Document origDoc)
throws IOException {
DocumentMergerFactory myDocMergerFactory = ci.getDocMergerFactory();
DocumentMerger merger = myDocMergerFactory.createDocumentMerger(origDoc);
return merger;
}
/**
* Resets the input queue, so that the user can use this class to
* perform another conversion. This causes the
* <code>addInputStream</code> method to accept input for the next
* conversion.
*/
public void reset() {
inputCD.reset();
}
/**
* Clones a Convert object so another Convert object can
* do the same conversion. <code>InputStream<code> objects passed
* in via calls to the <code>addInputStream</code> method are not
* copied.
*
* @return The cloned <code>Convert</code> object.
*/
public Object clone() {
Convert aClone = null;
try {
aClone = (Convert) super.clone();
aClone.reset();
}
catch (CloneNotSupportedException e) {
System.out.println("Convert clone could not be created");
}
return aClone;
}
/**
* Convert the input specified in calls to the <code>addInputStream</code>
* method to the output format specified by this <code>Convert</code>
* class.
*
* @return The output data.
*
* @throws ConvertException If any conversion error occurs.
* @throws IOException If any I/O error occurs.
*/
public ConvertData convert() throws ConvertException, IOException {
ConvertData dataOut = new ConvertData();
if (toOffice) {
// From device format to Office format
//
DocumentDeserializerFactory myDocDeserializerFactory =
ci.getDocDeserializerFactory();
DocumentDeserializer deser =
myDocDeserializerFactory.createDocumentDeserializer(inputCD);
Document deviceDoc = deser.deserialize();
dataOut.addDocument(deviceDoc);
return dataOut;
} else {
// From Office format to device format
//
DocumentSerializerFactory myDocSerializerFactory =
ci.getDocSerializerFactory();
Enumeration e = inputCD.getDocumentEnumeration();
Document doc = (Document) e.nextElement();
DocumentSerializer ser = myDocSerializerFactory.createDocumentSerializer(doc);
dataOut = ser.serialize();
return dataOut;
}
}
/**
* Returns the appropriate &quot;Office&quot; <code>Document</code>
* object for this plug-in.
*
* @param name The name of the <code>Document</code> to create.
* @param is The <code>InputStream</code> corresponding to the
* <code>Document</code> to create.
*
* @return The appropriate &quot;Office&quot; <code>Document</code>
* object for this plug-in.
*
* @throws IOException If any I/O error occurs.
*/
public Document getOfficeDocument(String name, InputStream is)
throws IOException {
return(ci.getPluginFactory().createOfficeDocument(name, is));
}
/**
* Returns the appropriate &quot;Device&quot; <code>Document</code>
* object for this plug-in.
*
* @param name The name of the <code>Document</code> to create.
* @param is The <code>InputStream</code> corresponding to the
* <code>Document</code> to create.
*
* @return The appropriate &quot;Device&quot; <code>Document</code>
* object for this plug-in.
*
* @throws IOException If any I/O error occurs.
*/
public Document getDeviceDocument(String name, InputStream is)
throws IOException {
return(ci.getPluginFactory().createDeviceDocument(name, is));
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import java.util.Vector;
import java.util.Enumeration;
/**
* <p><code>ConvertData</code> is used as a container for passing
* <code>Document</code> objects in and out of the <code>Convert</code>
* class. The <code>ConvertData</code> contains a <code>String</code>
* name and a <code>Vector</code> of <code>Document</code> objects.</p>
*
* @author Martin Maher
*/
public class ConvertData {
/**
* Vector of <code>Document</code> objects.
*/
private Vector v = new Vector();
/**
* Name of the <code>ConvertData</code> object.
*/
private String name;
/**
* Resets ConvertData. This empties all <code>Document</code>
* objects from this class. This allows reuse of a
* <code>ConvertData</code>.
*/
public void reset() {
name = null;
v.removeAllElements();
}
/**
* Returns the <code>Document</code> name.
*
* @return The <code>Document</code> name.
*/
public String getName() {
return name;
}
/**
* Sets the <code>Document</code> name.
*
* @param docName The name of the <code>Document</code>.
*/
public void setName(String docName) {
name = docName;
}
/**
* Adds a <code>Document</code> to the vector.
*
* @param doc The <code>Document</code> to add.
*/
public void addDocument(Document doc) {
v.add(doc);
}
/**
* Gets an <code>Enumeration</code> to access the <code>Vector</code>
* of <code>Document</code> objects.
*
* @return The <code>Enumeration</code> to access the
* <code>Vector</code> of <code>Document</code> objects.
*/
public Enumeration getDocumentEnumeration() {
Enumeration enum = v.elements();
return (enum);
}
/**
* Gets the number of <code>Document</code> objects currently stored
*
* @return The number of <code>Document</code> objects currently
* stored.
*/
public int getNumDocuments() {
return (v.size());
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* This <code>Exception</code> is thrown by convert algorithms.
*/
public class ConvertException extends Exception {
/**
* Exception thrown by convert algorithms.
*
* @param message Message to be included in the
* <code>Exception</code>.
*/
public ConvertException(String message) {
super(message);
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* <p>A <code>ConverterCapabilities</code> object is used by
* <code>DocumentMerger</code> implementations. The
* <code>ConverterCapabilities</code> indicates which
* &quot;Office&quot; XML tags are supported by the
* &quot;Device&quot; format.</p>
*
* @see org.openoffice.xmerge.PluginFactory
* @see org.openoffice.xmerge.DocumentMerger
*/
public interface ConverterCapabilities {
/**
* Test to see if the device document format supports the
* tag in question.
*
* @param tag The tag to check.
*
* @return true if the device format supports the
* tag, false otherwise.
*/
boolean canConvertTag(String tag);
/**
* Test to see if the device document format supports the
* tag attribute in question.
*
* @param tag The tag to check.
* @param attribute The tag attribute to check.
*
* @return true if the device format supports the
* attribute, false otherwise.
*/
boolean canConvertAttribute(String tag, String attribute);
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import org.openoffice.xmerge.util.registry.ConverterInfo;
import org.openoffice.xmerge.util.registry.ConverterInfoMgr;
/**
* Factory that provides access to <code>Convert</code> objects, which
* are used to do a conversion. The <code>ConvertFactory</code> does
* this via the <code>ConvertInfoMgr</code> which maintains a list of
* which <code>Convert</code> objects are available and their
* capabilities.
*
* @see Convert
* @see org.openoffice.xmerge.util.registry.ConverterInfoMgr
*
* @author Martin Maher
*/
public class ConverterFactory {
/**
* Confirms whether or not a particular conversion can be done
* based on the Mime types of the files to be converted to and
* from.
*
* @param mimeTypeIn The mime input type.
* @param mimeTypeOut The mime output type.
*
* @return true if the conversion is possible, false otherwise.
*/
public boolean canConvert(String mimeTypeIn, String mimeTypeOut) {
ConverterInfo foundInfo = null;
// findConverterInfo expects the second paramenter to be the
// destination MimeType
if (foundInfo.isValidOfficeType(mimeTypeOut))
foundInfo = ConverterInfoMgr.findConverterInfo(mimeTypeIn, mimeTypeOut);
else
foundInfo = ConverterInfoMgr.findConverterInfo(mimeTypeOut, mimeTypeIn);
if (foundInfo != null)
return true;
else
return false;
}
/**
* Returns the <code>Convert</code> object that converts
* the specified device/office mime type conversion. If there
* are multiple <code>Converter</code> objects registered
* that support this conversion, only the first is returned.
*
* @param mimeTypeIn The mime input type.
* @param mimeTypeOut The mime output type.
*
* @return The first <code>Convert</code> object that supports
* the specified conversion.
*/
public Convert getConverter(String mimeTypeIn, String mimeTypeOut) {
ConverterInfo foundInfo = null;
boolean toOffice;
toOffice = foundInfo.isValidOfficeType(mimeTypeOut);
// findConverterInfo expects the second paramenter to be the
// destination MimeType
if (toOffice)
foundInfo = ConverterInfoMgr.findConverterInfo(mimeTypeIn, mimeTypeOut);
else
foundInfo = ConverterInfoMgr.findConverterInfo(mimeTypeOut, mimeTypeIn);
if (foundInfo != null)
return getConverter(foundInfo, toOffice);
else
return null;
}
/**
* Returns the <code>Convert</code> object that is described
* by the <code>ConverterInfo</code> parameter.
*
* @param ci The <code>ConverterInfo</code> describing the converter.
*
* @param toOffice true to convert to office, false to convert to device.
*
* @return The <code>Convert</code> object
*/
public Convert getConverter(ConverterInfo ci, boolean toOffice) {
Convert myConvert = new Convert(ci, toOffice);
return myConvert;
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import java.io.OutputStream;
import java.io.InputStream;
import java.io.IOException;
/**
* <p>A <code>Document</code> represents any <code>Document</code>
* to be converted and the resulting <code>Document</code> from any
* conversion.</p>
*
* <p>It is created by the <code>PluginFactory</code> object's {@link
* org.openoffice.xmerge.PluginFactory#createOfficeDocument
* createOfficeDocument} method or the {@link
* org.openoffice.xmerge.PluginFactory#createDeviceDocument
* createDeviceDocument} method.</p>
*
* @author Herbie Ong
* @see org.openoffice.xmerge.PluginFactory
*/
public interface Document {
/**
* <p>Writes out the <code>Document</code> content to the specified
* <code>OutputStream</code>.</p>
*
* <p>This method may not be thread-safe.
* Implementations may or may not synchronize this
* method. User code (i.e. caller) must make sure that
* calls to this method are thread-safe.</p>
*
* @param os <code>OutputStream</code> to write out the
* <code>Document</code> content.
*
* @throws IOException If any I/O error occurs.
*/
public void write(OutputStream os) throws IOException;
/**
* <p>Reads the content from the <code>InputStream</code> into
* the <code>Document</code>.</p>
*
* <p>This method may not be thread-safe.
* Implementations may or may not synchronize this
* method. User code (i.e. caller) must make sure that
* calls to this method are thread-safe.</p>
*
* @param is <code>InputStream</code> to read in the
* <code>Document</code> content.
*
* @throws IOException If any I/O error occurs.
*/
public void read(InputStream is) throws IOException;
/**
* Returns the <code>Document</code> name with no file extension.
*
* @return The <code>Document</code> name with no file extension.
*/
public String getName();
/**
* Returns the <code>Document</code> name with file extension.
*
* @return The <code>Document</code> name with file extension.
*/
public String getFileName();
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import java.io.IOException;
/**
* <p>A <code>DocumentDeserializer</code> represents a converter that
* converts &quot;Device&quot; <code>Document</code> objects into the
* &quot;Office&quot; <code>Document</code> format.</p>
*
* <p>The <code>DocumentDeserializer</code> object is created by
* the </code>PluginFactory</code> {@link
* org.openoffice.xmerge.DocumentDeserializerFactory#createDocumentDeserializer
* createDocumentDeserializer} method. When it is constructed, a
* <code>ConvertData</code> object is passed in to be used as input.</p>
*
* @author Herbie Ong
* @see org.openoffice.xmerge.PluginFactory
* @see org.openoffice.xmerge.DocumentDeserializerFactory
*/
public interface DocumentDeserializer {
/**
* <p>Convert the data passed into the <code>DocumentDeserializer</code>
* constructor into the &quot;Office&quot; <code>Document</code>
* format.</p>
*
* <p>This method may or may not be thread-safe. It is expected
* that the user code does not call this method in more than one
* thread. And for most cases, this method is only done once.</p>
*
* @return The resulting <code>Document</code> object from conversion.
*
* @throws ConvertException If any Convert error occurs.
* @throws IOException If any I/O error occurs.
*/
public Document deserialize() throws ConvertException, IOException;
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* <p>A <code>DocumentDeserializer</code> object is used to convert
* from the &quot;Device&quot; <code>Documetn</code> format to the
* &quot;Office&quot; <code>Document</code> format.</p>
*
* <p>All plug-in implementations of the <code>PluginFactory</code>
* interface that also support deserialization must also
* implement this interface.</p>
*
* @see PluginFactory
* @see DocumentDeserializer
*/
public interface DocumentDeserializerFactory {
/**
* The <code>DocumentDeserializer</code> is used to convert
* from the &quot;Device&quot; <code>Document</code> format to
* the &quot;Office&quot; <code>Document</code> format.</p>
*
* The <code>ConvertData</code> object is passed along to the
* created <code>DocumentDeserializer</code> via its constructor.
* The <code>ConvertData</code> is read and converted when the
* the <code>DocumentDeserializer</code> object's
* <code>deserialize</code> method is called.
* </p>
*
* @param cd <code>ConvertData</code> object that the created
* <code>DocumentDeserializer</code> object uses as
* input.
*
* @return A <code>DocumentDeserializer</code> object.
*/
public DocumentDeserializer createDocumentDeserializer(ConvertData cd);
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* <p>A <code>DocumentMerger</code> can merge changes from a modified
* &quot;Device&quot; <code>Document</code> to the assigned original
* &quot;Office&quot; <code>Document</code>.</p>
*
* <p>Merge is useful when an <code>OfficeDocument</code>
* is converted to a &quot;Device&quot; <code>Document</code> format,
* and the &quot;Device&quot; <code>Document</code> version is modified.
* Those changes can be merged back into the original
* <code>OfficeDocument</code> with the merger. The merger is capable
* of doing this even if the &quot;Device&quot; format is lossy in
* comparison to the <code>OfficeDocument</code> format.</p>
*
* <p>The <code>ConverterCapabilities</code> object is what the
* DocumentMerger utilizes to know how the &quot;Office&quot;
* <code>Document</code> tags are supported in the &quot;Device&quot;
* format.</p>
*
* <p>The <code>DocumentMerger</code> object is created by a
* the <code>DocumentMergerFactory</code> {@link
* org.openoffice.xmerge.DocumentMergerFactory#createDocumentMerger
* createDocumenMerger} method. When it is constructed, the
* &quot;Original Office&quot; <code>Document</code> object is
* passed in to be used as input.</p>
*
* @author Herbie Ong
* @see org.openoffice.xmerge.PluginFactory
* @see org.openoffice.xmerge.DocumentMergerFactory
* @see org.openoffice.xmerge.ConverterCapabilities
*/
public interface DocumentMerger {
/**
* <p>This method will find the changes that had happened
* in the <code>modifiedDoc</code> <code>Document</code>
* object given the designated original <code>Document</code>.</p>
*
* <p>Note that this process may need the knowledge of the
* conversion process since some conversion process are lossy.
* Items/Data that are lost during the conversion process are not
* classified as changes. The main target of this method
* is to apply the changes done in <code>modifiedDoc</code>
* into the assigned original <code>Document</code> object, thus
* it also will try to preserve items that were originally in
* the original <code>Document</code>, but never got transferred
* during the
* {@link org.openoffice.xmerge.DocumentSerializer#serialize
* serialize} process/method call. After this method call, the
* original <code>Document</code> object will contain the changes
* applied.</p>
*
* <p>This method may or may not be thread-safe.
* Also, it is expected that the user uses only one instance
* of a <code>DocumentMerger</code> object per merge process.
* Create another <code>DocumentMerger</code> object for another
* merge process.</p>
*
* @param modifiedDoc device <code>Document</code> object.
*
* @throws MergeException If any merge error occurs.
*/
public void merge(Document modifiedDoc) throws MergeException;
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* <p>All plug-in implementations of the <code>PluginFactory</code>
* interface that also support merging must also implement
* this interface.</p>
*
* <p>Merge is useful when an <code>OfficeDocument</code>
* is converted to a &quot;Device&quot; <code>Document</code> format,
* and the &quot;Device&quot; <code>Document</code> version is modified.
* Those changes can be merged back into the original
* <code>OfficeDocument</code> with the merger. The merger is capable
* of doing this even if the &quot;Device&quot; format is lossy in
* comparison to the <code>OfficeDocument</code> format.</p>
*
* @see PluginFactory
* @see DocumentMerger
* @see ConverterCapabilities
*
*/
public interface DocumentMergerFactory {
/**
* <p>Create a <code>DocumentMerger</code> object given a
* <code>Document</code> object.</p>
*
* @param doc <code>Document</code> object that the created
* <code>DocumentMerger</code> object uses as a base
* <code>Document</code> for merging changes into.
*
* @return A <code>DocumentMerger</code> object or null if none
* exists.
*/
public DocumentMerger createDocumentMerger(Document doc);
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import java.io.IOException;
/**
* <p>A <code>DocumentSerializer</code> represents a converter that
* converts a &quot;Office&quot; <code>Document</code> to a
* &quot;Device&quot; <code>Document</code> format.</p>
*
* <p>The <code>DocumentSerializer</code> object is created by a
* the <code>PluginFactory</code> {@link
* org.openoffice.xmerge.DocumentSerializerFactory#createDocumentSerializer
* createDocumentSerializer} method. When it is constructed, a
* &quot;Office&quot; <code>Document</code> object is passed in to
* be used as input.</p>
*
* @author Herbie Ong
* @see org.openoffice.xmerge.PluginFactory
* @see org.openoffice.xmerge.DocumentSerializerFactory
*/
public interface DocumentSerializer {
/**
* <p>Convert the data passed into the <code>DocumentSerializer</code>
* constructor into the &quot;Device&quot; <code>Document</code>
* format.</p>
*
* <p>This method may or may not be thread-safe. It is expected
* that the user code does not call this method in more than one
* thread. And for most cases, this method is only done once.</p>
*
* @return <code>ConvertData</code> object to pass back the
* converted data.
*
* @throws ConvertException If any conversion error occurs.
* @throws IOException If any I/O error occurs.
*/
public ConvertData serialize() throws ConvertException, IOException;
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* <p>A <code>DocumentSerializer</code> object is used to convert
* from the &quot;Office&quot; <code>Document</code> format to the
* &quot;Device&quot; <code>Document</code> format.</p>
*
* <p>All plug-in implementations of the <code>PluginFactory</code>
* interface that also support serialization must also
* implement this interface.</p>
*
* @see PluginFactory
* @see DocumentSerializer
*/
public interface DocumentSerializerFactory {
/**
* <p>The <code>DocumentSerializer</code> is used to convert
* from the &quot;Office&quot; <code>Document</code> format
* to the &quot;Device&quot; <code>Document</code> format.</p>
*
* The <code>ConvertData</code> object is passed along to the
* created <code>DocumentSerializer</code> via its constructor.
* The <code>ConvertData</code> is read and converted when the
* the <code>DocumentSerializer</code> object's
* <code>serialize</code> method is called.
*
* @param doc <code>Document</code> object that the created
* <code>DocumentSerializer</code> object uses
* as input.
*
* @return A <code>DocumentSerializer</code> object.
*/
public DocumentSerializer createDocumentSerializer(Document doc);
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* This <code>Exception</code> is thrown by merge algorithms.
*/
public class MergeException extends Exception {
/**
* Exception thrown by merge algorithms.
*
* @param message Message to be included in the
* <code>Exception</code>.
*/
public MergeException(String message) {
super(message);
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
import org.openoffice.xmerge.util.registry.ConverterInfo;
import java.io.InputStream;
import java.io.IOException;
/**
* <p>A <code>PluginFactory</code> encapsulates the
* conversions from one <code>Document</code> format to another.
* It provides conversions in both directions. Refer to the
* <a href="package-summary.html#package_description">
* package description</a> for its usage.</p>
*
* <p>Conversion from the &quot;Office&quot; <code>Document</code>
* format to a &quot;Device&quot; <code>Document</code> format may
* be lossy, i.e. some information may be lost. If a plug-in
* implements the <code>DocumentMergerFactory</code> interface,
* then there is the possibility for merging the changes done on the
* &quot;Device&quot; <code>Document</code> back to the original
* &quot;Office&quot; <code>Document</code> via the
* <code>DocumentMerger</code> interface.</p>
*
* <p>Plug-ins that convert from the &quot;Device&quot;
* <code>Document</code> format to the &quot;Office&quot;
* <code>Document</code> format must implement the
* <code>DocumentDeserializerFactory</code> interface. Plug-ins
* that convert from the &quot;Office&quot; <code>Document</code>
* format to the &quot;Device&quot; format must implement the
* <code>DocumentSerializerFactory</code> interface.
*
* <p>All plug-ins should have an associated Plugin Configuration XML
* File which describes the capabilities of the plug-in. If the
* plug-in is bundled in a jarfile, then this XML file is also bundled
* with the jarfile. The data in the XML file is managed by the
* <code>ConverterInfo</code> object. The <code>ConverterInfoMgr</code>
* manages a registry of all <code>ConverterInfo</code> objects. For
* more information about this XML file, refer to
* <a href="converter/xml/sxc/package-summary.html">
* org.openoffice.xmerge.util.registry</a>.</p>
*
* @author Herbie Ong
* @see Document
* @see DocumentSerializer
* @see DocumentSerializerFactory
* @see DocumentDeserializer
* @see DocumentDeserializerFactory
* @see DocumentMerger
* @see DocumentMergerFactory
* @see ConverterInfo
* @see org.openoffice.xmerge.util.registry.ConverterInfoMgr
*/
public abstract class PluginFactory {
/**
* Cached <code>ConvertInfo</code> object.
*/
private ConverterInfo ciCache;
/**
* Constructor that caches the <code>ConvertInfo</code> that
* corresponds to the registry information for this plug-in.
*
* @param ci <code>ConvertInfo</code> object.
*/
public PluginFactory(ConverterInfo ci) {
ciCache=ci;
}
/**
* Returns the <code>ConvertInfo</code> that corresponds to this
* plug-in.
*
* @return The <code>ConvertInfo</code> that corresponds to this
* plug-in.
*/
public ConverterInfo getConverterInfo () {
return ciCache;
}
/**
* <p>Create a <code>Document</code> object that corresponds to
* the Office data passed in via the <code>InputStream</code>
* object. This abstract method must be implemented for each
* plug-in.</p>
*
* <p>This method will read from the given <code>InputStream</code>
* object. The returned <code>Document</code> object will contain
* the necessary data for the other objects created by the
* <code>PluginFactory</code> to process, like a
* <code>DocumentSerializer</code> object and a
* <code>DocumentMerger</code> object.</p>
*
* @param name The <code>Document</code> name.
* @param is <code>InputStream</code> object corresponding
* to the <code>Document</code>.
*
* @return A <code>Document</code> object representing the
* particular <code>Document</code> format for the
* <code>PluginFactory</code>.
*
* @throws IOException If any I/O error occurs.
*/
public abstract Document createOfficeDocument(String name, InputStream is)
throws IOException;
/**
* <p>Create a <code>Document</code> object that corresponds to
* the device data passed in via the <code>InputStream</code>
* object. This abstract method must be implemented for each
* plug-in.</p>
*
* <p>This method will read from the given <code>InputStream</code>
* object. The returned <code>Document</code> object will contain
* the necessary data for the other objects created by the
* <code>PluginFactory</code> to process, like a
* <code>DocumentSerializer</code> object and a
* <code>DocumentMerger</code> object.</p>
*
* @param name The <code>Document</code> name.
* @param is <code>InputStream</code> object corresponding
* to the <code>Document</code>.
*
* @return A <code>Document</code> object representing the
* particular <code>Document</code> format for the
* <code>PluginFactory</code>.
*
* @throws IOException If any I/O error occurs.
*/
public abstract Document createDeviceDocument(String name, InputStream is)
throws IOException;
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge;
/**
* This class provides a quick utility to check the version of the
* jar file. It has a main method that prints out the version
* info. It also provides two static methods for runtime classes
* to query.
*
* @author Herbie Ong
*/
public final class Version {
private static Package pkg;
private static Version version;
static {
version = new Version();
pkg = version.getClass().getPackage();
}
/**
* Private constructor to provide a singleton instance.
*/
private Version() {
}
/**
* Returns specification version.
*
* @return The specification version.
*/
public static String getSpecificationVersion() {
return pkg.getSpecificationVersion();
}
/**
* Returns implementation version.
*
* @return The implementation version.
*/
public static String getImplementationVersion() {
return pkg.getImplementationVersion();
}
/**
* Main method for printing out version info.
*
* @param args Array of arguments, not used.
*/
public static void main(String args[]) {
System.out.println("Specification-Title: " + pkg.getSpecificationTitle());
System.out.println("Specification-Vendor: " + pkg.getSpecificationVendor());
System.out.println("Specification-Version: " + pkg.getSpecificationVersion());
System.out.println("Implementation-Version: " + pkg.getImplementationVersion());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<project name="xmrg_joo_xmerge" default="main" basedir=".">
<!-- ================================================================= -->
<!-- settings -->
<!-- ================================================================= -->
<!-- project prefix, used for targets and build.lst -->
<property name="prj.prefix" value="xmrg"/>
<!-- name of this sub target used in recursive builds -->
<property name="target" value="xmrg_joo_xmerge"/>
<!-- relative path to project directory -->
<property name="prj" value="../../../.."/>
<!-- start of java source code package structure -->
<property name="java.dir" value="${prj}/java"/>
<!-- path component for current java package -->
<property name="package" value="org/openoffice/xmerge"/>
<!-- define how to handle CLASSPATH environment -->
<property name="build.sysclasspath" value="ignore"/>
<!-- classpath settings for javac tasks -->
<path id="classpath">
<pathelement location="${build.class}"/>
<pathelement location="${solar.jar}/parser.jar"/>
<pathelement location="${solar.jar}/jaxp.jar"/>
</path>
<!-- set whether we want to compile with or without deprecation -->
<property name="deprecation" value="on"/>
<!-- ================================================================= -->
<!-- solar build environment targets -->
<!-- ================================================================= -->
<target name="build_dir" unless="build.dir">
<property name="build.dir" value="${out}"/>
</target>
<target name="solar" depends="build_dir" if="solar.update">
<property name="solar.properties"
value="${solar.bin}/solar.properties"/>
</target>
<target name="init" depends="solar">
<property name="build.compiler" value="classic"/>
<property file="${solar.properties}"/>
<property file="${build.dir}/class/solar.properties"/>
</target>
<target name="info">
<echo message="--------------------"/>
<echo message="${target}"/>
<echo message="--------------------"/>
</target>
<!-- ================================================================= -->
<!-- custom targets -->
<!-- ================================================================= -->
<!-- the main target, called in recursive builds -->
<target name="main" depends="info,prepare,compile"/>
<!-- prepare output directories -->
<target name="prepare" depends="init" if="build.class">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.class}"/>
</target>
<!-- compile java sources in ${package} -->
<target name="compile" depends="prepare" if="build.class">
<javac srcdir="${java.dir}"
destdir="${build.class}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
<classpath refid="classpath"/>
<include name="${package}/Convert.java"/>
<include name="${package}/ConverterCapabilities.java"/>
<include name="${package}/ConverterFactory.java"/>
<include name="${package}/ConvertData.java"/>
<include name="${package}/PluginFactory.java"/>
<include name="${package}/Document.java"/>
<include name="${package}/DocumentDeserializer.java"/>
<include name="${package}/DocumentDeserializerFactory.java"/>
<include name="${package}/DocumentMerger.java"/>
<include name="${package}/DocumentMergerFactory.java"/>
<include name="${package}/DocumentSerializer.java"/>
<include name="${package}/DocumentSerializerFactory.java"/>
<include name="${package}/Version.java"/>
<include name="${package}/ConvertException.java"/>
<include name="${package}/MergeException.java"/>
</javac>
</target>
<!-- clean up -->
<target name="clean" depends="prepare">
<delete includeEmptyDirs="true">
<fileset dir="${build.class}">
<patternset>
<include name="${package}/*.class"/>
</patternset>
</fileset>
</delete>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<project name="xmrg_jooxc_dom" default="main" basedir=".">
<!-- ================================================================= -->
<!-- settings -->
<!-- ================================================================= -->
<!-- project prefix, used for targets and build.lst -->
<property name="prj.prefix" value="xmrg"/>
<!-- name of this sub target used in recursive builds -->
<property name="target" value="xmrg_jooxc_dom"/>
<!-- relative path to project directory -->
<property name="prj" value="../../../../../.."/>
<!-- start of java source code package structure -->
<property name="java.dir" value="${prj}/java"/>
<!-- path component for current java package -->
<property name="package"
value="org/openoffice/xmerge/converter/dom"/>
<!-- define how to handle CLASSPATH environment -->
<property name="build.sysclasspath" value="ignore"/>
<!-- classpath settings for javac tasks -->
<path id="classpath">
<pathelement location="${build.class}"/>
<pathelement location="${solar.jar}/parser.jar"/>
<pathelement location="${solar.jar}/jaxp.jar"/>
</path>
<!-- set whether we want to compile with or without deprecation -->
<property name="deprecation" value="on"/>
<!-- ================================================================= -->
<!-- solar build environment targets -->
<!-- ================================================================= -->
<target name="build_dir" unless="build.dir">
<property name="build.dir" value="${out}"/>
</target>
<target name="solar" depends="build_dir" if="solar.update">
<property name="solar.properties"
value="${solar.bin}/solar.properties"/>
</target>
<target name="init" depends="solar">
<property name="build.compiler" value="classic"/>
<property file="${solar.properties}"/>
<property file="${build.dir}/class/solar.properties"/>
</target>
<target name="info">
<echo message="--------------------"/>
<echo message="${target}"/>
<echo message="--------------------"/>
</target>
<!-- ================================================================= -->
<!-- custom targets -->
<!-- ================================================================= -->
<!-- the main target, called in recursive builds -->
<target name="main" depends="info,prepare,compile"/>
<!-- prepare output directories -->
<target name="prepare" depends="init" if="build.class">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.class}"/>
</target>
<!-- compile java sources in ${package} -->
<target name="compile" depends="prepare" if="build.class">
<javac srcdir="${java.dir}"
destdir="${build.class}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
<classpath refid="classpath"/>
<include name="${package}/DOMDocument.java"/>
</javac>
</target>
<!-- clean up -->
<target name="clean" depends="prepare">
<delete includeEmptyDirs="true">
<fileset dir="${build.class}">
<patternset>
<include name="${package}/*.class"/>
</patternset>
</fileset>
</delete>
</target>
</project>
#***************************************************************************
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#***************************************************************************
TARGET=xmrg_jooxc_dom
PRJ=../../../../../..
.INCLUDE : ant.mk
ALLTAR: ANTBUILD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<title>org.openoffice.xmerge.converter.palm package</title>
</head>
<body bgcolor="white">
<p>Provides classes for converting basic document types to/from a <code>
DOMDocument</code> object, which can be used by the framework. </p>
<p>This package provides classes that handle the writing of data to an <code>
OutputStream</code> object for the {@link org.openoffice.xmerge.DocumentSerializer
DocumentSerializer} interface for; as well as the reading of data from an
<code>InputStream</code> object for the framework's {@link org.openoffice.xmerge.DocumentDeserializer
DocumentDeserializer} interface. Both these framework interfaces are simply
converters from server-side documents to device specific documents and vice-versa.
</p>
<a name="streamformat">
<h2></h2>
</a>
<p></p>
<h2>Important Note</h2>
<p>Methods in these classes are not thread safe for performance reasons.
Users of these classes will have to make sure that the usage of these classes
are done in a proper manner. Possibly more on this later.</p>
</body>
</html>
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge.converter.xml;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.openoffice.xmerge.util.Resources;
/**
* Used by OfficeDocument to encapsulate exceptions. It will add
* more details to the message string if it is of type
* <code>SAXParseException</code>.
*
* @author Herbie Ong
*/
public final class OfficeDocumentException extends IOException {
StringBuffer message = null;
/**
* Constructor, capturing additional information from the
* <code>SAXException</code>.
*
* @param e The <code>SAXException</code>.
*/
public OfficeDocumentException(SAXException e) {
super(e.toString());
message = new StringBuffer();
if (e instanceof SAXParseException) {
String msgParseError =
Resources.getInstance().getString("PARSE_ERROR");
String msgLine =
Resources.getInstance().getString("LINE");
String msgColumn =
Resources.getInstance().getString("COLUMN");
String msgPublicId =
Resources.getInstance().getString("PUBLIC_ID");
String msgSystemId =
Resources.getInstance().getString("SYSTEM_ID");
SAXParseException spe = (SAXParseException) e;
message.append(msgParseError);
message.append(": ");
message.append(msgLine);
message.append(": ");
message.append(spe.getLineNumber());
message.append(", ");
message.append(msgColumn);
message.append(": ");
message.append(spe.getColumnNumber());
message.append(", ");
message.append(msgSystemId);
message.append(": ");
message.append(spe.getSystemId());
message.append(", ");
message.append(msgPublicId);
message.append(": ");
message.append(spe.getPublicId());
message.append("\n");
}
// if there exists an embedded exception
Exception ex = e.getException();
if (ex != null) {
message.append(ex.getMessage());
}
}
/**
* Constructor, creates exception with provided message.
*
* @param s Message value for the exception.
*/
public OfficeDocumentException(String s) {
super(s);
}
/**
* Constructor, creates exception with the message
* corresponding to the message value of the provided
* exception.
*
* @param e The Exception.
*/
public OfficeDocumentException(Exception e) {
super(e.getMessage());
}
/**
* Returns the message value for the <code>Exception</code>.
*
* @return The message value for the <code>Exception</code>.
*/
public String getMessage() {
return message.toString() + super.getMessage();
}
}
/************************************************************************
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
package org.openoffice.xmerge.converter.xml;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Element;
import org.openoffice.xmerge.Document;
import org.openoffice.xmerge.ConverterCapabilities;
import org.openoffice.xmerge.converter.xml.OfficeDocument;
import java.io.IOException;
import org.openoffice.xmerge.converter.xml.sxw.SxwDocument;
/**
* An object of class <code>Style</code> represents a <i>style</i>
* in an OpenOffice document. In practice subclasses of this
* <code>Style</code>, such as <code>TextStyle</code>,
* <code>ParaStyle</code> are used.
*
* @author David Proulx
* @see <a href="TextStyle.html">TextStyle</a>,
* <a href="ParaStyle.html">ParaStyle</a>
*/
public class Style {
/** Name of the <code>Style</code>. */
protected String name = null;
/** Family of the <code>Style</code>. */
protected String family = null;
/** Parent of the <code>Style</code>. */
protected String parent = null;
/**
* A reference to the <code>StyleCatalog</code> to be used for
* looking up ancestor <code>Style</code> objects.
*/
protected StyleCatalog sc;
/**
* Constructor for use when going from DOM to client device format.
*
* @param node A <i>style:style</i> or <i>style:default-style</i>
* <code>Node</code> from the document being parsed.
* No checking of <code>Node</code> is done, so if it
* is not of the proper type the results will be
* unpredictable.
* @param sc The <code>StyleCatalog</code>, which is used for
* looking up ancestor <code>Style</code> objects.
*/
public Style(Node node, StyleCatalog sc) {
this.sc = sc;
// Run through the attributes of this node, saving
// the ones we're interested in.
if (node.getNodeName().equals("style:default-style"))
name = "DEFAULT_STYLE";
NamedNodeMap attrNodes = node.getAttributes();
if (attrNodes != null) {
int len = attrNodes.getLength();
for (int i = 0; i < len; i++) {
Node attr = attrNodes.item(i);
if (attr.getNodeName().equals("style:family"))
family = attr.getNodeValue();
else if (attr.getNodeName().equals("style:name")) {
name = attr.getNodeValue();
} else if (attr.getNodeName().equals("style:parent-style-name"))
parent = attr.getNodeValue();
}
}
}
/**
* Constructor for use when going from client device format to DOM.
*
* @param name Name of the <code>Style</code>. Can be null.
* @param family Family of the <code>Style</code> - usually
* <i>paragraph</i>, <i>text</i>, etc. Can be null.
* @param parent Name of the parent <code>Style</code>, or null if none.
* @param sc The <code>StyleCatalog</code>, which is used for
* looking up ancestor <code>Style</code> objects.
*/
public Style(String name, String family, String parent, StyleCatalog sc) {
this.sc = sc;
this.name = name;
this.family = family;
this.parent = parent;
}
/**
* Set the <code>StyleCatalog</code> to be used when looking up the
* <code>Style</code> parent.
*
* @param sc The <code>StyleCatalog</code>, which is used for
* looking up ancestor <code>Style</code> objects.
*/
public void setCatalog(StyleCatalog sc) {
this.sc = sc;
}
/**
* Returns the name of this <code>Style</code>.
*
* @return The name of this <code>Style</code>.
*/
public String getName() {
return name;
}
/**
* Sets the name of this <code>Style</code>.
*
* @param newName The new name of this <code>Style</code>.
*/
public void setName(String newName) {
name = newName;
}
/**
* Return the family of this <code>Style</code>.
*
* @return The family of this <code>Style</code>.
*/
public String getFamily() {
return family;
}
/**
* Return the name of the parent of this <code>Style</code>.
*
* @return The parent of this <code>Style</code>.
*/
public String getParent() {
return parent;
}
/**
* Return a <code>Style</code> object corresponding to this one, but with
* all of the inherited information from parent <code>Style</code>
* objects filled in. The object returned will be a new object, not a
* reference to this object, even if it does not need any information
* added.
*
* @return A resolved <code>Style</code> object in which to look up
* ancestors.
*/
public Style getResolved() {
return new Style(name, family, parent, sc);
}
/**
* Write a <code>Node</code> in <code>parentDoc</code>
* representing this <code>Style</code>. Note that the
* <code>Node</code> is returned unconnected.
*
* @param parentDoc Document to which new <code>Node</code> will
* belong.
* @param name Name to use for new <code>Node</code>.
*/
public Node createNode(org.w3c.dom.Document parentDoc, String name) {
// DJP: write this! Should call writeAttributes()
return null;
}
/**
* Write this <code>Style</code> object's attributes to the given
* <code>Node</code>. This may involve writing child
* <code>Node</code> objects as well. This is similar to the
* <code>writeNode</code> method, but the <code>Node</code>
* already exists, and this does <b>not</b> write the name,
* family, and parent attributes, which are assumed to already
* exist in the <code>Node</code>.
*
* @param node The <code>Node</code> to add style attributes.
*/
public void writeAttributes(Node node) {
}
/**
* Return true if <code>Style</code> is a subset of this one. Note
* that this will return true even if <code>Style</code> is less
* specific than this <code>Style</code>, so long as it does not
* contradict this <code>Style</code> in any way.
*
* This always returns true since only subclasses of
* <code>Style</code> contain any actual <code>Style</code>
* information.
*
* @param style The <code>Style</code> to check
*
* @return true if the <code>Style</code> is a subset, false otherwise.
*/
public boolean isSubset(Style style) {
return true;
}
}
#***************************************************************************
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#***************************************************************************
TARGET=xmrg_jooxc_xml
PRJ=../../../../../..
.INCLUDE : ant.mk
ALLTAR: ANTBUILD
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--
# The Contents of this file are made available subject to the terms of
# either of the following licenses
#
# - GNU Lesser General Public License Version 2.1
# - Sun Industry Standards Source License Version 1.1
#
# Sun Microsystems Inc., October, 2000
#
# GNU Lesser General Public License Version 2.1
# =============================================
# Copyright 2000 by Sun Microsystems, Inc.
# 901 San Antonio Road, Palo Alto, CA 94303, USA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
#
# Sun Industry Standards Source License Version 1.1
# =================================================
# The contents of this file are subject to the Sun Industry Standards
# Source License Version 1.1 (the "License"); You may not use this file
# except in compliance with the License. You may obtain a copy of the
# License at http://www.openoffice.org/license.html.
#
# Software provided under this License is provided on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
# See the License for the specific provisions governing your rights and
# obligations concerning the Software.
#
# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
#
# Copyright: 2000 by Sun Microsystems, Inc.
#
# All Rights Reserved.
#
# Contributor(s): _______________________________________
#
#
-->
<html>
<head>
<title>org.openoffice.xmerge.util package</title>
</head>
<body bgcolor="white">
<p><code>Document</code> and <code>PluginFactory</code> implementations
for XML based formats.
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment