XRX Basic CRUDS Create, Read, Update and Delete and Search XML Data Date: May 2011 Dan McCreary President Dan McCreary & Associates

Slides:



Advertisements
Similar presentations
Mercury Quality Center 9.0 Training Material
Advertisements

Publication Module using back end interface. Institution Data Entry Add Documents. Edit/Delete Documents that are added but not yet sent to Institution.
Using the Self Service BMC Helpdesk
Recruitment Booster.
PantherSoft Financials Smart Internal Billing. Agenda  Benefits  Security and User Roles  Definitions  Workflow  Defining/Modifying Items  Creating.
Accessing and Using the e-Book Collection from EBSCOhost ® When an arrow appears, click to proceed to the next slide at your own pace. To go back, click.
OpenCMS and the MSASS Website. A Note on Terminology Locking a file for editing: No lockNOT locked You have write/edit access Someone else has write.
Library Online Catalog Tutorial Pentagon Library Last Updated March 2008.
Guide to using the myNATE website
HELP GUIDE NEW USER REGISTRATION (SLIDE 2) TAKING A QUIZ (SLIDE 8) REVIEWING A QUIZ (SLIDE 17) GROUP MEMBERSHIP (SLIDE 26) CREATING QUIZZES (SLIDE 31)
Using oXygen Using oXygen to build and execute XQuery applications on eXist Date: September 2008 Dan McCreary President Dan McCreary & Associates
Resource Discovery Module DigiTool Version 3.0. Resource Discovery 2 Deposit Approval Search & Index Dispatcher & Viewers Single & Bulk Web Services DigiTool.
Aspect-Oriented Software Development (236601) 1 Home Assignment (what, where and when)
SETUP AND CONFIGURATIONS WEBLOGIC SERVER. 1.Weblogic Installation 2.Creating domain through configuration wizard 3.Creating domain using existing template.
Introduction to EBSCOhost E-Books Access to thousands of e-books! Available 24/7!
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Compliance Assist Refresher Instruction Guide Adding or Editing Unit/College Strategic Goals.
Agenda Overview 2.What is SharePoint? 3.NCDOT Websites 4.Roles 5.Search 6.SharePoint Interface.
Overview and key features.  Each page will be embedded SEO friendly tag  Tags are editable for users.
Student Discipline. C4A-DI01:Student Discipline Agenda: -Create/update Incident Log and escalation to HEP -Conduct counselling, escalate counselling case.
Recruitment Office Procedures Job Posting Requests Creating a Search Committee –Adding Search Committee MembersAdding Search Committee Members –Designating.
LBTO IssueTrak User’s Manual Norm Cushing version 1.3 August 8th, 2007.
Google Classroom.
In addition to Word, Excel, PowerPoint, and Access, Microsoft Office® 2013 includes additional applications, including Outlook, OneNote, and Office Web.
Sample Auto-generated XForms With XQuery Date: 1/17/2009 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
Nancy Severe-Barnett Program Coordinator, SCIS
1 Project 4: XML Product Browser (Not Graded). Objectives This project is an exercise of the following knowledge and skills: Accessing and displaying.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
TxEIS Security A role-based solution October 2010.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
Drinking Water Infrastructure Needs Survey and Assessment 2007 Training.
OPAC Training aid (Library solutions & Library world)
© MIT 2000 Building Web Applications With Webjects Michael D. Barker The MIT Educational Media Creation Center September 2001.
Faculty Webpage Design Minimum Requirements. Go to: then High Schoolhttp://gcsc.groupfusion.net/
Session Objectives • Login to PeopleSoft Test Framework(PTF)
Drinking Water Infrastructure Needs Survey and Assessment 2007 Website.
EXist Indexing Using the right index for you data Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M.
Recursive Functions Creating Hierarchical Reports Date: 9/30/2008 Dan McCreary President Dan McCreary & Associates (952) M.
XQuery Functions Reusing XQuery Code Date: September, 2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata.
Auto-generation of Repeated Elements Part 2 of a series of XForms auto generation Date: 1/25/2008 Dan McCreary President Dan McCreary & Associates
Keyword Searching Weighted Federated Search with Key Word in Context Date: 10/2/2008 Dan McCreary President Dan McCreary & Associates
Deposit Module for Depositor DigiTool Version 3.0.
Using oXygen 12 with XQuery Using oXygen to build and execute XQuery XQuery applications on eXist Date: April 2011 Dan McCreary President Dan McCreary.
FY 2011 Public Libraries Survey WebPLUS Software Training.
) Main Menu: You can access all aspects of the database from this screen 2) Contacts: You can access the “contact database management” side of.
Compliance Assist Refresher Instruction Guide Adding or Editing Student Learning Outcomes.
12/14/20151 Uniquescriptz Backend Support Document Ver 2.0.
XQuery Labs Basic Reporting Date: 9/29/2008 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Class 3Intro to Databases Class 4 Simple Example of a Database We’re going to build a simple example of a database, which will allow us to register users.
ASSIGNMENT 2 Salim Malakouti. Ticketing Website  User submits tickets  Admins answer tickets or take appropriate actions.
LOGIN PAGE Login Page Support CRM:
Web Application Design. Data –What data is available? –How do we store it or how is it stored in the DB? Schema Data types Etc. –Where is the data?
Complete Ordering System for Promotional Literature and Samples Quick Reference and Training Guide.
IBM Express Runtime Quick Start Workshop © 2007 IBM Corporation Deploying a Solution.
Invoices and Service Invoices Training Presentation for Raytheon Supply Chain Platform (RSCP) April 2016.
Fab25 User Training Cerium Labs LabCollector - LIMS Lynette Ballast.
1 Introduction to MBProject. 2 Part I: MBProject and how it is used. Part II: What MBProject might do in the future. Also, as-built data collection and.
Introduction Moodle is a course management system, designed to help teachers create online courses and manage virtual interactions with their students.
Architecture Review 10/11/2004
Using the Personal Image Photo Library
Introduction to the new robust security system from SCC.
CARA 3.10 Major New Features
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Dan McCreary President Dan McCreary & Associates (952) M D
Activating Your Account and Navigating Through TIDE
Sequences in XQuery Core data structure of XQuery Date: 8/25/2009
Motivis Instructor Training
Links Launch Outlook Launch Skype Place Skype on Do Not Disturb.
XRX Diagrams Application Architecture Diagrams Date: Aug 21st, 2008
Presentation transcript:

