KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > openedit > modules > store > BaseStoreModule


1 /*
2  * Created on Jul 19, 2006
3  */

4 package com.openedit.modules.store;
5
6 import com.openedit.OpenEditException;
7 import com.openedit.WebPageRequest;
8 import com.openedit.modules.BaseModule;
9 import com.openedit.modules.cart.StoreDataReader;
10 import com.openedit.page.Page;
11 import com.openedit.store.Store;
12
13 public class BaseStoreModule extends BaseModule
14 {
15     protected static final String JavaDoc CATALOGIDX = "catalogid";
16     protected static final String JavaDoc CATEGORYID = "categoryid";
17
18     public Store getStore(WebPageRequest inPageRequest) throws OpenEditException
19     {
20         Page page = inPageRequest.getContentPage();
21         String JavaDoc readername = null;
22         if( page != null)
23         {
24             readername = page.get("storereadername");
25         }
26         if( readername == null)
27         {
28             readername = "StoreDataReader";
29         }
30         StoreDataReader reader = (StoreDataReader)getModuleManager().getBean(readername);
31         Store store = reader.loadStore(inPageRequest);
32         return store;
33     }
34
35
36     
37 }
38
Popular Tags