FELIX-1988 Apply 8.abstractconsolefix_and_props.patch by Valentin Valchev (thanks, excellent point about the getHeader/getFooter loading, thanks)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@911374 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java b/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
index 803b09b..9c6ad26 100644
--- a/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
+++ b/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
@@ -658,7 +658,7 @@
// (for example plugin provided CSS links)
if ( HEADER == null )
{
- HEADER = readTemplateFile( "/templates/main_header.html" );
+ HEADER = readTemplateFile( AbstractWebConsolePlugin.class, "/templates/main_header.html" );
}
return HEADER;
}
@@ -668,7 +668,7 @@
{
if ( FOOTER == null )
{
- FOOTER = readTemplateFile( "/templates/main_footer.html" );
+ FOOTER = readTemplateFile( AbstractWebConsolePlugin.class, "/templates/main_footer.html" );
}
return FOOTER;
}
@@ -692,9 +692,13 @@
* the template file into a string. The exception provides the
* exception thrown as its cause.
*/
- protected final String readTemplateFile( final String templateFile )
+ protected final String readTemplateFile( final String templateFile ) {
+ return readTemplateFile( getClass(), templateFile );
+ }
+
+ private final String readTemplateFile( final Class clazz, final String templateFile)
{
- InputStream templateStream = getClass().getResourceAsStream( templateFile );
+ InputStream templateStream = clazz.getResourceAsStream( templateFile );
if ( templateStream != null )
{
try
@@ -703,23 +707,17 @@
}
catch ( IOException e )
{
- throw new RuntimeException( "readTemplateFile: Error loading " + templateFile, e );
+ // don't use new Exception(message, cause) because cause is 1.4+
+ throw new RuntimeException( "readTemplateFile: Error loading " + templateFile + ": " + e );
}
finally
{
- try
- {
- templateStream.close();
- }
- catch ( IOException ignore )
- {
- // ignored
- }
+ IOUtils.closeQuietly( templateStream );
}
}
// template file does not exist, return an empty string
- log( "readTemplateFile: File '" + templateFile + "' not found through class " + getClass() );
+ log( "readTemplateFile: File '" + templateFile + "' not found through class " + clazz );
return "";
}
@@ -739,7 +737,7 @@
{
buf.append( "<link href='" );
buf.append( toUrl( cssRefs[i], appRoot ) );
- buf.append( "' rel='stylesheet' type='text/css'>" );
+ buf.append( "' rel='stylesheet' type='text/css' />" );
}
return buf.toString();
diff --git a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
index 6340ef0..b89c29f 100644
--- a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
+++ b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -33,6 +33,8 @@
type=Type
type_s=Type(s)
bundle=Bundle
+version=Version
+help=Help
# VMStat plugin
@@ -60,4 +62,33 @@
services.details.hide=Hide Details
services.details.tip=Details
services.statusline=Services information: {0} service(s) in total.
-services.caption=Services
\ No newline at end of file
+services.caption=Services
+
+# Log plugin
+log.status.ok=Log Service is running.
+log.status.missing=Log Service is not installed/running.
+log.severity.label=Severity at least:
+log.received=Received
+log.level=Level
+log.message=Message
+log.service=Service
+log.exception=Exception
+log.level.error=ERROR
+log.level.warn=WARN
+log.level.info=INFO
+log.level.debug=DEBUG
+
+# Deployment Admin plugin
+deployment.status.no_data=No deployment packages installed!
+deployment.status.no_service=Deployment Admin is not installed/running!
+deployment.status.ok=Deployment Admin service is running
+deployment.details=Details
+deployment.actions=Actions
+deployment.install_update=Install or Update
+deployment.package.name=Package Name
+deployment.bundles=Bundles
+deployment.uninstall=Uninstall
+
+# Shell plugin
+shell.clear=Clear
+shell.status=Use the command prompt to execute shell commands.
\ No newline at end of file