Skip to content

Commit

Permalink
create function reference page in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
teodord committed Sep 5, 2023
1 parent 1f04dbe commit 1fe19bd
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 19 deletions.
13 changes: 11 additions & 2 deletions jasperreports/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<delete dir="./build"/>
<delete dir="./dist"/>
<delete dir="./target"/>
<ant dir="./demo/samples" target="clean"/>
</target>

<target name="javadoc" description="Compiles the library API documentation.">
Expand Down Expand Up @@ -278,11 +279,19 @@
<include name="**/*.png"/>
</fileset>
</copy>
</target>

<target name="functionref" description="Generates the Function Reference." depends="compile">
<ant dir="./demo/samples/functions" target="test"/>
<copy todir="./dist/docs/sample.reference/functions" file="./demo/samples/functions/build/reports/FunctionsReport.html"/>
<ivy:cachepath pathid="project-lib" log="download-only" conf="docs"/>
<xslt basedir="docs" in="docs/function.reference.xml" destdir="dist/docs" style="docs/function.reference.xsl" out="./dist/docs/function.reference.html">
<param name="sf.net" expression="${sf.net}"/>
<param name="version" expression="${version}"/>
<classpath refid="project-classpath"/>
</xslt>
</target>

<target name="docs" depends="preparedocs, javadoc, schemaref, partschemaref, componentschemaref, configref, sampleref" description="Generates all documentation."/>
<target name="docs" depends="preparedocs, javadoc, schemaref, partschemaref, componentschemaref, configref, sampleref, functionref" description="Generates all documentation."/>

<target name="retrievelibs" description="Retrieve dependencies with Apache Ivy">
<ivy:retrieve conf="compile, javaflow, test" pattern="dist/lib/[artifact](-[classifier])-[revision].[ext]"/>
Expand Down
13 changes: 3 additions & 10 deletions jasperreports/demo/samples/functions/reports/FunctionsReport.jrxml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,9 @@
bottomMargin="15"
isIgnorePagination="true"
uuid="eae24cf2-cede-49ad-a3bf-a10ccd914c7d">
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>
<property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>
<property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>
<property name="net.sf.jasperreports.components.table.interactive" value="false"/>
<property name="net.sf.jasperreports.export.html.header" value=""/>
<property name="net.sf.jasperreports.export.html.footer" value=""/>
<import value="net.sf.jasperreports.engine.data.JRBeanCollectionDataSource"/>
<style name="BaseStyle" isDefault="true" fontSize="9"/>
<style name="Title" style="BaseStyle" isBold="true" fontSize="11">
Expand Down Expand Up @@ -511,7 +504,7 @@
<band height="42">
<staticText>
<reportElement style="Title" x="0" y="0" width="832" height="30" uuid="0baa5bef-ec42-46d4-818e-5395372bf50a"/>
<text><![CDATA[Functions Sample - Built-in Functions in JasperReports Library]]></text>
<text><![CDATA[Built-in Functions in JasperReports Library]]></text>
</staticText>
</band>
</title>
Expand Down
2 changes: 1 addition & 1 deletion jasperreports/docs/components.schema.reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion jasperreports/docs/config.reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down
7 changes: 7 additions & 0 deletions jasperreports/docs/function.reference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<functionReference>

<!-- intentionally left blank -->

</functionReference>
166 changes: 166 additions & 0 deletions jasperreports/docs/function.reference.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jr="http://jasperreports.sourceforge.net/jasperreports">

<xsl:output method="html"/>
<xsl:param name="sf.net"/>
<xsl:param name="version"/>

<xsl:variable name="api.url">api/</xsl:variable>

<xsl:template match="/">
<html>
<head>
<title>JasperReports <xsl:value-of select="$version"/> - Functions Reference</title>
<link rel="stylesheet" href="resources/stylesheet.css"/>
<style type="text/css">
</style>
</head>
<body bgcolor="#FFFFFF">
<xsl:if test="$sf.net = 'true'">
<!-- Tracker -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-399158-5', 'sourceforge.net');
ga('send', 'pageview');
</script>
<!-- End Tracker Tag -->
</xsl:if>

<a name="top"/>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td colspan="2" align="right">
<span class="element"><xsl:element name="a">
<xsl:attribute name="href">JasperReports-Ultimate-Guide-3.pdf</xsl:attribute>JasperReports Ultimate Guide</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
</td>
</tr>
<tr>
<td colspan="2">
<hr size="1"/>
</td>
</tr>
<tr valign="middle">
<td nowrap="true">
<span class="title">JasperReports - Function Reference (version <xsl:value-of select="$version"/>)</span>
</td>
<td align="right">
<img src="resources/jasperreports.svg" border="0"/>
</td>
</tr>
<tr>
<td colspan="2">
<hr size="1"/>
</td>
</tr>
</table>

