You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Stefan Kuhn <sk...@ice.mpg.de> on 2002/05/08 09:53:36 UTC

How to find jetspeed directory in daemon

Hi everybody,
in my code I need to get the jetspeed directory (i. e. something like 
/usr/local/jakarta-tomcat-3.3a/webapps/jetspeed).
Usually I did that with 
	String nmrpropsFile =
ServletUtils.expandRelative(runData.getServletConfig(), 
"/WEB-INF/conf/NMRShiftDB.properties");

Now I need to do that in a jetspeed daemon. The problem is that I do not have 
a rundata object there. So does somebody know either
1)How to get the runddata object into the run method of a daemon
or
2)Some other trick to find the jetspeed directory?
Thanks in advance
Stefan 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to find jetspeed directory in daemon

Posted by Stefan Kuhn <sk...@ice.mpg.de>.
Hi,
digging a bit into jetspeed I found a solution and I thought I could share 
that with you, so here it is:
Actually I don't need RunData, but the servletConfig, so I did:
1) In JetspeedDaemonFactoryService there is inti(ServletConfig). So I put 
ServletConfig in an attribute and instantiate the DaemonThread with it: 
DaemonThread dt = new DaemonThread( entries[i], servcon);         
2) The DaemonThread has a new Constructor    
public DaemonThread( DaemonEntry entry, ServletConfig servcon ) 
Here the ServletConfig is put into an attribute again. In the runDaemon 
method I do
if(daemon.getDaemonEntry().getName().equals("deleteoldmolfiles"))
	((org.openscience.nmrshiftdb.daemons.DeleteOldMolfiles)daemon).run(servcon);
else
	daemon.run();                        
instead of simply daemon.run().
My class, which is run as deleteoldmolfiles, has got an additional run method 
run(ServletConfig servcon) and so I've got the ServletConfig in the run 
method.
If somebody has some improvements ... always wellcome
Stefan




Am Mittwoch, 8. Mai 2002 09:53 schrieben Sie:
> Hi everybody,
> in my code I need to get the jetspeed directory (i. e. something like
> /usr/local/jakarta-tomcat-3.3a/webapps/jetspeed).
> Usually I did that with
> 	String nmrpropsFile =
> ServletUtils.expandRelative(runData.getServletConfig(),
> "/WEB-INF/conf/NMRShiftDB.properties");
>
> Now I need to do that in a jetspeed daemon. The problem is that I do not
> have a rundata object there. So does somebody know either
> 1)How to get the runddata object into the run method of a daemon
> or
> 2)Some other trick to find the jetspeed directory?
> Thanks in advance
> Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


velocity actions and javascript

Posted by Karen Schuchardt <kl...@pnl.gov>.
Can somebody provide some pointers on  how velocity actions work in relation to
javascript concepts like

location="" in menus
document.myform.action() and
document.myform.submit()

I'm able to do things like create a popup javascript menu with menu options that
create new windows to view documents that are at absolute or relative urls.  This
is good for some of my requirements but I'd also like to be able to define the
button such that it executes a velocity action just as if I had a button on my
form like:
<input type="submit" name="eventSubmit_doSomething" value="Something" />

For the location= assignment in the menu item, I see that I can put absolute urls
and I can put relative urls that jetspeed then puts together with the current
context.  But I don't know how to specify an action to execute and haven't been
able to figure it out from the jetspeed/turbine docs.



I also looked at using a javascript function but again don't know how to specify
an action.  I looked at jlink and how its used in sample .vm scripts but couldn't
find any similar examples.


Any pointers would be appreciated.
Karen



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>