Skip to content

Commit 97b7bc0

Browse files
committed
Update document for 2.1.0
Fixes gh-55
1 parent 236e07a commit 97b7bc0

File tree

1 file changed

+48
-29
lines changed

1 file changed

+48
-29
lines changed

src/site/xdoc/index.xml.vm

Lines changed: 48 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2015-2017 the original author or authors.
4+
Copyright 2015-2019 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -28,45 +28,33 @@
2828
<body>
2929
<section name="Introduction">
3030
<p>
31-
mybatis-freemarker is a plugin that helps creating big dynamic SQL queries. You can use it selectively, to only queries that need if statmenets or foreach-loops, for example. But it is possible to use this syntax by default too.
31+
The mybatis-freemarker is a plugin that helps creating big dynamic SQL queries. You can use it selectively, to only queries that need if statmenets or foreach-loops, for example. But it is possible to use this syntax by default too.
3232
</p>
3333
<p>
3434
If you are not familiar with FreeMarker syntax, you can view
35-
<ul>
36-
<li>
37-
<a href="http://freemarker.org/docs/ref.html">Template Language Reference</a>
38-
</li>
39-
</ul>
4035
</p>
36+
<ul>
37+
<li>
38+
<a href="http://freemarker.org/docs/ref.html">Template Language Reference</a>
39+
</li>
40+
</ul>
4141
</section>
4242

4343
<section name="Install">
4444
<p>
45-
mybatis-freemarker is available in <a href="https://bintray.com/bintray/jcenter">jcenter</a> maven repository. So, if you are using maven, you can add this:
45+
If you are using maven, you can add this:
4646
</p>
4747
<source><![CDATA[
48-
<repositories>
49-
<repository>
50-
<id>jcenter</id>
51-
<url>http://jcenter.bintray.com</url>
52-
</repository>
53-
</repositories>
54-
55-
<dependencies>
56-
<dependency>
57-
<groupId>org.mybatis.scripting</groupId>
58-
<artifactId>mybatis-freemarker</artifactId>
59-
<version>${project.version}</version>
60-
</dependency>
61-
</dependencies>]]></source>
48+
<dependency>
49+
<groupId>org.mybatis.scripting</groupId>
50+
<artifactId>mybatis-freemarker</artifactId>
51+
<version>${project.version}</version>
52+
</dependency>
53+
]]></source>
6254

6355
<p>If you are using gradle, you can use this snippet:</p>
6456

6557
<source><![CDATA[
66-
repositories {
67-
jcenter()
68-
}
69-
7058
dependencies {
7159
compile("org.mybatis.scripting:mybatis-freemarker:${project.version}")
7260
}]]></source>
@@ -90,12 +78,43 @@ dependencies {
9078

9179
<section name="Configuring">
9280
<subsection name="Common">
81+
<p>
82+
By default, the <code>mybatis-freemarker.properties</code> file create in your classpath.
83+
</p>
9384
<ul>
94-
<li>(Optional) Create <code>mybatis-freemarker.properties</code> file in your classpath:
95-
<source>basePackage=sql</source>
96-
This will define base package to search FreeMarker templates. By default it is empty string, so you will need to provide full path to template every time.
85+
<li>
86+
You can define the base package to search FreeMarker templates.
87+
By default it is empty string, so you will need to provide full path to template every time.
88+
<source><![CDATA[
89+
# 'base-package' (kebab-case) can be used too
90+
basePackage = sql
91+
]]></source>
92+
</li>
93+
<li>
94+
Since 2.1.0, you configure the FreeMarker configuration as follow:
95+
About available setting name, please refer to <a href="https://freemarker.apache.org/docs/api/freemarker/template/Configuration.html#setSetting-java.lang.String-java.lang.String-">the API documentation of FreeMarker</a>.
96+
<source><![CDATA[
97+
# freemarkerSettings.{name} = {value}
98+
# 'freemarker-settings' (kebab-case) can be used too
99+
freemarkerSettings.interpolation_syntax = dollar
100+
]]></source>
101+
</li>
102+
<li>
103+
Since 2.1.0, you can use an any properties file instead of the default properties file.
104+
If you use an any properties file, please specify a properties file using the special system properties(<code>mybatis-freemarker.config.file</code>) as follow:
105+
<source><![CDATA[
106+
$ java -Dmybatis-freemarker.config.file=mybatis-freemarker_production.properties ...
107+
]]></source>
108+
</li>
109+
<li>
110+
Since 2.1.0, you can use an any file encoding instead of the default file encoding(UTF-8).
111+
If you use an any file encoding, please specify a file encoding using the special system properties(<code>mybatis-freemarker.config.encoding</code>) as follow:
112+
<source><![CDATA[
113+
$ java -Dmybatis-freemarker.config.encoding=Windows-31J ...
114+
]]></source>
97115
</li>
98116
</ul>
117+
99118
</subsection>
100119
<subsection name="XML-driven mappers">
101120
<p>If your are using annotations-driven mappers, you don't need to do anything more. If you are using XML-driven mappers too, you may need to do next steps:</p>

0 commit comments

Comments
 (0)