Vol III: CLD
The Seal Developer's Manual
Introduction
1
Introduction
About CLD
Substrate
The Server Framework
Persistent-Object Database
The Content Framework
Installation
Examples
Echo
Ency
2
Running CLD
The CLD command-line executable
seal.script.cld
Quick start
Usage
Commands
Invoking CLD from Python
Running as a web service
Creating a new corpus
Local testing
Creating a CGI script
Configuration
Configuration file
Password and session files
3
Modules
The Server Framework
4
The Manager
seal.app.toplevel
Running an application
Overview
Execmode
Runtime configurations
Invocation pipeline
Creating the pipeline
Using the pipeline
Summary of classes
Other Command classes
Configuration-file management
CGI scripts
Manager
Introduction
Main function
Toplevel calls
Configuration-file management
Implementation
Main function
Calling the Manager as a function
Manager and Config
Command
5
Configuration and Logging
Environment
seal.app.config
Create config
Configuration keys
Logging
seal.app.log
Logger
Logging conditions
6
Requests and Responses
HTTP request information
seal.app.env
HTTP requests
Digest environ
Requests
seal.app.request
The components of a Request
Pathnames
URLPathComponent
Forms
Calls
Miscellany
Responses
seal.app.response
Regular responses
Redirect responses
Code and suffix tables
Authentication
seal.app.auth
Authenticator
The Auth script
seal.script.auth
7
The Seal web server
Server
seal.app.server
Client
seal.app.client
The Client class
String format for requests
8
WSGI adapter
seal.app.wsgi
The WSGI specification
Overview
Definition
Running a WSGI application
WsgiApp
The WsgiApp __call__ method
Response methods
Persistent-Object Database
10
Files and directories
Persistent Objects
The File class
seal.cld.db.file
Defining a specialization
Metadata
seal.cld.db.meta
Summary of members and methods of File
The Directory class
seal.cld.db.dir
Database and Environment
Implementation issues
Filename
Relocatability of Files
File format
Initialization
Checking permissions
Details
New child
Writer
Reparenting
Deletion
Reorder children
Reparent children
Delete children
Example
11
Database toplevel
Environment
seal.cld.db.env
Indexation
Permissions
Overview
Protected files
Controlling access
Determining permission
Setting permissions
Users and groups
Database
seal.cld.db.core
Description
An example
12
Generic regular files
13
Substrate
seal.cld.db.disk
The Content Framework
14
The SealApp framework
seal.app.core
Writing a Seal application
rest of chapter out of date
Initialization
Running
Internal and external servers
Running as application
Running as a CGI script
Running as a WSGI script
15
Request processing
seal.app.parse
Descending through the web space
Calling App
Postprocessing
Web objects
seal.app.item
The web object hierarchy
Item
Method __getitem__
Method to_page
Method to_response
Script library
seal.app.weblib
Defining an HtmlDirectory
16
Constructing a Page
Pages
Specializations of Page
Page to Response
HtmlPage
Creating a web page
Methods
Contents
Convenience module: html
seal.app.html
17
Interface elements
seal.app.ui
Element class
Spans
Font changes and headings
Spacers
Blocks
Paragraphs
Pre
Lists
Stack
Table
Navigation
Link
Button
Path
Menubar
Forms
Form element
Check boxes
Dropdown
File upload
Hidden
Not editable
Radio buttons
Submit
Text box
Text area
Example
Widgets
CLD
The Corpus
18
Application and corpus
seal.cld.corpus.core
CLD app
seal.cld.core
Overview
Manually instantiating the corpus
Corpus and environment
The Corpus class
The Environment
seal.cld.corpus.env
Example
User interface
Corpus UI
seal.cld.ui.corpus
Metadata editor
seal.cld.ui.file
Corpus file format
CLDManager
seal.cld.toplevel
19
Export files
Import/Export
seal.cld.corpus.export
Items and containers
Implementation
Managing export files
seal.cld.corpus.export_file
Export file format
20
Global resources
Users
User object
seal.cld.corpus.user
User editor
seal.cld.ui.users
Romanizations
Romanization
Registry
Editor
seal.cld.ui.rom
21
Languages
Language list
seal.cld.corpus.language
LanguageList
LanguageListEditor
LanguageSelector
Language
Editor
seal.cld.ui.language
22
Lexicon
seal.cld.corpus.lexicon
Lexical entry
Description
Lexical fields
Lexicon
Similarity
seal.cld.corpus.sim
Editor
seal.cld.ui.lexicon
Concordance
seal.cld.ui.conc
23
Texts
seal.cld.corpus.text
General
Data model
Plaintext
Indices
Examples
Editor
seal.cld.ui.text
Complex documents
Toc objects
Editor
seal.cld.ui.toc
24
Tokenized text
seal.cld.corpus.token
Tokenization
Definition
Token
Token file
Sentences
Editor
Page contents
seal.cld.ui.page
PageEditor
PlainTextPanel
Interlinear glossed text (IGT)
seal.cld.ui.igt
25
Recordings
External media directory
seal.cld.corpus.media
On disk
MediaDirectory
RawMediaFile
Media texts (recordings)
Media file
User media index
Audio and Video
Media
seal.cld.ui.media
Audio
seal.cld.ui.audio
Video
seal.cld.ui.video
Transcription
seal.cld.corpus.transcript
Transcription (data object)
Transcriber (server-side UI)
XScript.js (client-side UI)
XScript.js
Extensions
26 Language-learning support
Course
seal.cld.ui.course
seal.cld.corpus.drill
Drill
seal.cld.corpus.course
27
GLab
seal.cld.glab
Language
seal.cld.glab.lang
Functions
seal.cld.glab.functions
Implementation
seal.cld.glab.eval
Files
seal.cld.glab.file
UI
seal.cld.glab.ui
GLab script
seal.script.glab
Appendix
A1
The Python HTTP server
Introduction
The Python TCP server
Sockets
TCP server
TCP test handler
Start and stop
Hypertext Transfer Protocol
Format of HTTP requests
GET requests
POST requests
Upload requests
HTTP Server
HTTPServer class
Processing the data section
Query string example
Form example
Upload example
Secure HTTP
SSL server
Secure HTTP Server
WSGI Server
Environ
The response
Running the server
A simple example
server0