View config files
This commit is contained in:
44
view-webapp/src/main/config/macros.vtl
Normal file
44
view-webapp/src/main/config/macros.vtl
Normal file
@@ -0,0 +1,44 @@
|
||||
#macro(forward $url)
|
||||
## $log.debug("forwarding towards $url")
|
||||
$request.session.servletContext.getRequestDispatcher($url).forward($request,$response)
|
||||
#end
|
||||
|
||||
#macro(redirect $url)
|
||||
$log.debug("redirecting towards $url")
|
||||
$response.sendRedirect($url)
|
||||
#end
|
||||
|
||||
#macro(seterror $msg)##
|
||||
$log.error($msg)##
|
||||
$session.setAttribute('error',$msg)##
|
||||
#end
|
||||
|
||||
#macro(clearerror)##
|
||||
$session.removeAttribute('error')##
|
||||
#end
|
||||
|
||||
#macro(setmessage $msg)##
|
||||
$log.info($msg)##
|
||||
#if($message)##
|
||||
$session.setAttribute('message',"$message<br/>$msg")##
|
||||
#else##
|
||||
$session.setAttribute('message',$msg)##
|
||||
#end##
|
||||
#end
|
||||
|
||||
#macro(clearmessage)##
|
||||
$session.removeAttribute('message')##
|
||||
#end
|
||||
|
||||
#macro(api_error $message)
|
||||
$api.exception($message)
|
||||
#end
|
||||
|
||||
#macro(euro $amount)
|
||||
$number.format('#0.00 €', $amount)##
|
||||
#end
|
||||
|
||||
#macro(ttc $amount)
|
||||
#set($ttc = $amount * 1.2)##
|
||||
$number.format('#0.00 €', $ttc)##
|
||||
#end
|
23
view-webapp/src/main/config/tools.xml
Normal file
23
view-webapp/src/main/config/tools.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<tools xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<toolbox scope="application">
|
||||
<!--
|
||||
<tool key="number" format="#0.00"/>
|
||||
<tool key="date" locale="fr_FR" format="yyyy-MM-dd"/>
|
||||
<tool key="inflector" class="org.atteo.evo.inflector.English"/>
|
||||
<tool key="strings" class="org.apache.commons.lang3.StringUtils"/>
|
||||
-->
|
||||
</toolbox>
|
||||
|
||||
<toolbox scope="session">
|
||||
<!--
|
||||
<tool key="oauth" class="org.jeudego.egc2024.tool.OAuthTool"/>
|
||||
-->
|
||||
</toolbox>
|
||||
|
||||
<toolbox scope="request">
|
||||
<tool key="intl" class="org.jeudego.pairgoth.view.IntlTool"/>
|
||||
</toolbox>
|
||||
|
||||
</tools>
|
51
view-webapp/src/main/config/velocity.properties
Normal file
51
view-webapp/src/main/config/velocity.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
# 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.
|
||||
|
||||
runtime.log.name = velocity
|
||||
runtime.log.track_location = true
|
||||
|
||||
runtime.strict_mode.enable = true
|
||||
|
||||
runtime.introspector.uberspect = org.apache.velocity.util.introspection.UberspectImpl, org.apache.velocity.tools.view.WebappUberspector
|
||||
resource.manager.log_when_found = false
|
||||
|
||||
# fichier de macros globales
|
||||
velocimacro.library=/WEB-INF/macros.vtl
|
||||
|
||||
# definition inline des macros
|
||||
velocimacro.permissions.allow.inline=true
|
||||
velocimacro.permissions.allow.inline.to.replace.global = true
|
||||
velocimacro.permissions.allow.inline.local.scope = true
|
||||
|
||||
directive.set.null.allowed = true
|
||||
|
||||
#encoding
|
||||
input.encoding = UTF8
|
||||
output.encoding = UTF8
|
||||
|
||||
# content type
|
||||
default.contentType = text/html
|
||||
|
||||
# relative loading
|
||||
# eventhandler.include.class = com.axonia.web.IncludeRelativeTreePath
|
||||
|
||||
|
||||
resource.loaders = webapp,string
|
||||
|
||||
# custom directive
|
||||
|
||||
runtime.custom_directives = org.jeudego.pairgoth.view.TranslateDirective
|
Reference in New Issue
Block a user