You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Vassilis Rizopoulos <va...@zuehlke.com> on 2001/09/21 14:02:43 UTC

Implementing the dream...

OK, I got wind of Avalon only a short while ago (after an extended period of holidays devoid of electronic interference I returned and found ASF piling up the new and interesting stuff) and I liked it a lot I should say.So I started reading and then I wanted something to implement the ideas and API on so...I ported Wiki as a set of components. Don't even begin to ask why, it's one of those X-file type things.
My idea was to have the entry point as a servlet (or a JSP page - JSP works good as a template for those familiar with the inner workings of Wiki - But now I found out about Velocity, and that looks better) and the whole functionality on a set of Avalon components (so, that would be a Block, no? ) i.e. request processor, page renderer, search engine, page storage.
Now, the whole concept goes like this:
I have a JSP page that loads a bean. That bean will serve as the container for my service, meaning it will instantiate any components, manage their lifecycle etc (can I do that AND use a component manager?).
I wrote this (keeping the 'Development...' document close at hand)

        DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
        Configuration sysConfig = builder.buildFromFile("E:/development/wiki/src/conf/avalon-wiki.xml");
        Configuration roleConfig = builder.buildFromFile("E:/development/wiki/src/conf/roles.xml");
        RoleManager roles = new DefaultRoleManager();
   
        roles.configure(roleConfig);

and I get this

    [javac] E:\development\wiki\src\gr\umbra\wiki\avalon\WikiBean.java:44: Method configure(org.apache.avalon.framework.configuration.Configuration) not found in interface org.apache.avalon.excalibur.component.RoleManager.
    [javac]         roles.configure(roleConfig);


using Excalibur-4.0b4 and Framework 4.0b3. Which is actually correct. The question is, how do I configure the RoleManager component?
Thanks.-
P.S.
If there is another list more appropriate for these questions flame me and point it out :))


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


Re: Implementing the dream...

Posted by Peter Donald <do...@apache.org>.
On Tue, 25 Sep 2001 01:06, Vassilis Rizopoulos wrote:
> >sounds interesting. (and go with Velocity unless you need to learn JSP or
> >something).
>
> Already made up my mind about that and I'm going with Velocity. I already
> know JSP and it doesn't let me isolate my logic as good as Velocity
> promises - and I think it will deliver. 

Yup. I wanted to use Velocity (or WebMacro or FreeMarker or other templating 
engines) for ages but haven't been in a Web job where I could legitimately 
take the time to learn it ;/

> Maybe not, because there is an interesting discussion springing
> from the plugability of the design - using a ComponentSelector to choose
> between page renderers and search engines can expand a wiki almost without
> limit (again defeating the keep it simple and to the point ideas inherent
> in Wiki - never at the usage level, but at the inner workings level for
> sure :) ).

;)

> Since I'm
> documenting this (design choices, code examples etc.) maybe you could use
> it as an example too (It still needs a lot of work, but it's a shame to
> waste so many bytes of notes). 

documentation is good. So if you are willing to provide I am sure none will 
complain ;)

> One more point I stumbled on:
> AbstractLoggable is there to help make Loggable components. Is there a
> certain reason it doesn't implement the Component interface so that
> deriving classes don't have to explicity define it themeselves? (It took me
> about 15 minutes to trace the ClassCastExceptions from this thing - I guess
> I'm not thinking quickly anymore :)) ). V.-

When AbstractLKoggable was originally added to CVS it did extend Component. 
However it was later decided that it was better to be indepent of component.* 
package. Mainly as each of the packages are independent of each other (ie 
logger independent of activity/context/config/component/etc).

-- 
Cheers,

Pete

------------------------------------------------------------
 militant agnostic: i don't know, and you don't know either.
------------------------------------------------------------

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


Re: Implementing the dream...

