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sIHRhYmJlZF9ib3gsIGFuZCBzbyBvbiwg YW55dGhpbmcuDQoNCmFuZCBhbGwgdGhlIFN0eWxlIGFuZCBTa2luIHNob3VsZCBiZSBidWlsZCBh cyBhIGxpdHRsZSBtb2R1bGUgb3IgcGFja2FnZSBhbmQgc29tZSB0b29scyBjb3VsZCANCm1hbmFn ZSB0aGVtICggaW5zdGFsbCwgdW5pbnN0YWxsLCB1cGdyYWRlLCBhbmQgc28gb24pDQoNCmJ0dywg ZXZlcnkgcGtnJ3MgdGVtcGxhdGUgbWF5IHVzZSBzb21lIGxhbmd1YWdlIGRlZmluZSBmaWxlIHRv IHNhdGlzZnkgd2l0aCBtdWx0aS1sYW5ndWFnZSBzaXRlcy4NCg0KIAkJCQkNCg0KoaGhoaGhoaGh oaGhoaGhoWZvcmVoZWFkIChDaHVuIFNoZW5nKQ0KoaGhoaGhoaGhoaGhoaGhoWZvcmVoZWFkQDRy ZWQub3JnDQqhoaGhoaGhoaGhoaGhoaGhoaGhoTIwMDMtMTAtMzANCg== |
From: Chris W. <ch...@cw...> - 2003-10-30 17:46:47
|
forehead wrote: > Maybe in the future, there will has ShopCart pkg in OI2 system. > of course we need a new session to save the cart's info. and need a different > SESSION_COOKIE to set cookie and logout handler. Actually there is a 'cart' package in the 'extra_packages' directory of CVS. I haven't visited it in quite some time but it should work ok. (I'll rewrite it for OI2 and actually release it once OI2 is final.) > so my new idea is split the SESSION_COOKIE value into a Session Name which indcate > which session is to be handle. I'm not sure I understand this. You can put anything you want in the session, including a shopping cart object. (That might not be smart for high-volume sites, in those cases you'll want to just put a key and maybe frequently accessed data like number of items in the cart.) Anyway, you can do something like: my $cart = My::ShoppingCart->new(); $cart->add( $product, 2 ); $cart->add( $product_other, 1 ); # OI 1.x: $R->{session}{cart} = $cart; # OI 2.x: my $request = CTX->request; $request->session->{cart} = $cart; And then retrieve it later: # OI 1.x my $cart = $R->{session}{cart}; # OI 2.x my $request = CTX->request; my $cart = $request->session->{cart}; my $products = $cart->list_products; ... > Another idea about the OI is, init conf with different $ENV{'HTTP_HOST'} , and load > some site's own configure. that's like the apache's vitual host stuff. Since many > sites maybe in almost the same. Actually one of the reasons OI 1.x is a bit overengineered is to accommodate this -- running multiple instances of OI inside a single Apache server. The problem is that very few people actually want to do this, and the engineering necessary to make this happen (juggling namespaces, etc.) really gets in the way of normal usage. So that's not around in OI 2.x. > Another idea about Theme: > and the template with theme maybe look like thus: > > pkg > \-- [StyleName_1] \ templates\[some html template files] > \ [SkinName_1]\[some images or flash or anything associate with this skin] > \ [SkinName_2]\[some images or flash or anything associate with this skin] > \ [SkinName_3]\[some images or flash or anything associate with this skin] > ... > > and in top level there is a theme object which defines which package use which Style and use > which Skin for this style. This is interesting. So this allows you to change component templates by theme as well as fetch resources (images, movies, etc.) by theme. I'll have to noodle over this. > futher more, we can build some global template widgets , for meet the pkg template use, eg: > button, navigation, bar, box, tabbed_box, and so on, anything. Right. > and all the Style and Skin should be build as a little module or package and some tools could > manage them ( install, uninstall, upgrade, and so on) There's already some support for standalone themes ('themeballs') that you can manipulate with oi2_manage. (mostly untested of course...) > btw, every pkg's template may use some language define file to satisfy with multi-language sites. This goes along with the separate i18n discussion going on right now. I hadn't thought about this approach -- using an entirely separate template instead of message tags.... Very useful, thanks. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |