The Other Site

401 Authorization in Wonder

I while ago I updated DynEd’s web site and also had to update a set of html pages linking to product/training videos. The pages consisted of a simple FileMaker Pro database to generate the repetitive list of videos, separate headers/footers, and JavaScript. Some videos were QuickTime, some were Flash, some required passwords to play. I had a player for Flash and another for QuickTime that opened in a new window, JavaScript would inject the URLs to the videos. Authorization was done with web server realms where each player was in a realm. On the new site the player would not open in a new window but play inside the existing window, there no longer was a separate player file. It was going Web 2.0.
Long story short I had to figure out how to do authorization in Wonder. Here is how it works. Read More…

WebObjects Adding a Day

For one of my projects I needed to add (or subtract) a day from an NSTimestamp. Here is what I came up with. I extended ERXTimestampUtilities part of Wonder. Read More…

Sessions and relative linked images

I read my headers and footers from the file system into the WOApp as it starts up - to integrate the application in with the rest of the web site. If you add that to WOComponet as a reusable component or as a string doesn’t really matter, other then your personal preferences.

My header has a relative link to an image, like this: images/headerart.jpg. This allows me to reuse the same header file but display a different images depending on where the web page is. So if, for example, the technical support page resides in /support/ then I can have an image like /support/images/headerart.jpg. A page that lives in /education/ has an image that lives in /education/images/headerart.jpg.

For a WebObjects application, the stem URL is not the same as the stem URL of a static page. When my global header is read from the file system and used in my application, the relative URL to the header image is passed to the application. WebObjects does not understand a link like this, fails, and actually creates a new session for you.

Symptoms of this problem may be when users are unexpectedly sent to your custom ‘Session expired’ page.
Read More…

Sessions. Don't even think about it.

So you create a home page, or rather a main page for your WebObjects application and you add a form so you can log in. But hey, the content of the page changes when someone is logged in so you check in the Session is someone is logged in. Swell, now there is a session and the login form has a session ID in the action.

The simplest way to resolve this is not to make any references to Session() in the page java class (in this case You then would set a flag in if there is a user logged in that is false when the Main page is instantiated and only set to true when a user successfully logged in.
In the Main component sections can be hidden or shown using this flag.

The Main page as well as the login form should be direct actions. Otherwise sessions will get created.

So, don’t even think about make references to Session() unless you need to be state-full.
Read More…