XRX Basic CRUDS Create, Read, Update and Delete and Search XML Data Date: May 2011 Dan McCreary President Dan McCreary & Associates (952) M D Metadata Solutions

M D Copyright 2008 Dan McCreary & Associates 2 Outline Create new XML records using XForms –assigning sequential ids to each item (save-new.xq) Listing items –Creating a list of current items (list-items.xq) Reading XML records –creating read-only views of items (view-item.xq) Update existing records –use XQuery updates (update.xq) Deleting an item –How to delete with confirmation (delete-confirm.xq) Searching –How to build custom search forms

M D Copyright 2008 Dan McCreary & Associates 3 Architecturally Significant Functions Once you learn the basics CRUD(S) functions you can start to customize the item-manager code (S is for Search) Additional functions don’t require you to learn any additional architectural features

M D Copyright 2008 Dan McCreary & Associates 4 Sample Item To keep our examples simple, we are going to use a very simple “item” structure 47 Item Forty Seven This is a detailed description of item 47. medium draft tag-1

M D Copyright 2008 Dan McCreary & Associates 5 Folder Structure apps /db item-manager dataeditviewssearch 1.xml 2.xml 47.xml 99.xml save-new.xq update.xq new-instance.xml next-id.xml edit.xq delete.xq view-item.xq list-items.xq search.xq search.xhtml

M D Copyright 2008 Dan McCreary & Associates 6 List Items Simple for loop for all items in the data collection

M D Copyright 2008 Dan McCreary & Associates 7 list-items.xq ID Name … { for $item in collection($collection)/item let $id := $item/id/text() return {$id} {$item/name/text()} … }