Posted by Vassilis Rizopoulos <va...@zuehlke.com>.
>sounds interesting. (and go with Velocity unless you need to learn JSP or 
>something).
Already made up my mind about that and I'm going with Velocity. I already know JSP and it doesn't let me isolate my logic as good as Velocity promises - and I think it will deliver. With JSP I have a problem with the lifecycle of a single bean used by the JSP (with the include:bean directive) and Velocity will let me use a servlet with a slightly more complex lifecycle control (init() etc.) as a container. Although the whole nightmare infrastructure resulting from this solution slightly defeats the Wiki idea :))(Apache + Tomcat + Velocity + Excalibur - a good integration exercise). Maybe not, because there is an interesting discussion springing from the plugability of the design - using a ComponentSelector to choose between page renderers and search engines can expand a wiki almost without limit (again defeating the keep it simple and to the point ideas inherent in Wiki - never at the usage level, but at the inner workings level for sure :) ).

>>         DefaultConfigurationBuilder builder = new
>> DefaultConfigurationBuilder(); Configuration sysConfig =
>> builder.buildFromFile("E:/development/wiki/src/conf/avalon-wiki.xml");
>> Configuration roleConfig =
>> builder.buildFromFile("E:/development/wiki/src/conf/roles.xml");
>> RoleManager roles = new DefaultRoleManager();
>
>replace above with 
>
>DefaultRoleManager roles = new DefaultRoleManager();
>
>and the below should work
>
>>         roles.configure(roleConfig);
Well, it was a case of staring at the tree and missing the forest or rather blindly following documentation without thinking :)). Did exactly this and went further to find and correct my other mistakes :)))
Since I'm documenting this (design choices, code examples etc.) maybe you could use it as an example too (It still needs a lot of work, but it's a shame to waste so many bytes of notes).
One more point I stumbled on:
AbstractLoggable is there to help make Loggable components. Is there a certain reason it doesn't implement the Component interface so that deriving classes don't have to explicity define it themeselves? (It took me about 15 minutes to trace the ClassCastExceptions from this thing - I guess I'm not thinking quickly anymore :)) ).
V.-



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


Re: Implementing the dream...

Posted by Peter Donald <do...@apache.org>.
On Fri, 21 Sep 2001 22:02, Vassilis Rizopoulos wrote:
> OK, I got wind of Avalon only a short while ago (after an extended period
> of holidays devoid of electronic interference I returned and found ASF
> piling up the new and interesting stuff) and I liked it a lot I should
> say.So I started reading and then I wanted something to implement the ideas
> and API on so...I ported Wiki as a set of components. Don't even begin to
> ask why, it's one of those X-file type things. My idea was to have the
> entry point as a servlet (or a JSP page - JSP works good as a template for
> those familiar with the inner workings of Wiki - But now I found out about
> Velocity, and that looks better) 

sounds interesting. (and go with Velocity unless you need to learn JSP or 
something).

> and the whole functionality on a set of
> Avalon components (so, that would be a Block, no? ) 

Naah Blocks are only things that exist inside the Phoenix kernel

>i.e. request processor,
> page renderer, search engine, page storage. Now, the whole concept goes
> like this:

sounds good.

> I have a JSP page that loads a bean. That bean will serve as the container
> for my service, meaning it will instantiate any components, manage their
> lifecycle etc (can I do that AND use a component manager?). I wrote this
> (keeping the 'Development...' document close at hand)
>
>         DefaultConfigurationBuilder builder = new
> DefaultConfigurationBuilder(); Configuration sysConfig =
> builder.buildFromFile("E:/development/wiki/src/conf/avalon-wiki.xml");
> Configuration roleConfig =
> builder.buildFromFile("E:/development/wiki/src/conf/roles.xml");
> RoleManager roles = new DefaultRoleManager();

replace above with 

DefaultRoleManager roles = new DefaultRoleManager();

and the below should work

>         roles.configure(roleConfig);

-- 
Cheers,

Pete

----------------------------------------------------
"The only way to discover the limits of the possible 
is to go beyond them into the impossible." 
                             -Arthur C. Clarke
----------------------------------------------------

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