Application Developer’s Guide - MarkLogic

2y ago
23 Views
2 Downloads
2.05 MB
553 Pages
Last View : 1d ago
Last Download : 2m ago
Upload by : Noelle Grant
Transcription

MarkLogic ServerApplication Developer’s Guide1Application Developer’s GuideMarkLogic 10May, 2019Last Revised: 10.0-5, April, 2020Copyright 2020 MarkLogic Corporation. All rights reserved.

MarkLogic ServerTable of ContentsTable of ContentsApplication Developer’s Guide1.0Developing Applications in MarkLogic Server .161.11.21.32.0Loading Schemas .192.12.22.32.42.53.0Overview of MarkLogic Server Application Development .16Skills Needed to Develop MarkLogic Server Applications .16Where to Find Specific Information .17Configuring Your Database .19Loading Your Schema .20Referencing Your Schema .21Working With Your Schema .21Validating XML and JSON Data Against a Schema .222.5.1 Validating Schemas using Schematron .222.5.2 Validating Schemas using the XQuery validate Expression .252.5.3 Validating JSON Documents against JSON Schemas .26Understanding Transactions in MarkLogic Server .283.13.23.33.43.53.6Terms and Definitions .29Overview of MarkLogic Server Transactions .313.2.1 Key Transaction Attributes .323.2.2 Understanding Statement Boundaries .333.2.3 Single-Statement Transaction Concept Summary .353.2.4 Multi-Statement Transaction Concept Summary .36Commit Mode .37Transaction Type .383.4.1 Transaction Type Overview .383.4.2 Controlling Transaction Type in XQuery .393.4.3 Controlling Transaction Type in JavaScript .423.4.4 Query Transactions: Point-in-Time Evaluation .443.4.5 Update Transactions: Readers/Writers Locks .453.4.6 Example: Query and Update Transaction Interaction .48Single vs. Multi-statement Transactions .483.5.1 Single-Statement, Automatically Committed Transactions .493.5.2 Multi-Statement, Explicitly Committed Transactions .493.5.3 Semi-Colon as a Statement Separator .54Transaction Mode .563.6.1 Transaction Mode Overview .563.6.2 Auto Transaction Mode .583.6.3 Query Transaction Mode .59MarkLogic 10—May, 2019Application Developer’s Guide—Page 2

MarkLogic Server3.73.83.93.103.114.04.44.5Terminology .74Loading Binary Documents .75Configuring MarkLogic Server for Binary Content .754.3.1 Setting the Large Size Threshold .754.3.2 Sizing and Scalability of Binary Content .764.3.3 Selecting a Location For Binary Content .774.3.4 Monitoring the Total Size of Large Binary Data in a Forest .784.3.5 Detecting and Removing Orphaned Binaries .79Developing Applications That Use Binary Documents .804.4.1 Adding Metadata to Binary Documents Using Properties .804.4.2 Downloading Binary Content With HTTP Range Requests .814.4.3 Creating Binary Email Attachments .83Useful Built-ins for Manipulating Binary Documents .84Importing XQuery Modules, XSLT Stylesheets, and Resolving Paths .865.15.25.35.46.03.6.4 Update Transaction Mode .593.6.5 Query-Single-Statement Transaction Mode .603.6.6 Multi-Auto Transaction Mode .61Interactions with xdmp:eval/invoke .613.7.1 Isolation Option to xdmp:eval/invoke .613.7.2 Preventing Deadlocks .633.7.3 Seeing Updates From eval/invoke Later in the Transaction .653.7.4 Running Multi-Statement Transactions under xdmp:eval/invoke .66Functions With Non-Transactional Side Effects .67Reducing Blocking with Multi-Version Concurrency Control .68Administering Transactions .68Transaction Examples .693.11.1 Example: Multi-statement Transactions and Same-statement Isolation .693.11.2 Example: Multi-Statement Transactions and Different-transaction Isolation713.11.3 Example: Generating a Transaction Report With xdmp:host-status .72Working With Binary Documents .744.14.24.35.0Table of ContentsXQuery Library Modules and Main Modules .865.1.1 Main Modules .865.1.2 Library Modules .87Rules for Resolving Import, Invoke, and Spawn Paths .87Module Caching Notes .89Example Import Module Scenario .90Library Services Applications .916.16.26.36.4Understanding Library Services .91Building Applications with Library Services .93Required Range Element Indexes .93Library Services API .94MarkLogic 10—May, 2019Application Developer’s Guide—Page 3

