[opencms-dev] Re: NewsHack Newsbeans

Stephan Hartmann beffe at beffe.de
Tue Jun 10 21:49:01 CEST 2003


What i mean is your NewsBean methods could look like this:

    public Vector getList() {
        return NewsContentDefinition.getSortedList(null);
    }

/** Returns all news items specific to channel*/    
    public Vector getList(int channel) {
        return NewsContentDefinition.getNewsList(new Integer(channel),
-1);
    }

/** Returns a NewsItem specific to its id */
    public NewsContentDefinition getNews(int newsID) {
        try {
            return new NewsContentDefinition(null, new Integer(newsID));
        } catch (CmsException e) {return null;}
    }

The NewsContentDefinition can be used as a JavaBean and you don't have
to deal with the database stuff because it is already implemented there.

Am Die, 2003-06-10 um 20.40 schrieb Rene Hinojosa:
> Stephan,
> 
> I did the beans because I couldn't figure out the News XMLTemplate. Its meant for anyone who doesn't want to deal with the old XMLTemplate business and has some jsp know-how.
> 
> >>> beffe at beffe.de 06/10/03 02:13PM >>>
> Hi Rene,
> 
> why not just use the NewsContentDefinition which comes with some useful
> public static getXXXList-Methods???
> 
> Bye,
> Stephan
> 
> 
> Am Die, 2003-06-10 um 17.32 schrieb Rene Hinojosa:
> > Greetings All,
> > 
> > Attached is the source files for the News Module Hack I created a bit ago(See archives) All files are not necessary in the deployment. I used a class for testing the connections and queries. I left it in for everyone's convience.
> > 
> > >>> "Steele, Jeffrey" <steelej at DCSC.GOV> 06/10/03 09:29AM >>>
> > Rene:
> > 
> > I am attempting to install the News Module and your beans using Oracle. The
> > sql for the news modules doesn't work with Oracle because they used the
> > reserved word "date" for a field name. That's easy enough to change, but I
> > think I need to modify your beans as well. Would you be willing to make the
> > source available? 
> > 
> > Thanks much,
> > 
> > Jeff
> > 
> > 
> > > Greetings,
> > > 
> > > All I've finished my install of and documentation of the bean 
> > > that I've developed. Attached is the zip file containing the 
> > > class files, some sample pages, javadoc documentation(very 
> > > very brief) and a README with install instructions. Please, 
> > > keep in mind this is my first (and hopefully not last! :) ) 
> > > contribution  the group. Sorry for the manual install. In the 
> > > future, I'll try to create a install module for it. Enjoy.
> > > 
> > > Rene
> > 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list