M D Copyright 2008 Dan McCreary & Associates 8 Item Viewer Always provide a read-only viewer for your items Never force a person to use a write/lock edit form to view a document This causes unnecessary locking in the database

M D Copyright 2008 Dan McCreary & Associates 9 view-item.xq let $id := request:get-parameter('id', '') … View Item {let $item := collection($collection)/item[id = $id] return ID: {$item/id/text()} Name: {$item/faq-category-id/text()} Description: {$item/description/text()} Category: {$item/category/text()} Status: {$item/status/text()} Tag: {$item/tag/text()} }

M D Copyright 2008 Dan McCreary & Associates 10 edit.xq Architecture Generates an XHTML XForms on the fly Works for both new items and updates to items Calls save-new.xq if it has a new item Calls update.xq if it is updating an existing item

M D Copyright 2008 Dan McCreary & Associates 11 edit.xq

M D Copyright 2008 Dan McCreary & Associates 12 Excerpts from edit.xq let $new := request:get-parameter('new', '') let $id := request:get-parameter('id', '') … let $file := if ($new) then ('new-instance.xml') else ( concat( $server-port, '/exist/rest', $collection, '/', $id, '.xml')) …

M D Copyright 2008 Dan McCreary & Associates 13 New Instance Contains initial values of default form. Booleans must have true/false set.

M D Copyright 2008 Dan McCreary & Associates 14 XForms Controls for edit.xq Name: Question: Category: Small small Medium medium Large large

M D Copyright 2008 Dan McCreary & Associates 15 save-new.xq … (: this is gets the data from the XForms submission :) let $item := request:get-data() (: this creates the new file with a still-empty id element :) let $store := xmldb:store($data-collection, $file, $item) (: this adds the correct ID to the new document we just saved :) let $update-id := update replace doc(concat($data-collection, '/', $file))/item/id with {$id} (: this updates the next-id.xml file :) let $new-next-id := update replace doc($next-id-file-path)/data/next-id/text() with ($id + 1) return …

M D Copyright 2008 Dan McCreary & Associates 16 update.xq … (: Get the data from the XForms POST submission :) let $item := request:get-data() (: this saves the new file and overwrites the old one :) let $store := xmldb:store($collection, $file, $item) return Update Confirmation Item Home > List all Items > View Item Item {$id} has been updated. Note that save and update do not take URL parameters. They get all their data from the POST.

M D Copyright 2008 Dan McCreary & Associates 17 delete-confirm.xq xquery version "1.0"; let $id := request:get-parameter("id", "") … return Item Home > List Items Are you sure you want to delete this Item? Name: {doc($doc)/item/name/text()} Path: {$doc} Yes - Delete This Item? Cancel (Back to View Item) Note that save and update do not take URL parameters. They get all their data from the POST.

M D Copyright 2008 Dan McCreary & Associates 18 delete.xq let $collection := '/db/apps/manage-items/data' (: this script takes the integer value of the id parameter passed via get :) let $id := xs:integer(request:get-parameter('id', '')) (: this logs you into the collection :) let $login := xmldb:login($collection, ‘username', ‘password') (: this constructs the filename from the id :) let $file := concat($id, '.xml') (: this REALLY deletes the file :) let $store := xmldb:remove($collection, $file) return Note that save and update do not take URL parameters. They get all their data from the POST.

M D Copyright 2008 Dan McCreary & Associates 19 How CRUD Applications Work Together list-items.xqedit.xq view-item.xq delete-confirm.xq delete.xq search.xqsearch.xhtml index.xhtml Note: If you change a file name of an XQuery, make sure that everything that links to it is also updated save-new.xq update.xq optional

M D Copyright 2008 Dan McCreary & Associates 20 Next Steps Create additional reports for users –Customized dashboards –Use status codes to filter data –Data quality reports Customize Forms for specific users Add role-based functions so each role has custom views and forms Build custom searches for specific users

M D Copyright 2008 Dan McCreary & Associates 21 Labs Create your own application that includes the following functions: 1.List items by title and description 2.View an item 3.Search for an item 4.Creates a new record with an XForms page 5.Updates an record 6.Deletes a record 7.Run counts of item types