From d3fcba4a6783ea47567e77d0ea379ec2e3ed259c Mon Sep 17 00:00:00 2001 From: shameem_z Date: Mon, 29 Oct 2007 12:40:16 +0000 Subject: [PATCH] Refactoring of Create Client/U_WebMenu in Posterita --- .../src/main/org/posterita/core/MenuItem.java | 14 +++++++------- .../main/org/posterita/core/SessionStorage.java | 17 ----------------- .../main/org/posterita/core/SystemObjects.java | 7 +++---- .../src/main/org/posterita/core/TmkJSPEnv.java | 7 +------ 4 files changed, 11 insertions(+), 34 deletions(-) diff --git a/posterita/src/main/org/posterita/core/MenuItem.java b/posterita/src/main/org/posterita/core/MenuItem.java index 1b7e07cb0d..d7fed23d8c 100644 --- a/posterita/src/main/org/posterita/core/MenuItem.java +++ b/posterita/src/main/org/posterita/core/MenuItem.java @@ -25,15 +25,15 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.Properties; -import org.compiere.model.X_U_Menu; +import org.compiere.model.X_U_WebMenu; import org.posterita.factory.AbstractFactory; -import org.posterita.model.UDIU_Menu; +import org.posterita.model.U_WebMenu; public class MenuItem { protected String menuLink; - protected UDIU_Menu menu; + protected U_WebMenu menu; protected ArrayList children; protected int menuId; protected boolean available; @@ -44,7 +44,7 @@ public class MenuItem this.menuId = menuId; } - public MenuItem(UDIU_Menu menu) + public MenuItem(U_WebMenu menu) { this.menu = menu; children = new ArrayList(); @@ -196,11 +196,11 @@ public class MenuItem public static MenuItem getDummyMenuItem(Properties ctx) { - X_U_Menu xMenu = new X_U_Menu(ctx, 0, null); + X_U_WebMenu xMenu = new X_U_WebMenu(ctx, 0, null); xMenu.setName("Dummy Root Menu"); xMenu.setIsActive(false); - UDIU_Menu menu = new UDIU_Menu(xMenu); + U_WebMenu menu = new U_WebMenu(xMenu); MenuItem retMenu = new MenuItem(menu); return retMenu; @@ -297,7 +297,7 @@ public class MenuItem if (menuId.intValue() != 0) { - X_U_Menu menu = new X_U_Menu(ctx, menuId.intValue(), null); + X_U_WebMenu menu = new X_U_WebMenu(ctx, menuId.intValue(), null); breadcrumb = breadcrumb + "" + menu.getName() + ""; diff --git a/posterita/src/main/org/posterita/core/SessionStorage.java b/posterita/src/main/org/posterita/core/SessionStorage.java index c6a7bbfdf2..4187c34ebd 100644 --- a/posterita/src/main/org/posterita/core/SessionStorage.java +++ b/posterita/src/main/org/posterita/core/SessionStorage.java @@ -438,23 +438,6 @@ public class SessionStorage } - public static void putWebstoreUser(Properties ctx, HttpServletRequest request, Integer userId) throws Exception - { - String defaultAppName = ApplicationManager.getApplicationType(ctx).toUpperCase(); - - if(defaultAppName.contains(UdiConstants.WEBSTORE_APP_SUFFIX)) - { - WebstoreUserBean webstoreUserBean; - webstoreUserBean = UserManager.getWebstoreUser(ctx, userId); - - //Set Checkout Next Step - webstoreUserBean.setStep("1"); //Step 1: Delivery Information - - request.getSession().setAttribute(Constants.WEBSTORE_USER_BEAN,webstoreUserBean); - - } - - } public static void putPOSID(Properties ctx,String posId,HttpServletRequest request) throws OperationException { diff --git a/posterita/src/main/org/posterita/core/SystemObjects.java b/posterita/src/main/org/posterita/core/SystemObjects.java index fcbadcc34a..52dab921ca 100644 --- a/posterita/src/main/org/posterita/core/SystemObjects.java +++ b/posterita/src/main/org/posterita/core/SystemObjects.java @@ -33,8 +33,7 @@ import org.compiere.model.MProductCategory; import org.compiere.model.MTax; import org.compiere.model.MTaxCategory; import org.compiere.model.MUser; -import org.compiere.model.X_U_Menu; - +import org.compiere.model.X_U_WebMenu; import org.posterita.model.UDIMAssetGroup; import org.posterita.model.UDIMDiscountSchema; import org.posterita.model.UDIMPriceList; @@ -53,9 +52,9 @@ public class SystemObjects //private static UDIMRole udiAdminRole; - public static X_U_Menu getSMenuProductAttributeValue(Properties ctx) + public static X_U_WebMenu getSMenuProductAttributeValue(Properties ctx) { - X_U_Menu menu = new X_U_Menu(ctx, 0, null); + X_U_WebMenu menu = new X_U_WebMenu(ctx, 0, null); menu.setName("Create Product Attribute Value"); menu.setMenuLink("InitAttributeValueAction.do?action=initAttributeValues"); menu.setModule("DMS"); diff --git a/posterita/src/main/org/posterita/core/TmkJSPEnv.java b/posterita/src/main/org/posterita/core/TmkJSPEnv.java index 67d62dd311..c11d4a97a7 100644 --- a/posterita/src/main/org/posterita/core/TmkJSPEnv.java +++ b/posterita/src/main/org/posterita/core/TmkJSPEnv.java @@ -52,12 +52,7 @@ public class TmkJSPEnv try //Required since our friend Jorg hardcoded 30 mins in JSPEnv.java { - String applicationName = ApplicationManager.getApplicationType(ctx); - - if (applicationName.toUpperCase().endsWith(Constants.APP_POS.toUpperCase())) - request.getSession().setMaxInactiveInterval(5*60*60); // 5 Hours - else if(applicationName.toUpperCase().endsWith(Constants.APP_WEBSTORE.toUpperCase())) - request.getSession().setMaxInactiveInterval(1*60*60); // 1 Hour + request.getSession().setMaxInactiveInterval(5*60*60); // 5 Hours } catch(Exception ex) {