Repository: incubator-freemarker Updated Branches: refs/heads/3 49df6032d -> c448bcd87
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/ConfigureOutputFormatExamples2.properties ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/ConfigureOutputFormatExamples2.properties b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/ConfigureOutputFormatExamples2.properties new file mode 100644 index 0000000..5d2a738 --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/ConfigureOutputFormatExamples2.properties @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +templateConfigurations = \ + FirstMatchTemplateConfigurationFactory( \ + ConditionalTemplateConfigurationFactory( \ + FileExtensionMatcher("xml"), \ + TemplateConfiguration(outputFormat = XMLOutputFormat())), \ + ConditionalTemplateConfigurationFactory( \ + OrMatcher( \ + FileExtensionMatcher("html"), \ + FileExtensionMatcher("htm")), \ + TemplateConfiguration(outputFormat = HTMLOutputFormat())), \ + ConditionalTemplateConfigurationFactory( \ + FileExtensionMatcher("rtf"), \ + TemplateConfiguration(outputFormat = RTFOutputFormat())), \ + allowNoMatch = true) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh new file mode 100644 index 0000000..fe9690c --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh @@ -0,0 +1,22 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +${p?string.@price} +${w?string.@weight} +${fd?string.@fileDate} +${let?datetime?string.@logEventTime} http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh.out ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh.out b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh.out new file mode 100644 index 0000000..717431f --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias1.ftlh.out @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +10,000.00 +10.31 +23/Dec/15 10:09 PM +2015-12-23T21:09:04.213Z http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh new file mode 100644 index 0000000..624950f --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh @@ -0,0 +1,19 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +${10?string.@oct} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh.out ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh.out b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh.out new file mode 100644 index 0000000..08d0fea --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-alias2.ftlh.out @@ -0,0 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +12 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh new file mode 100644 index 0000000..9a34ac0 --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh @@ -0,0 +1,20 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +${10.12356} +${weight} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh.out ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh.out b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh.out new file mode 100644 index 0000000..25d6155 --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/CustomFormatsExample-modelAware.ftlh.out @@ -0,0 +1,20 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +10.1236 +1.5 kg \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples1.properties ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples1.properties b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples1.properties new file mode 100644 index 0000000..faf8592 --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples1.properties @@ -0,0 +1,25 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +templateConfigurations = \ + ConditionalTemplateConfigurationFactory( \ + FileExtensionMatcher("xml"), \ + TemplateConfiguration( \ + sourceEncoding = Charset("utf-8"), \ + outputFormat = XMLOutputFormat() \ + ) \ + ) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples2.properties ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples2.properties b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples2.properties new file mode 100644 index 0000000..f879e70 --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples2.properties @@ -0,0 +1,32 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +templateConfigurations = \ + ConditionalTemplateConfigurationFactory( \ + PathGlobMatcher("mail/**"), \ + FirstMatchTemplateConfigurationFactory( \ + ConditionalTemplateConfigurationFactory( \ + FileNameGlobMatcher("*.subject.*"), \ + TemplateConfiguration(outputFormat = PlainTextOutputFormat()) \ + ), \ + ConditionalTemplateConfigurationFactory( \ + FileNameGlobMatcher("*.body.*"), \ + TemplateConfiguration(outputFormat = HTMLOutputFormat()) \ + ), \ + noMatchErrorDetails = 'Mail template names must contain ".subject." or ".body."!' \ + ) \ + ) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples3.properties ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples3.properties b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples3.properties new file mode 100644 index 0000000..ce72fef --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/TemplateConfigurationExamples3.properties @@ -0,0 +1,47 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +templateConfigurations = \ + MergingTemplateConfigurationFactory( \ + ConditionalTemplateConfigurationFactory( \ + FileNameGlobMatcher("*.stats.*"), \ + TemplateConfiguration( \ + dateTimeFormat = "iso", \ + dateFormat = "iso", \ + timeFormat = "iso", \ + timeZone = TimeZone("UTC") \ + ) \ + ), \ + ConditionalTemplateConfigurationFactory( \ + PathGlobMatcher("mail/**"), \ + TemplateConfiguration(sourceEncoding = Charset("utf-8")) \ + ), \ + FirstMatchTemplateConfigurationFactory( \ + ConditionalTemplateConfigurationFactory( \ + FileExtensionMatcher("xml"), \ + TemplateConfiguration(outputFormat = XMLOutputFormat()) \ + ), \ + ConditionalTemplateConfigurationFactory( \ + OrMatcher( \ + FileExtensionMatcher("html"), \ + FileExtensionMatcher("htm") \ + ), \ + TemplateConfiguration(outputFormat = HTMLOutputFormat()) \ + ), \ + allowNoMatch = true \ + ) \ + ) http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/test.ftlh ---------------------------------------------------------------------- diff --git a/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/test.ftlh b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/test.ftlh new file mode 100644 index 0000000..852b82b --- /dev/null +++ b/freemarker-manual/src/test/resources/org/apache/freemarker/manual/examples/test.ftlh @@ -0,0 +1,28 @@ +<#-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--> +<html> +<head> + <title>Welcome!</title> +</head> +<body> + <h1>Welcome ${user}!</h1> + <p>Our latest product: + <a href="${latestProduct.url}">${latestProduct.name}</a>! +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/abfcac88/settings.gradle ---------------------------------------------------------------------- diff --git a/settings.gradle b/settings.gradle index 5bfbd3a..3d18991 100644 --- a/settings.gradle +++ b/settings.gradle @@ -24,4 +24,5 @@ include 'freemarker-core-test' include 'freemarker-core-test-java8' include 'freemarker-servlet' include 'freemarker-test-utils' +include 'freemarker-manual'
