Community
Participate
Working Groups
Provide an API call to determine whether a given topic (or perhaps toc entry) is being served up remotely. The API could be used by clients wishing to put an indicator on a page to describe its origin.
I made the fix in such a way that HelpURLConnection.getInputStream() method will return the object of the type RemoteHelpInputStream for the remote docs, which will help in the InjectionFilter to determine when do we need to insert the remote_css in the page. Working will be something like this, for the remote_css=/org.eclipse.help.base/doc/remote.css, a css (<link rel="stylesheet" href="../../../content/org.eclipse.help.base/doc/remote.css" type="text/css"></link>) will be inserted inside the <head> of the page. I have added the patch. Please have a look.
Created attachment 187258 [details] Patch for the Remote UA enablement I made the fix in such a way that HelpURLConnection.getInputStream() method will return the object of the type RemoteHelpInputStream for the remote docs, which will help in the InjectionFilter to determine when do we need to insert the remote_css in the page. Working is something like this, for the remote_css=/org.eclipse.help.base/doc/remote.css, a css (<link rel="stylesheet" href="../../../content/org.eclipse.help.base/doc/remote.css" type="text/css"></link>) will be inserted inside the <head> of the page.
I tested the patch and it worked. There are a few things that need to change, I will work with Chris Austin to fix these up so we can commit the patch today. 1. Copyrights need to be updated to 2011 2. .fbprefs should be removed from the patch 3. In preferences.ini the default for remoteHelpOn should not change 4. The preference remote_css defaults to /org.eclipse.help.base/doc/remote.css, but that file does not exist. For now we can set the default to be empty. 5. EclipseConnector is reentrant and setting a switch in the shared EclipseConnector object is not thread safe. I will create an updated patch and attach it.
One more thing - RemoteHelpInputStream is a thin wrapper around an InputStream which supports the read() method. Are we certain that none of the other methods in InputStream ever get called? It would be easier to support all 9 methods in InputStream than to do the analysis to determine that these methods are never called.
Created attachment 187319 [details] Revised Patch I have made the changes described in Comment 3 and Comment 4. There was not a reentrancy issue since a new InjectionFilter object is created for the remote stream, I modified InjectionFilter to add isRemote to the constructor so it is more obvious that the value is not allowed to change. I also update the documentation.
Created attachment 187322 [details] Revised patch with improved doc changes
Revised patch with improved doc changes committed to HEAD