proposed pages mods (was Re: BarracudaDiscRack up-to-date....)

Jacob Kjome <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Diez,

That sounds good.  We can definitely wait until you get your stuff finished 
before releasing.

One thing I'd like you to consider with the page stuff is modifying things 
so that the pages are capable of loading localized XMLC pages.  In order to 
do that.  In the barracuda-pages.sample build that I made based on your 
contrib project, I minor modifications to AbstractPage.java to take a 
Locale argument in the getDocument() method.  So, all implemented pages 
implement something like the following....

public Document getDocument(Locale iLocale) {
     //return new XMLCStdFactory(null, null).create(PrefixMappingHTML.class);

     Document doc = null;
     //load the localized DOM template
     try {doc = 
DefaultDOMLoader.getGlobalInstance().getDOM(PrefixMappingHTML.class, iLocale);}
     catch (IOException ioe) {logger.fatal ("Fatal Error loading DOM 
template:", ioe);}
     return doc;
}

That is basically all that needs to be changed.


Note that in the barracuda-pages.sample, I also modified your HTML 
templates to use ID's which I mapped to directives in a properties file.  I 
did that just to show how BTemplate doesn't require embedded 
directives.  Plus, you can change the directives at will without ever 
re-touching the HTML templates again.  I leave it up to you whether you 
want to bother with that approach.

Additionally, I removed some unused import statements and made explicit 
other import statements rather than importing mypackage.*.  Personally, 
this helps me figure out how things work when I know immediately where to 
look for an imported class being used for various purposes in a class.

The full barracuda-pages.sample build is available at:
ftp://ftp.visi.com/users/hoju/pub/


For convenience, I've attached (in a .zip file) the modified 
AbstractPage.java, which can be used as is, and ExampleBasePage.java which 
is provided just as an example of what I modified in the implemented pages 
(along with modified HTMl using id's and the properties file).

Jake



At 10:33 PM 2/24/2003 +0100, you wrote:
>Hi,
>
> > Diez, did we want to move your pages.* package into the main contrib
> > rather than under the src of the webapp?
>
>I think so. Tomorrow I have my math exam, afterwards I'm sure I can spend a
>few days on barracuda again. I got some things on my todo.
>
>Diez
>_______________________________________________
>Barracuda mailing list
>[email protected]
>http://barracudamvc.org/lists/listinfo/barracuda
page_mods.zip (application/zip, 4.2 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.