summaryrefslogtreecommitdiffstats
path: root/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java
parentInitial commit. (diff)
downloadlibreoffice-upstream.tar.xz
libreoffice-upstream.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java267
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components8
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.xcu103
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile142
4 files changed, 520 insertions, 0 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
new file mode 100644
index 000000000..6ba341977
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXml.java
@@ -0,0 +1,267 @@
+/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * The Contents of this file are made available subject to the terms of
+ * the BSD license.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Sun Microsystems, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *************************************************************************/
+
+import com.sun.star.uno.*;
+import com.sun.star.lang.*;
+import com.sun.star.beans.*;
+
+import com.sun.star.comp.loader.FactoryHelper;
+import com.sun.star.registry.XRegistryKey;
+
+import com.sun.star.xml.*;
+import com.sun.star.xml.sax.*;
+
+import com.sun.star.io.XInputStream;
+import com.sun.star.io.XOutputStream;
+import com.sun.star.io.XActiveDataSource;
+
+
+
+public class FlatXml implements XImportFilter, XExportFilter, XServiceName,
+ XServiceInfo, XDocumentHandler, XTypeProvider
+{
+
+ /*
+ * private data members
+ */
+ private final XMultiServiceFactory m_xServiceFactory;
+ private XExtendedDocumentHandler m_xHandler;
+ private static final boolean m_bPrettyPrint = true;
+
+ private static final String __serviceName = "devguide.officedev.samples.filter.FlatXmlJava";
+ private static final String __implName = "FlatXml";
+ private static final String[] __supportedServiceNames = {
+ "devguide.officedev.samples.filter.FlatXmlJava"
+ };
+
+ public FlatXml(XMultiServiceFactory f) {
+ m_xServiceFactory = f;
+ }
+
+ // --- XTypeProvider ---
+ public byte[] getImplementationId() {
+ return new byte[0];
+ }
+
+ // --- XServiceName ---
+ public String getServiceName() {
+ return __serviceName;
+ }
+
+ // --- XServiceInfo ---
+ public boolean supportsService(String sName) {
+ for (int i = 0; i < __supportedServiceNames.length; i++) {
+ if (__supportedServiceNames[i].equals(sName)) return true;
+ }
+ return false;
+ }
+ public String getImplementationName() {
+ return this.getClass().getName();
+ }
+ public String[] getSupportedServiceNames() {
+ return __supportedServiceNames;
+ }
+
+ public com.sun.star.uno.Type[] getTypes() {
+ Type[] typeReturn = {};
+ try {
+ typeReturn = new Type[] {
+ new Type( XTypeProvider.class ),
+ new Type( XExportFilter.class ),
+ new Type( XImportFilter.class ),
+ new Type( XServiceName.class ),
+ new Type( XServiceInfo.class )
+ };
+ } catch( java.lang.Exception exception ) {
+ return null;
+ }
+ return typeReturn;
+ }
+
+ public boolean importer(PropertyValue[] aSourceData, XDocumentHandler xDocHandler, String[] msUserData)
+ throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
+ {
+ String sName = null;
+ String sFileName = null;
+ String sURL = null;
+ com.sun.star.io.XInputStream xin = null;
+
+ try {
+
+ for (int i = 0 ; i < aSourceData.length; i++)
+ {
+ sName = aSourceData[i].Name;
+ if (sName.equals("InputStream"))
+ xin = (XInputStream)AnyConverter.toObject(XInputStream.class, aSourceData[i].Value);
+ if (sName.equals("URL"))
+ sURL=(String)AnyConverter.toObject(String.class, aSourceData[i].Value);
+ if (sName.equals("FileName"))
+ sFileName=(String)AnyConverter.toObject(String.class, aSourceData[i].Value);
+ }
+
+ Object tmpObj=m_xServiceFactory.createInstance("com.sun.star.xml.sax.Parser");
+ if (tmpObj == null) return false;
+
+ XParser xParser = UnoRuntime.queryInterface(XParser.class , tmpObj);
+ if (xParser == null) return false;
+
+ InputSource aInput = new InputSource();
+ aInput.sSystemId = sURL;
+ aInput.aInputStream =xin;
+ xParser.setDocumentHandler ( xDocHandler );
+ xParser.parseStream ( aInput );
+ } catch (com.sun.star.uno.Exception e){
+ e.printStackTrace();
+ return false;
+ }
+
+ // done...
+ return true;
+ }
+
+ public boolean exporter(PropertyValue[] aSourceData, String[] msUserData)
+ throws com.sun.star.uno.RuntimeException, com.sun.star.lang.IllegalArgumentException
+ {
+ try {
+ String sURL = null;
+ String sName = null;
+ XOutputStream xos = null;
+
+ // get interesting values from sourceData
+ for (int i = 0 ; i < aSourceData.length; i++)
+ {
+ sName = aSourceData[i].Name;
+ if (sName.equals("OutputStream"))
+ xos = (XOutputStream)AnyConverter.toObject(XOutputStream.class, aSourceData[i].Value);
+ if (sName.equals("URL"))
+ sURL=(String)AnyConverter.toObject(String.class, aSourceData[i].Value);
+ }
+
+ // prepare the XML writer
+ Object tmpObj = null;
+ if (m_xHandler == null)
+ {
+ tmpObj = m_xServiceFactory.createInstance("com.sun.star.xml.sax.Writer");
+ if (tmpObj != null)
+ m_xHandler = UnoRuntime.queryInterface(XExtendedDocumentHandler.class, tmpObj);
+ }
+ if (m_xHandler == null)
+ return false;
+
+ // Connect the provided output stream to the writer
+ XActiveDataSource xADSource = UnoRuntime.queryInterface(
+ XActiveDataSource.class, m_xHandler);
+
+ if (xADSource != null && xos != null)
+ xADSource.setOutputStream(xos);
+ else
+ return false;
+ } catch (com.sun.star.uno.Exception e){
+ return false;
+ }
+
+ // done ...
+ return true;
+ }
+
+ public void startDocument ()
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.startDocument();
+ }
+
+ public void endDocument()
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.endDocument();
+ }
+
+ public void startElement (String str, com.sun.star.xml.sax.XAttributeList xattribs)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.startElement(str, xattribs);
+ }
+
+ public void endElement(String str)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.endElement(str);
+ }
+
+ public void characters(String str)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.characters(str);
+ }
+
+ public void ignorableWhitespace(String str)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ if (!m_bPrettyPrint) return;
+ else m_xHandler.ignorableWhitespace(str);
+ }
+
+ public void processingInstruction(String aTarget, String aData)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.processingInstruction(aTarget, aData);
+ }
+
+ public void setDocumentLocator(XLocator xLocator)
+ throws com.sun.star.xml.sax.SAXException
+ {
+ m_xHandler.setDocumentLocator(xLocator);
+ }
+
+
+ // component management
+
+ public static XSingleServiceFactory __getServiceFactory(String implName,
+ XMultiServiceFactory multiFactory, XRegistryKey regKey)
+ {
+ XSingleServiceFactory xSingleServiceFactory = null;
+ if (implName.equals(__implName) ) {
+ try {
+ xSingleServiceFactory = FactoryHelper.getServiceFactory(
+ Class.forName(implName), __serviceName, multiFactory, regKey);
+ } catch (java.lang.ClassNotFoundException e) {
+ return null;
+ }
+ }
+ return xSingleServiceFactory;
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components
new file mode 100644
index 000000000..87359c3ec
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.components
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://openoffice.org/2010/uno-components">
+ <component loader="com.sun.star.loader.Java2" uri="FlatXmlFilter_java.uno.jar">
+ <implementation name="FlatXml">
+ <service name="devguide.officedev.samples.filter.FlatXmlJava"/>
+ </implementation>
+ </component>
+</components>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.xcu b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.xcu
new file mode 100644
index 000000000..8bb6e2350
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/FlatXmlFilter_java.xcu
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 .
+-->
+<!DOCTYPE oor:component-data SYSTEM "../../../../component-update.dtd">
+<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:package="org.openoffice.TypeDetection" oor:name="Filter">
+ <node oor:name="Filters">
+ <node oor:name="devguide_FlatXMLFilter_Java_calc" oor:op="replace">
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>devguide_FlatXMLType_Cpp_calc</value></prop>
+ <prop oor:name="DocumentService"><value>com.sun.star.sheet.SpreadsheetDocument</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="UserData"><value oor:separator=",">devguide.officedev.samples.filter.FlatXmlJava, ,com.sun.star.comp.Calc.XMLOasisImporter,com.sun.star.comp.Calc.XMLOasisExporter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="UIName">
+ <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. If it is not necessary. -->
+ <value xml:lang="x-no-translate"></value>
+ <value xml:lang="de">DevGuide FlatXML Calc</value>
+ <value xml:lang="en-US">DevGuide FlatXML Calc</value>
+ </prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER</value></prop>
+ </node>
+ <node oor:name="devguide_FlatXMLFilter_Java_draw" oor:op="replace">
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>devguide_FlatXMLType_Cpp_draw</value></prop>
+ <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="UserData"><value oor:separator=",">devguide.officedev.samples.filter.FlatXmlJava, ,com.sun.star.comp.DrawingLayer.XMLOasisImporter,com.sun.star.comp.DrawingLayer.XMLOasisExporter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="UIName">
+ <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. If it is not necessary. -->
+ <value xml:lang="x-no-translate"></value>
+ <value xml:lang="de">DevGuide FlatXML Draw</value>
+ <value xml:lang="en-US">DevGuide FlatXML Draw</value>
+ </prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER</value></prop>
+ </node>
+ <node oor:name="devguide_FlatXMLFilter_Java_impress" oor:op="replace">
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>devguide_FlatXMLType_Cpp_impress</value></prop>
+ <prop oor:name="DocumentService"><value>com.sun.star.presentation.PresentationDocument</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="UserData"><value oor:separator=",">devguide.officedev.samples.filter.FlatXmlJava, ,com.sun.star.comp.Impress.XMLOasisImporter,com.sun.star.comp.Impress.XMLOasisExporter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="UIName">
+ <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. If it is not necessary. -->
+ <value xml:lang="x-no-translate"></value>
+ <value xml:lang="de">DevGuide FlatXML Impress</value>
+ <value xml:lang="en-US">DevGuide FlatXML Impress</value>
+ </prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER</value></prop>
+ </node>
+ <node oor:name="devguide_FlatXMLFilter_Java_writer" oor:op="replace">
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>devguide_FlatXMLType_Cpp_writer</value></prop>
+ <prop oor:name="DocumentService"><value>com.sun.star.text.TextDocument</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="UserData"><value oor:separator=",">devguide.officedev.samples.filter.FlatXmlJava, ,com.sun.star.comp.Writer.XMLOasisImporter,com.sun.star.comp.Writer.XMLOasisExporter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="UIName">
+ <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. If it is not necessary. -->
+ <value xml:lang="x-no-translate"></value>
+ <value xml:lang="de">DevGuide FlatXML Writer</value>
+ <value xml:lang="en-US">DevGuide FlatXML Writer</value>
+ </prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER</value></prop>
+ </node>
+ <node oor:name="devguide_FlatXMLFilter_Java_master" oor:op="replace">
+ <prop oor:name="FileFormatVersion"><value>0</value></prop>
+ <prop oor:name="Type"><value>devguide_FlatXMLType_Cpp_master</value></prop>
+ <prop oor:name="DocumentService"><value>com.sun.star.text.GlobalDocument</value></prop>
+ <prop oor:name="UIComponent"/>
+ <prop oor:name="UserData"><value oor:separator=",">devguide.officedev.samples.filter.FlatXmlJava, ,com.sun.star.comp.Writer.XMLOasisImporter,com.sun.star.comp.Writer.XMLOasisExporter</value></prop>
+ <prop oor:name="FilterService"><value>com.sun.star.comp.Writer.XmlFilterAdaptor</value></prop>
+ <prop oor:name="TemplateName"/>
+ <prop oor:name="UIName">
+ <!-- The x-no-translate entry is a marker to prevent l10n tooling from translation. If it is not necessary. -->
+ <value xml:lang="x-no-translate"></value>
+ <value xml:lang="de">DevGuide FlatXML Master</value>
+ <value xml:lang="en-US">DevGuide FlatXML Master</value>
+ </prop>
+ <prop oor:name="Flags"><value>IMPORT EXPORT ALIEN 3RDPARTYFILTER</value></prop>
+ </node>
+ </node>
+</oor:component-data>
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile
new file mode 100644
index 000000000..58366b7d5
--- /dev/null
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_java/Makefile
@@ -0,0 +1,142 @@
+#*************************************************************************
+#
+# The Contents of this file are made available subject to the terms of
+# the BSD license.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Sun Microsystems, Inc. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+# TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#**************************************************************************
+
+# Builds the Java FlatXMLFilter component example of the Developers Guide.
+
+PRJ=../../../../..
+SETTINGS=$(PRJ)/settings
+
+include $(SETTINGS)/settings.mk
+include $(SETTINGS)/std.mk
+
+# Define non-platform/compiler specific settings
+COMP_NAME=FlatXmlFilter_java
+OUT_COMP_CLASS = $(OUT_CLASS)/$(COMP_NAME)
+COMP_PACKAGE = $(OUT_BIN)/$(COMP_NAME).$(UNOOXT_EXT)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE_DIR)$(PS)$(COMP_NAME).$(UNOOXT_EXT)")
+COMP_JAR_NAME = $(COMP_NAME).uno.jar
+COMP_JAR = $(OUT_COMP_CLASS)/$(COMP_JAR_NAME)
+COMP_MANIFESTFILE = $(OUT_COMP_CLASS)/$(COMP_NAME).uno.Manifest
+COMP_UNOPKG_MANIFEST = $(OUT_COMP_CLASS)/$(COMP_NAME)/META-INF/manifest.xml
+COMP_REGISTERFLAG = $(OUT_MISC)$(PS)devguide_$(COMP_NAME)_register_component.flag
+COMP_COMPONENTS=$(COMP_NAME).components
+
+JAVAFILES = \
+ FlatXml.java \
+
+CLASSFILES = $(patsubst %.java,$(OUT_COMP_CLASS)/%.class,$(JAVAFILES))
+
+
+#$(COMP_NAME)_CLASSFILES = FlatXml.class FlatXml$(dlr)_FlatXml.class
+
+$(COMP_NAME)_CLASSFILES = *.class
+
+SDK_CLASSPATH = $(subst $(EMPTYSTRING) $(PATH_SEPARATOR),$(PATH_SEPARATOR),$(CLASSPATH)\
+ $(PATH_SEPARATOR)$(OUT_COMP_CLASS))
+
+
+# Targets
+.PHONY: ALL
+ALL : \
+ FlatXmlFilterJavaExample
+
+include $(SETTINGS)/stdtarget.mk
+
+$(OUT_COMP_CLASS)/%.Manifest :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo RegistrationClassName: FlatXml> $@
+
+$(CLASSFILES) : $(JAVAFILES)
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ $(SDK_JAVAC) $(JAVAC_FLAGS) -classpath "$(SDK_CLASSPATH)" -d $(OUT_COMP_CLASS) $(JAVAFILES)
+
+# rule for component jar file
+$(COMP_JAR) : $(COMP_MANIFESTFILE) $(CLASSFILES)
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_JAR) cvfm $(@F) $(<F) $($(basename $(basename $(@F)))_CLASSFILES)
+
+# rule for component package manifest
+$(OUT_COMP_CLASS)/%/manifest.xml :
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ @echo $(OSEP)?xml version="$(QM)1.0$(QM)" encoding="$(QM)UTF-8$(QM)"?$(CSEP) > $@
+ @echo $(OSEP)!DOCTYPE manifest:manifest PUBLIC "$(QM)-//OpenOffice.org//DTD Manifest 1.0//EN$(QM)" "$(QM)Manifest.dtd$(QM)"$(CSEP) >> $@
+ @echo $(OSEP)manifest:manifest xmlns:manifest="$(QM)http://openoffice.org/2001/manifest$(QM)"$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.configuration-data$(QM)" >> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)FlatXmlFilter_java.xcu$(QM)"/$(CSEP) >> $@
+ @echo $(SQM) $(SQM)$(OSEP)manifest:file-entry manifest:media-type="$(QM)application/vnd.sun.star.uno-components$(QM)">> $@
+ @echo $(SQM) $(SQM)manifest:full-path="$(QM)$(COMP_COMPONENTS)$(QM)"/$(CSEP)>> $@
+ @echo $(OSEP)/manifest:manifest$(CSEP) >> $@
+
+# rule for component package file
+$(COMP_PACKAGE) : $(COMP_JAR) FlatXmlFilter_java.xcu $(COMP_UNOPKG_MANIFEST) $(COMP_COMPONENTS)
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ $(SDK_ZIP) $@ FlatXmlFilter_java.xcu
+ $(SDK_ZIP) -u $@ $(COMP_COMPONENTS)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)) && $(SDK_ZIP) -u ../../bin/$(@F) $(<F)
+ cd $(subst /,$(PS),$(OUT_COMP_CLASS)/$(subst .$(UNOOXT_EXT),,$(@F))) && $(SDK_ZIP) -u ../../../bin/$(@F) META-INF/manifest.xml
+
+$(COMP_REGISTERFLAG) : $(COMP_PACKAGE)
+ifeq "$(SDK_AUTO_DEPLOYMENT)" "YES"
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+ -$(MKDIR) $(subst /,$(PS),$(@D))
+ $(DEPLOYTOOL) $(COMP_PACKAGE_URL)
+ @echo flagged > $(subst /,$(PS),$@)
+else
+ @echo --------------------------------------------------------------------------------
+ @echo If you want to install your component automatically, please set the environment
+ @echo variable SDK_AUTO_DEPLOYMENT = YES. But note that auto deployment is only
+ @echo possible if no office instance is running.
+ @echo --------------------------------------------------------------------------------
+endif
+
+FlatXmlFilterJavaExample : $(COMP_REGISTERFLAG)
+ @echo --------------------------------------------------------------------------------
+ @echo The Java FlatXmlFilter component is installed if SDK_AUTO_DEPLOYMENT = YES.
+ @echo You can use the filters "$(QM)DevGuide FlatXML ...$(QM)" inside your office installation
+ @echo after you have installed the "$(QM)FlatXmlTypeDetection.uno.pkg"$(QM) as well.
+ @echo --------------------------------------------------------------------------------
+
+%.run: $(OUT_COMP_CLASS)/%.class
+ $(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@)
+
+%.local: $(OUT_COMP_CLASS)/%.class
+ $(SDK_JAVA) -classpath "$(SDK_CLASSPATH)" $(basename $@) local
+
+.PHONY: clean
+clean :
+ -$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_CLASS))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_PACKAGE_URL)))
+ -$(DEL) $(subst \\,\,$(subst /,$(PS),$(COMP_REGISTERFLAG)))