<%@ page import="com.dividedsky.clients.thumbs.cache.CatalogProductCache" %> <%@ page import="com.dividedsky.clients.thumbs.cache.CustomerCache" %> <%@ page import="com.dividedsky.clients.thumbs.cache.VersionTypeCache" %> <%@ page import="com.dividedsky.clients.thumbs.cache.ServiceTypeCache" %> <%@ page import="com.dividedsky.clients.thumbs.PhoneTypePulldown" %> <%@ page import="com.dividedsky.clients.thumbs.VersionTypePulldown" %> <%@ page import="com.dividedsky.clients.thumbs.ServiceTypePulldown" %> <%@ page import="com.dividedsky.clients.thumbs.primitives.CatalogProduct" %> <%@ page import="com.dividedsky.clients.thumbs.primitives.Customer" %> <%@ page import="com.dividedsky.clients.thumbs.primitives.ProductVersion" %> <%@ page import="com.dividedsky.clients.thumbs.primitives.VersionType" %> <%@ page import="com.dividedsky.clients.thumbs.CatalogSearch" %> <%@ page import="com.dividedsky.system.ResultList" %> <%@ page import="com.dividedsky.system.BufferedLog" %> <%@ page import="com.dividedsky.system.AssCache" %> <%@ page import="com.dividedsky.html.Pulldown" %> <%@ page import="com.dividedsky.system.PropertiesHash" %> <%@ page import="java.util.Vector" %> <% String page_id = "ADD_CATALOG_PRODUCT"; BufferedLog log = BufferedLog.getInstance(); CatalogProductCache product_cache = CatalogProductCache.getInstance(); VersionTypeCache version_type_cache = VersionTypeCache.getInstance(); ServiceTypeCache service_type_cache = ServiceTypeCache.getInstance(); PropertiesHash props = PropertiesHash.getInstance(); VersionTypePulldown ringtone_types = (VersionTypePulldown) session.getAttribute("VERSION_TYPES"); ServiceTypePulldown compatible_service = (ServiceTypePulldown) session.getAttribute("COMPAT_SERVICE"); if (compatible_service == null) { compatible_service = new ServiceTypePulldown(); } PhoneTypePulldown compatible_phones = (PhoneTypePulldown) session.getAttribute("COMPAT_PHONES"); if (compatible_phones == null) { compatible_phones = new PhoneTypePulldown(-1); } String phone_type_id = (String) session.getAttribute("ADD_PHONE_TYPE"); if (phone_type_id == null) { phone_type_id = "1"; } String product_id = (String) session.getAttribute("PRODUCT_ID"); if (product_id == null) { product_id = ""; } String version_type_id = (String) session.getAttribute("VERSION_ID"); if (version_type_id == null) { version_type_id = ""; } String product_type_id = (String) session.getAttribute("PRODUCT_TYPE"); if (product_type_id == null) { product_type_id = request.getParameter("product_type_id"); if (product_type_id == null) { product_type_id = ""; } } CatalogProduct p = (CatalogProduct) product_cache.get(product_id); // remember their last values String default_phone_number = ""; String email = null; if (session.getAttribute(props.getValue("AUTH_KEY")) != null) { // the user is logged in, lets try to help them out CustomerCache crusty_cache = CustomerCache.getInstance(); String cust_id = (String) session.getAttribute(props.getValue("CUSTOMER_ID_KEY")); Customer crusty = crusty_cache.get(cust_id); compatible_phones.setSelected(crusty.get("phone_type_id")); default_phone_number = crusty.get("phone"); email = crusty.get("email"); String st = (String) session.getAttribute("ADD_SERVICE_TYPE"); if (st != null) { compatible_service.setSelected(st); } } else { String pn = (String) session.getAttribute("ADD_PHONE_NUMBER"); String st = (String) session.getAttribute("ADD_SERVICE_TYPE"); String pt = (String) session.getAttribute("ADD_PHONE_TYPE"); if (pn != null) { default_phone_number = pn; } if (st != null) { compatible_service.setSelected(st); } if (pt != null) { compatible_phones.setSelected(pt); } email = (String) session.getAttribute("ADD_EMAIL"); if (email == null) {email = "";} } %> Adding: <%=p.getAuthor()%> - <%=p.getName()%>