View | Details | Raw Unified | Return to bug 53400
Collapse All | Expand All

(-)src/documentation/content/xdocs/trunk/running.xml (-1 / +3 lines)
Lines 109-115 Link Here
109
      </p>
109
      </p>
110
      <source><![CDATA[
110
      <source><![CDATA[
111
USAGE
111
USAGE
112
Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
112
Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-odt|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
113
 [OPTIONS]
113
 [OPTIONS]
114
  -version          print FOP version and exit
114
  -version          print FOP version and exit
115
  -d                debug mode
115
  -d                debug mode
Lines 164-169 Link Here
164
  -pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF
164
  -pdfa1b outfile   input will be rendered as PDF/A-1b compliant PDF
165
                    (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
165
                    (outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
166
  -awt              input will be displayed on screen
166
  -awt              input will be displayed on screen
167
  -odt outfile      input will be rendered as ODT (outfile req'd)
167
  -rtf outfile      input will be rendered as RTF (outfile req'd)
168
  -rtf outfile      input will be rendered as RTF (outfile req'd)
168
  -pcl outfile      input will be rendered as PCL (outfile req'd)
169
  -pcl outfile      input will be rendered as PCL (outfile req'd)
169
  -ps outfile       input will be rendered as PostScript (outfile req'd)
170
  -ps outfile       input will be rendered as PostScript (outfile req'd)
Lines 197-202 Link Here
197
  fop -xml foo.xml -xsl foo.xsl -foout foo.fo
198
  fop -xml foo.xml -xsl foo.xsl -foout foo.fo
198
  fop -xml - -xsl foo.xsl -pdf -
199
  fop -xml - -xsl foo.xsl -pdf -
199
  fop foo.fo -mif foo.mif
200
  fop foo.fo -mif foo.mif
201
  fop foo.fo -odt foo.odt
200
  fop foo.fo -rtf foo.rtf
202
  fop foo.fo -rtf foo.rtf
201
  fop foo.fo -print
203
  fop foo.fo -print
202
  fop foo.fo -awt]]></source>
204
  fop foo.fo -awt]]></source>
(-)src/documentation/content/xdocs/trunk/output.xml (+9 lines)
Lines 1111-1116 Link Here
1111
      </section>
1111
      </section>
1112
    </section>
1112
    </section>
1113
  </section>
1113
  </section>
1114
<section id="odt">
1115
  <title>ODT</title>
1116
  <p>
1117
    An open source XSL-FO to ODT converter has been integrated into Apache FOP.
1118
    This will create an ODT (rich text format) document that will
1119
    attempt to contain as much information from the XSL-FO document as
1120
    possible.
1121
  </p>
1122
</section>
1114
<section id="rtf">
1123
<section id="rtf">
1115
  <title>RTF</title>
1124
  <title>RTF</title>
1116
  <p>
1125
  <p>
(-)src/java/org/apache/fop/render/odf/FopOdfConverter.java (+47 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf;
19
20
import java.io.OutputStream;
21
22
import org.apache.fop.fo.FONode;
23
24
/**
25
 * Renderer that renders areas to odt.
26
 */
27
public interface FopOdfConverter {
28
29
    /**
30
     * Initialisation of converter
31
     * @throws OdfException
32
     */
33
    void init() throws OdfException;
34
35
    /**
36
     * Write created odf document to the output stream
37
     * @param os output stream
38
     */
39
    void writeToOutputStream(OutputStream os);
40
41
    /**
42
     * Convert FONode with its children to odf document holden by converter
43
     * @param foNode node of xslfo
44
     */
45
    void convertRecursively(FONode foNode);
46
47
}
(-)src/java/org/apache/fop/render/odf/OdfException.java (+35 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf;
19
20
import org.apache.avalon.framework.CascadingException;
21
22
/**
23
 * Generic exception for ODF renders.
24
 */
25
public class OdfException extends CascadingException {
26
27
    /**
28
     *
29
     */
30
    private static final long serialVersionUID = 6464226563894799824L;
31
32
    public OdfException(String message, Throwable throwable) {
33
        super(message, throwable);
34
    }
35
}
(-)src/java/org/apache/fop/render/odf/ODTHandler.java (+74 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf;
19
20
import java.io.OutputStream;
21
22
import org.xml.sax.SAXException;
23
24
import org.apache.fop.apps.FOUserAgent;
25
import org.apache.fop.fo.FOEventHandler;
26
import org.apache.fop.fo.pagination.PageSequence;
27
28
import org.apache.fop.render.odf.odt.FopOdtConverter;
29
30
/**
31
 * ODT Handler: generates ODT output
32
 */
33
public class ODTHandler extends FOEventHandler {
34
35
    private FopOdfConverter converter = new FopOdtConverter();
36
37
    private final OutputStream os;
38
39
    /**
40
     * Constructor : keeping output stream
41
     */
42
    public ODTHandler(FOUserAgent userAgent, OutputStream os) {
43
        super(userAgent);
44
        this.os = os;
45
    }
46
47
    /**
48
     * {@inheritDoc}
49
     */
50
    @Override
51
    public void startDocument() throws SAXException {
52
        try {
53
            converter.init();
54
        } catch (OdfException e) {
55
            e.printStackTrace();
56
        }
57
    }
58
59
    /**
60
     * {@inheritDoc}
61
     */
62
    @Override
63
    public void endDocument() throws SAXException {
64
        converter.writeToOutputStream(os);
65
    }
66
67
    /**
68
     * {@inheritDoc}
69
     */
70
    @Override
71
    public void endPageSequence(PageSequence pageSeq) {
72
        converter.convertRecursively(pageSeq);
73
    }
74
}
(-)src/java/org/apache/fop/render/odf/odt/FopOdtConverter.java (+115 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt;
19
20
import java.io.OutputStream;
21
import java.util.Iterator;
22
23
import org.odftoolkit.odfdom.doc.OdfTextDocument;
24
25
import org.apache.fop.fo.FONode;
26
27
import org.apache.fop.render.odf.FopOdfConverter;
28
import org.apache.fop.render.odf.FopTagType;
29
import org.apache.fop.render.odf.OdfException;
30
import org.apache.fop.render.odf.odt.tags.RootTag;
31
import org.apache.fop.render.odf.odt.tags.Tag;
32
import org.apache.fop.render.odf.odt.tags.TagFactory;
33
34
/**
35
 * Renderer that renders areas to odt.
36
 */
37
public class FopOdtConverter implements FopOdfConverter {
38
39
    OdfTextDocument odt = null;
40
41
    private TagFactory factory = new TagFactory();
42
43
    private Tag actualTag = null;
44
45
    /**
46
     * {@inheritDoc}
47
     * @throws OdfException
48
     */
49
    public void init() throws OdfException {
50
51
        try {
52
            odt = OdfTextDocument.newTextDocument();
53
        } catch (Exception e) {
54
            throw new OdfException("Can't initialize the document", e);
55
        }
56
57
        actualTag = new RootTag(odt);
58
    }
59
60
    /**
61
     * {@inheritDoc}
62
     */
63
    public void writeToOutputStream(OutputStream os) {
64
65
        try {
66
            odt.save(os);
67
        } catch (Exception e) {
68
            System.err.println(e.getMessage());
69
            e.printStackTrace();
70
        }
71
    }
72
73
    /**
74
     * {@inheritDoc}
75
     */
76
    public void convertRecursively(FONode foNode) {
77
        this.convert(foNode, FopTagType.START);
78
79
        if (foNode.getChildNodes() != null) {
80
            for (Iterator<?> it = foNode.getChildNodes(); it.hasNext();) {
81
                FONode fn = (FONode) it.next();
82
                convertRecursively(fn);
83
            }
84
        }
85
86
        this.convert(foNode, FopTagType.END);
87
    }
88
89
    /**
90
     * Convert one tag to the element of odt.
91
     * @param image the image which will be painted
92
     * @param context the renderer context for the current renderer
93
     */
94
    private void convert(FONode foNode, FopTagType type) {
95
        if (type == FopTagType.START) {
96
            try {
97
                actualTag = factory.getTag(this, foNode, actualTag);
98
            } catch (OdfException e1) {
99
                e1.printStackTrace();
100
            }
101
            try {
102
                actualTag.execute();
103
            } catch (OdfException e) {
104
                e.printStackTrace();
105
            }
106
        } else if (type == FopTagType.END) {
107
            try {
108
                actualTag.closeIntercept();
109
            } catch (OdfException e) {
110
                e.printStackTrace();
111
            }
112
            actualTag = actualTag.getParent();
113
        }
114
    }
115
}
(-)src/java/org/apache/fop/render/odf/odt/Namespace.java (+40 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt;
19
20
/**
21
 * Defines namespeces used for odf attributes.
22
 */
23
public final class Namespace {
24
25
    public static final String OFFICE = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
26
27
    public static final String FO     = "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0";
28
29
    public static final String XLINK  = "http://www.w3.org/1999/xlink";
30
31
    public static final String SVG    = "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0";
32
33
    public static final String TABLE  = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
34
35
    public static final String STYLE = "urn:oasis:names:tc:opendocument:xmlns:style:1.0";
36
37
    public static final String TEXT  = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
38
39
    private Namespace() {  }
40
}
(-)src/java/org/apache/fop/render/odf/odt/Style.java (+84 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt;
19
20
import java.util.HashMap;
21
import java.util.Map;
22
import java.util.Map.Entry;
23
24
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
25
26
import org.apache.fop.render.odf.properties.Properties;
27
import org.apache.fop.render.odf.properties.Property;
28
29
/**
30
 * Main class for style management.
31
 */
32
public class Style {
33
34
    private Map<Property, String> parameters = new HashMap<Property, String>();
35
36
    private Style parentStyle = null;
37
38
    /**
39
     * Constructor
40
     */
41
    public Style(Style parentStyle) {
42
        this.parentStyle = parentStyle;
43
    }
44
45
    /**
46
     * Constructor Style for the root tag. Setting default style parameters
47
     */
48
    public Style() {
49
        parameters.put(Properties.FONT_FAMILY, "Times New Roman");
50
        parameters.put(Properties.FONT_SIZE, "12pt");
51
        parameters.put(Properties.COLOR, "#000000");
52
        parameters.put(Properties.TEXT_ALIGN, "left");
53
    }
54
55
    /**
56
     * Get all style parameters
57
     */
58
    public Map<Property, String> getParameters() {
59
        return parameters;
60
    }
61
62
    /**
63
     * get an object from parameters.
64
     */
65
    public String get(Property property) {
66
        String value = parameters.get(property);
67
68
        if (value == null && parentStyle != null) {
69
            value = parentStyle.get(property);
70
        }
71
72
        return value;
73
    }
74
75
    public static String getStyleName(Map<String, StyleStyleElement> styles, StyleStyleElement sse) {
76
        for (Entry<String, StyleStyleElement> entry : styles.entrySet()) {
77
            StyleStyleElement style = entry.getValue();
78
            if (style.equals(sse)) {
79
                return entry.getKey();
80
            }
81
        }
82
        return null;
83
    }
84
}
(-)src/java/org/apache/fop/render/odf/odt/package.html (+23 lines)
Line 0 Link Here
1
<!--
2
  Licensed to the Apache Software Foundation (ASF) under one or more
3
  contributor license agreements.  See the NOTICE file distributed with
4
  this work for additional information regarding copyright ownership.
5
  The ASF licenses this file to You under the Apache License, Version 2.0
6
  (the "License"); you may not use this file except in compliance with
7
  the License.  You may obtain a copy of the License at
8
9
       http://www.apache.org/licenses/LICENSE-2.0
10
11
  Unless required by applicable law or agreed to in writing, software
12
  distributed under the License is distributed on an "AS IS" BASIS,
13
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
  See the License for the specific language governing permissions and
15
  limitations under the License.
16
-->
17
18
<HTML>
19
<TITLE>org.apache.fop.render.odt Package</TITLE>
20
<BODY>
21
<P>ODT render</P>
22
</BODY>
23
</HTML>
(-)src/java/org/apache/fop/render/odf/odt/tags/BasicLinkTag.java (+210 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.odftoolkit.odfdom.dom.element.text.TextAElement;
23
import org.odftoolkit.odfdom.dom.element.text.TextBookmarkRefElement;
24
import org.odftoolkit.odfdom.pkg.OdfElement;
25
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
26
27
import org.w3c.dom.DOMException;
28
29
import org.apache.fop.fo.flow.BasicLink;
30
31
import org.apache.fop.render.odf.OdfException;
32
import org.apache.fop.render.odf.odt.Namespace;
33
import org.apache.fop.render.odf.properties.Properties;
34
import org.apache.fop.render.odf.properties.Property;
35
36
/**
37
 * basic-link converter
38
 */
39
public class BasicLinkTag extends Tag {
40
41
    protected BasicLink bl = null;
42
43
    protected OdfElement oe = null;
44
45
    /**
46
     * Constructor.
47
     */
48
    public BasicLinkTag(Tag parent, BasicLink bl) {
49
        super(parent);
50
        this.bl = bl;
51
        Map<Property, String> params = this.currentStyle.getParameters();
52
53
        params.put(Properties.ALIGNMENT_ADJUST,                    null);
54
        params.put(Properties.ALIGNMENT_BASELINE,                  null);
55
        params.put(Properties.BASELINE_SHIFT,                      Properties.BASELINE_SHIFT.getValue(bl.getBaselineShift()));
56
        params.put(Properties.DOMINANT_BASELINE,                   null);
57
        params.put(Properties.LINE_HEIGHT,                         null);
58
        params.put(Properties.SOURCE_DOCUMENT,                     null);
59
        params.put(Properties.ROLE,                                null);
60
        params.put(Properties.AZIMUTH,                             null);
61
        params.put(Properties.CUE_AFTER,                           null);
62
        params.put(Properties.CUE_BEFORE,                          null);
63
        params.put(Properties.ELEVATION,                           null);
64
        params.put(Properties.PAUSE_AFTER,                         null);
65
        params.put(Properties.PAUSE_BEFORE,                        null);
66
        params.put(Properties.PITCH,                               null);
67
        params.put(Properties.PITCH_RANGE,                         null);
68
        params.put(Properties.PLAY_DURING,                         null);
69
        params.put(Properties.RICHNESS,                            null);
70
        params.put(Properties.SPEAK,                               null);
71
        params.put(Properties.SPEAK_HEADER,                        null);
72
        params.put(Properties.SPEAK_NUMERAL,                       null);
73
        params.put(Properties.SPEAK_PUNCTUATION,                   null);
74
        params.put(Properties.SPEECH_RATE,                         null);
75
        params.put(Properties.STRESS,                              null);
76
        params.put(Properties.VOICE_FAMILY,                        null);
77
        params.put(Properties.VOLUME,                              null);
78
        params.put(Properties.BACKGROUND_ATTACHMENT,               null);
79
        params.put(Properties.BACKGROUND_COLOR,                    Properties.BACKGROUND_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
80
        params.put(Properties.BACKGROUND_IMAGE,                    null);
81
        params.put(Properties.BACKGROUND_REPEAT,                   null);
82
        params.put(Properties.BACKGROUND_POSITION_HORIZONTAL,      null);
83
        params.put(Properties.BACKGROUND_POSITION_VERTICAL,        null);
84
        params.put(Properties.BORDER_BEFORE_COLOR,                 null);
85
        params.put(Properties.BORDER_BEFORE_STYLE,                 null);
86
        params.put(Properties.BORDER_BEFORE_WIDTH,                 null);
87
        params.put(Properties.BORDER_AFTER_COLOR,                  null);
88
        params.put(Properties.BORDER_AFTER_STYLE,                  null);
89
        params.put(Properties.BORDER_AFTER_WIDTH,                  null);
90
        params.put(Properties.BORDER_START_COLOR,                  null);
91
        params.put(Properties.BORDER_START_STYLE,                  null);
92
        params.put(Properties.BORDER_START_WIDTH,                  null);
93
        params.put(Properties.BORDER_END_COLOR,                    null);
94
        params.put(Properties.BORDER_END_STYLE,                    null);
95
        params.put(Properties.BORDER_END_WIDTH,                    null);
96
        params.put(Properties.BORDER_TOP_COLOR,                    null);
97
        params.put(Properties.BORDER_TOP_STYLE,                    null);
98
        params.put(Properties.BORDER_TOP_WIDTH,                    null);
99
        params.put(Properties.BORDER_BOTTOM_COLOR,                 null);
100
        params.put(Properties.BORDER_BOTTOM_STYLE,                 null);
101
        params.put(Properties.BORDER_BOTTOM_WIDTH,                 null);
102
        params.put(Properties.BORDER_LEFT_COLOR,                   null);
103
        params.put(Properties.BORDER_LEFT_STYLE,                   null);
104
        params.put(Properties.BORDER_LEFT_WIDTH,                   null);
105
        params.put(Properties.BORDER_RIGHT_COLOR,                  null);
106
        params.put(Properties.BORDER_RIGHT_STYLE,                  null);
107
        params.put(Properties.BORDER_RIGHT_WIDTH,                  null);
108
        params.put(Properties.PADDING_BEFORE,                      null);
109
        params.put(Properties.PADDING_AFTER,                       null);
110
        params.put(Properties.PADDING_START,                       null);
111
        params.put(Properties.PADDING_END,                         null);
112
        params.put(Properties.PADDING_TOP,                         null);
113
        params.put(Properties.PADDING_BOTTOM,                      null);
114
        params.put(Properties.PADDING_LEFT,                        null);
115
        params.put(Properties.PADDING_RIGHT,                       null);
116
        params.put(Properties.MARGIN_TOP_INLINE,                   null);
117
        params.put(Properties.MARGIN_BOTTOM_INLINE,                null);
118
        params.put(Properties.MARGIN_LEFT_INLINE,                  null);
119
        params.put(Properties.MARGIN_RIGHT_INLINE,                 null);
120
        params.put(Properties.TOP_R,                               null);
121
        params.put(Properties.RIGHT_R,                             null);
122
        params.put(Properties.BOTTOM_R,                            null);
123
        params.put(Properties.LEFT_R,                              null);
124
        params.put(Properties.RELATIVE_POSITION,                   null);
125
        params.put(Properties.KEEP_TOGETHER,                       null);
126
        params.put(Properties.KEEP_WITH_NEXT,                      null);
127
        params.put(Properties.KEEP_WITH_PREVIOUS,                  null);
128
        params.put(Properties.ID,                                  null);
129
        params.put(Properties.DESTINATION_PLACEMENT_OFFSET,        null);
130
        params.put(Properties.EXTERNAL_DESTINATION,                null);
131
        params.put(Properties.INDICATE_DESTINATION,                null);
132
        params.put(Properties.INTERNAL_DESTINATION,                null);
133
        params.put(Properties.SHOW_DESTINATION,                    null);
134
        params.put(Properties.TARGET_PRESENTATION_CONTEXT,         null);
135
        params.put(Properties.TARGET_PROCESSING_CONTEXT,           null);
136
        params.put(Properties.TARGET_STYLESHEET,                   null);
137
        params.put(Properties.INDEX_CLASS,                         null);
138
        params.put(Properties.INDEX_KEY,                           null);
139
        params.put(Properties.PAGE_NUMBER_TREATMENT,               null);
140
141
        // Not in the specification
142
        params.put(Properties.FONT_FAMILY,                         Properties.FONT_FAMILY.getFont(bl.getCommonFont()));
143
        params.put(Properties.FONT_STYLE,                          Properties.FONT_STYLE.getValue(bl.getCommonFont()));
144
        params.put(Properties.FONT_WEIGHT,                         Properties.FONT_WEIGHT.getValue(bl.getCommonFont()));
145
        params.put(Properties.FONT_SIZE,                           Properties.FONT_SIZE.getFontSize(bl.getCommonFont()));
146
        params.put(Properties.COLOR,                               Properties.COLOR.getValue(bl.getColor()));
147
    }
148
149
    public OdfElement getLinkElement() {
150
        return oe;
151
    }
152
153
    @Override
154
    protected OdfElement getTextContainer() {
155
        if (this.oe != null) {
156
            return this.oe;
157
        } else {
158
            return parent.getTextContainer();
159
        }
160
    }
161
162
    /**
163
     * {@inheritDoc}
164
     */
165
    @Override
166
    public void execute() {
167
        if (bl.hasExternalDestination()) {
168
            try {
169
                oe = (TextAElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextAElement.ELEMENT_NAME);
170
            } catch (Exception e1) {
171
                e1.printStackTrace();
172
            }
173
            String url = bl.getExternalDestination();
174
            if (url.startsWith("url")) {
175
                url = url.substring(5, url.length() - 2);
176
            }
177
            oe.setAttributeNS(Namespace.XLINK, "xlink:href", url);
178
            oe.setAttributeNS(Namespace.XLINK, "xlink:type", "simple");
179
        } else if (bl.hasInternalDestination()) {
180
            try {
181
                oe = (TextBookmarkRefElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextBookmarkRefElement.ELEMENT_NAME);
182
            } catch (Exception e) {
183
                e.printStackTrace();
184
            }
185
            oe.setAttributeNS(Namespace.TEXT, "text:ref-name", bl.getInternalDestination());
186
            oe.setAttributeNS(Namespace.TEXT, "text:reference-format", "page");
187
        }
188
    }
189
190
    /**
191
     * {@inheritDoc}
192
     * @throws OdfException
193
     */
194
    @Override
195
    public void closeIntercept() throws OdfException {
196
        try {
197
            parent.getTextContainer().appendChild(oe);
198
        } catch (DOMException e) {
199
            e.printStackTrace();
200
        }
201
    }
202
203
    /**
204
     * {@inheritDoc}
205
     * @throws OdfException
206
     */
207
    public void executeFromParent(TagExecutable child) throws OdfException {
208
        child.execute(this);
209
    }
210
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BidiOverrideTag.java (+93 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.BidiOverride;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * bidi-override converter
29
 */
30
public class BidiOverrideTag extends Tag {
31
32
    protected BidiOverride bo = null;
33
34
    protected BidiOverrideTag(Tag parent, BidiOverride bo) {
35
        super(parent);
36
        this.bo = bo;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.LINE_HEIGHT,             null);
40
        params.put(Properties.LETTER_SPACING,          null);
41
        params.put(Properties.WORD_SPACING,            null);
42
        params.put(Properties.COLOR,                   null);
43
        params.put(Properties.AZIMUTH,                 null);
44
        params.put(Properties.CUE_AFTER,               null);
45
        params.put(Properties.CUE_BEFORE,              null);
46
        params.put(Properties.ELEVATION,               null);
47
        params.put(Properties.PAUSE_AFTER,             null);
48
        params.put(Properties.PAUSE_BEFORE,            null);
49
        params.put(Properties.PITCH,                   null);
50
        params.put(Properties.PITCH_RANGE,             null);
51
        params.put(Properties.PLAY_DURING,             null);
52
        params.put(Properties.RICHNESS,                null);
53
        params.put(Properties.SPEAK,                   null);
54
        params.put(Properties.SPEAK_HEADER,            null);
55
        params.put(Properties.SPEAK_NUMERAL,           null);
56
        params.put(Properties.SPEAK_PUNCTUATION,       null);
57
        params.put(Properties.SPEECH_RATE,             null);
58
        params.put(Properties.STRESS,                  null);
59
        params.put(Properties.VOICE_FAMILY,            null);
60
        params.put(Properties.VOLUME,                  null);
61
        params.put(Properties.FONT_FAMILY,             null);
62
        params.put(Properties.FONT_SELECTION_STRATEGY, null);
63
        params.put(Properties.FONT_SIZE,               null);
64
        params.put(Properties.FONT_STRETCH,            null);
65
        params.put(Properties.FONT_SIZE_ADJUST,        null);
66
        params.put(Properties.FONT_STYLE,              null);
67
        params.put(Properties.FONT_VARIANT,            null);
68
        params.put(Properties.FONT_WEIGHT,             null);
69
        params.put(Properties.TOP_R,                   null);
70
        params.put(Properties.RIGHT_R,                 null);
71
        params.put(Properties.BOTTOM_R,                null);
72
        params.put(Properties.LEFT_R,                  null);
73
        params.put(Properties.RELATIVE_POSITION,       null);
74
        params.put(Properties.ID,                      null);
75
        params.put(Properties.SCORE_SPACES,            null);
76
        params.put(Properties.INDEX_CLASS,             null);
77
        params.put(Properties.INDEX_KEY,               null);
78
        params.put(Properties.DIRECTION,               null);
79
        params.put(Properties.UNICODE_BIDI,            null);
80
81
    }
82
83
    @Override
84
    public void execute() throws OdfException {
85
        // TODO Auto-generated method stub
86
87
    }
88
89
    public void executeFromParent(TagExecutable child) throws OdfException {
90
        child.execute(this);
91
    }
92
93
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BlockContainerTag.java (+133 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.BlockContainer;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * block-container converter
29
 */
30
public class BlockContainerTag extends Tag {
31
32
    protected BlockContainer bc = null;
33
34
    /**
35
     * Constructor
36
     */
37
    protected BlockContainerTag(Tag parent, BlockContainer bc) {
38
        super(parent);
39
        this.bc = bc;
40
        Map<Property, String> params = this.currentStyle.getParameters();
41
42
        params.put(Properties.DISPLAY_ALIGN,                        null);
43
        params.put(Properties.BLOCK_PROGRESSION_DIMENSION,          null);
44
        params.put(Properties.CONTENT_WIDTH,                        null);
45
        params.put(Properties.HEIGHT,                               null);
46
        params.put(Properties.INLINE_PROGRESSION_DIMENSION,         null);
47
        params.put(Properties.WIDTH,                                null);
48
        params.put(Properties.ABSOLUTE_POSITION,                    null);
49
        params.put(Properties.TOP,                                  null);
50
        params.put(Properties.RIGHT,                                null);
51
        params.put(Properties.BOTTOM,                               null);
52
        params.put(Properties.LEFT,                                 null);
53
        params.put(Properties.BACKGROUND_ATTACHMENT,                null);
54
        params.put(Properties.BACKGROUND_COLOR,                     Properties.BACKGROUND_COLOR.getValue(bc.getCommonBorderPaddingBackground()));
55
//        params.put(Properties.backgroundImage,                      null);
56
//        params.put(Properties.backgroundRepeat,                     null);
57
//        params.put(Properties.backgroundPositionHorizontal,         null);
58
//        params.put(Properties.backgroundPositionVertical,           null);
59
//        params.put(Properties.borderBeforeColor,                    null);
60
//        params.put(Properties.borderBeforeStyle,                    null);
61
//        params.put(Properties.borderBeforeWidth,                    null);
62
//        params.put(Properties.borderAfterColor,                     null);
63
//        params.put(Properties.borderAfterStyle,                     null);
64
//        params.put(Properties.borderAfterWidth,                     null);
65
//        params.put(Properties.borderStartColor,                     null);
66
//        params.put(Properties.borderStartStyle,                     null);
67
//        params.put(Properties.borderStartWidth,                     null);
68
//        params.put(Properties.borderEndColor,                       null);
69
//        params.put(Properties.borderEndStyle,                       null);
70
//        params.put(Properties.borderEndWidth,                       null);
71
//        params.put(Properties.borderTopColor,                       null);
72
//        params.put(Properties.borderTopStyle,                       null);
73
//        params.put(Properties.borderTopWidth,                       null);
74
//        params.put(Properties.borderBottomColor,                    null);
75
//        params.put(Properties.borderBottomStyle,                    null);
76
//        params.put(Properties.borderBottomWidth,                    null);
77
//        params.put(Properties.borderLeftColor,                      null);
78
//        params.put(Properties.borderLeftStyle,                      null);
79
//        params.put(Properties.borderLeftWidth,                      null);
80
//        params.put(Properties.borderRightColor,                     null);
81
//        params.put(Properties.borderRightStyle,                     null);
82
//        params.put(Properties.borderRightWidth,                     null);
83
//        params.put(Properties.paddingBefore,                        null);
84
//        params.put(Properties.paddingAfter,                         null);
85
//        params.put(Properties.paddingStart,                         null);
86
//        params.put(Properties.paddingEnd,                           null);
87
//        params.put(Properties.paddingTop,                           null);
88
//        params.put(Properties.paddingBottom,                        null);
89
//        params.put(Properties.paddingLeft,                          null);
90
//        params.put(Properties.paddingRight,                         null);
91
//        params.put(Properties.marginTopBlock,                       null);
92
//        params.put(Properties.marginBottomBlock,                    null);
93
        params.put(Properties.MARGIN_LEFT_BLOCK,                      Properties.MARGIN_LEFT_BLOCK.getMargin(bc.getCommonMarginBlock()));
94
        params.put(Properties.MARGIN_RIGHT_BLOCK,                     Properties.MARGIN_RIGHT_BLOCK.getMargin(bc.getCommonMarginBlock()));
95
//        params.put(Properties.spaceBeforeBlock,                     null);
96
//        params.put(Properties.spaceAfterBlock,                      null);
97
//        params.put(Properties.startIndentBlock,                     null);
98
//        params.put(Properties.endIndentBlock,                       null);
99
//        params.put(Properties.clear,                                null);
100
//        params.put(Properties.intrusionDisplace,                    null);
101
//        params.put(Properties.breakAfter,                           null);
102
//        params.put(Properties.breakBefore,                          null);
103
//        params.put(Properties.keepTogether,                         null);
104
//        params.put(Properties.keepWithNext,                         null);
105
//        params.put(Properties.keepWithPrevious,                     null);
106
//        params.put(Properties.clip,                                 null);
107
//        params.put(Properties.overflow,                             null);
108
//        params.put(Properties.referenceOrientation,                 null);
109
//        params.put(Properties.span,                                 null);
110
//        params.put(Properties.id,                                   null);
111
//        params.put(Properties.zIndex,                               null);
112
//        params.put(Properties.indexClass,                           null);
113
//        params.put(Properties.indexKey,                             null);
114
//        params.put(Properties.writingMode,                          null);
115
    }
116
117
    /**
118
     * {@inheritDoc}
119
     */
120
    @Override
121
    public void execute() {
122
123
    }
124
125
    /**
126
     * {@inheritDoc}
127
     * @throws OdfException
128
     */
129
    public void executeFromParent(TagExecutable child) throws OdfException {
130
        child.execute(this);
131
    }
132
133
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BlockTag.java (+331 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Iterator;
21
import java.util.Map;
22
23
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
24
import org.odftoolkit.odfdom.dom.element.table.TableTableCellElement;
25
import org.odftoolkit.odfdom.dom.element.text.TextBookmarkElement;
26
import org.odftoolkit.odfdom.dom.element.text.TextLineBreakElement;
27
import org.odftoolkit.odfdom.dom.element.text.TextListItemElement;
28
import org.odftoolkit.odfdom.dom.element.text.TextPElement;
29
import org.odftoolkit.odfdom.pkg.OdfElement;
30
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
31
32
import org.apache.fop.fo.FONode;
33
import org.apache.fop.fo.FOText;
34
import org.apache.fop.fo.flow.Block;
35
import org.apache.fop.fo.flow.ListBlock;
36
import org.apache.fop.fo.flow.table.Table;
37
import org.apache.fop.layoutmgr.BlockLayoutManager;
38
import org.apache.fop.render.odf.OdfException;
39
import org.apache.fop.render.odf.odt.Namespace;
40
import org.apache.fop.render.odf.properties.Properties;
41
import org.apache.fop.render.odf.properties.Property;
42
43
/**
44
 * block converter
45
 */
46
public class BlockTag extends Tag {
47
48
    private Block bl = null;
49
50
    private TextPElement paragraph = null;
51
52
    private OdfElement paragraphContainer = null;
53
54
    @Override
55
    protected OdfElement getTextContainer() {
56
        if (this.paragraph != null) {
57
            return this.paragraph;
58
        } else {
59
            return parent.getTextContainer();
60
        }
61
    }
62
63
    /**
64
     * {@inheritDoc}
65
     * @throws OdfException
66
     */
67
    @Override
68
    protected TextPElement getParagraph() throws OdfException {
69
        if (this.paragraph != null) {
70
            return this.paragraph;
71
        } else {
72
            return parent.getParagraph();
73
        }
74
    }
75
76
    /**
77
     * {@inheritDoc}
78
     */
79
    @Override
80
    protected OdfElement getParagraphContainer() {
81
        if (paragraphContainer != null) {
82
            return this.paragraphContainer;
83
        } else {
84
            return parent.getParagraphContainer();
85
        }
86
    }
87
88
    /**
89
     * Constructor
90
     * @throws OdfException
91
     */
92
    BlockTag(Tag parent, Block bl) throws OdfException {
93
        super(parent);
94
        this.bl = bl;
95
        Map<Property, String> params = this.currentStyle.getParameters();
96
97
        params.put(Properties.HYPHENATION_KEEP,                    null);
98
        params.put(Properties.HYPHENATION_LADDER_COUNT,             null);
99
        params.put(Properties.LAST_LINE_END_INDENT,                  null);
100
        params.put(Properties.LINE_HEIGHT,                         null);
101
        params.put(Properties.LINE_HEIGHT_SHIFT_ADJUSTMENT,          null);
102
        params.put(Properties.LINE_STACKING_STRATEGY,               null);
103
        params.put(Properties.LINEFEED_TREATMENT,                  null);
104
        params.put(Properties.WHITE_SPACE_TREATMENT,                null);
105
        params.put(Properties.TEXT_ALIGN,                          Properties.TEXT_ALIGN.getTextAlign(bl.getTextAlign()));
106
        params.put(Properties.TEXT_ALIGN_LAST,                      null);
107
        params.put(Properties.TEXT_INDENT,                         null);
108
        params.put(Properties.WHITE_SPACE_COLLAPSE,                 null);
109
        params.put(Properties.WRAP_OPTION,                         null);
110
        params.put(Properties.COLOR,                              Properties.COLOR.getValue(bl.getColor()));
111
        params.put(Properties.SOURCE_DOCUMENT,                     null);
112
        params.put(Properties.ROLE,                               null);
113
        params.put(Properties.AZIMUTH,                            null);
114
        params.put(Properties.CUE_AFTER,                           null);
115
        params.put(Properties.CUE_BEFORE,                          null);
116
        params.put(Properties.ELEVATION,                          null);
117
        params.put(Properties.PAUSE_AFTER,                         null);
118
        params.put(Properties.PAUSE_BEFORE,                        null);
119
        params.put(Properties.PITCH,                              null);
120
        params.put(Properties.PITCH_RANGE,                         null);
121
        params.put(Properties.PLAY_DURING,                         null);
122
        params.put(Properties.RICHNESS,                           null);
123
//        params.put(Properties.speak,                              null);
124
//        params.put(Properties.speakHeader,                        null);
125
//        params.put(Properties.speakNumeral,                       null);
126
//        params.put(Properties.speakPunctuation,                   null);
127
//        params.put(Properties.speechRate,                         null);
128
//        params.put(Properties.stress,                             null);
129
//        params.put(Properties.voiceFamily,                        null);
130
//        params.put(Properties.volume,                             null);
131
//        params.put(Properties.backgroundAttachment,               null);
132
        params.put(Properties.BACKGROUND_COLOR,                    Properties.BACKGROUND_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
133
//        params.put(Properties.backgroundImage,                    null);
134
//        params.put(Properties.backgroundRepeat,                   null);
135
//        params.put(Properties.backgroundPositionHorizontal,       null);
136
//        params.put(Properties.backgroundPositionVertical,         null);
137
        params.put(Properties.BORDER_BEFORE_COLOR,                  Properties.BORDER_BEFORE_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
138
        params.put(Properties.BORDER_BEFORE_STYLE,                  Properties.BORDER_BEFORE_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
139
        params.put(Properties.BORDER_BEFORE_WIDTH,                  Properties.BORDER_BEFORE_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
140
        params.put(Properties.BORDER_AFTER_COLOR,                   Properties.BORDER_AFTER_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
141
        params.put(Properties.BORDER_AFTER_STYLE,                   Properties.BORDER_AFTER_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
142
        params.put(Properties.BORDER_AFTER_WIDTH,                   Properties.BORDER_AFTER_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
143
        params.put(Properties.BORDER_START_COLOR,                   Properties.BORDER_START_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
144
        params.put(Properties.BORDER_START_STYLE,                   Properties.BORDER_START_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
145
        params.put(Properties.BORDER_START_WIDTH,                   Properties.BORDER_START_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
146
        params.put(Properties.BORDER_END_COLOR,                     Properties.BORDER_END_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
147
        params.put(Properties.BORDER_END_STYLE,                     Properties.BORDER_END_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
148
        params.put(Properties.BORDER_END_WIDTH,                     Properties.BORDER_END_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
149
        params.put(Properties.BORDER_TOP_COLOR,                     Properties.BORDER_TOP_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
150
        params.put(Properties.BORDER_TOP_STYLE,                     Properties.BORDER_TOP_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
151
        params.put(Properties.BORDER_TOP_WIDTH,                     Properties.BORDER_TOP_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
152
        params.put(Properties.BORDER_BOTTOM_COLOR,                  Properties.BORDER_BOTTOM_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
153
        params.put(Properties.BORDER_BOTTOM_STYLE,                  Properties.BORDER_BOTTOM_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
154
        params.put(Properties.BORDER_BOTTOM_WIDTH,                Properties.BORDER_BOTTOM_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
155
        params.put(Properties.BORDER_LEFT_COLOR,                  Properties.BORDER_LEFT_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
156
        params.put(Properties.BORDER_LEFT_STYLE,                  Properties.BORDER_LEFT_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
157
        params.put(Properties.BORDER_LEFT_WIDTH,                  Properties.BORDER_LEFT_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
158
        params.put(Properties.BORDER_RIGHT_COLOR,                 Properties.BORDER_RIGHT_COLOR.getValue(bl.getCommonBorderPaddingBackground()));
159
        params.put(Properties.BORDER_RIGHT_STYLE,                 Properties.BORDER_RIGHT_STYLE.getValue(bl.getCommonBorderPaddingBackground()));
160
        params.put(Properties.BORDER_RIGHT_WIDTH,                 Properties.BORDER_RIGHT_WIDTH.getValue(bl.getCommonBorderPaddingBackground()));
161
        params.put(Properties.PADDING_BEFORE,                     Properties.PADDING_BEFORE.getValue(bl.getCommonBorderPaddingBackground()));
162
        params.put(Properties.PADDING_AFTER,                      Properties.PADDING_AFTER.getValue(bl.getCommonBorderPaddingBackground()));
163
        params.put(Properties.PADDING_START,                      null);
164
        params.put(Properties.PADDING_END,                        null);
165
        params.put(Properties.PADDING_TOP,                        null);
166
        params.put(Properties.PADDING_BOTTOM,                     null);
167
        params.put(Properties.PADDING_LEFT,                       null);
168
        params.put(Properties.PADDING_RIGHT,                      null);
169
        params.put(Properties.FONT_FAMILY,                        Properties.FONT_FAMILY.getFont(bl.getCommonFont()));
170
        params.put(Properties.FONT_SELECTION_STRATEGY,            null);
171
        params.put(Properties.FONT_SIZE,                          Properties.FONT_SIZE.getFontSize(bl.getCommonFont()));
172
        params.put(Properties.FONT_STRETCH,                       null);
173
        params.put(Properties.FONT_SIZE_ADJUST,                   null);
174
        params.put(Properties.FONT_STYLE,                         Properties.FONT_STYLE.getValue(bl.getCommonFont()));
175
        params.put(Properties.FONT_VARIANT,                       Properties.FONT_VARIANT.getValue(bl.getCommonFont()));
176
        params.put(Properties.FONT_WEIGHT,                        Properties.FONT_WEIGHT.getValue(bl.getCommonFont()));
177
        params.put(Properties.COUNTRY,                            null);
178
        params.put(Properties.LANGUAGE,                           null);
179
        params.put(Properties.SCRIPT,                             null);
180
        params.put(Properties.HYPHENATE,                          null);
181
        params.put(Properties.HYPHENATION_CHARACTER,              null);
182
        params.put(Properties.HYPHENATION_PUSH_CHARACTER_COUNT,   null);
183
        params.put(Properties.HYPHENATION_RAMAIN_CHARACTER_COUNT, null);
184
        params.put(Properties.MARGIN_TOP_BLOCK,                   null);
185
        params.put(Properties.MARGIN_BOTTOM_BLOCK,                null);
186
        params.put(Properties.MARGIN_LEFT_BLOCK,                  Properties.MARGIN_LEFT_BLOCK.getMargin(bl.getCommonMarginBlock()));
187
        params.put(Properties.MARGIN_RIGHT_BLOCK,                 Properties.MARGIN_RIGHT_BLOCK.getMargin(bl.getCommonMarginBlock()));
188
        params.put(Properties.SPACE_BEFORE_BLOCK,                 Properties.SPACE_BEFORE_BLOCK.getSpace(bl.getCommonMarginBlock(), new BlockLayoutManager(bl)));
189
        params.put(Properties.SPACE_AFTER_BLOCK,                  Properties.SPACE_AFTER_BLOCK.getSpace(bl.getCommonMarginBlock(), new BlockLayoutManager(bl)));
190
//        params.put(Properties.startIndentBlock,                   null);
191
//        params.put(Properties.endIndentBlock,                     null);
192
//        params.put(Properties.topR,                               null);
193
//        params.put(Properties.rightR,                             null);
194
//        params.put(Properties.bottomR,                            null);
195
//        params.put(Properties.leftR,                              null);
196
//        params.put(Properties.relativePosition,                   null);
197
//        params.put(Properties.clear,                              null);
198
//        params.put(Properties.intrusionDisplace,                  null);
199
//        params.put(Properties.breakAfter,                         null);
200
//        params.put(Properties.breakBefore,                        null);
201
//        params.put(Properties.keepTogether,                       null);
202
//        params.put(Properties.keepWithNext,                       null);
203
//        params.put(Properties.keepWithPrevious,                   null);
204
//        params.put(Properties.orphans,                            null);
205
//        params.put(Properties.windows,                            null);
206
//        params.put(Properties.span,                               null);
207
//        params.put(Properties.id,                                 null);
208
//        params.put(Properties.visibility,                         null);
209
//        params.put(Properties.indexClass,                         null);
210
//        params.put(Properties.indexKey,                           null);
211
        params.put(Properties.BORDER,                    Properties.BORDER.getValue(bl.getCommonBorderPaddingBackground()));
212
//        params.put(Properties.textAltitude,                       null);
213
//        params.put(Properties.textDepth,                          null);
214
215
        registerFont(this.currentStyle.getParameters().get(Properties.FONT_FAMILY));
216
    }
217
218
    /**
219
     * {@inheritDoc}
220
     * @throws OdfException
221
     */
222
    @Override
223
    public void execute() throws OdfException {
224
        parent.executeFromParent(this);
225
    }
226
227
    /**
228
     * {@inheritDoc}
229
     * @throws OdfException
230
     */
231
    @Override
232
    public void execute(Tag tag) throws OdfException {
233
234
        if (!bl.hasChildren()) {
235
            addLineBreak();
236
        } else {
237
            if (!childrenAreOnlyBlocks(this.bl)) {
238
                this.paragraph = this.newParagraph(parent.getParagraphContainer());
239
                StyleStyleElement sse = this.generateOdtStyle(this.currentStyle);
240
                sse.setAttributeNS(Namespace.STYLE, "style:family", "paragraph");
241
                this.paragraph.setStyleName(this.appendNewStyle(sse));
242
243
                if (bl.getId() != null) {
244
                    insertBookmark(bl.getId());
245
                }
246
            }
247
        }
248
    }
249
250
    private void insertBookmark(String id) throws OdfException {
251
        TextBookmarkElement tbe = null;
252
        try {
253
            tbe = (TextBookmarkElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextBookmarkElement.ELEMENT_NAME);
254
        } catch (Exception e) {
255
            throw new OdfException("Can't create link intern.", e);
256
        }
257
        tbe.setAttributeNS(Namespace.TEXT, "text:name", id);
258
        this.paragraph.appendChild(tbe);
259
    }
260
261
    /**
262
     * {@inheritDoc}
263
     * @throws OdfException
264
     */
265
    @Override
266
    public void execute(TableCellTag tag) throws OdfException {
267
        TableTableCellElement ttce = tag.getTableCellElement();
268
269
        this.paragraphContainer = ttce;
270
271
        if (!childrenAreOnlyBlocks(this.bl)) {
272
            this.paragraph = this.newParagraph(this.paragraphContainer);
273
        }
274
    }
275
276
    /**
277
     * {@inheritDoc}
278
     * @throws OdfException
279
     */
280
    @Override
281
    public void execute(ListItemTag tag) throws OdfException {
282
        TextListItemElement tlie = tag.getTextListItemElement();
283
284
        this.paragraphContainer = tlie;
285
286
        if (!childrenAreOnlyBlocks(this.bl)) {
287
            this.paragraph = this.newParagraph(this.paragraphContainer);
288
        }
289
    }
290
291
    private void addLineBreak() throws OdfException {
292
        TextLineBreakElement tlb = null;
293
        try {
294
            tlb = (TextLineBreakElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextLineBreakElement.ELEMENT_NAME);
295
        } catch (Exception e) {
296
            e.printStackTrace();
297
        }
298
299
        this.getParagraph().appendChild(tlb);
300
    }
301
302
    private boolean childrenAreOnlyBlocks(Block bl) {
303
304
        if (bl.hasChildren()) {
305
            for (Iterator<?> it = bl.getChildNodes(); it.hasNext();) {
306
                FONode next = (FONode) it.next();
307
                if (!(next instanceof Block || next instanceof ListBlock || next instanceof Table) ) {
308
                    if (next instanceof FOText) {
309
                        if ( ((FOText) next).length() != 0) {
310
                            return false;
311
                        }
312
                    } else {
313
                        return false;
314
                    }
315
                }
316
            }
317
        } else {
318
            return false;
319
        }
320
321
        return true;
322
    }
323
324
    /**
325
     * {@inheritDoc}
326
     * @throws OdfException
327
     */
328
    public void executeFromParent(TagExecutable child) throws OdfException {
329
        child.execute(this);
330
    }
331
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BookmarkTag.java (+57 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.pagination.bookmarks.Bookmark;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * bookmark converter
29
 */
30
public class BookmarkTag extends Tag {
31
32
    protected Bookmark bm = null;
33
34
    protected BookmarkTag(Tag parent, Bookmark bm) {
35
        super(parent);
36
        this.bm = bm;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.SOURCE_DOCUMENT,                        null);
40
        params.put(Properties.ROLE,                                   null);
41
        params.put(Properties.EXTERNAL_DESTINATION,                   null);
42
        params.put(Properties.INTERNAL_DESTINATION,                   null);
43
        params.put(Properties.STARTING_STATE,                         null);
44
45
    }
46
47
    @Override
48
    public void execute() throws OdfException {
49
        // TODO Auto-generated method stub
50
51
    }
52
53
    public void executeFromParent(TagExecutable child) throws OdfException {
54
        child.execute(this);
55
    }
56
57
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BookmarkTitleTag.java (+57 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.pagination.bookmarks.BookmarkTitle;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * bookmark-title converter
29
 */
30
public class BookmarkTitleTag extends Tag {
31
32
    protected BookmarkTitle bt = null;
33
34
    public BookmarkTitleTag(Tag parent, BookmarkTitle bt) {
35
        super(parent);
36
        this.bt = bt;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.COLOR,                                  null);
40
        params.put(Properties.SOURCE_DOCUMENT,                        null);
41
        params.put(Properties.ROLE,                                   null);
42
        params.put(Properties.FONT_STYLE,                             null);
43
        params.put(Properties.FONT_WEIGHT,                            null);
44
45
    }
46
47
    @Override
48
    public void execute() throws OdfException {
49
        // TODO Auto-generated method stub
50
51
    }
52
53
    public void executeFromParent(TagExecutable child) throws OdfException {
54
        child.execute(this);
55
    }
56
57
}
(-)src/java/org/apache/fop/render/odf/odt/tags/BookmarkTreeTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.bookmarks.BookmarkTree;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class BookmarkTreeTag extends Tag {
24
25
    protected BookmarkTree bt = null;
26
27
    protected BookmarkTreeTag(Tag parent, BookmarkTree bt) {
28
        super(parent);
29
        this.bt = bt;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ChangeBarBeginTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class ChangeBarBeginTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected ChangeBarBeginTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ChangeBarEndTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class ChangeBarEndTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected ChangeBarEndTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/CharacterTag.java (+161 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.Character;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * Character converter
29
 */
30
public class CharacterTag extends Tag {
31
32
    protected Character c = null;
33
34
    CharacterTag(Tag actualTag, Character c) {
35
        super(actualTag);
36
        this.c = c;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.ALIGNMENT_ADJUST,                    null);
40
        params.put(Properties.ALIGNMENT_BASELINE,                  null);
41
        params.put(Properties.BASELINE_SHIFT,                      Properties.BASELINE_SHIFT.getValue(c.getBaselineShift()));
42
        params.put(Properties.DOMINANT_BASELINE,                   null);
43
        params.put(Properties.LINE_HEIGHT,                         null);
44
        params.put(Properties.CHARACTER,                          null);
45
        params.put(Properties.LETTER_SPACING,                      null);
46
        params.put(Properties.SUPPRESS_AT_LINE_BREAK,                null);
47
        params.put(Properties.TEXT_DECORATION,                     null);
48
        params.put(Properties.TEXT_SHADOW,                         null);
49
        params.put(Properties.TEXT_TRANSFORM,                      null);
50
        params.put(Properties.TREAT_AS_WORD_SPACE,                   null);
51
        params.put(Properties.COLOR,                              null);
52
        params.put(Properties.AZIMUTH,                            null);
53
//        params.put(Properties.cueAfter,                           null);
54
//        params.put(Properties.cueBefore,                          null);
55
//        params.put(Properties.elevation,                          null);
56
//        params.put(Properties.pauseAfter,                         null);
57
//        params.put(Properties.pauseBefore,                        null);
58
//        params.put(Properties.pitch,                              null);
59
//        params.put(Properties.pitchRange,                         null);
60
//        params.put(Properties.playDuring,                         null);
61
//        params.put(Properties.richness,                           null);
62
//        params.put(Properties.speak,                              null);
63
//        params.put(Properties.speakHeader,                        null);
64
//        params.put(Properties.speakNumeral,                       null);
65
//        params.put(Properties.speakPunctuation,                   null);
66
//        params.put(Properties.speechRate,                         null);
67
//        params.put(Properties.stress,                             null);
68
//        params.put(Properties.voiceFamily,                        null);
69
//        params.put(Properties.volume,                             null);
70
//        params.put(Properties.backgroundAttachment,               null);
71
        params.put(Properties.BACKGROUND_COLOR,                    Properties.BACKGROUND_COLOR.getValue(c.getCommonBorderPaddingBackground()));
72
        params.put(Properties.BACKGROUND_IMAGE,                    null);
73
//        params.put(Properties.backgroundRepeat,                   null);
74
//        params.put(Properties.backgroundPositionHorizontal,       null);
75
//        params.put(Properties.backgroundPositionVertical,         null);
76
//        params.put(Properties.borderBeforeColor,                  null);
77
//        params.put(Properties.borderBeforeStyle,                  null);
78
//        params.put(Properties.borderBeforeWidth,                  null);
79
//        params.put(Properties.borderAfterColor,                   null);
80
//        params.put(Properties.borderAfterStyle,                   null);
81
//        params.put(Properties.borderAfterWidth,                   null);
82
//        params.put(Properties.borderStartColor,                   null);
83
//        params.put(Properties.borderStartStyle,                   null);
84
//        params.put(Properties.borderStartWidth,                   null);
85
//        params.put(Properties.borderEndColor,                     null);
86
//        params.put(Properties.borderEndStyle,                     null);
87
//        params.put(Properties.borderEndWidth,                     null);
88
//        params.put(Properties.borderTopColor,                     null);
89
//        params.put(Properties.borderTopStyle,                     null);
90
//        params.put(Properties.borderTopWidth,                     null);
91
//        params.put(Properties.borderBottomColor,                  null);
92
//        params.put(Properties.borderBottomStyle,                  null);
93
//        params.put(Properties.borderBottomWidth,                  null);
94
//        params.put(Properties.borderLeftColor,                    null);
95
//        params.put(Properties.borderLeftStyle,                    null);
96
//        params.put(Properties.borderLeftWidth,                    null);
97
//        params.put(Properties.borderRightColor,                   null);
98
//        params.put(Properties.borderRightStyle,                   null);
99
//        params.put(Properties.borderRightWidth,                   null);
100
//        params.put(Properties.paddingBefore,                      null);
101
//        params.put(Properties.paddingAfter,                       null);
102
//        params.put(Properties.paddingStart,                       null);
103
//        params.put(Properties.paddingEnd,                         null);
104
//        params.put(Properties.paddingTop,                         null);
105
//        params.put(Properties.paddingBottom,                      null);
106
//        params.put(Properties.paddingLeft,                        null);
107
//        params.put(Properties.paddingRight,                       null);
108
//        params.put(Properties.fontFamily,                         null);
109
//        params.put(Properties.fontSelectionStrategy,              null);
110
//        params.put(Properties.fontSize,                           null);
111
//        params.put(Properties.fontStretch,                        null);
112
//        params.put(Properties.fontSizeAdjust,                     null);
113
//        params.put(Properties.fontStyle,                          null);
114
//        params.put(Properties.fontVariant,                        null);
115
//        params.put(Properties.fontWeight,                         null);
116
//        params.put(Properties.country,                            null);
117
//        params.put(Properties.language,                           null);
118
//        params.put(Properties.script,                             null);
119
//        params.put(Properties.hyphenate,                          null);
120
//        params.put(Properties.hyphenationCharacter,               null);
121
//        params.put(Properties.hyphenationPushCharacterCount,      null);
122
//        params.put(Properties.hyphenationRamainCharacterCount,    null);
123
//        params.put(Properties.marginTopInline,                    null);
124
//        params.put(Properties.marginBottomInline,                 null);
125
//        params.put(Properties.marginLeftInline,                   null);
126
//        params.put(Properties.marginRightInline,                  null);
127
//        params.put(Properties.spaceEndInline,                     null);
128
//        params.put(Properties.spaceStartInline,                   null);
129
//        params.put(Properties.topR,                               null);
130
//        params.put(Properties.rightR,                             null);
131
//        params.put(Properties.bottomR,                            null);
132
//        params.put(Properties.leftR,                              null);
133
//        params.put(Properties.relativePosition,                   null);
134
//        params.put(Properties.keepWithNext,                       null);
135
//        params.put(Properties.keepWithPrevious,                   null);
136
//        params.put(Properties.id,                                 null);
137
//        params.put(Properties.scoreSpaces,                        null);
138
//        params.put(Properties.visibility,                         null);
139
//        params.put(Properties.indexClass,                         null);
140
//        params.put(Properties.indexKey,                           null);
141
//        params.put(Properties.glyphOrientationHorizontal,         null);
142
//        params.put(Properties.glyphOrientationVertical,           null);
143
//        params.put(Properties.textAltitude,                       null);
144
//        params.put(Properties.textDepth,                          null);
145
    }
146
147
    /**
148
     * {@inheritDoc}
149
     */
150
    @Override
151
    public void execute() { }
152
153
    /**
154
     * {@inheritDoc}
155
     * @throws OdfException
156
     */
157
    public void executeFromParent(TagExecutable child) throws OdfException {
158
        child.execute(this);
159
    }
160
161
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ColorProfileTag.java (+49 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.pagination.ColorProfile;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
public class ColorProfileTag extends Tag {
28
29
    protected ColorProfile cp = null;
30
31
    protected ColorProfileTag(Tag parent, ColorProfile cp) {
32
        super(parent);
33
        this.cp = cp;
34
        Map<Property, String> params = this.currentStyle.getParameters();
35
36
        params.put(Properties.SRC,   null);
37
    }
38
39
    @Override
40
    public void execute() throws OdfException {
41
        // TODO Auto-generated method stub
42
43
    }
44
45
    public void executeFromParent(TagExecutable child) throws OdfException {
46
        child.execute(this);
47
    }
48
49
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ConditionalPageMasterReferenceTag.java (+53 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.pagination.ConditionalPageMasterReference;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
public class ConditionalPageMasterReferenceTag extends Tag {
28
29
    protected ConditionalPageMasterReference cpmr = null;
30
31
    protected ConditionalPageMasterReferenceTag(Tag parent, ConditionalPageMasterReference cpmr) {
32
        super(parent);
33
        this.cpmr = cpmr;
34
        Map<Property, String> params = this.currentStyle.getParameters();
35
36
        params.put(Properties.BLANK_OR_NOT_BLANK,                     null);
37
        params.put(Properties.MASTER_REFERENCE,                       null);
38
        params.put(Properties.ODD_OR_EVEN,                            null);
39
        params.put(Properties.PAGE_POSITION,                          null);
40
41
    }
42
43
    @Override
44
    public void execute() throws OdfException {
45
        // TODO Auto-generated method stub
46
47
    }
48
49
    public void executeFromParent(TagExecutable child) throws OdfException {
50
        child.execute(this);
51
    }
52
53
}
(-)src/java/org/apache/fop/render/odf/odt/tags/DeclarationsTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.Declarations;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class DeclarationsTag extends Tag {
24
25
    protected Declarations d = null;
26
27
    protected DeclarationsTag(Tag parent, Declarations d) {
28
        super(parent);
29
        this.d = d;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ExternalGraphicTag.java (+350 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.io.IOException;
21
import java.io.InputStream;
22
import java.util.Map;
23
import java.util.Random;
24
25
import org.odftoolkit.odfdom.dom.element.draw.DrawFrameElement;
26
import org.odftoolkit.odfdom.dom.element.draw.DrawImageElement;
27
import org.odftoolkit.odfdom.dom.element.text.TextParagraphElementBase;
28
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
29
30
import org.apache.commons.io.IOUtils;
31
32
import org.apache.xmlgraphics.image.loader.Image;
33
import org.apache.xmlgraphics.image.loader.ImageFlavor;
34
import org.apache.xmlgraphics.image.loader.ImageInfo;
35
import org.apache.xmlgraphics.image.loader.ImageManager;
36
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
37
import org.apache.xmlgraphics.image.loader.impl.ImageRawStream;
38
import org.apache.xmlgraphics.image.loader.util.ImageUtil;
39
40
import org.apache.fop.apps.FOUserAgent;
41
42
import org.apache.fop.datatypes.LengthBase;
43
import org.apache.fop.fo.FObj;
44
import org.apache.fop.fo.flow.AbstractGraphics;
45
import org.apache.fop.fo.flow.ExternalGraphic;
46
import org.apache.fop.layoutmgr.inline.ImageLayout;
47
import org.apache.fop.render.odf.OdfException;
48
import org.apache.fop.render.odf.odt.Namespace;
49
import org.apache.fop.render.odf.properties.Properties;
50
import org.apache.fop.render.odf.properties.Property;
51
52
/**
53
 * External Graphic converter
54
 */
55
public class ExternalGraphicTag extends Tag {
56
57
    public static class PercentBaseContext implements org.apache.fop.datatypes.PercentBaseContext {
58
59
        Image image = null;
60
61
        public PercentBaseContext(Image image) {
62
            this.image = image;
63
        }
64
65
        public int getBaseLength(int lengthBase, FObj fobj) {
66
67
            final ImageInfo info = image.getInfo();
68
69
            switch (lengthBase) {
70
            case LengthBase.IMAGE_INTRINSIC_WIDTH:
71
                return info.getSize().getWidthMpt();
72
            case LengthBase.IMAGE_INTRINSIC_HEIGHT:
73
                return info.getSize().getHeightMpt();
74
            default:
75
                return info.getSize().getHeightMpt();
76
            }
77
        }
78
    }
79
80
    public static final String ODT_IMAGES_PATH = "Pictures/";
81
82
    ExternalGraphic eg = null;
83
84
    ExternalGraphicTag(Tag parent, ExternalGraphic eg) {
85
        super(parent);
86
        this.eg = eg;
87
        Map<Property, String> params = this.currentStyle.getParameters();
88
89
//        params.put(Properties.alignmentAdjust,                       null);
90
//        params.put(Properties.alignmentBaseline,                     null);
91
//        params.put(Properties.baselineShift,                         null);
92
//        params.put(Properties.displayAlign,                          null);
93
//        params.put(Properties.dominantBaseline,                      null);
94
//        params.put(Properties.allowedHeightScale,                   null);
95
//        params.put(Properties.allowedWidthScale,                    null);
96
//        params.put(Properties.blockProgressionDimension,            null);
97
//        params.put(Properties.contentHeight,                         null);
98
//        params.put(Properties.contentWidth,                          null);
99
//        params.put(Properties.height,                                 null);
100
//        params.put(Properties.inlineProgressionDimension,           null);
101
//        params.put(Properties.scaling,                                null);
102
//        params.put(Properties.scalingMethod,                         null);
103
//        params.put(Properties.width,                                  null);
104
//        params.put(Properties.lineHeight,                            null);
105
//        params.put(Properties.textAlign,                             null);
106
//        params.put(Properties.sourceDocument,                        null);
107
//        params.put(Properties.role,                                   null);
108
//        params.put(Properties.azimuth,                                null);
109
//        params.put(Properties.cueAfter,                              null);
110
//        params.put(Properties.cueBefore,                             null);
111
//        params.put(Properties.elevation,                              null);
112
//        params.put(Properties.pauseAfter,                            null);
113
//        params.put(Properties.pauseBefore,                           null);
114
//        params.put(Properties.pitch,                                  null);
115
//        params.put(Properties.pitchRange,                            null);
116
//        params.put(Properties.playDuring,                            null);
117
//        params.put(Properties.richness,                               null);
118
//        params.put(Properties.speak,                                  null);
119
//        params.put(Properties.speakHeader,                           null);
120
//        params.put(Properties.speakNumeral,                   null);
121
//        params.put(Properties.speakPunctuation,               null);
122
//        params.put(Properties.speechRate,                     null);
123
//        params.put(Properties.stress,                         null);
124
//        params.put(Properties.voiceFamily,                    null);
125
//        params.put(Properties.volume,                         null);
126
//        params.put(Properties.backgroundAttachment,           null);
127
        params.put(Properties.BACKGROUND_COLOR,                Properties.BACKGROUND_COLOR.getValue(eg.getCommonBorderPaddingBackground()));
128
//        params.put(Properties.backgroundImage,                null);
129
//        params.put(Properties.backgroundRepeat,               null);
130
//        params.put(Properties.backgroundPositionHorizontal,   null);
131
//        params.put(Properties.backgroundPositionVertical,     null);
132
//        params.put(Properties.borderBeforeColor,              null);
133
//        params.put(Properties.borderBeforeStyle,              null);
134
//        params.put(Properties.borderBeforeWidth,              null);
135
//        params.put(Properties.borderAfterColor,               null);
136
//        params.put(Properties.borderAfterStyle,               null);
137
//        params.put(Properties.borderAfterWidth,               null);
138
//        params.put(Properties.borderStartColor,               null);
139
//        params.put(Properties.borderStartStyle,               null);
140
//        params.put(Properties.borderStartWidth,               null);
141
//        params.put(Properties.borderEndColor,                 null);
142
//        params.put(Properties.borderEndStyle,                 null);
143
//        params.put(Properties.borderEndWidth,                 null);
144
//        params.put(Properties.borderTopColor,                       null);
145
//        params.put(Properties.borderTopStyle,                       null);
146
//        params.put(Properties.borderTopWidth,                       null);
147
//        params.put(Properties.borderBottomColor,                    null);
148
//        params.put(Properties.borderBottomStyle,                    null);
149
//        params.put(Properties.borderBottomWidth,                    null);
150
//        params.put(Properties.borderLeftColor,                      null);
151
//        params.put(Properties.borderLeftStyle,                      null);
152
//        params.put(Properties.borderLeftWidth,                      null);
153
//        params.put(Properties.borderRightColor,                     null);
154
//        params.put(Properties.borderRightStyle,                     null);
155
//        params.put(Properties.borderRightWidth,                     null);
156
//        params.put(Properties.paddingBefore,                         null);
157
//        params.put(Properties.paddingAfter,                          null);
158
//        params.put(Properties.paddingStart,                          null);
159
//        params.put(Properties.paddingEnd,                            null);
160
//        params.put(Properties.paddingTop,                            null);
161
//        params.put(Properties.paddingBottom,                         null);
162
//        params.put(Properties.paddingLeft,                           null);
163
//        params.put(Properties.paddingRight,                          null);
164
//        params.put(Properties.marginTopInline,                      null);
165
//        params.put(Properties.marginBottomInline,                   null);
166
//        params.put(Properties.marginLeftInline,                     null);
167
//        params.put(Properties.marginRightInline,                    null);
168
//        params.put(Properties.spaceEndInline,                       null);
169
//        params.put(Properties.spaceStartInline,                     null);
170
//        params.put(Properties.topR,                                  null);
171
//        params.put(Properties.rightR,                                null);
172
//        params.put(Properties.bottomR,                               null);
173
//        params.put(Properties.leftR,                                 null);
174
//        params.put(Properties.relativePosition,                      null);
175
//        params.put(Properties.keepWithNext,                         null);
176
//        params.put(Properties.keepWithPrevious,                     null);
177
//        params.put(Properties.clip,                                   null);
178
//        params.put(Properties.overflow,                               null);
179
//        params.put(Properties.id,                                     null);
180
//        params.put(Properties.src,                                    null);
181
//        params.put(Properties.indexClass,                            null);
182
//        params.put(Properties.indexKey,                              null);
183
184
    }
185
186
    /**
187
     * {@inheritDoc}
188
     * @throws OdfException
189
     */
190
    @Override
191
    public void execute() throws OdfException {
192
193
        ImageInfo info = null;
194
        FOUserAgent userAgent = eg.getUserAgent();
195
        ImageManager manager = userAgent.getImageManager();
196
197
        try {
198
            info = manager.getImageInfo(eg.getURL(), userAgent.getImageSessionContext());
199
            putGraphic(eg, info);
200
        } catch (Exception e) {
201
            throw new OdfException("Can't create an image.", e);
202
        }
203
    }
204
205
    private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
206
        ImageFlavor.RAW_EMF,
207
        ImageFlavor.RAW_PNG,
208
        ImageFlavor.RAW_JPEG
209
    };
210
211
    private void putGraphic(AbstractGraphics abstractGraphic, ImageInfo info)
212
            throws OdfException {
213
214
            FOUserAgent userAgent = abstractGraphic.getUserAgent();
215
            ImageManager manager = userAgent.getImageManager();
216
            ImageSessionContext sessionContext = userAgent.getImageSessionContext();
217
            Map<?, ?> hints = ImageUtil.getDefaultHints(sessionContext);
218
            Image image;
219
            try {
220
                image = manager.getImage(info, FLAVORS, hints, sessionContext);
221
            } catch (Exception e) {
222
                throw new OdfException("Can't create an image.", e);
223
            }
224
225
            putGraphic(abstractGraphic, image);
226
    }
227
228
    private void putGraphic(AbstractGraphics abstractGraphic, Image image)
229
            throws OdfException {
230
231
        byte[] rawData;
232
        try {
233
            rawData = getRawData(image);
234
        } catch (IOException e) {
235
            throw new OdfException("Can't create an image.", e);
236
        }
237
238
        if (rawData == null) {
239
            return;
240
        }
241
242
        ImageLayout layout = getImageLayout(abstractGraphic, image);
243
244
        String imageType = image.getInfo().getMimeType().split("/")[1];
245
246
        String filename = createFilename(imageType);
247
248
        putImageFileIntoOdt(rawData, filename, imageType);
249
250
        DrawImageElement die = createImage();
251
252
        die.setAttributeNS(Namespace.XLINK, "xlink:href", ODT_IMAGES_PATH + filename);
253
        die.setAttributeNS(Namespace.XLINK, "xlink:type", "simple");
254
        die.setAttributeNS(Namespace.XLINK, "xlink:show", "embed");
255
        die.setAttributeNS(Namespace.XLINK, "xlink:actuate", "onLoad");
256
257
        DrawFrameElement dfe = createImageFrame();
258
259
        dfe.setAttributeNS(Namespace.SVG, "svg:width", Double.valueOf(layout.getViewportSize().getWidth() / 1000) + "pt");
260
        dfe.setAttributeNS(Namespace.SVG, "svg:height", Double.valueOf(layout.getViewportSize().getHeight() / 1000) + "pt");
261
262
        addImageToImageFrame(die, dfe);
263
264
        addImageFrameToParagraph(dfe, this.getParagraph());
265
    }
266
267
    private byte[] getRawData(Image image) throws IOException {
268
269
        byte[] rawData = null;
270
271
        if (image instanceof ImageRawStream) {
272
            ImageRawStream rawImage = (ImageRawStream)image;
273
            InputStream in = rawImage.createInputStream();
274
            try {
275
                rawData = IOUtils.toByteArray(in);
276
            } finally {
277
                IOUtils.closeQuietly(in);
278
            }
279
        }
280
        return rawData;
281
    }
282
283
    private ImageLayout getImageLayout(AbstractGraphics abstractGraphic, Image image) {
284
285
        PercentBaseContext pContext = new ExternalGraphicTag.PercentBaseContext(image);
286
287
        return new ImageLayout( abstractGraphic,
288
                                pContext,
289
                                image.getInfo().getSize().getDimensionMpt());
290
    }
291
292
    private void putImageFileIntoOdt(byte[] rawData, String filename, String imageType) {
293
        this.getOdt().getPackage().insert(rawData, ODT_IMAGES_PATH + filename, imageType);
294
    }
295
296
    private String createFilename(String imageType) {
297
        String filename = null;
298
299
        do {
300
            Random randomGenerator = new Random();
301
            filename = randomGenerator.nextInt(100) + "." + imageType;
302
        } while(this.getOdt().getPackage().contains(ODT_IMAGES_PATH + filename));
303
304
        return filename;
305
    }
306
307
    private DrawImageElement createImage() throws OdfException {
308
        DrawImageElement die = null;
309
        try {
310
            die = (DrawImageElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), DrawImageElement.ELEMENT_NAME);
311
        } catch (Exception e) {
312
            throw new OdfException("Can't create an image.", e);
313
        }
314
        return die;
315
    }
316
317
    private DrawFrameElement createImageFrame() {
318
        DrawFrameElement dfe = null;
319
        try {
320
            dfe = (DrawFrameElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), DrawFrameElement.ELEMENT_NAME);
321
        } catch (Exception e) {
322
            e.printStackTrace();
323
        }
324
        return dfe;
325
    }
326
327
    private void addImageToImageFrame(DrawImageElement die, DrawFrameElement dfe) throws OdfException {
328
        try {
329
            dfe.appendChild(die);
330
        } catch (Exception e) {
331
            throw new OdfException("Can't create an image.", e);
332
        }
333
    }
334
335
    private void addImageFrameToParagraph(DrawFrameElement dfe, TextParagraphElementBase tpeb) {
336
        try {
337
            tpeb.appendChild(dfe);
338
        } catch (Exception e) {
339
            e.printStackTrace();
340
        }
341
    }
342
343
    /**
344
     * {@inheritDoc}
345
     * @throws OdfException
346
     */
347
    public void executeFromParent(TagExecutable child) throws OdfException {
348
        child.execute(this);
349
    }
350
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FloatTag.java (+53 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.Float;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
public class FloatTag extends Tag {
28
29
    protected Float f = null;
30
31
    protected FloatTag(Tag parent, Float f) {
32
        super(parent);
33
        this.f = f;
34
        Map<Property, String> params = this.currentStyle.getParameters();
35
36
        params.put(Properties.CLEAR,                null);
37
        params.put(Properties.FLOAT_PROPERTY,        null);
38
        params.put(Properties.ID,                   null);
39
        params.put(Properties.INDEX_CLASS,           null);
40
        params.put(Properties.INDEX_KEY,             null);
41
    }
42
43
    @Override
44
    public void execute() throws OdfException {
45
        // TODO Auto-generated method stub
46
47
    }
48
49
    public void executeFromParent(TagExecutable child) throws OdfException {
50
        child.execute(this);
51
    }
52
53
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowAssignmentTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class FlowAssignmentTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected FlowAssignmentTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowMapTag.java (+48 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
public class FlowMapTag extends Tag {
27
28
    protected Object o = null;
29
30
    protected FlowMapTag(Tag parent, Object o) {
31
        super(parent);
32
        this.o = o;
33
        Map<Property, String> params = this.currentStyle.getParameters();
34
35
        params.put(Properties.FLOW_MAP_NAME,                          null);
36
    }
37
38
    @Override
39
    public void execute() throws OdfException {
40
        // TODO Auto-generated method stub
41
42
    }
43
44
    public void executeFromParent(TagExecutable child) throws OdfException {
45
        child.execute(this);
46
    }
47
48
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowNameSpecifierTag.java (+48 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
public class FlowNameSpecifierTag extends Tag {
27
28
    protected Object o = null;
29
30
    protected FlowNameSpecifierTag(Tag parent, Object o) {
31
        super(parent);
32
        this.o = o;
33
        Map<Property, String> params = this.currentStyle.getParameters();
34
35
        params.put(Properties.FLOW_NAME_REFERENCE,                    null);
36
    }
37
38
    @Override
39
    public void execute() throws OdfException {
40
        // TODO Auto-generated method stub
41
42
    }
43
44
    public void executeFromParent(TagExecutable child) throws OdfException {
45
        child.execute(this);
46
    }
47
48
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowSourceListTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class FlowSourceListTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected FlowSourceListTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowTag.java (+58 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.pagination.Flow;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * Flow converter.
29
 */
30
public class FlowTag extends Tag {
31
32
    protected Flow f = null;
33
34
    FlowTag(Tag parent, Flow f) {
35
        super(parent);
36
        this.f = f;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.ID,                                    null);
40
        params.put(Properties.FLOW_NAME,                              null);
41
        params.put(Properties.INDEX_CLASS,                            null);
42
        params.put(Properties.INDEX_KEY,                              null);
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     */
48
    @Override
49
    public void execute() { }
50
51
    /**
52
     * {@inheritDoc}
53
     * @throws OdfException
54
     */
55
    public void executeFromParent(TagExecutable child) throws OdfException {
56
        child.execute(this);
57
    }
58
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FlowTargetListTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class FlowTargetListTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected FlowTargetListTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FolioPrefixTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class FolioPrefixTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected FolioPrefixTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FolioSuffixTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class FolioSuffixTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected FolioSuffixTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FootnoteBodyTag.java (+60 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.FootnoteBody;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * FootnoteBodyConverter
29
 */
30
public class FootnoteBodyTag extends Tag {
31
32
    protected FootnoteBody fb = null;
33
34
    protected FootnoteBodyTag(Tag parent, FootnoteBody fb) {
35
        super(parent);
36
        this.fb = fb;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.SOURCE_DOCUMENT,                        null);
40
        params.put(Properties.ROLE,                                   null);
41
        params.put(Properties.ID,                                     null);
42
        params.put(Properties.INDEX_CLASS,                            null);
43
        params.put(Properties.INDEX_KEY,                              null);
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    @Override
50
    public void execute() { }
51
52
    /**
53
     * {@inheritDoc}
54
     * @throws OdfException
55
     */
56
    public void executeFromParent(TagExecutable child) throws OdfException {
57
        child.execute(this);
58
    }
59
60
}
(-)src/java/org/apache/fop/render/odf/odt/tags/FootnoteTag.java (+66 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.Footnote;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
/**
28
 * Footnote converter
29
 */
30
public class FootnoteTag extends Tag {
31
32
    protected Footnote fn = null;
33
34
    FootnoteTag(Tag parent, Footnote fn) {
35
        super(parent);
36
        this.fn = fn;
37
        Map<Property, String> params = this.currentStyle.getParameters();
38
39
        params.put(Properties.SOURCE_DOCUMENT,                        null);
40
        params.put(Properties.ROLE,                                  null);
41
        params.put(Properties.ID,                                    null);
42
        params.put(Properties.INDEX_CLASS,                            null);
43
        params.put(Properties.INDEX_KEY,                              null);
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    @Override
50
    public void execute() {
51
        /*Footnote fn = (Footnote)foNode;
52
53
        recurseFONode(fn.getFootnoteCitation());
54
        recurseFONode(fn.getFootnoteBody()); */
55
56
    }
57
58
    /**
59
     * {@inheritDoc}
60
     * @throws OdfException
61
     */
62
    public void executeFromParent(TagExecutable child) throws OdfException {
63
        child.execute(this);
64
    }
65
66
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexKeyReferenceTag.java (+56 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
/**
27
 * FootnoteBodyConverter
28
 */
29
public class IndexKeyReferenceTag extends Tag {
30
31
    protected Object o = null;
32
33
    protected IndexKeyReferenceTag(Tag parent, Object o) {
34
        super(parent);
35
        this.o = o;
36
        Map<Property, String> params = this.currentStyle.getParameters();
37
38
        params.put(Properties.PAGE_NUMBER_TREATMENT,                  null);
39
        params.put(Properties.REF_INDEX_KEY,                          null);
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45
    @Override
46
    public void execute() { }
47
48
    /**
49
     * {@inheritDoc}
50
     * @throws OdfException
51
     */
52
    public void executeFromParent(TagExecutable child) throws OdfException {
53
        child.execute(this);
54
    }
55
56
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexPageCitationListSeparatorTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class IndexPageCitationListSeparatorTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected IndexPageCitationListSeparatorTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexPageCitationListTag.java (+50 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
public class IndexPageCitationListTag extends Tag {
27
28
    protected Object o = null;
29
30
    protected IndexPageCitationListTag(Tag parent, Object o) {
31
        super(parent);
32
        this.o = o;
33
        Map<Property, String> params = this.currentStyle.getParameters();
34
35
        params.put(Properties.MERGE_RANGES_ACROSS_INDEX_KEY_REFERENCES, null);
36
        params.put(Properties.MERGE_SEQUENTIAL_PAGE_NUMBERS,          null);
37
        params.put(Properties.MERGE_PAGES_ACROSS_INDEX_KEY_REFERENCES,  null);
38
    }
39
40
    @Override
41
    public void execute() throws OdfException {
42
        // TODO Auto-generated method stub
43
44
    }
45
46
    public void executeFromParent(TagExecutable child) throws OdfException {
47
        child.execute(this);
48
    }
49
50
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexPageCitationRangeSeparatorTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class IndexPageCitationRangeSeparatorTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected IndexPageCitationRangeSeparatorTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexPageNumberPrefixTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class IndexPageNumberPrefixTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected IndexPageNumberPrefixTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexPagePageNumberSuffixTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class IndexPagePageNumberSuffixTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected IndexPagePageNumberSuffixTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexRangeBeginTag.java (+50 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
public class IndexRangeBeginTag extends Tag {
27
28
    protected Object o = null;
29
30
    protected IndexRangeBeginTag(Tag parent, Object o) {
31
        super(parent);
32
        this.o = o;
33
        Map<Property, String> params = this.currentStyle.getParameters();
34
35
        params.put(Properties.ID,                                    null);
36
        params.put(Properties.INDEX_CLASS,                            null);
37
        params.put(Properties.INDEX_KEY,                              null);
38
    }
39
40
    @Override
41
    public void execute() throws OdfException {
42
        // TODO Auto-generated method stub
43
44
    }
45
46
    public void executeFromParent(TagExecutable child) throws OdfException {
47
        child.execute(this);
48
    }
49
50
}
(-)src/java/org/apache/fop/render/odf/odt/tags/IndexRangeEndTag.java (+48 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.render.odf.OdfException;
23
import org.apache.fop.render.odf.properties.Properties;
24
import org.apache.fop.render.odf.properties.Property;
25
26
public class IndexRangeEndTag extends Tag {
27
28
    protected Object o = null;
29
30
    protected IndexRangeEndTag(Tag parent, Object o) {
31
        super(parent);
32
        this.o = o;
33
        Map<Property, String> params = this.currentStyle.getParameters();
34
35
        params.put(Properties.REF_ID,                                 null);
36
    }
37
38
    @Override
39
    public void execute() throws OdfException {
40
        // TODO Auto-generated method stub
41
42
    }
43
44
    public void executeFromParent(TagExecutable child) throws OdfException {
45
        child.execute(this);
46
    }
47
48
}
(-)src/java/org/apache/fop/render/odf/odt/tags/InitialPropertySetTag.java (+127 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.apache.fop.fo.flow.InitialPropertySet;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.properties.Properties;
25
import org.apache.fop.render.odf.properties.Property;
26
27
public class InitialPropertySetTag extends Tag {
28
29
    protected InitialPropertySet ips = null;
30
31
    protected InitialPropertySetTag(Tag parent, InitialPropertySet ips) {
32
        super(parent);
33
        this.ips = ips;
34
        Map<Property, String> params = this.currentStyle.getParameters();
35
36
        params.put(Properties.LINE_HEIGHT,                            null);
37
//        params.put(Properties.letterSpacing,                         null);
38
//        params.put(Properties.textDecoration,                        null);
39
//        params.put(Properties.textShadow,                            null);
40
//        params.put(Properties.textTransform,                         null);
41
//        params.put(Properties.wordSpacing,                           null);
42
//        params.put(Properties.color,                                  null);
43
//        params.put(Properties.sourceDocument,                        null);
44
//        params.put(Properties.role,                                   null);
45
//        params.put(Properties.azimuth,                                null);
46
//        params.put(Properties.cueAfter,                              null);
47
//        params.put(Properties.cueBefore,                             null);
48
//        params.put(Properties.elevation,                              null);
49
//        params.put(Properties.pauseAfter,                            null);
50
//        params.put(Properties.pauseBefore,                           null);
51
//        params.put(Properties.pitch,                                  null);
52
//        params.put(Properties.pitchRange,                            null);
53
//        params.put(Properties.playDuring,                            null);
54
//        params.put(Properties.richness,                               null);
55
//        params.put(Properties.speak,                                  null);
56
//        params.put(Properties.speakHeader,                           null);
57
//        params.put(Properties.speakNumeral,                          null);
58
//        params.put(Properties.speakPunctuation,                      null);
59
//        params.put(Properties.speechRate,                            null);
60
//        params.put(Properties.stress,                                 null);
61
//        params.put(Properties.voiceFamily,                           null);
62
//        params.put(Properties.volume,                                 null);
63
//        params.put(Properties.backgroundAttachment,                  null);
64
//        params.put(Properties.backgroundColor,                       null);
65
//        params.put(Properties.backgroundImage,                       null);
66
//        params.put(Properties.backgroundRepeat,                      null);
67
//        params.put(Properties.backgroundPositionHorizontal,         null);
68
//        params.put(Properties.backgroundPositionVertical,           null);
69
//        params.put(Properties.borderBeforeColor,                    null);
70
//        params.put(Properties.borderBeforeStyle,                    null);
71
//        params.put(Properties.borderBeforeWidth,                    null);
72
//        params.put(Properties.borderAfterColor,                     null);
73
//        params.put(Properties.borderAfterStyle,                     null);
74
//        params.put(Properties.borderAfterWidth,                     null);
75
//        params.put(Properties.borderStartColor,                     null);
76
//        params.put(Properties.borderStartStyle,                     null);
77
//        params.put(Properties.borderStartWidth,                     null);
78
//        params.put(Properties.borderEndColor,                       null);
79
//        params.put(Properties.borderEndStyle,                       null);
80
//        params.put(Properties.borderEndWidth,                       null);
81
//        params.put(Properties.borderTopColor,                       null);
82
//        params.put(Properties.borderTopStyle,                       null);
83
//        params.put(Properties.borderTopWidth,                       null);
84
//        params.put(Properties.borderBottomColor,                    null);
85
//        params.put(Properties.borderBottomStyle,                    null);
86
//        params.put(Properties.borderBottomWidth,                    null);
87
//        params.put(Properties.borderLeftColor,                      null);
88
//        params.put(Properties.borderLeftStyle,                      null);
89
//        params.put(Properties.borderLeftWidth,                      null);
90
//        params.put(Properties.borderRightColor,                     null);
91
//        params.put(Properties.borderRightStyle,                     null);
92
//        params.put(Properties.borderRightWidth,                     null);
93
//        params.put(Properties.paddingBefore,                         null);
94
//        params.put(Properties.paddingAfter,                          null);
95
//        params.put(Properties.paddingStart,                          null);
96
//        params.put(Properties.paddingEnd,                            null);
97
//        params.put(Properties.paddingTop,                            null);
98
//        params.put(Properties.paddingBottom,                         null);
99
//        params.put(Properties.paddingLeft,                           null);
100
//        params.put(Properties.paddingRight,                          null);
101
//        params.put(Properties.fontFamily,                            null);
102
//        params.put(Properties.fontSelectionStrategy,                null);
103
//        params.put(Properties.fontSize,                              null);
104
//        params.put(Properties.fontStretch,                           null);
105
//        params.put(Properties.fontSizeAdjust,                       null);
106
//        params.put(Properties.fontStyle,                             null);
107
//        params.put(Properties.fontVariant,                           null);
108
//        params.put(Properties.fontWeight,                            null);
109
//        params.put(Properties.topR,                                  null);
110
//        params.put(Properties.rightR,                                null);
111
//        params.put(Properties.bottomR,                               null);
112
//        params.put(Properties.leftR,                                 null);
113
//        params.put(Properties.relativePosition,                      null);
114
//        params.put(Properties.scoreSpaces,                           null);
115
    }
116
117
    @Override
118
    public void execute() throws OdfException {
119
        // TODO Auto-generated method stub
120
121
    }
122
123
    public void executeFromParent(TagExecutable child) throws OdfException {
124
        child.execute(this);
125
    }
126
127
}
(-)src/java/org/apache/fop/render/odf/odt/tags/InlineContainerTag.java (+200 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.odftoolkit.odfdom.dom.OdfContentDom;
23
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
24
import org.odftoolkit.odfdom.dom.element.style.StyleTextPropertiesElement;
25
import org.odftoolkit.odfdom.dom.element.text.TextSpanElement;
26
import org.odftoolkit.odfdom.pkg.OdfElement;
27
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
28
import org.w3c.dom.Node;
29
30
import org.apache.fop.fo.flow.InlineContainer;
31
import org.apache.fop.render.odf.OdfException;
32
import org.apache.fop.render.odf.odt.Namespace;
33
import org.apache.fop.render.odf.properties.Properties;
34
import org.apache.fop.render.odf.properties.Property;
35
36
/**
37
 * Inline converter
38
 */
39
public class InlineContainerTag extends Tag {
40
41
    protected InlineContainer ic = null;
42
43
    protected TextSpanElement tse = null;
44
45
    InlineContainerTag(Tag parent, InlineContainer ic) throws OdfException {
46
        super(parent);
47
        this.ic = ic;
48
        Map<Property, String> params = this.currentStyle.getParameters();
49
50
        params.put(Properties.ALIGNMENT_ADJUST,                       null);
51
//        params.put(Properties.alignmentBaseline,                     null);
52
//        params.put(Properties.baselineShift,                         null);
53
//        params.put(Properties.displayAlign,                          null);
54
//        params.put(Properties.dominantBaseline,                      null);
55
//        params.put(Properties.blockProgressionDimension,            null);
56
//        params.put(Properties.height,                                 null);
57
//        params.put(Properties.inlineProgressionDimension,           null);
58
//        params.put(Properties.width,                                  null);
59
//        params.put(Properties.lineHeight,                            null);
60
//        params.put(Properties.backgroundAttachment,                  null);
61
//        params.put(Properties.backgroundColor,                       null);
62
//        params.put(Properties.backgroundImage,                       null);
63
//        params.put(Properties.backgroundRepeat,                      null);
64
//        params.put(Properties.backgroundPositionHorizontal,         null);
65
//        params.put(Properties.backgroundPositionVertical,           null);
66
//        params.put(Properties.borderBeforeColor,                    null);
67
//        params.put(Properties.borderBeforeStyle,                    null);
68
//        params.put(Properties.borderBeforeWidth,                    null);
69
//        params.put(Properties.borderAfterColor,                     null);
70
//        params.put(Properties.borderAfterStyle,                     null);
71
//        params.put(Properties.borderAfterWidth,                     null);
72
//        params.put(Properties.borderStartColor,                     null);
73
//        params.put(Properties.borderStartStyle,                     null);
74
//        params.put(Properties.borderStartWidth,                     null);
75
//        params.put(Properties.borderEndColor,                       null);
76
//        params.put(Properties.borderEndStyle,                       null);
77
//        params.put(Properties.borderEndWidth,                       null);
78
//        params.put(Properties.borderTopColor,                       null);
79
//        params.put(Properties.borderTopStyle,                       null);
80
//        params.put(Properties.borderTopWidth,                       null);
81
//        params.put(Properties.borderBottomColor,                    null);
82
//        params.put(Properties.borderBottomStyle,                    null);
83
//        params.put(Properties.borderBottomWidth,                    null);
84
//        params.put(Properties.borderLeftColor,                      null);
85
//        params.put(Properties.borderLeftStyle,                      null);
86
//        params.put(Properties.borderLeftWidth,                      null);
87
//        params.put(Properties.borderRightColor,                     null);
88
//        params.put(Properties.borderRightStyle,                     null);
89
//        params.put(Properties.borderRightWidth,                     null);
90
//        params.put(Properties.paddingBefore,                         null);
91
//        params.put(Properties.paddingAfter,                          null);
92
//        params.put(Properties.paddingStart,                          null);
93
//        params.put(Properties.paddingEnd,                            null);
94
//        params.put(Properties.paddingTop,                            null);
95
//        params.put(Properties.paddingBottom,                         null);
96
//        params.put(Properties.paddingLeft,                           null);
97
//        params.put(Properties.paddingRight,                          null);
98
//        params.put(Properties.marginTopInline,                      null);
99
//        params.put(Properties.marginBottomInline,                   null);
100
//        params.put(Properties.marginLeftInline,                     null);
101
//        params.put(Properties.marginRightInline,                    null);
102
//        params.put(Properties.spaceEndInline,                       null);
103
//        params.put(Properties.spaceStartInline,                     null);
104
//        params.put(Properties.topR,                                  null);
105
//        params.put(Properties.rightR,                                null);
106
//        params.put(Properties.bottomR,                               null);
107
//        params.put(Properties.leftR,                                 null);
108
//        params.put(Properties.relativePosition,                      null);
109
//        params.put(Properties.keepTogether,                          null);
110
//        params.put(Properties.keepWithNext,                         null);
111
//        params.put(Properties.keepWithPrevious,                     null);
112
//        params.put(Properties.clip,                                   null);
113
//        params.put(Properties.overflow,                               null);
114
//        params.put(Properties.referenceOrientation,                  null);
115
//        params.put(Properties.id,                                     null);
116
//        params.put(Properties.indexClass,                            null);
117
//        params.put(Properties.indexKey,                              null);
118
//        params.put(Properties.writingMode,                           null);
119
120
        registerFont(this.currentStyle.getParameters().get(Properties.FONT_FAMILY));
121
    }
122
123
    public TextSpanElement getTextSpanElement() {
124
        return tse;
125
    }
126
127
    @Override
128
    protected OdfElement getTextContainer() {
129
        if (this.tse != null) {
130
            return this.tse;
131
        } else {
132
            return parent.getTextContainer();
133
        }
134
    }
135
    /**
136
     * {@inheritDoc}
137
     * @throws OdfException
138
     */
139
    @Override
140
    public void execute() throws OdfException {
141
        try {
142
            tse = (TextSpanElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextSpanElement.ELEMENT_NAME);
143
        } catch (Exception e) {
144
            throw new OdfException("Can't create text span.", e);
145
        }
146
147
        StyleStyleElement sse = null;
148
        try {
149
            sse = (StyleStyleElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), StyleStyleElement.ELEMENT_NAME);
150
        } catch (Exception e) {
151
            throw new OdfException("Can't create new style for text span.", e);
152
        }
153
154
        sse.setAttributeNS(Namespace.STYLE, "style:family", "text");
155
156
        StyleTextPropertiesElement stpe = null;
157
158
        try {
159
            stpe = (StyleTextPropertiesElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), StyleTextPropertiesElement.ELEMENT_NAME);
160
        } catch (Exception e) {
161
            throw new OdfException("Can't create new style for text span.", e);
162
        }
163
164
        stpe.setAttributeNS(Namespace.FO,    "fo:font-size",    this.currentStyle.get(Properties.FONT_SIZE));
165
        stpe.setAttributeNS(Namespace.FO,    "fo:font-weight",  this.currentStyle.get(Properties.FONT_WEIGHT));
166
        stpe.setAttributeNS(Namespace.FO,    "fo:font-style",   this.currentStyle.get(Properties.FONT_STYLE));
167
        stpe.setAttributeNS(Namespace.FO,    "fo:color",        this.currentStyle.get(Properties.COLOR));
168
        stpe.setAttributeNS(Namespace.STYLE, "style:font-name", this.currentStyle.get(Properties.FONT_FAMILY));
169
170
        sse.appendChild(stpe);
171
172
        try {
173
            OdfContentDom odf = this.getOdt().getContentDom();
174
            Node odfstyles = odf.getElementsByTagNameNS(Namespace.OFFICE, "automatic-styles").item(0);
175
            odfstyles.appendChild(sse);
176
        } catch (Exception e) {
177
            throw new OdfException("Can't create new style.", e);
178
        }
179
180
        tse.setStyleName(this.appendNewStyle(sse));
181
    }
182
183
    /**
184
     * {@inheritDoc}
185
     * @throws OdfException
186
     */
187
    @Override
188
    public void closeIntercept() throws OdfException {
189
        parent.getTextContainer().appendChild(tse);
190
    }
191
192
    /**
193
     * {@inheritDoc}
194
     * @throws OdfException
195
     */
196
    public void executeFromParent(TagExecutable child) throws OdfException {
197
        child.execute(this);
198
    }
199
200
}
(-)src/java/org/apache/fop/render/odf/odt/tags/InlineTag.java (+181 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
22
import org.odftoolkit.odfdom.doc.OdfTextDocument;
23
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
24
import org.odftoolkit.odfdom.dom.element.text.TextSpanElement;
25
import org.odftoolkit.odfdom.pkg.OdfElement;
26
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
27
28
import org.apache.fop.fo.flow.Inline;
29
import org.apache.fop.render.odf.OdfException;
30
import org.apache.fop.render.odf.odt.Namespace;
31
import org.apache.fop.render.odf.properties.Properties;
32
import org.apache.fop.render.odf.properties.Property;
33
34
/**
35
 * Inline converter
36
 */
37
public class InlineTag extends Tag {
38
39
    protected Inline inl = null;
40
41
    protected TextSpanElement tse = null;
42
43
    InlineTag(Tag parent, Inline inl) throws OdfException {
44
        super(parent);
45
        this.inl = inl;
46
        Map<Property, String> params = this.currentStyle.getParameters();
47
48
//        params.put(Properties.alignmentAdjust,                       null);
49
//        params.put(Properties.alignmentBaseline,                     null);
50
        params.put(Properties.BASELINE_SHIFT,                         Properties.BASELINE_SHIFT.getValue(inl.getBaselineShift()));
51
//        params.put(Properties.dominantBaseline,                      null);
52
//        params.put(Properties.blockProgressionDimension,            null);
53
//        params.put(Properties.height,                                 null);
54
//        params.put(Properties.inlineProgressionDimension,           null);
55
//        params.put(Properties.width,                                  null);
56
//        params.put(Properties.lineHeight,                            null);
57
//        params.put(Properties.wrapOption,                            null);
58
        params.put(Properties.TEXT_DECORATION,                      Properties.TEXT_DECORATION.getValue(inl));
59
        params.put(Properties.COLOR,                                Properties.COLOR.getValue(inl.getColor()));
60
//        params.put(Properties.sourceDocument,                        null);
61
//        params.put(Properties.role,                                   null);
62
//        params.put(Properties.backgroundAttachment,                  null);
63
        params.put(Properties.BACKGROUND_COLOR,                       Properties.BACKGROUND_COLOR.getValue(inl.getCommonBorderPaddingBackground()));
64
//        params.put(Properties.backgroundImage,                       null);
65
//        params.put(Properties.backgroundRepeat,                      null);
66
//        params.put(Properties.backgroundPositionHorizontal,         null);
67
//        params.put(Properties.backgroundPositionVertical,           null);
68
//        params.put(Properties.borderBeforeColor,                    null);
69
//        params.put(Properties.borderBeforeStyle,                    null);
70
//        params.put(Properties.borderBeforeWidth,                    null);
71
//        params.put(Properties.borderAfterColor,                     null);
72
//        params.put(Properties.borderAfterStyle,                     null);
73
//        params.put(Properties.borderAfterWidth,                     null);
74
//        params.put(Properties.borderStartColor,                     null);
75
//        params.put(Properties.borderStartStyle,                     null);
76
//        params.put(Properties.borderStartWidth,                     null);
77
//        params.put(Properties.borderEndColor,                       null);
78
//        params.put(Properties.borderEndStyle,                       null);
79
//        params.put(Properties.borderEndWidth,                       null);
80
//        params.put(Properties.borderTopColor,                       null);
81
//        params.put(Properties.borderTopStyle,                       null);
82
//        params.put(Properties.borderTopWidth,                       null);
83
//        params.put(Properties.borderBottomColor,                    null);
84
//        params.put(Properties.borderBottomStyle,                    null);
85
//        params.put(Properties.borderBottomWidth,                    null);
86
//        params.put(Properties.borderLeftColor,                      null);
87
//        params.put(Properties.borderLeftStyle,                      null);
88
//        params.put(Properties.borderLeftWidth,                   null);
89
        params.put(Properties.BORDER_RIGHT_COLOR,                  null);
90
        params.put(Properties.BORDER_RIGHT_STYLE,                  null);
91
        params.put(Properties.BORDER_RIGHT_WIDTH,                  null);
92
        params.put(Properties.PADDING_BEFORE,                      null);
93
        params.put(Properties.PADDING_AFTER,                       null);
94
        params.put(Properties.PADDING_START,                       null);
95
        params.put(Properties.PADDING_END,                         null);
96
        params.put(Properties.PADDING_TOP,                         null);
97
        params.put(Properties.PADDING_BOTTOM,                      null);
98
        params.put(Properties.PADDING_LEFT,                        null);
99
        params.put(Properties.PADDING_RIGHT,                       null);
100
        params.put(Properties.FONT_FAMILY,                         Properties.FONT_FAMILY.getFont(inl.getCommonFont()));
101
        params.put(Properties.FONT_SELECTION_STRATEGY,             null);
102
        params.put(Properties.FONT_SIZE,                           Properties.FONT_SIZE.getFontSize(inl.getCommonFont()));
103
        params.put(Properties.FONT_STRETCH,                        null);
104
        params.put(Properties.FONT_SIZE_ADJUST,                    null);
105
        params.put(Properties.FONT_STYLE,                          Properties.FONT_STYLE.getValue(inl.getCommonFont()));
106
        params.put(Properties.FONT_VARIANT,                        Properties.FONT_VARIANT.getValue(inl.getCommonFont()));
107
        params.put(Properties.FONT_WEIGHT,                         Properties.FONT_WEIGHT.getValue(inl.getCommonFont()));
108
//        params.put(Properties.marginTopInline,                      null);
109
//        params.put(Properties.marginBottomInline,                   null);
110
//        params.put(Properties.marginLeftInline,                     null);
111
//        params.put(Properties.marginRightInline,                    null);
112
//        params.put(Properties.spaceEndInline,                       null);
113
//        params.put(Properties.spaceStartInline,                     null);
114
//        params.put(Properties.topR,                                  null);
115
//        params.put(Properties.rightR,                                null);
116
//        params.put(Properties.bottomR,                               null);
117
//        params.put(Properties.leftR,                                 null);
118
//        params.put(Properties.relativePosition,                      null);
119
//        params.put(Properties.keepTogether,                          null);
120
//        params.put(Properties.keepWithNext,                         null);
121
//        params.put(Properties.keepWithPrevious,                     null);
122
//        params.put(Properties.id,                                     null);
123
//        params.put(Properties.visibility,                             null);
124
//        params.put(Properties.indexClass,                            null);
125
//        params.put(Properties.indexKey,                              null);
126
127
        registerFont(this.currentStyle.getParameters().get(Properties.FONT_FAMILY));
128
    }
129
130
    public TextSpanElement getTextSpanElement() {
131
        return tse;
132
    }
133
134
    @Override
135
    protected OdfElement getTextContainer() {
136
        if (this.tse != null) {
137
            return this.tse;
138
        } else {
139
            return parent.getTextContainer();
140
        }
141
    }
142
    /**
143
     * {@inheritDoc}
144
     * @throws OdfException
145
     */
146
    @Override
147
    public void execute() throws OdfException {
148
        try {
149
            tse = (TextSpanElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextSpanElement.ELEMENT_NAME);
150
        } catch (Exception e) {
151
            throw new OdfException("Can't create text span.", e);
152
        }
153
154
        StyleStyleElement sse = this.generateOdtStyle(this.currentStyle);
155
        sse.setAttributeNS(Namespace.STYLE, "style:family", "text");
156
        tse.setStyleName(this.appendNewStyle(sse));
157
    }
158
159
    /**
160
     * {@inheritDoc}
161
     * @throws OdfException
162
     */
163
    @Override
164
    public void closeIntercept() throws OdfException {
165
        parent.getTextContainer().appendChild(tse);
166
    }
167
168
    @Override
169
    protected void executeProperty(Property property, StyleStyleElement sse, String value, OdfTextDocument odt) throws OdfException {
170
        property.execute(this, sse, value, odt);
171
    }
172
173
    /**
174
     * {@inheritDoc}
175
     * @throws OdfException
176
     */
177
    public void executeFromParent(TagExecutable child) throws OdfException {
178
        child.execute(this);
179
    }
180
181
}
(-)src/java/org/apache/fop/render/odf/odt/tags/InstreamForeignObjectTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.InstreamForeignObject;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * InstreamForeignObject converter
25
 */
26
public class InstreamForeignObjectTag extends Tag {
27
28
    InstreamForeignObjectTag(Tag parent, InstreamForeignObject foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/LayoutMasterSetTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class LayoutMasterSetTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected LayoutMasterSetTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/LeaderTag.java (+49 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.Leader;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * Leader converter
25
 */
26
public class LeaderTag extends Tag {
27
28
    protected LeaderTag(Tag parent, Leader foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() {
37
        // TODO Auto-generated method stub
38
39
    }
40
41
    /**
42
     * {@inheritDoc}
43
     * @throws OdfException
44
     */
45
    public void executeFromParent(TagExecutable child) throws OdfException {
46
        child.execute(this);
47
    }
48
49
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ListBlockTag.java (+71 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.odftoolkit.odfdom.dom.element.text.TextListElement;
21
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
22
23
import org.apache.fop.fo.flow.ListBlock;
24
import org.apache.fop.render.odf.OdfException;
25
26
/**
27
 * ListBlock converter
28
 */
29
public class ListBlockTag extends Tag {
30
31
    protected TextListElement tle = null;
32
33
    ListBlockTag(Tag parent, ListBlock foNode) {
34
        super(parent);
35
    }
36
37
    public TextListElement getTextListElement() {
38
        return tle;
39
    }
40
41
    /**
42
     * {@inheritDoc}
43
     * @throws OdfException
44
     */
45
    @Override
46
    public void execute() throws OdfException {
47
        try {
48
            tle = (TextListElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextListElement.ELEMENT_NAME);
49
        } catch (Exception e) {
50
            throw new OdfException("Can't create the list", e);
51
        }
52
    }
53
54
    @Override
55
    public void closeIntercept() throws OdfException {
56
        try {
57
            this.getParagraphContainer().appendChild(tle);
58
        } catch (Exception e) {
59
            throw new OdfException("Can't create the list", e);
60
        }
61
     }
62
63
    /**
64
     * {@inheritDoc}
65
     * @throws OdfException
66
     */
67
    public void executeFromParent(TagExecutable child) throws OdfException {
68
        child.execute(this);
69
    }
70
71
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ListItemBodyTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.ListItemBody;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * ListItemBody converter
25
 */
26
public class ListItemBodyTag extends Tag {
27
28
    protected ListItemBodyTag(Tag parent, ListItemBody foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        parent.executeFromParent(child);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ListItemLabelTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.ListItemLabel;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * ListItemLabel converter
25
 */
26
public class ListItemLabelTag extends Tag {
27
28
    ListItemLabelTag(Tag parent, ListItemLabel foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ListItemTag.java (+90 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.odftoolkit.odfdom.dom.element.text.TextListItemElement;
21
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
22
23
import org.apache.fop.fo.flow.ListItem;
24
import org.apache.fop.render.odf.OdfException;
25
import org.apache.fop.render.odf.odt.FopOdtConverter;
26
27
/**
28
 * ListItem converter
29
 */
30
public class ListItemTag extends Tag {
31
32
    private ListItem xslfoListItem = null;
33
34
    private TextListItemElement tlie = null;
35
36
    private FopOdtConverter converter = null;
37
38
    ListItemTag(Tag parent, ListItem foNode, FopOdtConverter converter) {
39
        super(parent);
40
        this.xslfoListItem = foNode;
41
        this.converter = converter;
42
    }
43
44
    public ListItem getXslfoListItem() {
45
        return xslfoListItem;
46
    }
47
48
    public TextListItemElement getTextListItemElement() {
49
        return tlie;
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     * @throws OdfException
55
     */
56
    @Override
57
    public void execute() throws OdfException {
58
        try {
59
            tlie = (TextListItemElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextListItemElement.ELEMENT_NAME);
60
        } catch (Exception e) {
61
            throw new OdfException("Can't create List Item", e);
62
        }
63
64
        parent.executeFromParent(this);
65
66
        converter.convertRecursively(xslfoListItem.getBody());
67
    }
68
69
    /**
70
     * {@inheritDoc}
71
     * @throws OdfException
72
     */
73
    @Override
74
    public void execute(ListBlockTag tag) throws OdfException {
75
        try {
76
            tag.getTextListElement().appendChild(tlie);
77
        } catch (Exception e) {
78
            throw new OdfException("Can't create List Item", e);
79
        }
80
    }
81
82
    /**
83
     * {@inheritDoc}
84
     * @throws OdfException
85
     */
86
    public void executeFromParent(TagExecutable child) throws OdfException {
87
        child.execute(this);
88
    }
89
90
}
(-)src/java/org/apache/fop/render/odf/odt/tags/MarkerTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class MarkerTag extends Tag {
23
24
    protected Object o = null;
25
26
    MarkerTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/MultiCaseTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.MultiCase;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class MultiCaseTag extends Tag {
24
25
    protected MultiCase mc = null;
26
27
    MultiCaseTag(Tag parent, MultiCase mc) {
28
        super(parent);
29
        this.mc = mc;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/MultiPropertiesTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.MultiProperties;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class MultiPropertiesTag extends Tag {
24
25
    protected MultiProperties mp = null;
26
27
    MultiPropertiesTag(Tag parent, MultiProperties mp) {
28
        super(parent);
29
        this.mp = mp;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/MultiSwitchTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.MultiSwitch;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class MultiSwitchTag extends Tag {
24
25
    protected MultiSwitch ms = null;
26
27
    MultiSwitchTag(Tag parent, MultiSwitch ms) {
28
        super(parent);
29
        this.ms = ms;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/MultiToggleTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.MultiToggle;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class MultiToggleTag extends Tag {
24
25
    protected MultiToggle mt = null;
26
27
    MultiToggleTag(Tag parent, MultiToggle mt) {
28
        super(parent);
29
        this.mt = mt;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageNumberCitationLastTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.PageNumberCitationLast;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * PageNumberCitation converter
25
 */
26
public class PageNumberCitationLastTag extends Tag {
27
28
    PageNumberCitationLastTag(Tag parent, PageNumberCitationLast foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageNumberCitationTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.PageNumberCitation;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * PageNumberCitation converter
25
 */
26
public class PageNumberCitationTag extends Tag {
27
28
    PageNumberCitationTag(Tag parent, PageNumberCitation foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageNumberTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.PageNumber;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * PageNumber converter
25
 */
26
public class PageNumberTag extends Tag {
27
28
    PageNumberTag(Tag parent, PageNumber foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageSequenceMasterTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.PageSequenceMaster;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * PageNumberCitation converter
25
 */
26
public class PageSequenceMasterTag extends Tag {
27
28
    PageSequenceMasterTag(Tag parent, PageSequenceMaster foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageSequenceTag.java (+113 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.PageSequence;
21
import org.apache.fop.fo.pagination.PageSequenceMaster;
22
import org.apache.fop.fo.pagination.SimplePageMaster;
23
import org.apache.fop.render.odf.OdfException;
24
import org.apache.fop.render.odf.odt.FopOdtConverter;
25
26
/**
27
 * Defines a number of standard constants (keys) for use by the RendererContext class.
28
 */
29
public class PageSequenceTag extends Tag {
30
31
    protected PageSequence pageSeq = null;
32
33
    protected FopOdtConverter converter = null;
34
35
    protected SimplePageMaster pagemaster = null;
36
37
    PageSequenceTag(Tag parent, PageSequence pageSeq, FopOdtConverter converter) {
38
        super(parent);
39
        this.pageSeq = pageSeq;
40
        this.converter = converter;
41
42
        String reference = pageSeq.getMasterReference();
43
        this.pagemaster = pageSeq.getRoot().getLayoutMasterSet().getSimplePageMaster(reference);
44
        if (pagemaster == null) {
45
            PageSequenceMaster master = pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(reference);
46
            this.pagemaster = master.getNextSimplePageMaster(false, false, false, false, "");
47
        }
48
49
        //if(!isFirstPageSequence()) this.getOdt().addPageBreak();
50
51
        //read page size and margins, if specified
52
        //only simple-page-master supported, so pagemaster may be null
53
54
        //builderContext.pushContainer(sect);
55
56
        //Calculate usable page width for this flow
57
        //int useAblePageWidth = pagemaster.getPageWidth().getValue()
58
        //    - pagemaster.getCommonMarginBlock().marginLeft.getValue()
59
        //    - pagemaster.getCommonMarginBlock().marginRight.getValue()
60
        //percentManager.setDimension(pageSeq, useAblePageWidth);
61
62
        //bHeaderSpecified = false;
63
        //bFooterSpecified = false;
64
65
        /*Region regionBefore = pagemaster.getRegion(Constants.FO_REGION_BEFORE);
66
        if (regionBefore != null) {
67
            FONode staticBefore = (FONode) pageSequence.getFlowMap().get(regionBefore.getRegionName());
68
            if (staticBefore != null) recurseFONode(staticBefore);
69
        }
70
71
        Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER);
72
        if (regionAfter != null) {
73
            FONode staticAfter = (FONode) pageSequence.getFlowMap().get(regionAfter.getRegionName());
74
            if (staticAfter != null) recurseFONode(staticAfter);
75
        }*/
76
    }
77
78
    //private boolean isFirstPageSequence() {
79
        // TODO Auto-generated method stub
80
    //    return false;
81
    //}
82
83
    /**
84
     * {@inheritDoc}
85
     */
86
    @Override
87
    public void execute() {
88
        setMargins();
89
        converter.convertRecursively(pageSeq.getMainFlow());
90
    }
91
92
    private void setMargins() {
93
        //int a = this.pagemaster.getPageWidth().getValue();
94
        //int b = this.pagemaster.getPageHeight().getValue();
95
        //int c = this.pagemaster.getCommonMarginBlock().marginLeft.getValue();
96
        //int d = this.pagemaster.getCommonMarginBlock().marginRight.getValue();
97
    }
98
99
    /**
100
     * {@inheritDoc}
101
     */
102
    @Override
103
    public void closeIntercept() {
104
    }
105
106
    /**
107
     * {@inheritDoc}
108
     * @throws OdfException
109
     */
110
    public void executeFromParent(TagExecutable child) throws OdfException {
111
        child.execute(this);
112
    }
113
}
(-)src/java/org/apache/fop/render/odf/odt/tags/PageSequenceWrapperTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.PageSequenceWrapper;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * PageNumberCitation converter
25
 */
26
public class PageSequenceWrapperTag extends Tag {
27
28
    PageSequenceWrapperTag(Tag parent, PageSequenceWrapper foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionAfterTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RegionAfter;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RegionAfterTag extends Tag {
24
25
    protected RegionAfter ra = null;
26
27
    protected RegionAfterTag(Tag parent, RegionAfter ra) {
28
        super(parent);
29
        this.ra = ra;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionBeforeTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RegionBefore;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RegionBeforeTag extends Tag {
24
25
    protected RegionBefore rb = null;
26
27
    protected RegionBeforeTag(Tag parent, RegionBefore rb) {
28
        super(parent);
29
        this.rb = rb;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionBodyTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RegionBody;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RegionBodyTag extends Tag {
24
25
    protected RegionBody rb = null;
26
27
    protected RegionBodyTag(Tag parent, RegionBody rb) {
28
        super(parent);
29
        this.rb = rb;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionEndTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RegionEnd;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RegionEndTag extends Tag {
24
25
    protected RegionEnd re = null;
26
27
    protected RegionEndTag(Tag parent, RegionEnd re) {
28
        super(parent);
29
        this.re = re;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionNameSpecifierTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class RegionNameSpecifierTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected RegionNameSpecifierTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RegionStartTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RegionStart;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RegionStartTag extends Tag {
24
25
    protected RegionStart rs = null;
26
27
    protected RegionStartTag(Tag parent, RegionStart rs) {
28
        super(parent);
29
        this.rs = rs;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RepeatablePageMasterAlternativesTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RepeatablePageMasterAlternatives;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RepeatablePageMasterAlternativesTag extends Tag {
24
25
    protected RepeatablePageMasterAlternatives rpma = null;
26
27
    protected RepeatablePageMasterAlternativesTag(Tag parent, RepeatablePageMasterAlternatives rpma) {
28
        super(parent);
29
        this.rpma = rpma;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RepeatablePageMasterReferenceTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.RepeatablePageMasterReference;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class RepeatablePageMasterReferenceTag extends Tag {
24
25
    protected RepeatablePageMasterReference rpmr = null;
26
27
    protected RepeatablePageMasterReferenceTag(Tag parent, RepeatablePageMasterReference rpmr) {
28
        super(parent);
29
        this.rpmr = rpmr;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RetriveMarkerTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class RetriveMarkerTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected RetriveMarkerTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RetriveTableMarkerTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class RetriveTableMarkerTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected RetriveTableMarkerTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/RootTag.java (+93 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.HashMap;
21
import java.util.Map;
22
import java.util.Vector;
23
24
import org.odftoolkit.odfdom.doc.OdfTextDocument;
25
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
26
import org.odftoolkit.odfdom.dom.element.text.TextPElement;
27
import org.odftoolkit.odfdom.pkg.OdfElement;
28
29
import org.apache.fop.render.odf.OdfException;
30
31
/**
32
 *
33
 */
34
public class RootTag extends Tag {
35
36
    private OdfTextDocument outputOdt = null;
37
38
    private Map<String, StyleStyleElement> usedStyles = new HashMap<String, StyleStyleElement>();
39
40
    private Vector<String> usedFonts = new Vector<String>();
41
42
    private TextPElement paragraph = null;
43
44
    public RootTag(OdfTextDocument odt) {
45
        super(null);
46
        this.outputOdt = odt;
47
    }
48
49
    protected OdfTextDocument getOdt() {
50
        return outputOdt;
51
    }
52
53
    @Override
54
    public Map<String, StyleStyleElement> getUsedStyles() {
55
        return usedStyles;
56
    }
57
58
    @Override
59
    public Vector<String> getUsedFonts() {
60
        return usedFonts;
61
    }
62
63
    @Override
64
    protected TextPElement getParagraph() throws OdfException {
65
        this.paragraph = this.newParagraph(getParagraphContainer());
66
        return this.paragraph;
67
    }
68
69
    @Override
70
    protected OdfElement getParagraphContainer() {
71
        try {
72
            return outputOdt.getContentRoot();
73
        } catch (Exception e) {
74
            e.printStackTrace();
75
        }
76
        return null;
77
    }
78
79
    /**
80
     * {@inheritDoc}
81
     */
82
    @Override
83
    public void execute() { }
84
85
    /**
86
     * {@inheritDoc}
87
     * @throws OdfException
88
     */
89
    public void executeFromParent(TagExecutable child) throws OdfException {
90
        child.execute(this);
91
    }
92
93
}
(-)src/java/org/apache/fop/render/odf/odt/tags/ScalingValueCitationTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class ScalingValueCitationTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected ScalingValueCitationTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/SimplePageMasterReferenceTag.java (+41 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
public class SimplePageMasterReferenceTag extends Tag {
23
24
    protected Object o = null;
25
26
    protected SimplePageMasterReferenceTag(Tag parent, Object o) {
27
        super(parent);
28
        this.o = o;
29
    }
30
31
    @Override
32
    public void execute() throws OdfException {
33
        // TODO Auto-generated method stub
34
35
    }
36
37
    public void executeFromParent(TagExecutable child) throws OdfException {
38
        child.execute(this);
39
    }
40
41
}
(-)src/java/org/apache/fop/render/odf/odt/tags/SimplePageMasterTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.SimplePageMaster;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class SimplePageMasterTag extends Tag {
24
25
    protected SimplePageMaster spm = null;
26
27
    protected SimplePageMasterTag(Tag parent, SimplePageMaster spm) {
28
        super(parent);
29
        this.spm = spm;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/StaticContentTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.pagination.StaticContent;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 *
25
 */
26
public class StaticContentTag extends Tag {
27
28
    protected StaticContentTag(Tag parent, StaticContent foNode) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/StaticTag.java (+37 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.render.odf.OdfException;
21
22
/**
23
 *
24
 */
25
public class StaticTag extends Tag {
26
27
    protected StaticTag(Tag parent) {
28
        super(parent);
29
    }
30
31
    @Override
32
    public void execute() { }
33
34
    public void executeFromParent(TagExecutable child) throws OdfException {
35
        child.execute(this);
36
    }
37
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableAndCaptionTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableAndCaption;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class TableAndCaptionTag extends Tag {
24
25
    protected TableAndCaption tac = null;
26
27
    protected TableAndCaptionTag(Tag parent, TableAndCaption tac) {
28
        super(parent);
29
        this.tac = tac;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableBodyTag.java (+45 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableBody;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * TableBody converter
25
 */
26
public class TableBodyTag extends Tag {
27
28
    TableBodyTag(Tag parent, TableBody tblBody) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        parent.executeFromParent(child);
44
    }
45
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableCaptionTag.java (+42 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableCaption;
21
import org.apache.fop.render.odf.OdfException;
22
23
public class TableCaptionTag extends Tag {
24
25
    protected TableCaption tc = null;
26
27
    protected TableCaptionTag(Tag parent, TableCaption tc) {
28
        super(parent);
29
        this.tc = tc;
30
    }
31
32
    @Override
33
    public void execute() throws OdfException {
34
        // TODO Auto-generated method stub
35
36
    }
37
38
    public void executeFromParent(TagExecutable child) throws OdfException {
39
        child.execute(this);
40
    }
41
42
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableCellTag.java (+138 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
21
import org.odftoolkit.odfdom.dom.element.style.StyleTableCellPropertiesElement;
22
import org.odftoolkit.odfdom.dom.element.table.TableTableCellElement;
23
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
24
25
import org.apache.fop.fo.flow.table.TableCell;
26
import org.apache.fop.render.odf.OdfException;
27
import org.apache.fop.render.odf.odt.Namespace;
28
29
/**
30
 * TableCell converter
31
 */
32
public class TableCellTag extends Tag {
33
34
    private TableCell tblCell = null;
35
36
    private TableTableCellElement tce = null;
37
38
    TableCellTag(Tag parent, TableCell tblCell) {
39
        super(parent);
40
        this.tblCell = tblCell;
41
    }
42
43
    public TableCell getTableCell() {
44
        return tblCell;
45
    }
46
47
    public TableTableCellElement getTableCellElement() {
48
        return tce;
49
    }
50
51
    /**
52
     * {@inheritDoc}
53
     * @throws OdfException
54
     */
55
    @Override
56
    public void execute() throws OdfException {
57
58
        try {
59
            tce = (TableTableCellElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TableTableCellElement.ELEMENT_NAME);
60
        } catch (Exception e) {
61
            throw new OdfException("Can't create table cell", e);
62
        }
63
64
        StyleStyleElement sse = null;
65
        try {
66
            sse = (StyleStyleElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), StyleStyleElement.ELEMENT_NAME);
67
        } catch (Exception e) {
68
            throw new OdfException("Can't create the style for new table cell", e);
69
        }
70
71
        sse.setAttributeNS(Namespace.STYLE, "style:family", "table-cell");
72
73
        StyleTableCellPropertiesElement stcpe = null;
74
75
        try {
76
            stcpe = (StyleTableCellPropertiesElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), StyleTableCellPropertiesElement.ELEMENT_NAME);
77
        } catch (Exception e) {
78
            throw new OdfException("Can't create style fot table cell", e);
79
        }
80
81
        float borderSize = Math.round(((float)tblCell.getCommonBorderPaddingBackground().getBorderStartWidth(false)) / 100);
82
        borderSize = borderSize / 10;
83
        stcpe.setAttributeNS(Namespace.FO, "fo:border-left", Float.toString(borderSize) + "pt solid #000000");
84
85
        borderSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getBorderEndWidth(false) / 100);
86
        borderSize = borderSize / 10;
87
        stcpe.setAttributeNS(Namespace.FO, "fo:border-right", Float.toString(borderSize) + "pt solid #000000");
88
89
        borderSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getBorderBeforeWidth(false) / 100);
90
        borderSize = borderSize / 10;
91
        stcpe.setAttributeNS(Namespace.FO, "fo:border-top", Float.toString(borderSize) + "pt solid #000000");
92
93
        borderSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getBorderAfterWidth(false) / 100);
94
        borderSize = borderSize / 10;
95
        stcpe.setAttributeNS(Namespace.FO, "fo:border-bottom", Float.toString(borderSize) + "pt solid #000000");
96
97
        float paddingSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getPaddingLengthProperty(0).getLengthValue() / 100);
98
        paddingSize = paddingSize / 10;
99
        stcpe.setAttributeNS(Namespace.FO, "fo:padding-left", Float.toString(paddingSize) + "pt");
100
101
        paddingSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getPaddingLengthProperty(1).getLengthValue() / 100);
102
        paddingSize = paddingSize / 10;
103
        stcpe.setAttributeNS(Namespace.FO, "fo:padding-top", Float.toString(paddingSize) + "pt");
104
105
        paddingSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getPaddingLengthProperty(2).getLengthValue() / 100);
106
        paddingSize = paddingSize / 10;
107
        stcpe.setAttributeNS(Namespace.FO, "fo:padding-right", Float.toString(paddingSize) + "pt");
108
109
        paddingSize = Math.round((float)tblCell.getCommonBorderPaddingBackground().getPaddingLengthProperty(3).getLengthValue() / 100);
110
        paddingSize = paddingSize / 10;
111
        stcpe.setAttributeNS(Namespace.FO, "fo:padding-bottom", Float.toString(paddingSize) + "pt");
112
113
        sse.appendChild(stcpe);
114
115
        tce.setAttributeNS(Namespace.TABLE, "table:number-columns-spanned", Integer.toString(tblCell.getNumberColumnsSpanned()));
116
        tce.setAttributeNS(Namespace.TABLE, "table:number-rows-spanned",     Integer.toString(tblCell.getNumberRowsSpanned()));
117
118
        tce.setStyleName(this.appendNewStyle(sse));
119
120
        parent.executeFromParent(this);
121
    }
122
123
    @Override
124
    public void execute(TableRowTag tag) throws OdfException {
125
        try {
126
            tag.getTableRow().appendChild(tce);
127
        } catch (Exception e) {
128
            throw new OdfException("Can't create table cell", e);
129
        }
130
    }
131
132
    public void executeFromParent(TagExecutable child) throws OdfException {
133
        if (this != child) {
134
            child.execute(this);
135
        }
136
    }
137
138
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableColumnTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableColumn;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * TableColumn converter
25
 */
26
public class TableColumnTag extends Tag {
27
28
    TableColumnTag(Tag parent, TableColumn tblColumn) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableFooterTag.java (+39 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableFooter;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * TableFooter converter
25
 */
26
public class TableFooterTag extends Tag {
27
28
    TableFooterTag(Tag parent, TableFooter tblFooter) {
29
        super(parent);
30
    }
31
32
    @Override
33
    public void execute() { }
34
35
    public void executeFromParent(TagExecutable child) throws OdfException {
36
        child.execute(this);
37
    }
38
39
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableHeaderTag.java (+46 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.apache.fop.fo.flow.table.TableHeader;
21
import org.apache.fop.render.odf.OdfException;
22
23
/**
24
 * TableHeader converter
25
 */
26
public class TableHeaderTag extends Tag {
27
28
    TableHeaderTag(Tag parent, TableHeader tblHeader) {
29
        super(parent);
30
    }
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    @Override
36
    public void execute() { }
37
38
    /**
39
     * {@inheritDoc}
40
     * @throws OdfException
41
     */
42
    public void executeFromParent(TagExecutable child) throws OdfException {
43
        child.execute(this);
44
    }
45
46
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableRowTag.java (+75 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.odftoolkit.odfdom.dom.element.table.TableTableRowElement;
21
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
22
23
import org.apache.fop.fo.flow.table.TableRow;
24
import org.apache.fop.render.odf.OdfException;
25
26
/**
27
 * TableRow converter
28
 */
29
public class TableRowTag extends Tag {
30
31
    private TableTableRowElement tre = null;
32
33
    TableRowTag(Tag parent, TableRow tblRow) {
34
        super(parent);
35
    }
36
37
    public TableTableRowElement getTableRow() {
38
        return this.tre;
39
    }
40
41
    /**
42
     * {@inheritDoc}
43
     * @throws OdfException
44
     */
45
    @Override
46
    public void execute() throws OdfException {
47
        try {
48
            tre = (TableTableRowElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TableTableRowElement.ELEMENT_NAME);
49
        } catch (Exception e) {
50
            throw new OdfException("Can't create table row.", e);
51
        }
52
53
        parent.executeFromParent(this);
54
    }
55
56
    /**
57
     * {@inheritDoc}
58
     */
59
    @Override
60
    public void execute(TableTag tag) {
61
        try {
62
            tag.getTable().appendChild(tre);
63
        } catch (Exception e) {
64
            e.printStackTrace();
65
        }
66
    }
67
68
    /**
69
     * {@inheritDoc}
70
     * @throws OdfException
71
     */
72
    public void executeFromParent(TagExecutable child) throws OdfException {
73
        child.execute(this);
74
    }
75
}
(-)src/java/org/apache/fop/render/odf/odt/tags/TableTag.java (+98 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import org.odftoolkit.odfdom.dom.element.table.TableTableColumnElement;
21
import org.odftoolkit.odfdom.dom.element.table.TableTableElement;
22
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
23
import org.w3c.dom.DOMException;
24
25
26
import org.apache.fop.fo.flow.table.Table;
27
import org.apache.fop.render.odf.OdfException;
28
import org.apache.fop.render.odf.odt.Namespace;
29
30
/**
31
 * Table converter
32
 */
33
public class TableTag extends Tag {
34
35
    private Table table = null;
36
37
    private TableTableElement tte = null;
38
39
    TableTag(Tag parent, Table table) {
40
        super(parent);
41
        this.table = table;
42
    }
43
44
    public TableTableElement getTable() {
45
        return tte;
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     * @throws OdfException
51
     */
52
    @Override
53
    public void execute() throws OdfException {
54
55
        try {
56
            tte = (TableTableElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TableTableElement.ELEMENT_NAME);
57
        } catch (Exception e) {
58
            throw new OdfException("Can't create new table.", e);
59
        }
60
        tte.setAttributeNS(Namespace.TABLE, "table:align", "margins");
61
62
        if (table.getColumns().size() > 1) {
63
            TableTableColumnElement tcne = null;
64
            try {
65
                tcne = (TableTableColumnElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TableTableColumnElement.ELEMENT_NAME);
66
            } catch (Exception e) {
67
                throw new OdfException("Can't create new table column.", e);
68
            }
69
            tcne.setAttributeNS(Namespace.TABLE,
70
                                "table:number-columns-repeated",
71
                                Integer.toString(table.getColumns().size()));
72
73
            try {
74
                tte.appendChild(tcne);
75
            } catch (Exception e) {
76
                throw new OdfException("Can't create table.", e);
77
            }
78
        }
79
    }
80
81
    /**
82
     * {@inheritDoc}
83
     */
84
    @Override
85
    public void closeIntercept() {
86
        try {
87
            this.getParagraphContainer().appendChild(tte);
88
        } catch (DOMException e) {
89
            e.printStackTrace();
90
        } catch (Exception e) {
91
            e.printStackTrace();
92
        }
93
    }
94
95
    public void executeFromParent(TagExecutable child) throws OdfException {
96
        child.execute(this);
97
    }
98
}
(-)src/java/org/apache/fop/render/odf/odt/tags/Tag.java (+256 lines)
Line 0 Link Here
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
package org.apache.fop.render.odf.odt.tags;
19
20
import java.util.Map;
21
import java.util.Map.Entry;
22
import java.util.Random;
23
import java.util.Vector;
24
25
import org.odftoolkit.odfdom.doc.OdfTextDocument;
26
import org.odftoolkit.odfdom.dom.OdfContentDom;
27
import org.odftoolkit.odfdom.dom.element.style.StyleFontFaceElement;
28
import org.odftoolkit.odfdom.dom.element.style.StyleStyleElement;
29
import org.odftoolkit.odfdom.dom.element.text.TextPElement;
30
import org.odftoolkit.odfdom.pkg.OdfElement;
31
import org.odftoolkit.odfdom.pkg.OdfXMLFactory;
32
import org.w3c.dom.DOMException;
33
import org.w3c.dom.Node;
34
35
import org.apache.fop.fo.pagination.Flow;
36
import org.apache.fop.render.odf.FopTagType;
37
import org.apache.fop.render.odf.OdfException;
38
import org.apache.fop.render.odf.odt.Namespace;
39
import org.apache.fop.render.odf.odt.Style;
40
import org.apache.fop.render.odf.properties.Property;
41
42
/**
43
 * Tag converter abstract class.
44
 */
45
public abstract class Tag implements TagExecutable, TagExecutor {
46
47
    protected Tag parent = null;
48
49
    protected Style currentStyle = null;
50
51
    private static Random rand = new Random();
52
53
    protected Tag(Tag parent) {
54
        this.parent = parent;
55
        if (parent != null) {
56
            currentStyle = new Style(parent.getStyle());
57
        } else {
58
            currentStyle = new Style();
59
        }
60
    }
61
62
    protected OdfTextDocument getOdt() {
63
        return parent != null ? parent.getOdt() : null;
64
    }
65
66
    protected Map<String, StyleStyleElement> getUsedStyles() {
67
        return parent.getUsedStyles();
68
    }
69
70
    protected Vector<String> getUsedFonts() {
71
        return parent.getUsedFonts();
72
    }
73
74
    protected void registerFont(String font) throws OdfException {
75
        if (!this.getUsedFonts().contains(font)) {
76
            StyleFontFaceElement sffe = null;
77
            try {
78
                sffe = (StyleFontFaceElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), StyleFontFaceElement.ELEMENT_NAME);
79
            } catch (Exception e) {
80
                throw new OdfException("Can't create new style.", e);
81
            }
82
83
            if (isOnlyOneParagraph(this.getOdt())) {
84
                removeLastParagraph(this.getOdt());
85
            }
86
87
            sffe.setStyleNameAttribute(font);
88
            sffe.setAttributeNS(Namespace.SVG, "svg:font-family", font);
89
            try {
90
                this.getOdt().getContentDom().getElementsByTagNameNS(Namespace.OFFICE, "font-face-decls").item(0).appendChild(sffe);
91
            } catch (Exception e) {
92
                throw new OdfException("Can't register new font", e);
93
            }
94
            this.getUsedFonts().add(font);
95
        }
96
    }
97
98
    private boolean isOnlyOneParagraph(OdfTextDocument textDocument) {
99
        int i = 0;
100
        try {
101
            i = textDocument.getContentDom().getElementsByTagNameNS(Namespace.TEXT, "p").getLength();
102
        } catch (Exception e) {
103
            return false;
104
        }
105
        return i == 1 ? true : false;
106
    }
107
108
    private void removeLastParagraph(OdfTextDocument textDocument) {
109
        try {
110
            textDocument.getContentDom().getElementsByTagNameNS(Namespace.OFFICE, "text").item(0).removeChild(textDocument.getContentDom().getElementsByTagNameNS(Namespace.TEXT, "p").item(0));
111
        } catch (Exception e) {
112
            e.printStackTrace();
113
        }
114
    }
115
116
    protected Style getStyle() {
117
        return this.currentStyle;
118
    }
119
120
    public Tag getParent() {
121
        return parent;
122
    }
123
124
    protected OdfElement getTextContainer() {
125
        if (parent != null) {
126
            return parent.getTextContainer();
127
        } else {
128
            return null;
129
        }
130
    }
131
132
    protected TextPElement getParagraph() throws OdfException {
133
        return parent != null ? parent.getParagraph() : null;
134
    }
135
136
    protected OdfElement getParagraphContainer() {
137
        return parent != null ? parent.getParagraphContainer() : null;
138
    }
139
140
    protected TextPElement newParagraph(Node paragraphContainer) throws OdfException {
141
142
        TextPElement tpe = null;
143
144
        try {
145
            tpe = (TextPElement) OdfXMLFactory.newOdfElement(this.getOdt().getContentDom(), TextPElement.ELEMENT_NAME);
146
        } catch (Exception e1) {
147
            throw new OdfException("Can't create new style.", e1);
148
        }
149
150
        try {
151
            paragraphContainer.appendChild(tpe);
152
        } catch (DOMException e) {
153
            throw new OdfException("Can't create new paragraph", e);
154
        }
155
156
        return tpe;
157
    }
158
159
    protected String appendNewStyle(StyleStyleElement sse) throws OdfException {
160
161
        sse.setAttributeNS(Namespace.STYLE, "style:name", "");
162
163
        String styleName = Style.getStyleName(this.getUsedStyles(), sse);
164
165
        if (styleName == null) {
166
            styleName = generateName();
167
            sse.setAttributeNS(Namespace.STYLE, "style:name", styleName);
168
169
            try {
170
                OdfContentDom odf = this.getOdt().getContentDom();
171
                Node odfstyles = odf.getElementsByTagNameNS(Namespace.OFFICE, "automatic-styles").item(0);
172
                odfstyles.appendChild(sse);
173
            } catch (Exception e) {
174
                throw new OdfException("Can't create new style.&q