<br/>

<xsl:copy-of select="document('../demo/samples/functions/build/reports/FunctionsReport.html')"/>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td><br/><br/></td>
</tr>
<tr>
<td><hr size="1"/></td>
</tr>
<tr>
<td align="center">
<span class="copy">&#169; 2001-<script language="javascript">document.write((new Date()).getFullYear())</script> Cloud Software Group, Inc. <a href="http://www.jaspersoft.com" target="_blank" class="copy">www.jaspersoft.com</a></span>
</td>
</tr>
</table>

</body>
</html>
</xsl:template>


<xsl:template match="content">
<xsl:for-each select="feature">
<tr>
<td></td>
<td>
<xsl:choose>
<xsl:when test="@complete = 'false'">
<span class="incomplete"><xsl:element name="a"><xsl:attribute name="href">sample.reference/<xsl:value-of select="@sample"/>/index.html#<xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="class">incomplete</xsl:attribute><xsl:value-of select="@title"/></xsl:element></span>
</xsl:when>
<xsl:otherwise>
<span class="complete"><xsl:element name="a"><xsl:attribute name="href">sample.reference/<xsl:value-of select="@sample"/>/index.html#<xsl:value-of select="@name"/></xsl:attribute><xsl:attribute name="class">complete</xsl:attribute><xsl:value-of select="@title"/></xsl:element></span>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
</xsl:template>

<xsl:template match="description">
<xsl:apply-templates/>
</xsl:template>


<xsl:template match="sample">
<span class="element"><xsl:element name="a"><xsl:attribute name="href">sample.reference/<xsl:value-of select="text()"/>/index.html</xsl:attribute><xsl:value-of select="concat('/demo/samples/', text())"/></xsl:element></span>
</xsl:template>


<xsl:template match="*" mode="copy">
<span class="description"><xsl:copy-of select="."/></span>
</xsl:template>


<xsl:template match="text()">
<span class="description"><xsl:value-of select="."/></span>
</xsl:template>


<xsl:template match="p/text()">
<p><span class="description"><xsl:value-of select="." disable-output-escaping="yes" /></span></p>
</xsl:template>


<xsl:template match="br">
<br/>
</xsl:template>


<xsl:template match="a">
<span class="element"><xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="./@href"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute><xsl:value-of select="."/></xsl:element></span>
</xsl:template>


<xsl:template match="api">
<span class="element"><xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="$api.url"/><xsl:value-of select="./@href"/></xsl:attribute><xsl:value-of select="."/></xsl:element></span>
</xsl:template>


<xsl:template match="ul">
<xsl:element name="ul"><xsl:apply-templates/></xsl:element>
</xsl:template>


<xsl:template match="ol">
<xsl:element name="ol"><xsl:apply-templates/></xsl:element>
</xsl:template>


<xsl:template match="li">
<xsl:element name="li"><xsl:apply-templates/></xsl:element>
</xsl:template>


</xsl:stylesheet>
2 changes: 1 addition & 1 deletion jasperreports/docs/parts.schema.reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion jasperreports/docs/sample.reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down
4 changes: 2 additions & 2 deletions jasperreports/docs/sample.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<html>
<head>
<title>JasperReports <xsl:value-of select="$version"/> - <xsl:value-of select="sample/title"/></title>
<link rel="stylesheet" href="resources/stylesheet.css"/>
<link rel="stylesheet" href="../../resources/stylesheet.css"/>
<style type="text/css">
</style>
</head>
Expand All @@ -41,7 +41,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">../../sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">../../schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">../../config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">../../sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">../../function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion jasperreports/docs/schema.reference.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ga('send', 'pageview');
<xsl:attribute name="href">sample.reference.html</xsl:attribute>Samples</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">schema.reference.html</xsl:attribute>Schema</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">config.reference.html</xsl:attribute>Configuration</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">sample.reference/functions/FunctionsReport.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">function.reference.html</xsl:attribute>Functions</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href">http://community.jaspersoft.com/wiki/jasperreports-library-faqs</xsl:attribute>FAQ</xsl:element> - <xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$api.url"/>index.html</xsl:attribute>API (Javadoc)</xsl:element></span>
<br/>
Expand Down

0 comments on commit 1fe19bd

Please sign in to comment.