Refactoring of Create Client/U_WebMenu in Posterita

This commit is contained in:
shameem_z 2007-10-29 12:40:16 +00:00
parent c96c9066cf
commit d3fcba4a67
4 changed files with 11 additions and 34 deletions

View File

@ -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<MenuItem> 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<MenuItem>();
@ -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 + "<a href=" + menu.getMenuLink() + ">" + menu.getName() + "</a>";

View File

@ -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
{

View File

@ -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");

View File

@ -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)
{