You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/04/24 23:48:17 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent AvalonComponentService.java TurbineAvalonComponentService.java

quintonm    2003/04/24 14:48:17

  Modified:    src/java/org/apache/turbine/services/avaloncomponent
                        AvalonComponentService.java
                        TurbineAvalonComponentService.java
  Log:
  The actual path for the application root is now added to the context for all components.
  
  Revision  Changes    Path
  1.6       +4 -1      jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/AvalonComponentService.java
  
  Index: AvalonComponentService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/AvalonComponentService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AvalonComponentService.java	14 Mar 2003 17:33:38 -0000	1.5
  +++ AvalonComponentService.java	24 Apr 2003 21:48:17 -0000	1.6
  @@ -77,6 +77,9 @@
       /** property specifing file name of the component role file */
       String COMPONENT_ROLE = "componentRoles";
   
  +    /** Key used in the context for defining the application root */
  +    String APP_ROOT = "ComponentAppRoot";
  +
       /**
        * Returns an instance of the named component
        *
  
  
  
  1.9       +5 -2      jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentService.java
  
  Index: TurbineAvalonComponentService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent/TurbineAvalonComponentService.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- TurbineAvalonComponentService.java	14 Mar 2003 17:33:39 -0000	1.8
  +++ TurbineAvalonComponentService.java	24 Apr 2003 21:48:17 -0000	1.9
  @@ -71,6 +71,7 @@
   import org.apache.commons.logging.LogFactory;
   import org.apache.turbine.services.InitializationException;
   import org.apache.turbine.services.TurbineBaseService;
  +import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.Turbine;
   import org.apache.turbine.util.ServletUtils;
   
  @@ -181,7 +182,9 @@
           this.manager.setLoggerManager(lm);
           this.manager.enableLogging(
                   lm.getLoggerForCategory("org.apache.turbine.services"));
  -        this.manager.contextualize(new DefaultContext());
  +        DefaultContext context = new DefaultContext();
  +        context.put(AvalonComponentService.APP_ROOT, Turbine.getRealPath("/"));
  +        this.manager.contextualize(context);
           this.manager.setRoleManager(roles);
           this.manager.configure(sysConfig);
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


RE: cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent AvalonComponentService.java TurbineAvalonComponentService.java

Posted by Quinton McCombs <qm...@nequalsone.com>.

> -----Original Message-----
> From: Henning P. Schmiedehausen [mailto:hps@intermeta.de] 
> Sent: Thursday, April 24, 2003 5:06 PM
> To: turbine-dev@jakarta.apache.org
> Subject: Re: cvs commit: 
> jakarta-turbine-2/src/java/org/apache/turbine/services/avalonc
> omponent AvalonComponentService.java 
> TurbineAvalonComponentService.java
> 
> 
> quintonm@apache.org writes:
> 
> >  +++ AvalonComponentService.java	24 Apr 2003 21:48:17 
> -0000	1.6
> >  @@ -77,6 +77,9 @@
> >       /** property specifing file name of the component role file */
> >       String COMPONENT_ROLE = "componentRoles";
> >   
> >  +    /** Key used in the context for defining the 
> application root */
> >  +    String APP_ROOT = "ComponentAppRoot";
> >  +
> >       /**
> >        * Returns an instance of the named component
> >        *
> 
> ... just nitpicking...
> 
> any particular reason why one constant starts with uppercase 
> and the other with lowercase letter? And why not call the 
> APP_ROOT COMPONENT_APP_ROOT which would match the three word 
> components in ComponentAppRoot.

Not a bad idea.  I actually want to come up with a better way to specify
the name.  The components can not use the constant since that would
create a dependancy on Turbine.  I think that I need to set the name in
the configuration file.  I just have not played around with that part
yet.
 
> I hate surprises like calling $link.setPage() which changes a 
> variable called "template". =:-)
> 
> 	Regards
> 		Henning
> 
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/
> 
> Java, perl, Solaris, Linux, xSP Consulting, Web Services 
> freelance consultant -- Jakarta Turbine Development  -- hero for hire
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/avaloncomponent AvalonComponentService.java TurbineAvalonComponentService.java

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
quintonm@apache.org writes:

>  +++ AvalonComponentService.java	24 Apr 2003 21:48:17 -0000	1.6
>  @@ -77,6 +77,9 @@
>       /** property specifing file name of the component role file */
>       String COMPONENT_ROLE = "componentRoles";
>   
>  +    /** Key used in the context for defining the application root */
>  +    String APP_ROOT = "ComponentAppRoot";
>  +
>       /**
>        * Returns an instance of the named component
>        *

... just nitpicking...

any particular reason why one constant starts with uppercase and the
other with lowercase letter? And why not call the APP_ROOT
COMPONENT_APP_ROOT which would match the three word components in
ComponentAppRoot.

I hate surprises like calling $link.setPage() which changes a variable
called "template". =:-)

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org