Index: lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java
===================================================================
RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java,v
diff -u -r1.10 -r1.11
--- lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java 14 Jun 2007 06:12:07 -0000 1.10
+++ lams_central/src/java/org/lamsfoundation/lams/web/tag/HelpTag.java 11 Jan 2008 01:53:49 -0000 1.11
@@ -86,7 +86,13 @@
}
try {
- if(toolSignature != null && module != null) {
+ Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY);
+ if ( locale != null ) {
+ language = locale.getLanguage();
+ country = locale.getCountry();
+ }
+
+ if(toolSignature != null && module != null) {
// retrieve help URL for tool
ILamsToolService toolService = (ILamsToolService) getContext().getBean(AuthoringConstants.TOOL_SERVICE_BEAN_NAME);
IToolVO tool = toolService.getToolBySignature(toolSignature);
@@ -97,35 +103,27 @@
return SKIP_BODY;
// construct link
-
- Locale locale = (Locale) session.getAttribute(LocaleFilter.PREFERRED_LOCALE_KEY);
- if ( locale != null ) {
- language = locale.getLanguage();
- country = locale.getCountry();
- }
-
fullURL = helpURL + module + "#" + toolSignature + module + "-" + language + country;
- // TODO Added to debug Chinese problem. To be removed.
- if ( log.isDebugEnabled() ) {
- log.debug("In help tag, url is "+fullURL);
- }
-
writer.println("
");
-
+
+
} else if(page != null){
- writer.println("
");
+
+ String anchorPrefix = page.replaceAll("[+\\s]", "");
+
+ fullURL = Configuration.get(ConfigurationKeys.HELP_URL) +page+ "#" +anchorPrefix+ "-" + language + country;
+
+ writer.println("
");
+
} else {
log.error("HelpTag unable to write out due to unspecified values.");
writer.println("
");
-
}
} catch (NullPointerException npe) {
log.error("HelpTag unable to write out due to NullPointerException. Most likely a required paramater was unspecified or incorrect.", npe);
// don't throw a JSPException as we want the system to still function.
-
- writer.println("
");
-
+
}
writer.println("");