MullinsFinalPresenta..

296 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
296
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • TurboRep is an all encompassing software solution that incorporates all facets of job tracking and management. Specifically designed for HVAC sales agencies, TurboRep began sales in 2000 and has customers across the United States. The software, written with Visual Basic 6, utilizes a SQL database to manage the more than seventy individual tables required to handle TurboRep. The software also offers over fifty unique reports that track everything from job cost analysis to employee tax payments to date.
  • Essentially, certain venders required the sales reps to use their software. To track these items inside TurboRep a sales rep would have to reenter the order into TurboRep. Management at TurboRep wanted an easy way to resolve this situation and since the vender software created XML images of each order we could take advantage of that.
  • Here is a very small order that was made via the vender software, only a small fraction of the data represented here was needed for TurboRep.
  • To resolve the issues I had to complete the following plan. In the beginning I had never had to work within an XML document. Research a means on which to connect to an XML document using VB6. Read through the document extracting only desired data. Saving the data to the SQL database once complete. Make the operation as simple as a push of a button for the user.
  • My research showed that to connect to an XML document I would want to implement DOMDocument. This allows the XML document to be viewed as a tree structure which allows a user to search the document through the nodes. Firstly I create document variable Next I set the document Finally I load the path of the document Once connected I could query any node I wished. I give two examples, one that tells me number of fans there are, the second tells me the value of the attribute of the respected fan.
  • Here I just explain that I loop through the document getting the appropriate data and that the next slide contains sample code.
  • This sample shows an example of where a connection to the document is completed followed by a for loop and case statement. This portion of code tells me where the respected product type is located and how many there are. This is necessary for when I actually collect all the data to be moved over.
  • This and the next few slides show the entire process in action. Firstly the user selects the vendor button.
  • Next the user will choose the “Purchase Order” option as this is where all vendor orders are entered and reviewed.
  • From here the user chooses to create a new purchase order to import the data.
  • First item for the user to add to the purchase order is the vendors name, this will trigger the import button
  • With the venders name in place the import button appears and at the push of the button the import begins.
  • The user is prompted to choose the appropriate file from a designated folder.
  • Once a file has been selected the import completes and prompts the user to save the purchase order. Saving of the purchase order completes the moves of data imported from the XML document to TurboRep.
  • Here is the finished product. All the items, and their appropriate accessories, have been imported into TurboRep with their respective prices.
  • There are a few things I would have done differently if I had to do it All over: I statically coded the locations of the data that needed to be imported, feeling pressed for time I did this. I would have created a few locating loops to find the necessary data using the node names. I also would like to create a function that would add any product not present in TurboReps product table, this would have allowed me to use the individual product key rather than a generic part descriptor key.
  • MullinsFinalPresenta..

    1. 1. XML Importing CS 8630 Database Administration, Sean Mullins Extracting Data From XML: A Module for TurboRep, Inc. By Sean Mullins XML
    2. 2. XML Importing CS 8630 Database Administration, Sean Mullins TurboRep is an all encompassing software solution that incorporates all facets of job tracking and management. Specifically designed for HVAC sales agencies, TurboRep began sales in 2000 and has customers across the United States. The software, written with Visual Basic 6, utilizes a SQL database to manage the more than seventy individual tables required to handle TurboRep. The software also offers over fifty unique reports that track everything from job cost analysis to employee tax payments to date. TurboRep Back Ground
    3. 3. XML Importing CS 8630 Database Administration, Sean Mullins Current customers of TurboRep that use vendor software to place orders are required to double their work load by entering the order into both the vendor software and TurboReps’ in effort to track the job. This may seem like a trivial amount of work but it is not when you consider the average order requires thirty or more line items, not including line item notes. Currently there is no means to efficiently move the data from vendor software to TurboRep. The vendor software conveniently stores the order data locally to the users machine in the form of an XML document. The next side displays a sample of such a document. TurboRep Problem
    4. 4. XML Importing CS 8630 Database Administration, Sean Mullins
    5. 5. XML Importing CS 8630 Database Administration, Sean Mullins The Plan <ul><li>Research a means on which to connect to an XML document using VB6. </li></ul><ul><li>Read through the document extracting only desired data. </li></ul><ul><li>Saving the data to the SQL database once complete. </li></ul><ul><li>Make the operation as simple as a push of a button for the user. </li></ul>
    6. 6. XML Importing CS 8630 Database Administration, Sean Mullins Connecting to an XML Document: DOMDocument <ul><li>DOMDocument allows the XML document to be viewed in a tree structure, i.e. parent/child nodes. </li></ul><ul><li>Create, set and load a DOMDocument variable. </li></ul><ul><li>DIM xmlDoc As DOMDocument </li></ul><ul><li>SET xmlDoc = New DOMDocumnet </li></ul><ul><li>xmlDoc.Load c:/my/path/xmlDocument.xml </li></ul><ul><li>Once connected to the document, I can attain any attribute value or count of any parent or child node. </li></ul><ul><li>fanCount = xmlDoc.firstChild.childNodes(i).childNodes.length </li></ul><ul><li>FanModel = xmlDoc.firstChild.childNodes(Fan).childNodes(i).Attributes(18).nodeValue </li></ul>
    7. 7. XML Importing CS 8630 Database Administration, Sean Mullins Process continued: <ul><li>After a successful connection, several methods are used that loop through the parts and accessories stored in the XML document that extract appropriate data, i.e. product code, description, line item notes, quantity ordered and unit costs. </li></ul><ul><li>The next slide shows a piece of sample code I created that attains the location of the location of two possible product types and the number of each product. </li></ul>
    8. 8. XML Importing CS 8630 Database Administration, Sean Mullins Dim xmlDoc As DOMDocument Set xmlDoc = New DOMDocument xmlDoc.Load docselection kidcount = xmlDoc.firstChild.childNodes.length For i = 0 To kidcount - 1 child = xmlDoc.firstChild.childNodes(i).nodeName Select Case child Case &quot;Fans&quot; fanCount = xmlDoc.firstChild.childNodes(i).childNodes.length fanParentValue = i thereareFans = True Case &quot;Parts&quot; partCount = xmlDoc.firstChild.childNodes(i).childNodes.length partParentValue = i thereareParts = True Case Else unknownChild = True End Select Next i <ul><li>The next slides display the module in action as outlined in the users guide created for the module. </li></ul>
    9. 9. XML Importing CS 8630 Database Administration, Sean Mullins From the main menu choose the vender button located to the left.
    10. 10. XML Importing CS 8630 Database Administration, Sean Mullins From the vendor menu choose the “Purchase Orders” option.
    11. 11. XML Importing CS 8630 Database Administration, Sean Mullins From here choose the “New” option to create a new purchase order.
    12. 12. XML Importing CS 8630 Database Administration, Sean Mullins From here enter a vendor, “Penn Ventilation” for example.
    13. 13. XML Importing CS 8630 Database Administration, Sean Mullins Next click the “Import PO” button to choose a document.
    14. 14. XML Importing CS 8630 Database Administration, Sean Mullins Next choose an the appropriate XML file to be imported, “TestData” in this example.
    15. 15. XML Importing CS 8630 Database Administration, Sean Mullins Next save the changes to complete the import, the disk icon.
    16. 16. XML Importing CS 8630 Database Administration, Sean Mullins Import Complete!
    17. 17. XML Importing CS 8630 Database Administration, Sean Mullins <ul><li>Looking back on the project I would do a few things differently. </li></ul><ul><li>Firstly rather than statically code the node locations of the product attributes I would implement a more dynamic means of searching by using attribute names rather than the location. This would prevent any loss of use in the event of the XML structure changing. </li></ul><ul><li>I would have liked to add a function that would add the new products to the products table rather than generating the generic code and using it. </li></ul>Hindsight:
    18. 18. XML Importing CS 8630 Database Administration, Sean Mullins The End

    ×