MarkLogic Server6.56.66.76.86.96.106.116.127.06.4.1 Library Services API Categories .956.4.2 Managed Document Update Wrapper Functions .95Security Considerations of Library Services Applications .966.5.1 dls-admin Role .966.5.2 dls-user Role .966.5.3 dls-internal Role .97Transactions and Library Services .97Putting Documents Under Managed Version Control .97Checking Out Managed Documents .986.8.1 Displaying the Checkout Status of Managed Documents .986.8.2 Breaking the Checkout of Managed Documents .98Checking In Managed Documents .99Updating Managed Documents .99Defining a Retention Policy .1006.11.1 Purging Versions of Managed Document .1006.11.2 About Retention Rules .1016.11.3 Creating Retention Rules .1016.11.4 Retaining Specific Versions of Documents .1036.11.5 Multiple Retention Rules .1046.11.6 Deleting Retention Rules .106Managing Modular Documents in Library Services .1076.12.1 Creating Managed Modular Documents .1076.12.2 Expanding Managed Modular Documents .1096.12.3 Managing Versions of Modular Documents .110Transforming XML Structures With a Recursive typeswitch Expression 1137.17.28.0Table of ContentsXML Transformations .1137.1.1 XQuery vs. XSLT .1137.1.2 Transforming to XHTML or XSL-FO .1137.1.3 The typeswitch Expression .114Sample XQuery Transformation Code .1147.2.1 Simple Example .1157.2.2 Simple Example With cts:highlight .1167.2.3 Sample Transformation to XHTML .1177.2.4 Extending the typeswitch Design Pattern .119Document and Directory Locks .1208.1Overview of Locks .1208.1.1 Write Locks .1208.1.2 Persistent .1208.1.3 Searchable .1218.1.4 Exclusive or Shared .1218.1.5 Hierarchical .1218.1.6 Locks and WebDAV .1218.1.7 Other Uses for Locks .121MarkLogic 10—May, 2019Application Developer’s Guide—Page 4

MarkLogic Server8.28.38.48.58.69.0Lock APIs .121Example: Finding the URI of Documents With Locks .122Example: Setting a Lock on a Document .123Example: Releasing a Lock on a Document .123Example: Finding the User to Whom a Lock Belongs .124Properties Documents and Directories .1259.19.29.39.49.510.0Table of ContentsProperties Documents .1259.1.1 Properties Document Namespace and Schema .1259.1.2 APIs on Properties Documents .1279.1.3 XPath property Axis .1289.1.4 Protected Properties .1299.1.5 Creating Element Indexes on a Properties Document Element .1299.1.6 Sample Properties Documents .1299.1.7 Standalone Properties Documents .129Using Properties for Document Processing .1309.2.1 Using the property Axis to Determine Document State .1309.2.2 Document Processing Problem .1319.2.3 Solution for Document Processing .1329.2.4 Basic Commands for Running Modules .133Directories .1339.3.1 Properties and Directories .1349.3.2 Directories and WebDAV Servers .1349.3.3 Directories Versus Collections .135Permissions On Properties and Directories .135Example: Directory and Document Browser .1359.5.1 Directory Browser Code .1369.5.2 Setting Up the Directory Browser .137Point-In-Time Queries .13910.110.2Understanding Point-In-Time Queries .13910.1.1 Fragments Stored in Log-Structured Database .13910.1.2 System Timestamps and Merge Timestamps .14010.1.3 How the Fragments for Point-In-Time Queries are Stored .14010.1.4 Only Available on Query Statements, Not on Update Statements .14110.1.5 All Auxiliary Databases Use Latest Version .14110.1.6 Database Configuration Changes Do Not Apply to Point-In-Time Fragments 142Using Timestamps in Queries .14210.2.1 Enabling Point-In-Time Queries in the Admin Interface .14210.2.2 The xdmp:request-timestamp Function .14410.2.3 Requires the xdmp:timestamp Execute Privilege .14410.2.4 The Timestamp Parameter to xdmp:eval, xdmp:invoke, xdmp:spawn .14410.2.5 Timestamps on Requests in XCC .14510.2.6 Scoring Considerations .145MarkLogic 10—May, 2019Application Developer’s Guide—Page 5

