From: <aro...@cl...> - 2009-07-06 19:42:23
|
Hi Daniel, I agree with others about the javascript and image resources but there is an extra bit that hadn't been mentioned. Sure, you can put these "static" resources in a "magic" location from the root of your webserver and then reference them from your app. But then it is outside of your app and a minor headache to sync with various updates to your app. Not so bad though, pefectly fine and easy to comprehend. Alternatively you can stick most of those "static" resources in the "Webserver Resources" folder of your WO project. Then, in pure java, use "addScriptResourceToHead()" (and similar methods) to pull in those various files. This is harder for some to wrap their head around but it gives a nice and tight ".woa" with everything together. You can't always do this trick but for javascript resources it will work. CSS that references images is trickier, those images might need to be in a "magic" spot but the CSS itself can be loaded this way. Now the other bit, the auto-force-login, could be taken care of with a nice "PageWrapper.wo" component that you create. On every page you probably want to use a page wrapper just to have a consistent look and feel. You can start off with something simple that has nothing but just a "WOComponentContent" in it. Then add common menus and layout to it. All the "special" stuff for a particular page will show up in the "WOComponentContent" location. Now if you beef up your page wrapper with extra java logic and woConditionals, you can always force that a user be logged in, or need to create an account, before showing them the "special" content of the page. It becomes universal for every page you use the page wrapper on. -- Aaron Daniel Brajkovic <da...@br...> wrote on 04-07-2009 02:17:16 PM: > Didn't they just find a "Gianduia man" fossil in Myanmar. "They" say > he may be the missing link. > > As the one who started this thread, I thought I would provide an > update. I've given up on using sproutcore for the first version of my > app. But I switched to Cappuccino, which I'm starting to like more and > more, especially since it can take advantage of Interface Builder! > Remember when WO used to do that. (sigh). > > Now for the bad news. At the insistence of my partner, we agreed to > switch to Rails (for now). I tried Cappuccino with WO and it works > great with Mike's new REST routing classes. However, I found something > I could easily do in Rails, which I tried over and over to get to work > with WO and just couldn't. > > Cappucino has just a single html file from which it launches the app. > In Rails, I can stick the html code in a view of a controller. (For > those of you unfamiliar with rails, (controller like a directAction > class combined with a component class, and views are the html of a WO > component). This scheme works great because in the controller, I > simply "require_login" and if a user is not logged in it redirects to > a login screen. And everything is in the same domain, so cookies and > cross-domain ajax aren't an issue. > > So I figured, OK, I can do the same in WO. So I created a component > and stuck the html from the Cappuccino app in it. And for the life of > me, I could not get it to properly access all the supporting > javascript/Cappuccino classes. I tried everything. If any of you WO > guru's want to give it a crack, I'd love to find out how to make this > work. > > A new Cappuccino folder looks like this. What I want to do is extract > the index.html and stick it in a WO component. But where do I put the > rest of these files/folders? (.j files are like .m files + .h files in > cocoa) > > /Users/dan/Desktop/TestCapp > |-AppController.j > |-Frameworks > |---AppKit > |-----Resources > |-------Aristo.blend > |---------Resources > |-----------HUD > |-----------old-scroller > |-------CPAlert > |-------CPApplication > |-------CPImageView > |-------CPMenuItem > |-------CPProgressIndicator > |-------CPShadowView > |-------CPSplitView > |-------CPTabView > |-------CPToolbarItem > |-------CPWindow > |---------HUD > |---------Standard > |-------HUDTheme > |-------_CPMenuBarWindow > |-------_CPMenuWindow > |---------untitled > |-------_CPToolbarView > |-------_CPWindowView > |-----browser.platform > |-----rhino.platform > |---BlendKit > |-----Resources > |-----objj.platform > |---Debug > |-----AppKit > |-------Resources > |---------Aristo.blend > |-----------Resources > |-------------HUD > |-------------old-scroller > |---------CPAlert > |---------CPApplication > |---------CPImageView > |---------CPMenuItem > |---------CPProgressIndicator > |---------CPShadowView > |---------CPSplitView > |---------CPTabView > |---------CPToolbarItem > |---------CPWindow > |-----------HUD > |-----------Standard > |---------HUDTheme > |---------_CPMenuBarWindow > |---------_CPMenuWindow > |-----------untitled > |---------_CPToolbarView > |---------_CPWindowView > |-------browser.platform > |-------rhino.platform > |-----BlendKit > |-------Resources > |-------objj.platform > |-----Foundation > |-------Resources > |-------objj.platform > |-----Objective-J > |-------rhino.platform > |---Foundation > |-----Resources > |-----objj.platform > |---Objective-J > |-----rhino.platform > |-Info.plist > |-index.html > |-main.j > |-Resources > |-TestCapp.xcodeproj > |-build > |---TestCapp.build > |-----Release > |-------TestCapp.build > |-----TestCapp.pbxindex > |-------strings.pbxstrings > > > > On Jul 4, 2009, at 12:29 PM, Chuck Hill wrote: > > > > > On Jul 3, 2009, at 11:52 PM, Janine Sisk wrote: > > > >> Not so fast there... > >> > >> (I know this is an old post now, but I could not resist! :) > >> > >> janine (definitely not a man, of gianduia or otherwise) > > > > But the question is whether you WANT to be a Gianduia man! :-P > > > > > > > >> > >> On Jun 24, 2009, at 9:27 AM, David Holt wrote: > >> > >>> We ALL want to be gianduia men :-) > >>> > >>> > >>> On 24-Jun-09, at 8:06 AM, Mike Schrag wrote: > >>> > >>>> i'm a gianduia > >>>> man, myself > >>> > >>> > ------------------------------------------------------------------------------ > >>> _______________________________________________ > >>> Wonder-disc mailing list > >>> Won...@li... > >>> https://lists.sourceforge.net/lists/listinfo/wonder-disc > >> > >> > ------------------------------------------------------------------------------ > >> _______________________________________________ > >> Wonder-disc mailing list > >> Won...@li... > >> https://lists.sourceforge.net/lists/listinfo/wonder-disc > > > > -- > > Chuck Hill Senior Consultant / VP Development > > > > 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 > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > > Wonder-disc mailing list > > Won...@li... > > https://lists.sourceforge.net/lists/listinfo/wonder-disc > > [attachment "smime.p7s" deleted by Aaron Rosenzweig/hq/hjf] > ------------------------------------------------------------------------------ > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |