Oracle9i XML Product Catalog Application


Description of Sample Files


Directory File Name Description
ProductCatalog\jsps Welcome.jsp

This page is the Home page of the Product Catalog Application. If offers three options to enter into the application. Adminstration will allow insertion, updation and deletion of Categories and Products. Browse option will allow to browse through the Catalog to view all products. The Search option will allow search on the Catalog

TitleFrame.jsp This page forms the title frame of the application which displays the Application name as gif image.
AdminMain.jsp This page implements Administrative features by including three frames: TitleFrame; LeftFrame which holds all the administrative options; and contentsFrame where the user input for managing the Catalog is accepted. Note: Catalog updation ai not allowed.
AdminLeft.jsp This page is part of the Product Catalog Application implementing the administrative feature. Various options for the category/Product addition, updation and deletion is displayed. The home page link will take the user back to CatalogMain page.
CategAdd.jsp This page is part of the Administrative option of the Product Catalog Application. This will basically take user inputs for creating a new category. The user input for the Product Schema has two options. The user can either directly upload a local file using 'Browse' button or include the schema in the text area provided. When the user presses 'Add Category' button, CategInsGetFileContent.jsp is called. If the user uploads a file for the schema, the file content is read in CategInsGetFileContent.jsp, else it is read from the text area.
CategInsGetFileContent.jsp
This page is part of the administrative option of the Product Catalog Application. This will read the uploaded file if any to read the product schema. The bean which will read the file content, is the 'FileUpload' class. Here, jsp:forward tag is used to call CategInsert.xsql page. The product schema, category name and description are passed as parameters. The CategInsert.xsql will use an action handler class CategInsertHandler to insert the new category into the database.
CategDelete.jsp This page is part of the administrative option of the Product Catalog Application. This will delete the selected category from the database. Category list is obtained by including the CategoryList.xsql page in the form. When the user selects a category and presses 'Delete' button, Cateogory id is passed as a parameter to CategDelete.xsql. CategDelete xsql will call the CategDeleteHandler XSQL action handler class to do the deletion in the database.
ProdAdd.jsp This page is part of the administrative option of the Product Catalog Application. This will basically take user inputs for creating a new Product for a selected category. The user input for the Product information which is an XML document has two options. The user can either directly upload a local file using 'Browse' button or include the XML document in the text area provided. When the user presses 'Add Product' button, ProdInsGetFileContent.jsp is called. If the user uploads a file for the schema, the file content is read in ProdInsGetFileContent.jsp, else it is read from the text area.
ProdInsGetFileContent.jsp This page is part of the administrative option of the Product Catalog Application. This will read the uploaded file if any to read the product information XML document. The application uses 'FileUpload' bean class to read the uploaded file content. Here, jsp:forward tag is used to call ProductInsert.xsql page. The product XML document, Product name and description are passed as parameters. The ProductInsert.xsql will use an action handler class ProductInsertHandler to insert the new Product into the Category_Products table in the database.
ProdUpdateMain.jsp
This page is part administrative option of the Product Catalog Application for Product update. This creates two frames: UpdateFrame where the product is selected for update. UpdateResultsFrame is where the the product information is entered for update.
UpdateEnter.jsp This page is part of the administrative option of the Product Catalog Application. This page has two lists: Category list and Product list. This is displayed by including two xsql files: CategoryList.xsql and ProductList.xsql respectively. Initially, the Products Lists is empty. The 'Fetch Products' button will call ProductList.xsql with a passed parameter: category id. This will get all products for that category id. 'Get Product Information' button will call GetProdInfo.xsql, which will query the database table category_products to fetch the product data. The GetProdInfo.xsl will transform the xml data obtained from GetProdInfo.xsql and displays the data in UpdateResultsFrame.
ProdUpdGetFileContent.jsp
This page is part of the administrative option of the Product Catalog Application. This will read the uploaded file if any to read the product information XML document. The bean which will read the file content, is the 'FileUpload' class. Here, jsp:forward tag is used to call ProductUpdate.xsql page. The productid, product XML document, Product name and description are passed as parameters. The ProductUpdate.xsql will use an action handler class ProductUpdateHandler to update the Product in the Category_Products table in the database.
UpdateResults.jsp This page is part of the Product update option of the Product Catalog Application. This page is replaced by the results of the update.
ProdDelete.jsp This page is part of the administrative option of the Product Catalog Application. This will delete the selected Product of the selected category from the database. Category list is obtained by including the CategoryList.xsql page in the form. The product list is obtained by inlcuding ProductList.xsql page which takes in category id as the parameter. The user selects a category and presses 'Fetch Products' button. This will fetch all the products to the Product list. 'Delete' button when pressed, will call ProductDelete.xsql to which Productid is passed as parameter. The ProductDelete.xsql will call the ProductDeleteHandler XSQL action handler class to do the deletion in the database.
BrowseMain.jsp
This page defines the Browse frames of the Product Catalog Application. It has two frames. 'BrowseChoose' frame is where the user chooses what is to to be viewed. The 'BrowseResults' frame will show the results of the choice.
BrowseChoose.jsp This frame implements the Browse option of the Product Catalog Application. The frame has two buttons: 'View All Products' and 'View Products in PDF Document'. 'View All Products' when pressed will call ProductsLink.xsql page which displays all the products for the selected category as links in the below frame. These are db-uris generated from ProductsLinks.xsql page. 'View Products in PDF Document' when pressed will call ProductPDF.xsql page which renders all the products for the selected category in a PDF document in the bottom frame.
BrowseResults.jsp This page is part of the Browse option of the Product Catalog Application. This page is replaced by the results of the browse.
SearchMain.jsp This page defines the search frames for the Product Catalog Application. It creates two frames. SearchEnter is where the user enters the search criteria to search; SearchResultsFrame is where the results of the search are displayed.
SearchEnter.jsp This page is part of the Product Catalog Application for implementing search. User has to put in data to search for the products. The user can put in the node value to search and enter condition on the node to be searched. There are two buttons: Search and Create Index. Search button when pressed will search on the node matching the entered node value. The results of this is shown in the frame below.
SearchResults.jsp This jsp is part of Product Catalog application. This is the page where the results of the search are shown to the user.
ErrorHandler.jsp This is the JSP error page to which is used by the application to display all the jsp errors.
ProductCatalog\docs *.html The files in this folder include the Readme and Install files for this sample application.
ProductCatalog\images *.gifs The files in this folder include the gif files that are used by the JSPs.
ProductCatalog\sql CreateTables.sql This SQL batch file is used for creation of the objects required for running of the sample.
ProductCatalog\java CategDeleteHandler.java This is the java Custom Action Handler class called from CategDelete.xsql for deleting given category from the Categories table in the database. The database connection management is done using the cusotm action handler factory class: MyXSQLConnectionManagerFactoryImpl.java. CategId is sent as the parameter to the action handler from the xsql page.
CategInsertHandler.java This is the java Custom Action Handler class which is called from CategInsert.xsql for insertig a new Category information into the database. This will make use of the custom connection implemented by MyXSQLConnectionManagerFactoryImpl class. The Category is inserted to Categories table in the database.
FileUpload.java This is the java class to read the file contents when it uploaded from a JSP. This is called from the jsps: CategInsGetFilecontent.jsp, ProdInsGetFilecontent.jsp and ProdUpdGetFilecontent.jsp.
ProductDeleteHandler.java This is the java Custom Action Handler class called from ProductDelete.xsql for deleting given product from the Category_products table in the database. This will make use of the custom connection implemented by MyXSQLConnectionManagerFactoryImpl class. prodId is sent as the parameter to the action handler from the xsql page.
ProductInsertHandler.java This is the java Custom Action Handler class which is called from ProductInsert.xsql for insertig a new Product information into the database. This will make use of the custom connection implemented by MyXSQLConnectionManagerFactoryImpl class. Before inserting the product information, this class also check for validity of the XML document of the product to the schema it is associated with. If the XML document does not adhere to its XML schema, an error is thrown and product is not inserted. Else, the product is inserted.
ProductUpdateHandler.java This is the java Custom Action Handler class which is called from ProductUpdate.xsql for updating Product information in the database. This will make use of the custom connection implemented by MyXSQLConnectionManagerFactoryImpl class. Before updating the product information, this class also check for validity of the XML document of the product to the schema it is associated with. If the XML document does not adhere to its schema, an error is thrown and product is not updated. Else, the product is updated.
MyXSQLConnectionManagerFactoryImpl.java This is the java factory class used by the XSQL pages to create instances of MyXSQLConnectionManagerImpl class for use by the current request.
MyXSQLConnectionManagerImpl.java This is the java Custom connection Manager class used by the XSQL pages to make database connection. By default, all connections are read from XSQLConfig.xml that resides in the %oc4j_home%/j2ee/home/lib directory. This exposes the username and password. To override this, this class creates the database connection by using the username and password in the class thus securing the sensitive information.
ProductCatalog\xml   CategoryList.xsql This XSQL page queries the database to get the category list from Categories table
  CategoryList.xsl This will transform the xml data from CategoryList.xsql into drop down list in the html form.
  ProductList.xsql This XSQL page queries the database to get the Product list from Categories table for the passed category id.
  ProductList.xsl This will transform the xml data from ProductList.xsql into drop down list in the html form.
  CategDelete.xsql This will delete the category from the Categories table. Category id is passed as parameter.
  CategDelSuccess.xsl This will show the successful category delete message
  CategInsert.xsql This will call the action handler CategInsertHandler.class to insert a new category inside the database. This takes in category name, description and product schema as parameters.
  CategInsSuccess.xsl This will show the successful category insert message
  CategProdInfo.xsql This XSQL page queries all categories and the products in each category. It uses the media attribute to assign different stylesheets based on the user agent. This XSQL page assigns stylesheets for Netscape 4.x, 6, IE, Palm device and WML.

  CategProdInfo_ns4.xsl
  CategProdInfo_ns6ie.xsl
  CategProdInfo_palm.xsl
  CategProdInfo_wml.xsl

Different stylesheets for different user agents like Netscape, Internet Explorer, Palm Pilot, WAP browser. Used in CategProdInfo.xsql.
  ProductInsert.xsql This will call the action handler ProductInsertHandler.class to insert a new Product inside the database. This takes in Product name, description and product xml data as parameters.
  ProdInsSuccess.xsl This will show the successful Product insert message. If there are errors, they will be displayed.
  ProductUpdate.xsql This will call the action handler ProductUpdateHandler.class to update a selected product inside the database. This takes in Product name, description and product xml data as parameters.
  GetProdInfo.xsql This will get the information of the selected product from the database.
  GetProdInfo.xsl This will transform the xml data from GetProdInfo.xsql to html form so that the user can change the values.
  ProdUpdSuccess.xsl This will show the successful Product update message. If there are errors, they will be displayed.
  ProductDoc.xsql This will get the details of all the products for the selected category. The output is transformed to be displayed in an Excel file or as a WML document
  Product Excel.xsl This will transform the XML output of ProductDoc.xsql to an Excel document.
  ProductWml.xsl This will transform the XML output of ProductDoc.xsql to a WML document. This document can be viewed in a WML/WAP enabled browser.

 

Back to Readme

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy