fix locale

This commit is contained in:
Peter Hormanns 2017-07-20 19:43:41 +02:00
parent 5ad5f1b827
commit 1eb93f7ecc
3 changed files with 5 additions and 4 deletions

View File

@ -66,13 +66,13 @@ public class ModulesManager implements Serializable {
public List<Map<String, Object>> search(final String runAsUser, final String ticket, final Map<String, String> whereParams) throws XmlRpcException public List<Map<String, Object>> search(final String runAsUser, final String ticket, final Map<String, String> whereParams) throws XmlRpcException
{ {
LOG.info("RPC Call: " + moduleName + ".search - user " + runAsUser); LOG.info("RPC Call: " + moduleName + ".search - user " + runAsUser);
final List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
final XmlRpcClient rpcClient = rpcClient(moduleName); final XmlRpcClient rpcClient = rpcClient(moduleName);
final List<Object> xmlRpcParamsList = new ArrayList<Object>(); final List<Object> xmlRpcParamsList = new ArrayList<Object>();
xmlRpcParamsList.add(runAsUser); xmlRpcParamsList.add(runAsUser);
xmlRpcParamsList.add(ticket); xmlRpcParamsList.add(ticket);
xmlRpcParamsList.add(whereParams); xmlRpcParamsList.add(whereParams);
final Object[] rpcResult = (Object[]) rpcClient.execute(moduleName + ".search", xmlRpcParamsList); final Object[] rpcResult = (Object[]) rpcClient.execute(moduleName + ".search", xmlRpcParamsList);
final List<Map<String, Object>> resultList = new ArrayList<Map<String,Object>>();
for (final Object obj : rpcResult) { for (final Object obj : rpcResult) {
if (obj instanceof Map) { if (obj instanceof Map) {
resultList.add((Map<String, Object>) obj); resultList.add((Map<String, Object>) obj);

View File

@ -59,6 +59,6 @@ public class HSAdminUI extends UI {
} }
public void setGrantingTicket(String grantingTicket, String username) { public void setGrantingTicket(String grantingTicket, String username) {
layout.addComponent(new MainWindow(ticketService, grantingTicket, username)); layout.addComponent(new MainWindow(getUI().getLocale(), ticketService, grantingTicket, username));
} }
} }

View File

@ -3,6 +3,7 @@ package de.hsadmin.web;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -36,11 +37,11 @@ public class MainWindow extends CustomComponent implements HSAdminSession {
private ModulesManager modulesManager; private ModulesManager modulesManager;
private AbstractSplitPanel content; private AbstractSplitPanel content;
public MainWindow(final TicketService ticketService, final String grantingTicket, final String username) { public MainWindow(final Locale locale, final TicketService ticketService, final String grantingTicket, final String username) {
this.ticketService = ticketService; this.ticketService = ticketService;
this.grantingTicket = grantingTicket; this.grantingTicket = grantingTicket;
this.username = username; this.username = username;
this.i18n = I18N.loc(getUI().getLocale()); this.i18n = I18N.loc(locale);
setSizeFull(); setSizeFull();
final Panel mainPanel = new Panel(); final Panel mainPanel = new Panel();