public class LocalizationServlet extends ServletBase
debug
Constructor and Description |
---|
LocalizationServlet() |
Modifier and Type | Method and Description |
---|---|
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
protected ResourceBundle |
getBundle(String pluginId,
String name)
Retrieve a
ResourceBundle from a plugin. |
String |
getJSONBundle(String pluginId,
String name)
Load the resource bundle for the plugin provided and return the resulting properties map as JSON.
|
protected String |
getJsonForBundle(ResourceBundle bundle)
Convert a
ResourceBundle into a JSON string. |
org.apache.commons.logging.Log |
getLogger() |
boolean |
isMessageCachingEnabled(org.pentaho.platform.api.engine.IPluginManager pm,
String pluginId)
Should the messages in the Resource Bundle be cached?
|
debug, debug, error, error, fatal, fatal, getLoggingLevel, getObjectName, getPentahoSession, info, info, setCorsHeaders, setLoggingLevel, trace, trace, warn, warn
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
public org.apache.commons.logging.Log getLogger()
getLogger
in class ServletBase
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doGet
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException
doPost
in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
IOException
protected ResourceBundle getBundle(String pluginId, String name)
ResourceBundle
from a plugin.pluginId
- ID of the plugin to load the resource bundle fromname
- Resource bundle name that resides in the pluginpluginId
IllegalArgumentException
- Invalid plugin IdMissingResourceException
- Invalid resource bundle namepublic boolean isMessageCachingEnabled(org.pentaho.platform.api.engine.IPluginManager pm, String pluginId)
pm
- Plugin managerpluginId
- ID of plugin whose "cache-messages" setting should be checkedtrue
if the localization messages loaded from this plugin should be cachedpublic String getJSONBundle(String pluginId, String name)
pluginId
- ID of plugin to load the resource fromname
- Name of the resource to loadprotected String getJsonForBundle(ResourceBundle bundle) throws org.json.JSONException
ResourceBundle
into a JSON string.bundle
- Resource bundle to convertorg.json.JSONException
Copyright © 2021 Hitachi Vantara. All rights reserved.