Re: New (sorta) to WebObjects and looking for some insight.
Re: New (sorta) to WebObjects and looking for some insight.
- Subject: Re: New (sorta) to WebObjects and looking for some insight.
- From: Chuck Hill <email@hidden>
- Date: Mon, 20 Mar 2006 11:53:20 -0800
On Mar 20, 2006, at 11:41 AM, Andrew Satori wrote:
OK, so I'm only sorta new to this, I've experimented and done many
of the WO tutorials on WO a couple of times as I've flirted with WO
a couple of times in the past 3 years, however this time I'm fairly
seriously working to build a web application using WO.
Hi, Welcome!
Now, for me, OpenBase isn't an option, my choices are PostgreSQL or
MSSQL, with a strong preference to PostgreSQL, This isn't a
soapbox thing, it's what I have invested in both knowledge and
money, and switching to OpenBase means a cost that I can't afford
right now. So I feel kinda handicapped right out of the gate. So
I'm approaching this group hoping to gain some insight from people
with more experience and knowledge than myself.
The question of PostgreSQL versus MSSQL is not really a question in
my opinion. Use PostgreSQL. In fact, I would prefer PostgreSQL over
OpenBase due to its SQL92 standard-ness. FrontBase is my platform of
choice, but it is not free for deployment. When free / open is
required, PostgreSQL is a fine solution.
I've worked with ASP, JSP and ASP.NET pretty heavily over the
years, and as I sit down with WO today, what I see is an
environment that implemented 'CodeBehind' logic years before
ASP.NET, and deploys cleaner than a typical JSP war. Building upon
just that makes WO a nice tool, I've already rebuilt my basic
website with a blog style news & announcements system that works,
though it's using Java classes that I hand coded for a JSP
implementation of another site a year or so ago, and not use EOF.
Here's where I've hit a wall.
I've got this WebApp, with a subpage, but I can't seem to generate
a link to that subpage without first linking to it from the main
page and generating a session, and I think I'm missing something
that's probably incredibly obvious. For example, I want to be able
to pass a link to the rss feed from the main page, something like
http://somesite/cgi-bin/WebObjects/myWebApp.woa?rss.wo or similar.
This needs to be done in such a way that the it doesn't require
that main link. I could obviously do this as a seperate WebApp,
but that seems like wasted overhead in this instance.
Hell yes that is wasted overhead. What you want are called Direct
Actions. In a nutshell, a direct action associates a particular URL
with one method in a class. They allow for multiple "entry points"
into your application. In your particular example, the URL would/
could look like this:
http://somesite/cgi-bin/WebObjects/myWebApp.woa/wa/rssFeed
Note:
/wa/ indicates a Direct Action
/wo/ indicates a standard component action
rssFeed is the name of the direct action
Then in DirectAction.java add:
// Note the method name is the name of the direct action plus "Action"
public WOActionResults rssFeedAction() {
return pageWithName("RSSFeedPage");
}
The second item deals directly with EOF. While I see the
advantages from an intellectual standpoint, I've not had much luck
in working with EOF and any DB engine other than OpenBase, usually
getting syntax errors on the generated SQL. I've also tried the
Project Wonder stuff, but since CVS has been impossible to get to,
I can't build the EOPlugins to generate proper SQL.
You need those plugins. They are not optional. E-mail me off list
and I can send you a built version of the Postgres one and instructions.
Which brings me to the other issue, reverse usage, using EOF with
pre-existing schemas where the Primary Keys are identity (MSSQL) or
serial (PostgreSQL) columns. While *read* seems to work with these
models, update and insert do not. Again, I suspect User Error,
probably along the lines of over complicating things based upon my
background. I'm really just looking for some pointers or a gently
nudge in the right direction.
You can't (easily, with software almost anything is possible given
enough effort) use identity and serial columns with WebObjects. WO
needs to know the PK at the time of save so that it can find the
object again)
Chuck
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden