<%@page import="javax.jdo.*,java.util.Iterator,PrjPackage.*"%> <%@page isThreadSafe="false" %> <%-- more efficient and safe in a website which is not too loaded --%> Choose Category Name <%PersistenceManager pm = WebAppMgr.getPersistenceManager();%> <%try{ System.setProperty("proxySet", "true"); System.setProperty("proxyHost", "10.0.1.254"); System.setProperty("proxyPort", "8080"); String btnDeat = request.getParameter("SubmitDeat"); String btnPad = request.getParameter("SubmitPad");%> <% if(request.getParameter("CategoryId")!= null && "Add".equals(btnDeat)) { String programName = (request.getParameter("programName").trim()); String companyUrl = request.getParameter("companyUrl").trim(); String programVersion = request.getParameter("programVersion").trim(); String programCost = request.getParameter("programCost").trim(); String programFileSize = request.getParameter("programFileSize").trim(); String description = request.getParameter("description").trim(); if (! "".equals(programName) && !"".equals(companyUrl) && ! "".equals(programVersion) && !"".equals(programFileSize) && !"".equals(description) && !"".equals(programCost)) { try{ pm.currentTransaction().begin(); Object id = pm.newObjectIdInstance(Category.class,request.getParameter("CategoryId")); Category dir = (Category)pm.getObjectById(id, true); Item item=new Item(programName,programVersion,companyUrl,description,programCost,programFileSize); dir.AddNewItem(item); pm.currentTransaction().commit(); %>
Item File Has Been added Successesfuly !
<% } catch(Exception x) { %>
Problem With Building The Item !!!
<%} } else{%>
Please Fill all The Fileds
<%} }%> <% if("Add".equals(btnPad)) { if(("".equals(request.getParameter("xml").trim()))==false) { try{ pm.currentTransaction().begin(); Object idXmlPad = pm.newObjectIdInstance(Category.class,request.getParameter("CategoryIdUrl")); Category dirXmlPad = (Category)pm.getObjectById(idXmlPad, true); Item item=new Item(request.getParameter("xml")); dirXmlPad.AddNewItem(item); pm.currentTransaction().commit(); %>
Pad File Has Been added Successesfuly !
<% } catch(Exception x) {%>
Incorrect Pad File !!!
<%} } else{%>
Fill The Url Field !
<% } } %>

 

Contact Form

 

---------------------------------------------------------------------------------------------------------------------------

Choose Category Name

Enter a Url Of a Pad File

                                                 

---------------------------------------------------------------------------------------------------------------------------

Choose Category Name

Enter The Program Name

Enter The Company URL

Enter The Program Version

Enter The Program Cost

Enter The Program Size (Kb)

Type a short description of the program.(max 80 characters) :

 

                                                 

-------------------------------------------------------------------------------------------------------------------------

Back To Home <%} finally{ if(pm.currentTransaction().isActive()) { pm.currentTransaction().rollback(); } pm.close(); }%>