Skip to content

Commit

Permalink
0.3.7.1 (2021-12-22)
Browse files Browse the repository at this point in the history
+ Added bookmark tree support (currently only work with fop renderer)
  • Loading branch information
mttfranci committed Dec 22, 2021
1 parent 72eb404 commit 0361b2e
Show file tree
Hide file tree
Showing 23 changed files with 666 additions and 21 deletions.
4 changes: 2 additions & 2 deletions docgen/parameters.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title" : "Venus (Fugerit Document Generation Framework)",
"name": "Venus",
"version" : "0.3.7.0",
"date" : "21/11/2021",
"version" : "0.3.7.1",
"date" : "22/12/2021",
"organization" : {
"name" : "Fugerit Org",
"url" : "https://www.fugerit.org"
Expand Down
6 changes: 5 additions & 1 deletion docgen/release-notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
0.3.7.0 (2021-11-21)
0.3.7.1 (2021-12-22)
--------------------
+ Added bookmark tree support (currently only work with fop renderer)

0.3.7.0 (2021-11-21)
--------------------
+ Better header handling for fop

Expand Down
2 changes: 1 addition & 1 deletion fj-doc-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.fugerit.java</groupId>
<artifactId>fj-doc</artifactId>
<version>0.3.7.0</version>
<version>0.3.7.1</version>
</parent>

<name>fj-doc-base</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ public DocBase() {

private DocBackground docBackground;

private DocBookmarkTree docBookmarkTree;

private HashMap<String, DocElement> idMap;

private String xsdVersion;
Expand Down Expand Up @@ -215,5 +217,13 @@ public DocBackground getDocBackground() {
public void setDocBackground(DocBackground docBackground) {
this.docBackground = docBackground;
}

public DocBookmarkTree getDocBookmarkTree() {
return docBookmarkTree;
}

public void setDocBookmarkTree(DocBookmarkTree docBookmarkTree) {
this.docBookmarkTree = docBookmarkTree;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*****************************************************************
<copyright>
Fugerit Java Library org.fugerit.java.doc.base
Copyright (c) 2019 Fugerit
All rights reserved. This program and the accompanying materials
are made available under the terms of the Apache License v2.0
which accompanies this distribution, and is available at
http://www.apache.org/licenses/
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
</copyright>
*****************************************************************/
package org.fugerit.java.doc.base.model;
/*
* @(#)DocTable.java
*
* @project : org.fugerit.java.doc.base
* @package : org.fugerit.java.doc.base
* @creation : 06/set/06
* @license : META-INF/LICENSE.TXT
*/

/**
*
*
* @author fugerit
*
*/
public class DocBookmark extends DocElement {

public DocBookmark() {
this.title = "";
}

/**
*
*/
private static final long serialVersionUID = 470846678198846L;

public static final String TAG_NAME = "bookmark";

public static final String ATT_REF = "ref";

private String ref;

private String title;

public String getRef() {
return ref;
}

public void setRef(String ref) {
this.ref = ref;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*****************************************************************
<copyright>
Fugerit Java Library org.fugerit.java.doc.base
Copyright (c) 2019 Fugerit
All rights reserved. This program and the accompanying materials
are made available under the terms of the Apache License v2.0
which accompanies this distribution, and is available at
http://www.apache.org/licenses/
(txt version : http://www.apache.org/licenses/LICENSE-2.0.txt
html version : http://www.apache.org/licenses/LICENSE-2.0.html)
This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
</copyright>
*****************************************************************/
package org.fugerit.java.doc.base.model;
/*
* @(#)DocTable.java
*
* @project : org.fugerit.java.doc.base
* @package : org.fugerit.java.doc.base
* @creation : 06/set/06
* @license : META-INF/LICENSE.TXT
*/

/**
*
*
* @author fugerit
*
*/
public class DocBookmarkTree extends DocContainer {

/**
*
*/
private static final long serialVersionUID = 47084667819886346L;

public static final String TAG_NAME = "bookmark-tree";

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ The Apache Software Foundation (http://www.apache.org/).
import org.fugerit.java.doc.base.model.DocBackground;
import org.fugerit.java.doc.base.model.DocBarcode;
import org.fugerit.java.doc.base.model.DocBase;
import org.fugerit.java.doc.base.model.DocBookmark;
import org.fugerit.java.doc.base.model.DocBookmarkTree;
import org.fugerit.java.doc.base.model.DocBorders;
import org.fugerit.java.doc.base.model.DocBr;
import org.fugerit.java.doc.base.model.DocCell;
Expand Down Expand Up @@ -83,7 +85,8 @@ public class DocContentHandler implements ContentHandler {
"footer",
"header-ext",
"footer-ext",
DocBackground.TAG_NAME};
DocBackground.TAG_NAME,
DocBookmarkTree.TAG_NAME};

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

Expand Down Expand Up @@ -120,6 +123,9 @@ public void characters(char[] ch, int start, int length) throws SAXException {
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocPara ) {
DocPara docPara = (DocPara)this.currentElement;
docPara.setText( docPara.getText()+text );
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocBookmark ) {
DocBookmark docBookmarkTitle = (DocBookmark)this.currentElement;
docBookmarkTitle.setTitle( docBookmarkTitle.getTitle()+text );
} else if ( text.trim().length() > 0 && this.currentElement instanceof DocInfo ) {
DocInfo docInfo = (DocInfo)this.currentElement;
docInfo.getContent().append( text );
Expand Down Expand Up @@ -280,6 +286,8 @@ private static void valuePara( DocPara docPara, Properties props, boolean headin
}
docPara.setStyle( DocPara.parseStyle( style, defaultStyle ) );
docPara.setOriginalStyle( DocPara.parseStyle( style, DocPara.STYLE_UNSET ) );
String id = props.getProperty( "id" );
docPara.setId( id );
// setting paragraph align
String align = props.getProperty( "align" );
docPara.setAlign( getAlign( align ) );
Expand Down Expand Up @@ -506,6 +514,15 @@ public void startElement(String uri, String localName, String qName, Attributes
this.currentElement = docCell;
} else if ( "page-break".equalsIgnoreCase( qName ) ) {
this.currentElement = new DocPageBreak();
} else if ( DocBookmarkTree.TAG_NAME.equalsIgnoreCase( qName ) ) {
DocBookmarkTree docBookmarkTree = new DocBookmarkTree();
this.docBase.setDocBookmarkTree(docBookmarkTree);
this.currentElement = docBookmarkTree;
} else if ( DocBookmark.TAG_NAME.equalsIgnoreCase( qName ) ) {
DocBookmark docBookmark = new DocBookmark();
String ref = props.getProperty( DocBookmark.ATT_REF );
docBookmark.setRef( ref );
this.currentElement = docBookmark;
}
// processamenti finali
if ( this.currentContainer != null && this.currentContainer != this.currentElement ) {
Expand Down
Loading

0 comments on commit 0361b2e

Please sign in to comment.