Shirly Radco has uploaded a new change for review. Change subject: reprts: added jar to support localization per session ......................................................................
reprts: added jar to support localization per session Added jar to suppoert Ad Hoc Domains - localization according to session context and not according to enum translator view. Change-Id: I05b4d2dc0cdee10346e0dc6f250429aad9734cfd Bug-Url: https://bugzilla.redhat.com/1010681 Signed-off-by: Shirly Radco <[email protected]> --- M build.xml A ovirt-engine-reports/RequestAttributesBinder/build.xml A ovirt-engine-reports/RequestAttributesBinder/src/main/java/com/ovirt/reports/jasper/RequestAttributesBinder.java 3 files changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-reports refs/changes/21/28221/1 diff --git a/build.xml b/build.xml index 49a3e3b..29c2f7a 100644 --- a/build.xml +++ b/build.xml @@ -60,6 +60,8 @@ <ant dir="ovirt-engine-reports/ReportsStatus" target="${target}"/> <echo message="WebadminLineBarChartTheme"/> <ant dir="ovirt-engine-reports/WebadminLineBarChartTheme" target="${target}"/> + <echo message="RequestAttributesBinder"/> + <ant dir="ovirt-engine-reports/RequestAttributesBinder" target="${target}"/> </target> </project> diff --git a/ovirt-engine-reports/RequestAttributesBinder/build.xml b/ovirt-engine-reports/RequestAttributesBinder/build.xml new file mode 100644 index 0000000..931f843 --- /dev/null +++ b/ovirt-engine-reports/RequestAttributesBinder/build.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<project name="RequestAttributesBinder" default="all"> + <property name="build.output" location="lib"/> + <property name="local.output" value="${build.output}/RequestAttributesBinder.jar"/> + + <path id="local.classpath"> + <fileset dir="${jasper.lib}"><filename name="spring-web-*.jar"/></fileset> + <fileset dir="${jasper.lib}"><filename name="spring-webflow-*.jar"/></fileset> + <fileset dir="${jasper.lib}"><filename name="ji-datarator-*.jar"/></fileset> + </path> + + <target name="all"> + <mkdir dir="target"/> + <mkdir dir="${build.output}"/> + <javac + srcdir="src" + destdir="target" + includeAntRuntime="no" + encoding="utf-8" + debug="true" + debuglevel="lines,vars,source" + classpathref="local.classpath" + /> + <jar + destfile="${local.output}" + basedir="target" + includes="**/*.class" + /> + </target> + + <target name="clean"> + <delete dir="target"/> + <delete file="${local.output}"/> + </target> +</project> diff --git a/ovirt-engine-reports/RequestAttributesBinder/src/main/java/com/ovirt/reports/jasper/RequestAttributesBinder.java b/ovirt-engine-reports/RequestAttributesBinder/src/main/java/com/ovirt/reports/jasper/RequestAttributesBinder.java new file mode 100644 index 0000000..26693c9 --- /dev/null +++ b/ovirt-engine-reports/RequestAttributesBinder/src/main/java/com/ovirt/reports/jasper/RequestAttributesBinder.java @@ -0,0 +1,23 @@ +package com.ovirt.reports.jasper; + +import org.springframework.web.context.request.RequestContextHolder; +import com.jaspersoft.commons.groovy.ScriptRunnerFactory; + +public class RequestAttributesBinder implements ScriptRunnerFactory.Binder { + private String name; + + @Override + public String getName() { + return name; + } + + @Override + public Object getValue() { + return RequestContextHolder.getRequestAttributes().getAttribute("org.springframework.web.context.request.RequestContextListener.REQUEST_ATTRIBUTES", 0); + } + + @Override + public void setName(String name) { + this.name = name; + } +} -- To view, visit http://gerrit.ovirt.org/28221 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05b4d2dc0cdee10346e0dc6f250429aad9734cfd Gerrit-PatchSet: 1 Gerrit-Project: ovirt-reports Gerrit-Branch: master Gerrit-Owner: Shirly Radco <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
