Hi Austin,
As Geert said, welcome to the mailing list! He's right about that a lot
of people don't post -- it took me a while to work up to it for some of
the same reasons you list: just feeling dumb or being intimidated. :)
I'll just address how to pull info out of the ContentStore after it has
been entered via CRUD.
First, a note about how CRUD works with RIFE base: All of the
programmatic access for database tables and record access (creation,
reading, updating, deleting) exist in RIFE base. What CRUD provides is
a sort of instant setup tool for creating the database tables to manage
data for the bean and its content related properties, as well a GUI for
Creating, Reading, Updating, and Deletion. It (CRUD) does a little more
than that, but that's the main conceptual gist.
So, while you may use CRUD for record administration or getting some
data into the system for prototyping, you will probably (as you
discovered) want to create some sort of custom display rather than
CRUD's stock List element and template.
Ok, it sounds like you managed to get the CRUD interface set up, and
enter some records. Now, you want to display them via something other
than CRUD's default List element. This is done by using the RIFE base
ContentQueryManager methods:
========
Datasource ds =
Datasources.getRepInstance().getDatasource("datasource");
ContentQueryManager<NewsItem> mgr = new
ContentQueryManager<NewsItem>(ds, NewsItem.class);
// Retrieve all of the NewsItems
List<NewsItem> items = mgr.restore();
// If NewsItems had a boolean 'active' property, you could restrict
your results to only the 'active' NewsItems like so
//List<NewsItem> items =
mgr.restore(mgr.getRestoreQuery().where("active","=",true));
// We'll just log them for now as an exercise so we can see them.
Logger log = Logger.getLogger(this.getClass().getName());
for( NewsItem item : items ) {
log.info("NewsItem id=["+item.getId()+"],
title=["+item.getTitle()+"]");
}
========
Once you have the records, you can populate a template with them, etc.
I recommend for starters just logging them so you can see that you are
retrieving them, then moving on to working with templates.
The "content management framework" cookbook page will be helpful if you
note that CRUD takes care of installing the database tables for the
content query management system as well as the table for the bean. CRUD
also provides a default add element (along with edit, list, and delete),
so the part you'll want to focus on is the ViewNews element.
http://rifers.org/wiki/display/RIFE/Content+management+framework
Feel free to ask for clarification if you get stuck. Since RIFE is a
fairly complete framework on its own, there are a lot of parts to it and
it takes a while to digest. :)
Josh
--
Joshua Hansen
Up Bear Enterprises
(541) 760-7685
Austin Coose wrote:
> Hello Rifers,
>
> I apologize if this question has been answered or seems very
> juvenile, but I have searched the forums, reviewed code, and watched
> all of tutorials, viewed the wiki, etc., and it just does not seem
> evident on exactly how to retrieve items created in the "back end" of
> the crud jumpstart for view in the "front end".
>
> I am very new to programming, and I am just trying to learn, so
> please do not ridicule too much. ;-)
>
> I have spent the last few months trying to "pick" a framework to dive
> into. I worked mostly with struts2 and jsf, but dabbled with
> stripes, wicket, grails, spring mvc, the usual suspects, and stumbled
> upon RIFE.
>
> After watching the tutorials and getting my feet wet, reading some
> material on the web comparing RIFE to other frameworks, a recurring
> theme was that at first glance things are not what they seem, you
> must use it. So that is what I am trying to do.
>
> I have spent most of my spare time this last week trying to
> understand RIFE by reading and watching, now I am trying to build a
> simple web-app starting with the crud jumpstart. Anyhow, I feel like
> a dunce and that right now, the beauty and simplicity of the
> framework that is evident aside, I am just missing something.
>
> Are there any training courses available for RIFE?
>
> I own an RIA (no, not a rich internet application ;-) ), but a
> Registered Investment Advising firm. I would like to develop some
> custom applications for the web. I am a small start up, and have
> limited resources. I know that I am eventually going to need an
> outside developer. Still, I also want to know the process in depth
> so I can develop some small pieces on my own and choose the framework
> that makes the most sense, not the just one that is easiest to find a
> developer.
>
> After all the searching, I very much would like to choose RIFE.
>
> Anyhow, I apologize for the long winded question and introduction, I
> usually try to figure it out before I post, so this is the first post
> on any mailing list. Like I said, I feel like I am just missing
> something, so I thought I would ask.
>
>
>
> -Austin Coose
>
>
>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rife-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rife-users?hl=en
-~----------~----~----~----~------~----~------~--~---