1 / 35

The GUS Web Development Kit (WDK)

The GUS Web Development Kit (WDK). Starting with the WDK Model. Overview. WDK Goals What is the “model” User’s perspective Implementation. Overall WDK Goals. Ease the development of Query and Record based web sites (What about data input sites like StudyAnnotator?)

hazelc
Download Presentation

The GUS Web Development Kit (WDK)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The GUS Web Development Kit (WDK) Starting with the WDK Model

  2. Overview • WDK Goals • What is the “model” • User’s perspective • Implementation

  3. Overall WDK Goals • Ease the development of Query and Record based web sites • (What about data input sites like StudyAnnotator?) • Site authors use declarative specifications • Substantial reuse across projects • Model • View • Use industry standard technologies

  4. History • A re-design of the WDK-Classic (Crabtree) • Used for PlasmoDB, EPConDB, AllGenes • Incorporating ideas of CBIL’s CSP (Schug, Fischer, Crabtree) • “CBIL Style Police” • An abstraction of Parameter acquisition dialogues • Incorporating ideas from PageMaker (Schug)

  5. Model-View-Controller (MVC) Design • The Model describes the data • The View displays it • The controller • Directs program flow based on the user’s action • Updates the model accordingly • The View knows about the Model • But, not vice versa

  6. MVC - Courtesy of Google Images

  7. Why is MVC important? • By defining the Model separately we: • Understand it better • Don’t pollute it with View implementations • Don’t commit to any particular view • By defining the View separately we: • Can write multiple views • Have multiple views operate in one application • Don’t pollute the view with Model logic

  8. The WDK Model – what’s in it?(so far) • Queries • Parameters • Results • Tables • Records • Primary Key • Fields • Tables

  9. AllGenes Query

  10. AllGenes Result

  11. AllGenes Record

  12. The Flow of a Query TABLE w/ MAIN RESULT 12344 23324 4344 343344 373422 4444 44444 35555 09734 23477 424 342477 9823 2783247 Dialogue GeneName: Species: GoFunction: Page of Details 4344 Blah blah blah 343344 blah blah blah 373422 blah blah blah Main Query Page Query params rows Record DT.373422 Mouse Brca1

  13. Pageable Query(Encapsulates two queries) TABLE w/ MAIN RESULT 12344 23324 4344 343344 373422 4444 44444 35555 09734 23477 424 342477 9823 2783247 Dialogue GeneName: Species: GoFunction: Page of Details 4344 Blah blah blah 343344 blah blah blah 373422 blah blah blah Main Query Page Query Record DT.373422 Mouse Brca1 params rows

  14. See sample file… classic.config How was this specified in WDK-Classic?

  15. The New WDK Uses JSP for the View • JSP looks like HTML but, embeds calls to JavaBean objects. • The reverse of how we used to make dynamic web pages: • Instead of the Java/Perl formatting the HTML, the HTML calls the Java • See file… simpleQueryDemo1.jsp

  16. A WDK Query Model in XML • <wdkModel> • <simpleQuerySet> • <simpleQuery> • <param> • <pageableQuerySet> • <pageableQuery mainQuery=q1 pageQuery=q2>

  17. Take a look at the real XML • See file… sampleQuerySet.xml

  18. Test the Model - without the view! • Three commands to test a model that you are creating • wdkXml – parses and checks the XML • wdkQuery – runs a Query • wdkRecord – retrieves a Record

  19. wdkXml • Parses and checks the Model XML file • Prints out the model • See file… wdkXml_output.txt

  20. wdkQuery • Tests a query found in a ModelXML file • Can run a SimpleQuery or a PageableQuery • See file… wdkQuery_output.txt

  21. Records - What are They? • They tell about an entity • Parameterized by a primary key (eg DT.xxxx) • Have: • Fields • A column from a Query • A block of text • Tables • A result from a query

  22. AllGenes Record Again Tables Fields

  23. A WDK Record Model in XML • <wdkModel> • <simpleQuerySet> • <simpleQuery> • <param> • <wdkModel> • <simpleQuerySet> • <simpleQuery> • <param> • <column> • <recordSet> • <record> • <tableQuery reference> • <fieldQuery reference> • <textField>

  24. Take a Look at the Real XML • See file… sampleRecordSet.xml

  25. wdkRecord • Tests a Record found in an XML file • See file… wdkRecord_output.txt

  26. ConfigFile (XML) • A little XML file configures the model • Specifies site-specific stuff • (the Model XML is not site specific) • See file… sampleModelConfig.xml

  27. Upcoming (major) Features • DTD/XMLSchema for Model XML? • Import model files into each othe • ParamSets • Boolean Queries • Query History • Flat file queries • Process queries • Allow multiple PageQueries in PageableQueries • Define special data types to handle eg URLs • Nested results (eg Gene-Centrism) • Lots of param types (hierarchy, …)

  28. Implementation • Uses Java Interfaces to abstract away SQL details • Clear definition of what is public (ie, visible to view)

  29. UML

  30. Third Party Resources • From Jakarta: • Command Line Interpreter • XML Digester • Connection Pool • Logging

  31. Digester • A very convenient way to transform XML into JavaBeans Objects • See file… ModelXmlParser.java

  32. Command Line Interpreter (CLI) • A Java equivalent to Getopt in Perl • Parses command line args • Produces nice Usage • See file… wdkQuery_usage.txt

  33. Quick Look at Accessing the Model • public ResultSet getResult(String querySetName, String queryName, • Hashtable paramHash, • boolean useCache) throws Exception, QueryParamsException { • SimpleQuerySet simpleQuerySet • = wdkModel.getSimpleQuerySet(querySetName); • SimpleQueryI query = simpleQuerySet.getQuery(queryName); • SimpleQueryInstanceI instance = query.makeInstance(); • instance.setIsCacheable(useCache); • instance.setValues(paramHash); • return instance.getResult(); • }

  34. The QueryInstance Table • Previously known as “the cache” • Captures details of a QueryInstance: • Query name • Parameter values • Link to table holding result • Used for caching and/or pageable queries • wdkCache • Program to create, reset and drop a cache

  35. JavaDoc Take a tour of the Java API See files… wdkjdoc/index.html

More Related