home *** CD-ROM | disk | FTP | other *** search
- <%@ page language="java" import="
- java.util.*,
- com.jproxy.site.ejbeans.interfaces.*,
- com.jproxy.site.*"
- %>
-
- <script language="JavaScript">
- function luanch_browser(sPageURL)
- {
- window.open(sPageURL, null, "");
- }
- </script>
-
- <jsp:useBean id="ses" scope="session" class="com.jproxy.site.JSPSession"/>
- <%
- if (!ses.isLoggedIn())
- {
- %>
- <jsp:forward page="login.jsp">
- </jsp:forward>
- <%
- }
- ses.request(pageContext);
- ses.setNewHit(pageContext, "hits", "Product List", null);
- %>
-
- <%
- String bgcolors[] = {"#F3F8FF", "#FFFFFF"};
-
- String customerID = ses.getParameter("customer-id");
- if(customerID.trim().length()==0||ses.isAdmin())
- customerID = ses.getLogin().getID();
-
- Vector formulas = null;
- try{
- formulas = ses.session.getSaleFormulas(customerID);
- }catch(Exception e)
- {
- e.printStackTrace();
- }
-
- %>
- <!-- HEADER -->
- <jsp:include page="header.jsp" flush="true">
- <jsp:param name="pageId" value="product_list"/>
- </jsp:include>
-
- <!-- MAIN PANEL -->
- <%
- int totalPurchasedLicenses = 0;
- %>
- <br>
- This is a list of all available products. You may choose any of available actions
- against each product name and version. You may buy licenses for a product,
- review its release notes and if you have a valid support contract then you may
- be able to interact with our technical support engineers via private Forums.
- <p>
- Each purchased product version get its own private Forum. If you have a question
- or would like to report a bug please choose the product name and version that your
- question relates to and follow the [Forum] link.
- Once in forum submit your questions there.
-
- <p>
- <table class="h8Verdana" border="0" cellpadding="2" cellspacing="2" width="100%">
- <tr class="h8VerdanaBold" bgcolor="9c9cff">
- <td>Product Name</td>
- <td>Product Version</td>
- <td>Release Date</td>
- <td>Purchased<br>licenses</td>
- <td>Action</td>
- </tr>
- <%
- /*
- int productLastPurchaseID = 0;
- for(int i=0; i<formulas.size(); i++)
- {
- IProduct product = (IProduct)products.elementAt(i);
- String productID = product.getID();
- Vector purchases = ses.session.findPurchases(customerID, productID);
- if(purchases.size()>0)
- {
- productLastPurchaseID = i+1;
- break;
- }
- }
- */
- int nTotalProducts = 0;
- // for each "saleable" product for this customer
- for(int i=0; i<formulas.size(); i++)
- {
- // get its sale formula interface
- ISaleFormula saleFormula = (ISaleFormula)formulas.elementAt(i);
-
- if (!saleFormula.getType().equals("development"))
- continue;
-
- nTotalProducts++;
-
- // get its product that this sale formula interface is bound to
- IProduct product = (IProduct)ses.session.getProductById(saleFormula.getProductID());
- String productID = product.getID();
- String productName = product.getProductName();
-
- // calcaulate total license purchase for this product
- Vector purchases = ses.session.findPurchases(customerID, productID);
- int purchasedLicenses = 0;
- for(int j=0; j<purchases.size(); j++)
- {
- IPurchase purchase = (IPurchase)purchases.elementAt(j);
- int licenses = purchase.getNumberOfLicenses();
- purchasedLicenses += licenses;
- totalPurchasedLicenses += licenses;
- }
- %>
- <tr bgcolor="<%=bgcolors[i % 2]%>">
- <td align="left">
- <%=productName%>
- </td>
- <td align="left"><%=product.getProductVersion()%></td>
- <%
- java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(JSPRes.dateFormar);
- String releaseDate = sdf.format(new Date(product.getReleaseDate()));
- %>
- <td align="left"><%=releaseDate%></td>
- <td align="left">
- <%=purchasedLicenses%>
- <%
- if(purchasedLicenses>0)
- {
- %>
- <a class="h8Verdana" href="<%=JSPRes.path%>/main/customers/purchases-list.jsp?customer-id=<%=customerID%>&product-id=<%=productID%>"> [details] </a><br>
- <%
- }
- %>
- </td>
- <td align="left">
- <a class="h8Verdana" href="<%=JSPRes.path%>/main/customers/buy.jsp?productid=<%=productID%>&customer-id=<%=customerID%>&purchased-licenses=<%=purchasedLicenses%>"> [Buy] </a>
- <%
- ISaleFormula sf = (ISaleFormula)formulas.elementAt(0);
- String upgradeProductID = sf.getProductID();
- if(!upgradeProductID.equalsIgnoreCase(JSPRes.defaultTunnelLicenseID)&&purchasedLicenses>0)
- {
- %>
- <br><a class="h8Verdana" href="<%=JSPRes.path%>/main/customers/buy.jsp?productid=<%=upgradeProductID%>&customer-id=<%=customerID%>&purchased-licenses=<%=purchasedLicenses%>&is-upgrade=true"> [Upgrade] </a>
- <%
- }
- %>
- <%
- // if this guy has actually bought at least one license then let him have access to Forums
- // TO DO: Disable editing capabilities, once the support contract is over
- String permit = ses.getLogin().getPermit();
- if(permit==null)
- permit = "";
- if(purchasedLicenses>0||permit.equalsIgnoreCase("admin")||permit.equalsIgnoreCase("forum"))
- {
- %>
- <br><a class="h8Verdana" href="<%=JSPRes.path%>/main/mlist/topic.jsp?command=refresh&product-id=<%=productID%>"> [Forum] </a>
- <%
- }
- %>
- <br><a class="h8Verdana" target="_blank" href="../release-notes/<%=product.getReleaseNotes()%>"> [Notes] </a>
- </td>
- </tr>
- <%
- }
- %>
- </table>
- <p>
- <table class="h8Verdana" width="100%" border="0" bgcolor="#f3f8ff" cellpadding="1" cellspacing="0">
- <tr>
- <td>
- <span class="h8Verdana">
- You've a total of <span class="h8VerdanaBold"><%=nTotalProducts%></span>
- products with total purchase of <span class="h8VerdanaBold"><%=totalPurchasedLicenses%></span>
- licenses
- </span>
- </td>
- </tr>
- </table>
- <p>
- If you want to get a combined view of all Forums, please follow this link:
- <a class="h8VerdanaBold" href="<%=JSPRes.path%>/main/mlist/topic.jsp?command=refresh"> [All Forums] </a>
-
-
- <!-- FOOTER -->
- <jsp:include page="footer.jsp" flush="true"/>
-