Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonrad Kolosowski2004-05-05 12:02:31 -0400
committerKonrad Kolosowski2004-05-05 12:02:31 -0400
commit025bd0d070963ff8b97d6a06c23941fe01d12f94 (patch)
treee71c829c368cf2c25315371e0f0ba7a339585da6
parentf9d814171ebcfc249438b4a3fa6b2a90aa504c71 (diff)
downloadeclipse.platform.ua-025bd0d070963ff8b97d6a06c23941fe01d12f94.tar.gz
eclipse.platform.ua-025bd0d070963ff8b97d6a06c23941fe01d12f94.tar.xz
eclipse.platform.ua-025bd0d070963ff8b97d6a06c23941fe01d12f94.zip
22995 Active help link in doc not working in standalone
-rw-r--r--org.eclipse.help.base/preferences.ini10
-rw-r--r--org.eclipse.help.webapp/advanced/livehelp.js.jsp8
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/WebappResources.properties1
-rw-r--r--org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/data/WebappPreferences.java3
-rw-r--r--org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/servlet/LiveHelpServlet.java4
5 files changed, 25 insertions, 1 deletions
diff --git a/org.eclipse.help.base/preferences.ini b/org.eclipse.help.base/preferences.ini
index 49931d253..b373f9776 100644
--- a/org.eclipse.help.base/preferences.ini
+++ b/org.eclipse.help.base/preferences.ini
@@ -116,3 +116,13 @@ locales=
# on - user can choose to show all topics, all topics intially shown
# always - topic from disabled activites are shown (filtering disabled)
showDisabledActivityTopics=off
+
+######################
+# Active (live) help disabling
+######################
+# Allows enabling and disabling execution of active help
+# The option does has no effect in the infocenter setup, where active help is disabled
+# Accepted values:
+# true - default active help actions enabled
+# false - active help framework disabled
+activeHelp=true \ No newline at end of file
diff --git a/org.eclipse.help.webapp/advanced/livehelp.js.jsp b/org.eclipse.help.webapp/advanced/livehelp.js.jsp
index 99210b3b2..7d752dd11 100644
--- a/org.eclipse.help.webapp/advanced/livehelp.js.jsp
+++ b/org.eclipse.help.webapp/advanced/livehelp.js.jsp
@@ -17,12 +17,18 @@ function liveActionInternal(topHelpWindow, pluginId, className, argument)
{
<%
RequestData data = new RequestData(application,request, response);
+ WebappPreferences prefs = data.getPrefs();
if(data.getMode() == RequestData.MODE_INFOCENTER){
%>
alert("<%=UrlUtil.JavaScriptEncode(ServletResources.getString("noLiveHelpInInfocenter", request))%>");
return;
<%
- }else{
+ }else if(!prefs.isActiveHelp()){
+%>
+ alert("<%=UrlUtil.JavaScriptEncode(ServletResources.getString("noLiveHelp", request))%>");
+ return;
+<%
+ }else {
%>
// construct the proper url for communicating with the server
var url= window.location.href;
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/WebappResources.properties b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/WebappResources.properties
index 54c00f39e..d2010d0dd 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/WebappResources.properties
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/WebappResources.properties
@@ -65,6 +65,7 @@ search=Search Results
bookmarks=Bookmarks
Views=Navigation Views
+noLiveHelp=Active help is not enabled in your installation.
noLiveHelpInInfocenter=You must run help locally to perform "active help" actions.
cookieSaveFailed=Saving search scope failed. Please reduce search scope definitions.
diff --git a/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/data/WebappPreferences.java b/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/data/WebappPreferences.java
index 57619a7e2..0bb93ddf1 100644
--- a/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/data/WebappPreferences.java
+++ b/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/data/WebappPreferences.java
@@ -105,5 +105,8 @@ public class WebappPreferences {
public void setDontConfirmShowAll(boolean dontconfirm) {
prefs.setValue("dontConfirmShowAll", dontconfirm);
}
+ public boolean isActiveHelp() {
+ return "true".equalsIgnoreCase(prefs.getString("activeHelp"));
+ }
}
diff --git a/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/servlet/LiveHelpServlet.java b/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/servlet/LiveHelpServlet.java
index 96ed2cbe2..d8f04bdb5 100644
--- a/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/servlet/LiveHelpServlet.java
+++ b/org.eclipse.help.webapp/src_servlets/org/eclipse/help/internal/webapp/servlet/LiveHelpServlet.java
@@ -18,6 +18,7 @@ import javax.servlet.http.*;
import org.eclipse.core.runtime.*;
import org.eclipse.help.ILiveHelpAction;
import org.eclipse.help.internal.base.BaseHelpSystem;
+import org.eclipse.help.internal.webapp.data.*;
import org.osgi.framework.*;
/**
@@ -41,6 +42,9 @@ public class LiveHelpServlet extends HttpServlet {
if (BaseHelpSystem.getMode() == BaseHelpSystem.MODE_INFOCENTER) {
return;
}
+ if (!new WebappPreferences().isActiveHelp()) {
+ return;
+ }
req.setCharacterEncoding("UTF-8");
String pluginID = req.getParameter("pluginID");
if (pluginID == null)

Back to the top