1 / 28

Automating Metadata Services

Automating Metadata Services. Ozgur Balsoy Community Grids Lab, Indiana University Marlon Pierce, Presenting. XML Metadata Management. Managing metadata is a general problem faced all portals, problem solving environments. EX: Data provenance

acatalano
Download Presentation

Automating Metadata Services

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. Automating Metadata Services Ozgur Balsoy Community Grids Lab, Indiana University Marlon Pierce, Presenting O.Balsoy et al.

  2. XML Metadata Management • Managing metadata is a general problem faced all portals, problem solving environments. • EX: Data provenance • The Community Grids Lab at IU has developed a number of tools for XML metadata management. • Wizard publishers allow you to create and publish XML instances. • JMS-style brokers can be used to both store XML messages persistently and deliver immediately. • Access control systems provide fine-grained topic management. • RSS catalogs allow topic postings to be browsed and searched. • See various running examples at www.xmlnuggets.org. • Newsgroups, bibtex-based citation managers, glossary term managers O.Balsoy et al.

  3. O.Balsoy et al.

  4. Need for Metadata Generation • Applications that guide users through a complicated task are usually called wizards. • XML wizards are applications that receive user inputs to generate XML documents. Such applications with different capabilities are widely available for either freely or commercially. • In our research on XML information frameworks, we help users generate schema-based XML content and publish into a XML messaging broker. • Around the broker, the system allows new applications to plug-in easily; however, each application might require a different schema or a newer version of an older one. • We analyzed the steps to develop and integrate such applications. O.Balsoy et al.

  5. Steps for a Metadata Generator • There were common tasks that we performed for each application: • Design an object model and create a W3C XML Schema to represent it. • Create a memory object model of the schema, i.e. corresponding Java classes. • Design an interface, i.e. HTML forms, for user inputs, and bind the interface with the memory model. • Let users input data. • Finally, generate XML based on input, and publish it. • Given these repetitive tasks, we have developed a general purpose tool that automates the creation of this process. O.Balsoy et al.

  6. SchemaWizard and XML • Schema Wizard maps XML Schema elements to HTML form elements through its schema parser, and creates the framework and logic for an XML form wizard. • Users use newly generated wizards to create and publish XML instances, which follow a schema, to any destinations such as publish/subscribe messaging systems or through SMTP. • XML form wizards are Web applications that also serve as validating XML editors and are customized through schema annotations. O.Balsoy et al.

  7. A Mapping of XML to SchemaWizard Parts SchemaWizard Annotated XML Schema SchemaParser input of generates follows outputs XML Instances XML FormWizard edited SchemaWizard and XML O.Balsoy et al.

  8. SchemaWizard Architecture • Schema Wizard (SW) is composed of three major parts: • A Web application package with necessary libraries and directory structure that serves as an application template; • A SchemaParser that process W3C XML Schemas and builds the final XML form wizard; • Velocity Macro templates that contain the view and the logic for the wizard. O.Balsoy et al.

  9. SchemaWizard Architecture • The steps that take place in generating a XML form wizard • The Schema Wizard unpacks and deploys the Web application package into a Web server’s application repository (i.e. webapps under Tomcat). • User provides with a location of the Schema. • The Schema is read in to create an in-memory representation (SOM) of the schema and also to create Java classes. • SOM=Castor’s Schema Object Model • SOM API provides a convenient interface to access the W3C XML Schema structures. • Using the SOM, Castor SourceGenerator creates Java classes that correspond to the Schema structures. These classes form the memory model (i.e. Javabeans for JSP) and come with the necessary framework to parse and regenerate (marshal and unmarshal) XML instances. • Java classes are compiled, and binaries are placed into the new project’s directory structure. O.Balsoy et al.

  10. Annotated XML Schema Castor Schema Unmarshaller Castor SourceGenerator Castor SOM Web Application Template Schema Parser JavaBeans Velocity Templates Java Compiler Libraries Classes JSPs XML Form Wizard created as a Web Application SchemaWizard Architecture (2) (3) (6) (4) (7) (1) (5) (8) O.Balsoy et al.

  11. SchemaWizard Architecture • The steps that take place in generating a XML form wizard (cont.) • Using the SOM once again, SchemaParser traverses the in-memory schema and collects structure information, i.e. names, types, whether element or attribute, complex or simple type. • Based on this information, the parser chooses what type of template will be used, stores the information in a Velocity context, and invokes the template engine to generate the program logic presented in JSP. The parser also gathers the Schema annotations, i.e. page color, input sizes, at this level and place the parameters in the context. • The engine runs on templates placing each JSP code in its directory, creating the interface based on the user schema. O.Balsoy et al.

  12. Schema object Individual types JavaBeans info Castor SOM Velocity context with type info Templates Context, template JSP SchemaParserData Flow and Action Traverse schema for types Collect type information, create a context Decide template: Project page Index page Simple type Enumerated simple type Unbounded simple type Complex type Unbounded complex type Velocity Template Engine O.Balsoy et al.

  13. Velocity Template Example <tr><td> ## if numbers is requested, then print out the leading numbers, ## i.e. 1. , 2.2, 3.4.2 #if ($numbers) <%= ((Leveler)request.getAttribute("_leveler")).increase()%> #end $label</td> <td> <select name="$name"> <option value="<%=REMOVE%>"><%=REMOVE%></option><% // print out option. select the one that matches in-memory value for(int i=0; i< values.length; i++) { String enm = values[i]; %> <option value="<%= enm %>"<%= (value != null && value.equals(enm)) ? " SELECTED" :"" %>><%= enm %> </option><% } %> </select> </td> </tr> O.Balsoy et al.

  14. XML Schema location is given to SchemaWizard. XML Form Wizard is generated. XML instance is marshaled. O.Balsoy et al.

  15. Schema Annotations • Users can make cosmetic changes for the final project beforehand with annotations in the schema. • W3C XML Schema allows developers to embed user defined languages into the schema using <xs:annotation> and <xs:appinfo> structures. • Annotations for the whole schema affects the whole page, i.e. page title, background color, default input sizes, leading numbers on and off, XML browsing on and off. <xs:annotation> <xs:appinfo source="title">SchemaWizard Output for Topics Schema </xs:appinfo> <xs:appinfo source="inputsize">30</xs:appinfo> <xs:appinfo source="bgcolor">#e0e0ff</xs:appinfo> <xs:appinfo source="leadingnumbers">false</xs:appinfo> <xs:appinfo source="showxml">true</xs:appinfo> </xs:annotation> O.Balsoy et al.

  16. Schema Annotations • Annotations for individual structures override the schema annotations, i.e. input size for each element. Also, labels for each element can be defined, and input fields can be changed to larger text areas with a textarea parameter and row numbers, or to password fields by a password parameter whose value set to true. <xs:annotation> <xs:appinfo source=“label">User Password</xs:appinfo> <xs:appinfo source="inputsize">15</xs:appinfo> <xs:appinfo source=“password">true</xs:appinfo> </xs:annotation> … <xs:annotation> <xs:appinfo source=“label">Memo</xs:appinfo> <xs:appinfo source=“textarea">5</xs:appinfo> </xs:annotation> O.Balsoy et al.

  17. Title set Smaller input size Textarea, row count set to 5 Unbounded element with its own add/delete buttons XML browsing turned on Background set to gray O.Balsoy et al.

  18. XML Form Wizard • The final products of the Schema Wizard are XML Form Wizards that help users to create XML instances. • The Wizards are Web applications compliant with the JSP standards. • Each application is built around a form page. • Each schema element is mapped to a self-contained JSP nugget. • JSP nuggets are generated from templates. • One template for each element type (simple, complex, enumerated, unbounded,….). • Velocity is used for convenient scripting of JSP. • The final JSP page is an aggregate of the JSP nuggets files (using <%@:include>). • Complex schema elements are mapped to JavaBeans generated from the schema with Castor. • Scripting templates set up the imports O.Balsoy et al.

  19. Project Page • create a session • initialize the environment • retrieve an XML instance list • Complex Types • create a complex type bean • include sub elements • if submitted, validate the content New command • Index Page • create a root element bean as new or from existing XML • include sub element pages • if submitted, validate the bean content • if editing is complete, generate XML includes includes list XML instance • Simple Types • if parent bean has data, display content for this type (or property) using a form element • if form is submitted, update the parent bean for this type XML XML Form Wizard O.Balsoy et al.

  20. URLs and Contact • Project Site: http://ptlportal.ucs.indiana.edu/schemawizard. • Email: Ozgur Balsoy, obalsoy@indiana.edu. O.Balsoy et al.

  21. Web Services Invocation Methods • Static • A local WSDL • A stub generator, e.g. wsdl2java utility • A programmer, generate stub code and make changes • Dynamic • Generate web-based interface and make SOAP call on the fly O.Balsoy et al.

  22. Why WSDI • WSDI – Web Services Dynamic Invocation O.Balsoy et al.

  23. What is WSDI • Is a Java application based on Apache Axis and Tomcat • Makes use of WSDL and WSIL technology • Provides transparent environment for web services invocation • Generates JSP interface dynamically O.Balsoy et al.

  24. A Sample SOAP Call – echo // Input data from the user textToSend = “Hello World!”; // Setup the TargetEndpointAddress call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.setOperationName( new QName("MyService", "serviceMethod") ); // I/O information for operations, // type mapping will be required for complex type call.addParameter( "arg1", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING); // Make the SOAP call ret = (String) call.invoke( new Object[] { textToSend } ); O.Balsoy et al.

  25. WSDL abstract definition Interface definition type of message and operation concrete information Implementation bindings port and binding protocol Implementation • WSDL plays the most import role Source of web services WSIL WSDL WSDL complete information of service Axis SOAP calls O.Balsoy et al.

  26. Components • Four important components • WSDL Parser • gets the I/O information of each service • GhostWSDL Parser • Parses the WSDL to schema format • Schema Wizard • generates the user interface and gathers the input data • User Data Parser • Simple type: parses the users’ data to its corresponding Java value • Complex type: uses data to instantiate the Java object class which generated by Schema Wizard O.Balsoy et al.

  27. Components(cont.) WSDL Document I/O information of the service WSDL Parser WSDL Document GhostWSDL Parser Service Invocation GhostWSDL Schema Wizard XML with User Data User Data Parser User Data O.Balsoy et al.

  28. Architecture O.Balsoy et al.

More Related