Re: (no subject)

"Florin T.PATRASCU" <[email protected]> Mon, 7 May 2007 20:04:14 -0400
Newsgroups gmane.comp.java.jpublish.devel
Message-ID <[email protected]>
Hi,

If you need the SiteContext in startup actions, then in your Action  =

(bsh, js, etc.) you can simply use the parameter 'site'. For example,  =

a simple startup Action (StartUpTest.bsh)  containing only one line  =

of code:

	syslog.info( "configuration path: "+site.getConfigurationPath());

The file jpublish.xml:
...
	<action-manager>
     		<startup-action name=3D"StartUpTest.bsh"/>
	</action-manager>
...

And when you'll start your JPublish application you'll see in the  =

logs something like this:
...
	2275 [main] INFO  syslog  - configuration path: WEB-INF/jpublish.xml
...

Don't worry, JPublish is a fine application :)
-florin


On 07-May-07, at 16:16 , Andres Alcarraz wrote:

> Hi all, I was trying to make a java startup action when I realized
> that I cannot access the site context from them because the Context is
> null, that doesn't occur in script actions where you have a reference
> to the site context, I wonder what is the sense of having a startup
> action that has no access to the site context.
> Looking at the code I've found that when an action script is found
> site context is passed through the constructor, but that doesn't
> happen in java actions, I think the execute method could have more
> parameters or Action interface could have a setSiteContext() method, I
> know this would not be backward compatible, but a new StartupAction
> could be defined.
> What others means do i have to access the site context from a java
> startup action?
>
> I'm using jpublish 3.0b2 thanks in advance
>
>
> Andr=E9s
>
> ---------------------------------------------------------------------- =

> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Jpublish-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jpublish-developer


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/