Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates

Slides:



Advertisements
Similar presentations
Minnesota Department of Education Metadata Registry Case Study Date: October 31 st, 2008 Dan McCreary President Dan McCreary & Associates
Advertisements

Native XML Database or RDBMS. Data or Document orientation If you are primarily storing documents, then a Native XML Database may be the best option.
W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.
Project Implementation for COSC 5050 Distributed Database Applications Lab4.
Using oXygen Using oXygen to build and execute XQuery applications on eXist Date: September 2008 Dan McCreary President Dan McCreary & Associates
Paper by: A. Balmin, T. Eliaz, J. Hornibrook, L. Lim, G. M. Lohman, D. Simmen, M. Wang, C. Zhang Slides and Presentation By: Justin Weaver.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Clarity Educational Community Clarity Educational Community Creating and Tuning SQL Queries that Engage Users.
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
1 Chapter 5: Introduction To Form Builder. 2 Forms  Why Do We Use Form Builder?  Why Don’t We Use SQL Only?!
XML Schema Describing the structure of XML documents. A very brief introduction 1XML Schema.
Creating Web Page Forms
Database Updates Made Easy In WebFocus Using SQL And HTML Painter Sept 2011 Lender Processing Services 1.
5 Copyright © 2009, Oracle. All rights reserved. Defining ETL Mappings for Staging Data.
Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
Overview of XPath Author: Dan McCreary Date: October, 2008 Version: 0.2 with TEI Examples M D.
Create Forms Lesson 5. Software Orientation Creating Forms A form is a database object –enter, edit, or display data from a table or query Providing.
Scott Pinkerton Sample GUI/Application Portfolio 1.
Advanced Forms Lesson 10.
XML Overview. Chapter 8 © 2011 Pearson Education 2 Extensible Markup Language (XML) A text-based markup language (like HTML) A text-based markup language.
Data Access Patterns Some of the problems with data access from OO programs: 1.Data source and OO program use different data modelling concepts 2.Decoupling.
Sample Auto-generated XForms With XQuery Date: 1/17/2009 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
Navigating database with windows forms.. Tiered applications  Provide a means to develop many presentations of the same app  Makes changes to the back.
Styling XForms Using CSS to make your forms look great Date: 10/9/2008 Dan McCreary President Dan McCreary & Associates (952)
Copyright © 2008 Model Driven Solutions EKB User Interface Lab Jim Logan October 2008 Formerly Data Access Technologies.
FireRMS NEMSIS (Part 2) Presented by Laura Small FireRMS Quality Assurance.
Chapter 10 Fireworks: Part II The Web Warrior Guide to Web Design Technologies.
Metadata Management Case Study Date: 10/21/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
Project Implementation for COSC 4120 Database Applications Lab 3.
XRules An XML Business Rules Language Introduction Copyright © Waleed Abdulla All rights reserved. August 2004.
1 Data Warehouses BUAD/American University Data Warehouses.
EXist Indexing Using the right index for you data Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M.
Waqas Anwar Next SlidePrevious Slide. Waqas Anwar Next SlidePrevious Slide XML XML stands for EXtensible Markup Language.
Recursive Functions Creating Hierarchical Reports Date: 9/30/2008 Dan McCreary President Dan McCreary & Associates (952) M.
SITES SOFTWARE APPLICATION SEMINAR __________________________ SITES INTEGRATED DEVELOPMENT ENVIRONMENT for WATER RESOURCE SITE ANALYSIS SITES.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
HTML Forms.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Microsoft Office 2013: In Practice Chapter 4 Creating and Using Forms and Reports Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
Tutorial 13 Validating Documents with Schemas
XRX Basic CRUDS Create, Read, Update and Delete and Search XML Data Date: May 2011 Dan McCreary President Dan McCreary & Associates
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
TOS / TIS Code Architecture Copyright © 2008 Talend. All rights reserved.
SCHEMAS Workshop Bath - May 2000 Andy Powell, UKOLN Example tool/registry integration UKOLN is funded by Resource: The Council.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
© 2008 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Lesson # 9 HP UCMDB 8.0 Essentials.
How to Build an IT Portal with Oracle Application Server Allan L Haensgen Senior Principal Instructor Oracle Corporation Session id:
XQuery Labs Basic Reporting Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
HTML Hyper Text Markup Language. The Basics u HTML documents contain “tags” which instruct the Browser software on how to present the information within.
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
Instance Discovery and Schema Matching With Applications to Biological Deep Web Data Integration Tantan Liu, Fan Wang, Gagan Agrawal {liut, wangfa,
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Connecting to External Data. Financial data can be obtained from a number of different data sources.
1 Chapter 6: Creating Oracle Data Block Forms. 2 Forms  Application with a graphical user interface that looks like a paper form  Used to insert, update,
XML 1. Chapter 8 © 2013 Pearson Education, Inc. Publishing as Prentice Hall SAMPLE XML SCHEMA (XSD) 2 Schema is a record definition, analogous to the.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Lesson # 9 HP UCMDB 8.0 Essentials
Dan McCreary President Dan McCreary & Associates (952) M D
Unit 8.2 How data can be used Accessing Data in Views
Developing a Model-View-Controller Component for Joomla Part 3
Sequences in XQuery Core data structure of XQuery Date: 8/25/2009
Dynamically Updated Publications
XRX Diagrams Application Architecture Diagrams Date: Aug 21st, 2008
Presentation transcript:

Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions

M D Copyright 2008 Dan McCreary & Associates2 Agenda/Objective Why repetition is hard –Dynamic controls –Conditional display of delete trigger for last item in a set –Conditional display of add button for maxOccurs The Tools –Group/ref and Repeat/nodeset Model Supporting Structures –conditional views –bindings Design Patterns –Inline Table Editing –Summary Line/Inspectors

M D Copyright 2008 Dan McCreary & Associates3 Conditional Display of Delete Note: No Delete Button (you can not delete the last item in a list) But you can delete the first item Disable add if we exceed maxOccurs

M D Copyright 2008 Dan McCreary & Associates4 Ref vs Nodeset Ref points to a single node and is used by group and other controls to set the context Nodeset points to a sequence of nodes in is used by the repeat element ref nodeset

M D Copyright 2008 Dan McCreary & Associates5 Schema Derived Presentation Rules XML Schemas describe the cardinality restrictions using two attributes of and element –minOccurs –maxOccurs Never delete the last remaining item in a nodeset. This is needed for the form. You do not need to disable the Add button if the maxOccurs=“unbounded”

M D Copyright 2008 Dan McCreary & Associates6 Sample XML Schema A person has one to many phone numbers Note that in this example you MUST have at lease one phone number but it might be blank This is required by XForms so that the views have some data to map to Null elements sometimes must be added before an instance is loaded into a form

M D Copyright 2008 Dan McCreary & Associates7 XML Instance Home Work Moble Moble Cabin

M D Copyright 2008 Dan McCreary & Associates8 XForms Repeat XPath Query: –/PersonPhones/Phone /* adjust the widths of the text values */.PhoneDescriptionText.xf-value {width: 14ex;}.PhoneNumber.xf-value {width: 24ex;}

M D Copyright 2008 Dan McCreary & Associates9 Steps Create a place to put visibility data (the ‘views’ instance) Create visibility rules with bind elements in the model Bind the screen elements to the rules using a bind ID Link the three components together Delete Bind View Model Form Body Add

M D Copyright 2008 Dan McCreary & Associates10 Conditional Views In the Model We will bind a visibility rule to this element in the model.

M D Copyright 2008 Dan McCreary & Associates11 Binding Delete Trigger <xf:bind id=“Phone-delete-trigger" nodeset="instance('views')/phone-delete-trigger" relevant="instance(‘save-data’')/Phone[2]"/> Delete <xf:delete nodeset="instance('phones')/Phone[index('phone-number-repeat')]" ev:event="DOMActivate"/> The binding rule in the model The delete button inside the repeat loop

M D Copyright 2008 Dan McCreary & Associates12 Disable “Add” at Five Add button view is relevant when count is less than five Disable add button when count is five This prevents the user from adding more items then the XML Schema permits

M D Copyright 2008 Dan McCreary & Associates13 Disable the Add Trigger <xf:bind id=“Phone-add-trigger" nodeset="instance('views')/Phone-add-trigger" relevant="count(instance(‘save-data')/Phone) < 5"/> From the XML Schema we want to build a user interface that will only generate between two and five rows of data. The bind rule will only show user interfaces contorls where there are less then five phone numbers. XML Schema Defintion:

M D Copyright 2008 Dan McCreary & Associates14 The Body Generated Code Phone Numbers Delete Add

M D Copyright 2008 Dan McCreary & Associates15 Model Steps for Auto-generator Find all elements in the entire XML Schema that have repeating structures Create a views instance and for each of the repeating elements, add one element for the delete trigger Create binding rules for each of the instances

M D Copyright 2008 Dan McCreary & Associates16 Body Steps for Auto-generator For each repeatable element –Generate a repeat-loop –Place Delete Triggers on Each Line –Add a Add trigger to the end of the repeat

M D Copyright 2008 Dan McCreary & Associates17 s2f Functions Model: –s2i:conditional-views($schema) –s2i:view-bind-rules($schema) Body –s2i:xforms-body($schema, $schema, ‘’)

M D Copyright 2008 Dan McCreary & Associates18 When We have Repetition We use s2i:repeat($schema, $element) Generates an xf:repeat statement that uses the count of items in the instance to generate user interface elements Works with repeating simple and complex types

M D Copyright 2008 Dan McCreary & Associates19 Code Tables s2f:code-tables($schema) Generates an single of code tables instance in the model that holds all the code tables How it works: –for $enumerated-element in $schema for $code in $enumerated-elements {$label} {$value} Can be easily replaces by a metadata registry- backed XQuery function that includes screen labels

M D Copyright 2008 Dan McCreary & Associates20 Sample XForms Driver <xf:instance xmlns="" id="save-data" src="/exist/rest/db/xrx/modules/test-input-instances/{$my-form}.xml"/> {s2f:code-tables($schema)} {s2f:conditional-views($schema)} {s2f:required-binds($schema)} {s2f:date-binds($schema)} {s2f:indicator-binds($schema)} {s2f:trigger-visability-bind-rules($schema)} {style:header()} {style:breadcrumb()} {s2f:xforms-body($schema, $schema, '')} Save {style:footer()}

M D Copyright 2008 Dan McCreary & Associates21 Thank You! Please contact me for more information: Native XML Databases Metadata Management Metadata Registries Service Oriented Architectures Business Intelligence and Data Warehouse Semantic Web Dan McCreary, President Dan McCreary & Associates Metadata Strategy Development (952)