Thread: [JPublish-developer] (no subject)
Brought to you by:
aeden
From: Giampaolo T. <gt...@pe...> - 2003-08-15 06:03:00
|
Hello, Concerning deploy problem in JBoss 3.2.1 Jython cannot see class in WEB-INF/classes Try this Edit the file in $JBOSS_HOME/server/default/deploy/jboss-web.sar/META-INF/jboss-service.x ml Change true to false at line <attribute name="Java2ClassLoadingCompliance">true</attribute> Restart JBoss Jython can now see your classes. Best regards |
From: Andres A. <alc...@gm...> - 2007-05-07 20:16:33
|
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 |
From: Florin T.P. <flo...@gm...> - 2007-05-08 00:04:20
|
Hi, If you need the SiteContext in startup actions, then in your Action =20 (bsh, js, etc.) you can simply use the parameter 'site'. For example, =20= a simple startup Action (StartUpTest.bsh) containing only one line =20 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 =20 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 > > ----------------------------------------------------------------------=20= > --- > 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 > Jpu...@li... > https://lists.sourceforge.net/lists/listinfo/jpublish-developer |
From: Andres A. <alc...@gm...> - 2007-05-08 01:52:08
|
Hello Florin thank you very much for answering so fast, but problem I'm having is in a Java class action, there es where I cannot access the site context. Precisely I'm now trying to use java classes for actions, I'm not trying to migrate all the application that previously used beanshell actions to this new approach but I want new things in pure java. What I don't understand is that asymmetry between java class based action and script based ones. I'm not saying Jpublish is a bad thing, i've been using it from years but nobody and nothing is perfect. In fact what I tried to say is that java class based actions have nothing t= o do at start up if they can not access the site context, because where could they put any object created? My intention was to mention a quick and backward compatible fix (StartupAction interface) that I have no problem to implement, the same problem may be occurring in Shutdown actions so there may be a better name :). Certainly I can fix that in my own Application by calling a StartupAction from a generic BeanShell kind of adapter where the action class is a parameter of the beanshell adapter script. my proposal is to define a new interface: public interface StartupAction extends Action{ public void setSiteContext(SiteContext context); } And in the part of the code where the action is found (in findAction() when handling start up actions) if (action instanceof StartupAction) ((StartupAction)action).setSiteContext(siteContext); or something like this. Best regards and thanks again Andr=E9s 2007/5/7, Florin T.PATRASCU <flo...@gm...>: > > 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 > > Jpu...@li... > > 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/ > _______________________________________________ > Jpublish-developer mailing list > Jpu...@li... > https://lists.sourceforge.net/lists/listinfo/jpublish-developer > |
From: Florin T.P. <fl...@ro...> - 2007-05-08 03:54:49
|
Hi Andres, is done; a bit different than your proposal, but with the same or =20 better effect, I hope ;) I believe you have to wait a bit for the sf.net to synchronize the =20 public CVS before you can grab the updated version of JP3. For Java actions you will have now a minimum context available at =20 startup and shutdown. In this context you don't have only the 'site' =20 but you'll also find few helpers to help you do ... stuff at startup :) These helpers are: RequestContext.JPUBLISH_DATE_UTILITIES RequestContext.JPUBLISH_NUMBER_UTILITIES "messageUtilities" RequestContext.JPUBLISH_SYSLOG and the one that you requested: RequestContext.JPUBLISH_SITE I tested my changes with the followings: - in jpublish.xml <action-manager> <startup-action name=3D"org.jpublish.test.JavaStartUpAction"/>= .... - JavaStartUpAction.java (excerpt) public void execute(RequestContext context, Configuration =20 configuration) { Log syslog =3D (Log) = context.get(RequestContext.JPUBLISH_SYSLOG); SiteContext site =3D context.getSiteContext(); // or ...get=20 ( RequestContext.JPUBLISH_SITE syslog.info("configuration path: "+site.getConfigurationPath=20 ()); } And you have a space (the context received by the Action) where all =20 the startup actions can share Objects. This is happening because I am =20= reusing the same context for all the Actions executed at startup; a =20 similar approach being used for shutdown. I hope it helps, -florin PS Now I have to back-port this functionality to JPublish 2.0 ;) On 07-May-07, at 21:52 , Andres Alcarraz wrote: > Hello Florin thank you very much for answering so fast, but problem =20= > I'm having is in a Java class action, there es where I cannot =20 > access the site context. > Precisely I'm now trying to use java classes for actions, I'm not =20 > trying to migrate all the application that previously used =20 > beanshell actions to this new approach but I want new things in =20 > pure java. > What I don't understand is that asymmetry between java class based =20 > action and script based ones. I'm not saying Jpublish is a bad =20 > thing, i've been using it from years but nobody and nothing is =20 > perfect. > In fact what I tried to say is that java class based actions have =20 > nothing to do at start up if they can not access the site context, =20 > because where could they put any object created? > My intention was to mention a quick and backward compatible fix =20 > (StartupAction interface) that I have no problem to implement, the =20 > same problem may be occurring in Shutdown actions so there may be a =20= > better name :). > Certainly I can fix that in my own Application by calling a =20 > StartupAction from a generic BeanShell kind of adapter where the =20 > action class is a parameter of the beanshell adapter script. > > my proposal is to define a new interface: > public interface StartupAction extends Action{ > public void setSiteContext(SiteContext context); > } > > And in the part of the code where the action is found (in findAction=20= > () when handling start up actions) > if (action instanceof StartupAction) > ((StartupAction)action).setSiteContext(siteContext); > > or something like this. > > Best regards and thanks again > > Andr=E9s > > > 2007/5/7, Florin T.PATRASCU <flo...@gm... >: > 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: =20 > "+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/=20 > 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 =20 > Context is > > null, that doesn't occur in script actions where you have a =20 > 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() =20 > 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 > > > > =20 > ---------------------------------------------------------------------- > > --- > > 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 > > Jpu...@li... > > https://lists.sourceforge.net/lists/listinfo/jpublish-developer > > > ----------------------------------------------------------------------=20= > --- > 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 > Jpu...@li... > https://lists.sourceforge.net/lists/listinfo/jpublish-developer > > ----------------------------------------------------------------------=20= > --- > 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/=20 > _______________________________________________ > Jpublish-developer mailing list > Jpu...@li... > https://lists.sourceforge.net/lists/listinfo/jpublish-developer |
From: Andres A. <alc...@gm...> - 2007-05-08 04:31:18
|
Wow that was quick, Thank you very much Florin I'll test this tomorrow ASAP= . Have a nice day Andr=E9s 2007/5/8, Florin T.PATRASCU <fl...@ro...>: > > Hi Andres, > is done; a bit different than your proposal, but with the same or better > effect, I hope ;) > I believe you have to wait a bit for the sf.net to synchronize the public > CVS before you can grab the updated version of JP3. > > For Java actions you will have now a minimum context available at startup > and shutdown. In this context you don't have only the 'site' but you'll a= lso > find few helpers to help you do ... stuff at startup :) > > These helpers are: > > RequestContext.JPUBLISH_DATE_UTILITIES > RequestContext.JPUBLISH_NUMBER_UTILITIES > "messageUtilities" > RequestContext.JPUBLISH_SYSLOG > > and the one that you requested: > RequestContext.JPUBLISH_SITE > > > I tested my changes with the followings: > - in jpublish.xml > <action-manager> > <startup-action name=3D"org.jpublish.test.JavaStartUpAction"/> > .... > > - JavaStartUpAction.java (excerpt) > public void execute(RequestContext context, Configuration > configuration) { > > Log syslog =3D (Log) context.get(RequestContext.JPUBLISH_SYSLOG); > SiteContext site =3D context.getSiteContext(); // or ...get( > RequestContext.JPUBLISH_SITE > > syslog.info("configuration path: "+site.getConfigurationPath()); > > } > > > And you have a space (the context received by the Action) where all the > startup actions can share Objects. This is happening because I am reusing > the same context for all the Actions executed at startup; a similar appro= ach > being used for shutdown. > > I hope it helps, > -florin > > > PS > Now I have to back-port this functionality to JPublish 2.0 ;) > > > On 07-May-07, at 21:52 , Andres Alcarraz wrote: > > Hello Florin thank you very much for answering so fast, but problem I'm > having is in a Java class action, there es where I cannot access the site > context. > Precisely I'm now trying to use java classes for actions, I'm not trying > to migrate all the application that previously used beanshell actions to > this new approach but I want new things in pure java. > What I don't understand is that asymmetry between java class based action > and script based ones. I'm not saying Jpublish is a bad thing, i've been > using it from years but nobody and nothing is perfect. > In fact what I tried to say is that java class based actions have nothing > to do at start up if they can not access the site context, because where > could they put any object created? > My intention was to mention a quick and backward compatible fix > (StartupAction interface) that I have no problem to implement, the same > problem may be occurring in Shutdown actions so there may be a better nam= e > :). > Certainly I can fix that in my own Application by calling a StartupAction > from a generic BeanShell kind of adapter where the action class is a > parameter of the beanshell adapter script. > > my proposal is to define a new interface: > public interface StartupAction extends Action{ > public void setSiteContext(SiteContext context); > } > > And in the part of the code where the action is found (in findAction() > when handling start up actions) > if (action instanceof StartupAction) > ((StartupAction)action).setSiteContext(siteContext); > > or something like this. > > Best regards and thanks again > > Andr=E9s > > > 2007/5/7, Florin T.PATRASCU <flo...@gm... >: > > > > 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 i= s > > > 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 > > > Jpu...@li... > > > 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/ > > _______________________________________________ > > Jpublish-developer mailing list > > Jpu...@li... > > 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/_____________________________________= __________ > Jpublish-developer mailing list > Jpu...@li... > 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/ > _______________________________________________ > Jpublish-developer mailing list > Jpu...@li... > https://lists.sourceforge.net/lists/listinfo/jpublish-developer > > |