Skip to content

Commit 0361b2e

Browse files
committed
0.3.7.1 (2021-12-22)
+ Added bookmark tree support (currently only work with fop renderer)
1 parent 72eb404 commit 0361b2e

File tree

23 files changed

+666
-21
lines changed

23 files changed

+666
-21
lines changed

docgen/parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"title" : "Venus (Fugerit Document Generation Framework)",
33
"name": "Venus",
4-
"version" : "0.3.7.0",
5-
"date" : "21/11/2021",
4+
"version" : "0.3.7.1",
5+
"date" : "22/12/2021",
66
"organization" : {
77
"name" : "Fugerit Org",
88
"url" : "https://www.fugerit.org"

docgen/release-notes.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
0.3.7.0 (2021-11-21)
1+
0.3.7.1 (2021-12-22)
2+
--------------------
3+
+ Added bookmark tree support (currently only work with fop renderer)
4+
5+
0.3.7.0 (2021-11-21)
26
--------------------
37
+ Better header handling for fop
48

fj-doc-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>org.fugerit.java</groupId>
99
<artifactId>fj-doc</artifactId>
10-
<version>0.3.7.0</version>
10+
<version>0.3.7.1</version>
1111
</parent>
1212

1313
<name>fj-doc-base</name>

fj-doc-base/src/main/java/org/fugerit/java/doc/base/model/DocBase.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ public DocBase() {
9090

9191
private DocBackground docBackground;
9292

93+
private DocBookmarkTree docBookmarkTree;
94+
9395
private HashMap<String, DocElement> idMap;
9496

9597
private String xsdVersion;
@@ -215,5 +217,13 @@ public DocBackground getDocBackground() {
215217
public void setDocBackground(DocBackground docBackground) {
216218
this.docBackground = docBackground;
217219
}
220+
221+
public DocBookmarkTree getDocBookmarkTree() {
222+
return docBookmarkTree;
223+
}
224+
225+
public void setDocBookmarkTree(DocBookmarkTree docBookmarkTree) {
226+
this.docBookmarkTree = docBookmarkTree;
227+
}
218228

219229
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*****************************************************************
2+
<copyright>
3+
Fugerit Java Library org.fugerit.java.doc.base
4+
5+
Copyright (c) 2019 Fugerit
6+
7+
All rights reserved. This program and the accompanying materials
8+
are made available under the terms of the Apache License v2.0
9+
which accompanies this distribution, and is available at
10+
http://www.apache.org/licenses/
11+
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12+
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13+
14+
This product includes software developed at
15+
The Apache Software Foundation (http://www.apache.org/).
16+
</copyright>
17+
*****************************************************************/
18+
package org.fugerit.java.doc.base.model;
19+
/*
20+
* @(#)DocTable.java
21+
*
22+
* @project : org.fugerit.java.doc.base
23+
* @package : org.fugerit.java.doc.base
24+
* @creation : 06/set/06
25+
* @license : META-INF/LICENSE.TXT
26+
*/
27+
28+
/**
29+
*
30+
*
31+
* @author fugerit
32+
*
33+
*/
34+
public class DocBookmark extends DocElement {
35+
36+
public DocBookmark() {
37+
this.title = "";
38+
}
39+
40+
/**
41+
*
42+
*/
43+
private static final long serialVersionUID = 470846678198846L;
44+
45+
public static final String TAG_NAME = "bookmark";
46+
47+
public static final String ATT_REF = "ref";
48+
49+
private String ref;
50+
51+
private String title;
52+
53+
public String getRef() {
54+
return ref;
55+
}
56+
57+
public void setRef(String ref) {
58+
this.ref = ref;
59+
}
60+
61+
public String getTitle() {
62+
return title;
63+
}
64+
65+
public void setTitle(String title) {
66+
this.title = title;
67+
}
68+
69+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*****************************************************************
2+
<copyright>
3+
Fugerit Java Library org.fugerit.java.doc.base
4+
5+
Copyright (c) 2019 Fugerit
6+
7+
All rights reserved. This program and the accompanying materials
8+
are made available under the terms of the Apache License v2.0
9+
which accompanies this distribution, and is available at
10+
http://www.apache.org/licenses/
11+
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
12+
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
13+
14+
This product includes software developed at
15+
The Apache Software Foundation (http://www.apache.org/).
16+
</copyright>
17+
*****************************************************************/
18+
package org.fugerit.java.doc.base.model;
19+
/*
20+
* @(#)DocTable.java
21+
*
22+
* @project : org.fugerit.java.doc.base
23+
* @package : org.fugerit.java.doc.base
24+
* @creation : 06/set/06
25+
* @license : META-INF/LICENSE.TXT
26+
*/
27+
28+
/**
29+
*
30+
*
31+
* @author fugerit
32+
*
33+
*/
34+
public class DocBookmarkTree extends DocContainer {
35+
36+
/**
37+
*
38+
*/
39+
private static final long serialVersionUID = 47084667819886346L;
40+
41+
public static final String TAG_NAME = "bookmark-tree";
42+
43+
}

fj-doc-base/src/main/java/org/fugerit/java/doc/base/xml/DocContentHandler.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ The Apache Software Foundation (http://www.apache.org/).
3636
import org.fugerit.java.doc.base.model.DocBackground;
3737
import org.fugerit.java.doc.base.model.DocBarcode;
3838
import org.fugerit.java.doc.base.model.DocBase;
39+
import org.fugerit.java.doc.base.model.DocBookmark;
40+
import org.fugerit.java.doc.base.model.DocBookmarkTree;
3941
import org.fugerit.java.doc.base.model.DocBorders;
4042
import org.fugerit.java.doc.base.model.DocBr;
4143
import org.fugerit.java.doc.base.model.DocCell;
@@ -83,7 +85,8 @@ public class DocContentHandler implements ContentHandler {
8385
"footer",
8486
"header-ext",
8587
"footer-ext",
86-
DocBackground.TAG_NAME};
88+
DocBackground.TAG_NAME,
89+
DocBookmarkTree.TAG_NAME};
8790

8891
private static final Collection<String> CONTAINER_LIST = new HashSet<>( Arrays.asList( ELEMENT_CONTAINER ) );
8992

@@ -120,6 +123,9 @@ public void characters(char[] ch, int start, int length) throws SAXException {
120123
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocPara ) {
121124
DocPara docPara = (DocPara)this.currentElement;
122125
docPara.setText( docPara.getText()+text );
126+
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocBookmark ) {
127+
DocBookmark docBookmarkTitle = (DocBookmark)this.currentElement;
128+
docBookmarkTitle.setTitle( docBookmarkTitle.getTitle()+text );
123129
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocInfo ) {
124130
DocInfo docInfo = (DocInfo)this.currentElement;
125131
docInfo.getContent().append( text );
@@ -280,6 +286,8 @@ private static void valuePara( DocPara docPara, Properties props, boolean headin
280286
}
281287
docPara.setStyle( DocPara.parseStyle( style, defaultStyle ) );
282288
docPara.setOriginalStyle( DocPara.parseStyle( style, DocPara.STYLE_UNSET ) );
289+
String id = props.getProperty( "id" );
290+
docPara.setId( id );
283291
// setting paragraph align
284292
String align = props.getProperty( "align" );
285293
docPara.setAlign( getAlign( align ) );
@@ -506,6 +514,15 @@ public void startElement(String uri, String localName, String qName, Attributes
506514
this.currentElement = docCell;
507515
} else if ( "page-break".equalsIgnoreCase( qName ) ) {
508516
this.currentElement = new DocPageBreak();
517+
} else if ( DocBookmarkTree.TAG_NAME.equalsIgnoreCase( qName ) ) {
518+
DocBookmarkTree docBookmarkTree = new DocBookmarkTree();
519+
this.docBase.setDocBookmarkTree(docBookmarkTree);
520+
this.currentElement = docBookmarkTree;
521+
} else if ( DocBookmark.TAG_NAME.equalsIgnoreCase( qName ) ) {
522+
DocBookmark docBookmark = new DocBookmark();
523+
String ref = props.getProperty( DocBookmark.ATT_REF );
524+
docBookmark.setRef( ref );
525+
this.currentElement = docBookmark;
509526
}
510527
// processamenti finali
511528
if ( this.currentContainer != null && this.currentContainer != this.currentElement ) {

0 commit comments

Comments
 (0)