MarkLogic Server10.310.410.5Table of ContentsSpecifying Point-In-Time Queries in xdmp:eval, xdmp:invoke, xdmp:spawn, andXCC 14610.3.1 Example: Query Old Versions of Documents Using XCC .14610.3.2 Example: Querying Deleted Documents .146Keeping Track of System Timestamps .147Rolling Back a Forest to a Particular Timestamp .14910.5.1 Tradeoffs and Scenarios to Consider For Rolling Back Forests .14910.5.2 Setting the Merge Timestamp .15010.5.3 Notes About Performing an xdmp:forest-rollback Operation .15010.5.4 General Steps for Rolling Back One or More Forests .15111.0 System Plugin Framework .15211.111.211.312.0Using the map Functions to Create Name-Value Maps .15712.112.212.312.412.512.613.0How MarkLogic Server Plugins Work .15211.1.1 Overview of System Plugins .15211.1.2 System Plugins versus Application Plugins .15311.1.3 The plugin API .153Writing System Plugin Modules .153Password Plugin Sample .15411.3.1 Understanding the Password Plugin .15411.3.2 Modifying the Password Plugin .155Maps: In-Memory Structures to Manipulate in XQuery .157map:map XQuery Primitive Type .157Serializing a Map to an XML Node .158Map API .158Map Operators .159Examples .15912.6.1 Creating a Simple Map .16012.6.2 Returning the Values in a Map .16012.6.3 Constructing a Serialized Map .16112.6.4 Add a Value that is a Sequence .16112.6.5 Creating a Map Union .

MarkLogic Server Table of Contents MarkLogic 10—May, 2019 Application Developer’s Guide—Page 6 10.3 Specifying Point-In-Time Queries in xdmp:eval, xdmp:invoke, xdmp:spawn, and

Related Documents:

(Both Docker and Kubernetes) Emma Liu Product Manager, MarkLogic . Vitaly Korolev. Staff QA Engineer, MarkLogic . Setup MarkLogic Docker in 3 Easy Steps DEVELOPING & TESTING MADE EASY DOCKER FILE. Dependencies. Expose ports. 1. MARKLOGIC IMAGE. Docker build. 2. RUN MARKLOGIC DOCKER CONTAINER.

MarkLogic Server SQL on MarkLogic Server MarkLogic 10—May, 2019 SQL Data Modeling Guide—Page 5 1.2 Schemas and Views Schemas and views are the main SQL data-modeli ng components used to represent content stored in a MarkLogic Server database to SQL clients. A view is a virtual read-only table that represents

MarkLogic Server Java Application Developer's Guide 1 MarkLogic 8 February, 2015 Last Revised: 8.0-7, August, 2017

Enterprise NoSQL is a NoSQL database you would bet your business on—a database like MarkLogic. The MarkLogic database moves easily between the schema-less approach used for advanced web, rich content, and document solutions, as well as full ACID transaction processing. Its native shared-nothing architecture enables near-

Changes in Oracle SQL Developer Release 18.1 xlviii 1 SQL Developer Concepts and Usage 1.1 About SQL Developer 1-2 1.2 Installing and Getting Started with SQL Developer 1-2 1.3 SQL Developer User Interface 1-3 1.3.1 Menus for SQL Developer

high-performance open source C implementation of JavaScript. MarkLogic embeds version 6.7 of the Google V8 JavaScript engine. This version of V8 offers some of th

Die innovative Optik-API vereint die relationale Welt und die Welt der NoSQL-Dokumente mit dokumentübergreifenden Verknüpfungen und Aggregationen. MarkLogic ist die einzige Datenbank der Welt, die dazu in der Lage ist. Eine der Funktionen, die hierfür verwendet wird, ist die Template Driven Extraction (TDE). Damit werden

Remember, first aid is a practical skill so the more you physically practice these skills and techniques the better. Completing a first aid course is highly recommended to ensure you can have supervision from an expert in first aid who can check your skills. As you go through the programme ensure you are gathering evidence to upload into eDofE. For example, you could upload photos of you .