Skip to main content



      Home
Home » Eclipse Projects » Platform - User Assistance (UA) » JavaScript to tell if ActiveHelp is available?
JavaScript to tell if ActiveHelp is available? [message #471300] Fri, 21 December 2007 17:21 Go to next message
Eclipse UserFriend
Hi all,

I have help content that includes ActiveHelp links that call some custom
actions. Since the same content may be running in a workbench, in the
stand-alone help, or in an Infocenter. I'm looking for a way to tell
*in JavaScript* whether the ActiveHelp is available, so I can make the
links behave as I want them to in all situations.

I have tried several variations of the following JavaScript function:

//---------------------------------------------------------- -
function activeHelpIsAvailable() {
var available = 0;
if (liveAction(
"org.eclipse.help.ui",
"org.eclipse.help.ui.internal.ExecuteCommandAction",
"org.eclipse.ui.PlatformUI.isWorkbenchRunning()")
//"org.eclipse.core.runtime.Platform.isRunning()")
//"org.eclipse.ui.PlatformUI.getWorkbench()")
!= null) {
available = 1;
}
return available;
}
//---------------------------------------------------------- -

but none of the functions I've tried calling to determine whether
the workbench is running:

* org.eclipse.ui.PlatformUI.isWorkbenchRunning()
* org.eclipse.core.runtime.Platform.isRunning()
* org.eclipse.ui.PlatformUI.getWorkbench()

returns anything but null.

Am I way off the track here? Is there some obvious way to do this
that I'm missing? Or some non-obvious way?

This needs to work in Eclipse 3.3.

Thanks for any help,

Doug Dirks
Re: JavaScript to tell if ActiveHelp is available? [message #471430 is a reply to message #471300] Thu, 03 January 2008 15:20 Go to previous messageGo to next message
Eclipse UserFriend
That won't work for a couple of reasons. First of all the liveHelp
function does not return a useful result. Second if you are in
infocenter mode this is going to pop up a dialog telling you that live
help is not available.

Unfortunately I don't have an idea for a simple scheme to detect from
JavaScript whether live help is enabled. The bookmarks view does not
exist in infocenter mode but testing for it's existence would involve a
lot of frame navigation and I would not recommend doing this from within
a help page.
Re: JavaScript to tell if ActiveHelp is available? [message #471433 is a reply to message #471430] Fri, 04 January 2008 19:10 Go to previous messageGo to next message
Eclipse UserFriend
Thanks, Chris --

I understand both of those points; I was hoping that in my digging through
the org.eclipse.help.* plugins I had somehow missed a Javascript function
that would tell me the answer, or allow me to get it.

Barring that, could I learn which mode the help server is in using JSP
somehow?
I'd like to be able to incorporate .jsp files into my content anyway, and
it strikes me that I might be able to learn about the help server that way.

My initial attempts to include .jsp files inside a documentation plugin
have failed, and I can't seem to find any documentation on how to set up a
plugin
so that the help server will process .jsp files. Any hints on how to
configure
the plugin, or hints on where to look for info?

Thanks for any help,
Doug Dirks
Re: JavaScript to tell if ActiveHelp is available? [message #471436 is a reply to message #471433] Mon, 07 January 2008 17:01 Go to previous messageGo to next message
Eclipse UserFriend
Putting jsp files in a documentation plugin is not going to work. The
server is set up to only interpret jsp files that come from the webapp
project. It seems that there should be some way to determine using
JavaScript whether or not the help system is in an infocenter but when I
looked through the sources it seems that this is done using jsps.
Re: JavaScript to tell if ActiveHelp is available? [message #471440 is a reply to message #471436] Wed, 09 January 2008 19:19 Go to previous messageGo to next message
Eclipse UserFriend
I feared that there was a hard-coded path for the JSPs. I'm a bit out
of my depth here with respect to configuring a JSP server, but is there
a good reason not to allow JSPs in content plugins to use the same server?
Being able to incorporate JSPs into documentation content would certainly
be handy.

I'd just file a feature request, but I'm afraid I'm missing some
technical point that makes this a silly idea...
Re: JavaScript to tell if ActiveHelp is available? [message #471441 is a reply to message #471440] Wed, 09 January 2008 20:07 Go to previous message
Eclipse UserFriend
Doug Dirks wrote:
> I feared that there was a hard-coded path for the JSPs. I'm a bit out
> of my depth here with respect to configuring a JSP server, but is there
> a good reason not to allow JSPs in content plugins to use the same server?
> Being able to incorporate JSPs into documentation content would
> certainly be handy.
>
> I'd just file a feature request, but I'm afraid I'm missing some
> technical point that makes this a silly idea...
>

Allowing users to add jsp files seems like a reasonable request although
I would need to think about this for a while to know how feasible it
was. The server needs to know where to look for the jsp files, just
putting them in a documentation project won't cause them to have act
like jsps. You could certainly file a bug report and I expect there
would be other people interested in doing this also, I know I have.
Re: JavaScript to tell if ActiveHelp is available? [message #606324 is a reply to message #471300] Thu, 03 January 2008 15:20 Go to previous message
Eclipse UserFriend
That won't work for a couple of reasons. First of all the liveHelp
function does not return a useful result. Second if you are in
infocenter mode this is going to pop up a dialog telling you that live
help is not available.

Unfortunately I don't have an idea for a simple scheme to detect from
JavaScript whether live help is enabled. The bookmarks view does not
exist in infocenter mode but testing for it's existence would involve a
lot of frame navigation and I would not recommend doing this from within
a help page.
Re: JavaScript to tell if ActiveHelp is available? [message #606331 is a reply to message #471430] Fri, 04 January 2008 19:10 Go to previous message
Eclipse UserFriend
Originally posted by: ddirks.ittvis.com

Thanks, Chris --

I understand both of those points; I was hoping that in my digging through
the org.eclipse.help.* plugins I had somehow missed a Javascript function
that would tell me the answer, or allow me to get it.

Barring that, could I learn which mode the help server is in using JSP
somehow?
I'd like to be able to incorporate .jsp files into my content anyway, and
it strikes me that I might be able to learn about the help server that way.

My initial attempts to include .jsp files inside a documentation plugin
have failed, and I can't seem to find any documentation on how to set up a
plugin
so that the help server will process .jsp files. Any hints on how to
configure
the plugin, or hints on where to look for info?

Thanks for any help,
Doug Dirks
Re: JavaScript to tell if ActiveHelp is available? [message #606340 is a reply to message #471433] Mon, 07 January 2008 17:01 Go to previous message
Eclipse UserFriend
Putting jsp files in a documentation plugin is not going to work. The
server is set up to only interpret jsp files that come from the webapp
project. It seems that there should be some way to determine using
JavaScript whether or not the help system is in an infocenter but when I
looked through the sources it seems that this is done using jsps.
Re: JavaScript to tell if ActiveHelp is available? [message #606355 is a reply to message #471436] Wed, 09 January 2008 19:19 Go to previous message
Eclipse UserFriend
Originally posted by: ddirks.ittvis.com

I feared that there was a hard-coded path for the JSPs. I'm a bit out
of my depth here with respect to configuring a JSP server, but is there
a good reason not to allow JSPs in content plugins to use the same server?
Being able to incorporate JSPs into documentation content would certainly
be handy.

I'd just file a feature request, but I'm afraid I'm missing some
technical point that makes this a silly idea...
Re: JavaScript to tell if ActiveHelp is available? [message #606358 is a reply to message #471440] Wed, 09 January 2008 20:07 Go to previous message
Eclipse UserFriend
Doug Dirks wrote:
> I feared that there was a hard-coded path for the JSPs. I'm a bit out
> of my depth here with respect to configuring a JSP server, but is there
> a good reason not to allow JSPs in content plugins to use the same server?
> Being able to incorporate JSPs into documentation content would
> certainly be handy.
>
> I'd just file a feature request, but I'm afraid I'm missing some
> technical point that makes this a silly idea...
>

Allowing users to add jsp files seems like a reasonable request although
I would need to think about this for a while to know how feasible it
was. The server needs to know where to look for the jsp files, just
putting them in a documentation project won't cause them to have act
like jsps. You could certainly file a bug report and I expect there
would be other people interested in doing this also, I know I have.
Previous Topic:Is there an external method to get the randomly chosen port number when standalone help is launched
Next Topic:Re: Welcome Framework
Goto Forum:
  


Current Time: Tue May 20 00:47:36 EDT 2025

Powered by FUDForum. Page generated in 0.05731 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top