@Override public Locale getLocale() { return ((PortletRequest)wrapped).getLocale(); }
protected Locale getLocale(PortletRequest portletRequest) { if (portletRequest != null) { return portletRequest.getLocale(); } return LocaleUtil.getMostRelevantLocale(); }
protected Locale getLocale(PortletRequest portletRequest) { if (portletRequest != null) { return portletRequest.getLocale(); } return LocaleUtil.getMostRelevantLocale(); }
@Override public Locale getRequestLocale() { if (requestLocale == null) { requestLocale = portletRequest.getLocale(); } return requestLocale; }
/** {@inheritDoc} */ public Locale getRequestLocale() { if (request != null) { return request.getLocale(); } else { return null; } }
@Override public Locale getLocale() { if (isClosed) return null; return preq.getLocale(); }
/** * The default behavior of this method is to call * <code>getLocale()</code> on the wrapped request object. */ public Locale getLocale() { return request.getLocale(); }
@Override public Locale getRequestLocale() { return mPortletRequest.getLocale(); }
/** {@inheritDoc} */ public Locale getRequestLocale() { if (request != null) { return request.getLocale(); } else { return null; } }
/** * <p>Retrieve and return the <code>Locale</code> for this request.</p> * * @param context The {@link Context} we are operating on. * @return The Locale for the request. */ protected Locale getLocale(Context context) { PortletRequest request = (PortletRequest) context.get("request"); return (request.getLocale()); }
private Locale _getLocale(PortletRequest portletRequest) { if (portletRequest != null) { return portletRequest.getLocale(); } return LocaleUtil.getMostRelevantLocale(); }
public final String getLocalizedString(PortletRequest request, String key, Object... vars) { String value = resourceRegistry.handleGetObject(BASENAME, request.getLocale(), key); if (null == value || 0 == value.length()) return key; return MessageFormat.format(value, vars); }
/** * Build a LocaleContext for the given request, exposing the request's * primary locale as current locale. * @param request current HTTP request * @return the corresponding LocaleContext */ protected LocaleContext buildLocaleContext(PortletRequest request) { return new SimpleLocaleContext(request.getLocale()); }
/** * Build a LocaleContext for the given request, exposing the request's * primary locale as current locale. * @param request current HTTP request * @return the corresponding LocaleContext */ protected LocaleContext buildLocaleContext(PortletRequest request) { return new SimpleLocaleContext(request.getLocale()); }
public static Locale getLocale() { PortletRequest portletRequest = getPortletRequest(); if (portletRequest == null) { throw new IllegalStateException( "The request is not PortletRequest."); } return portletRequest.getLocale(); }
_remoteUser = portletRequest.getRemoteUser(); _contextPath = portletRequest.getContextPath(); _locale = portletRequest.getLocale(); _portletMode = portletRequest.getPortletMode(); _portletSessionId = portletRequest.getRequestedSessionId();
private final List<PortletUsage> getCounts(PortletRequest portletRequest, Integer days) { final HttpServletRequest servletRequest = this.portalRequestUtils.getPortletHttpRequest(portletRequest); IPerson user = personManager.getPerson(servletRequest); final List<PortletUsage> resultList = buildEventCounts(days, user, portletRequest.getLocale()); return resultList; }
/** * expose the request to the current thread * @param request */ public static void exposeRequest(PortletRequest request) { //use same code as requestInitialized from Spring RequestContextListener PortletRequestAttributes attributes = new PortletRequestAttributes(request); request.setAttribute(REQUEST_ATTRIBUTES_ATTRIBUTE, attributes); LocaleContextHolder.setLocale(request.getLocale()); RequestContextHolder.setRequestAttributes(attributes); }
/** * Return a label in resources files * @param pcc * @param label the key in resources bundle * @return the label translated */ protected String getMessage(PortalControllerContext pcc, String label) { Bundle bundle = this.getBundleFactory().getBundle(pcc.getRequest().getLocale()); return bundle.getString(label); }
/** * Return a label in resources files * @param pcc * @param label the key in resources bundle * @param args some args * @return the label translated */ protected String getMessage(PortalControllerContext pcc, String label, Object... args) { Bundle bundle = this.getBundleFactory().getBundle(pcc.getRequest().getLocale()); return bundle.getString(label, args); }