The Zope Book (2.6 Edition)Amos Latteier, Michel Pelletier, Chris McDonough, Peter Sabaini
The Zope Book (2.6 Edition)Preface
32
How the Book Is Organized
32
Conventions Used in This Book
34
Contributors to This Book
35
Introducing Zope
36
What Is A Web Application?
36
How You Can Benefit From Using An Application Server
37
Zope History
38
Why Use Zope Instead of Another Application Server
38
Zope Audiences and What Zope Isn't
39
Zope's Terms of Use and License and an Introduction to The Zope Community
40
Zope Concepts and Architecture
41
Fundamental Zope Concepts
41
Zope Is A Framework
41
Object Orientation
41
Object Publishing
41
Through-The-Web Management
42
Security and Safe Delegation
42
Native Object Persistence and Transactions
43
Acquisition
43
Zope Is Extensible
43
Fundamental Zope Components
44
Installing and Starting Zope
45
Downloading Zope
45
Installing Zope
45
Installing Zope for Windows With Binaries from Zope.org
46
Installing Zope on Linux and Solaris With Binaries from Zope.org
50
Compiling and Installing Zope from Source Code
52
Starting Zope
53
Using Zope With An Existing Webserver
54
Starting Zope On Windows
54
Starting Zope on UNIX
54
Starting Zope As The Root User
55
Your Zope Installation
55
Logging In
56
Controlling the Zope Process With the Control Panel
57
2
The Zope Book (2.6 Edition)Controlling the Zope Process From the Command Line
57
Troubleshooting
58
Options To The Zope start or start.bat Script
58
Environment Variables that Effect Zope at Runtime
61
When All Else Fails
65
Object Orientation
66
Objects
66
Attributes
67
Methods
67
Messages
67
Classes and Instances
68
Inheritance
68
Object Lifetimes
69
Summary
69
Using The Zope Management Interface
70
Introduction
70
How The Zope Management Interface Relates to Objects
70
ZMI Frames
70
The Navigator Frame
70
The Workspace Frame
71
The Status Frame
72
Creating Objects
72
Moving and Renaming Objects
73
Transactions and Undoing Mistakes
75
Undo Details and Gotchas
76
Reviewing Change History
76
Importing and Exporting Objects
77
Using Object Properties
80
Using the Help System
82
Browsing and Searching Help
82
Logging Out
83
Using Basic Zope Objects
84
Basic Zope Objects
84
Content Objects: Folders, Files, and Images
84
Folders
84
Files
84
Creating and Editing Files
85
3
The Zope Book (2.6 Edition)Editing File Contents
86
Viewing Files
86
Images
87
Presentation Objects: Zope Page Templates and DTML Objects
87
ZPT vs. DTML: Same Purpose, Different Audiences
88
Zope Page Templates
89
Creating A Page Template
89
Editing A Page Template
89
Uploading A Page Template
89
Viewing A Page Template
90
DTML Objects: DTML Documents and DTML Methods
90
Creating DTML Methods
91
Editing DTML Methods
91
Viewing a DTML Method
92
Uploading an HTML File as Content for a DTML Method
92
Logic Objects: Script (Python) Objects and External Methods
93
Script (Python) Objects
93
Creating A Script (Python)
94
Editing A Script (Python)
94
Testing A Script (Python)
94
Uploading A Script (Python)
95
External Methods
96
Creating and Editing An External Method File
96
Creating an External Method Object
96
Testing An External Method Object
96
SQL Methods: Another Kind of Logic Object
97
Creating a Basic Zope Application Using Page Templates and Scripts
97
Creating a Data Collection Form
98
Creatng A Script To Calculate Interest Rates
98
Creating A Page Template To Display Results
99
Dealing With Errors
99
Using The Application
100
The Zope Tutorial
100
Acquisition
102
Acquisition vs. Inheritance
102
Acquisition is about Containment
103
Say What?
103
4
The Zope Book (2.6 Edition)Providing Services
104
Getting Deeper with Multiple Levels
104
Summary
104
Basic DTML
106
How DTML Relates to Similar Languages and Templating Facilities
106
When To Use DTML
106
When Not To Use DTML
106
The Difference Between DTML Documents and DTML Methods
107
Details
107
DTML Tag Syntax
108
DTML Tag Names, Targets, and Attributes
108
Creating a "Sandbox" for the Examples in This Chapter
109
Examples of Using DTML for Common Tasks
109
Inserting Text into HTML with DTML
109
Formatting and Displaying Sequences
111
Processing Input from Forms
112
Dealing With Errors
115
Dynamically Acquiring Content
115
Using Python Expressions from DTML
117
DTML Expression Gotchas
119
will call the method. However,
119
Common DTML Tags
120
The Var Tag
120
Var Tag Attributes
120
Var Tag Entity Syntax
121
The If Tag
121
Here's an example condition:
121
Name and Expression Syntax Differences
122
Else and Elif Tags
122
Using Cookies with the If Tag
123
The In Tag
124
Iterating over Folder Contents
124
In Tag Special Variables
125
Summary
127
Using Zope Page Templates
128
Zope Page Templates versus DTML
128
How Page Templates Work
128
5
The Zope Book (2.6 Edition)Creating a Page Template
129
Simple Expressions
130
Inserting Text
130
Repeating Structures
131
Conditional Elements
132
Changing Attributes
133
Creating a File Library with Page Templates
133
Remote Editing with FTP and WebDAV
136
Debugging and Testing
137
XML Templates
138
Using Templates with Content
138
Creating Basic Zope Applications
140
Building "Instance-Space" Applications
140
Instance-Space Applications vs. Products
140
Using A Folder as A Container For Your Intstance-Space Application
140
Using Objects as Methods Of Folders Via URLs
141
Using Acquisition In Instance-Space Applications
141
The Special Folder Object index_html
141
Building the Zope Zoo Website
142
Navigating the Zoo
142
Adding a Front Page to the Zoo
144
Improving Navigation
145
Factoring out Style Sheets
147
Creating a File Library
148
148
Building a Guest Book
150
Extending the Guest Book to Generate XML
153
The Next Step
154
Users and Security
155
Introduction to Zope Security
155
Review: Logging In and Logging Out of the Zope Management Interface
155
Zope's "Stock" Security Setup
155
Identification and Authentication
156
Authorization, Roles, and Permissions
156
Managing Users
157
Creating Users in User Folders
157
Editing Users
159
6
The Zope Book (2.6 Edition)Defining a User's Location
159
Working with Alternative User Folders
160
Special User Accounts
160
Zope Anonymous User
161
Zope Emergency User
161
Creating an Emergency User
162
Zope Initial Manager
163
Protecting Against Password Snooping
163
Managing Custom Security Policies
164
Working with Roles
164
Defining Global Roles
164
Understanding Local Roles
165
Understanding Permissions
165
Defining Security Policies
166
Security Policy Acquisition
167
Security Usage Patterns
168
Security Rules of Thumb
168
Global and Local Policies
168
Delegating Control to Local Managers
168
Different Levels of Access with Roles
169
Controlling Access to Locations with Roles
170
Performing Security Checks
170
Advanced Security Issues: Ownership and Executable Content
172
The Problem: Trojan Horse Attacks
172
Managing Ownership
172
Roles of Executable Content
173
Proxy Roles
174
Summary
174
Advanced DTML
176
How Variables are Looked up
177
DTML Namespaces
178
DTML Client Object
179
DTML Method vs. DTML Document
180
DTML Request Object
180
Rendering Variables
181
Modifying the DTML Namespace
181
In Tag Namespace Modifications
181
7
The Zope Book (2.6 Edition)Additional Notes
182
The With Tag
182
The Let Tag
183
DTML Namespace Utility Functions
184
DTML Security
185
Safe Scripting Limits
186
Advanced DTML Tags
186
The Call Tag
186
The Comment Tag
187
The Tree Tag
188
The Return Tag
190
The Sendmail Tag
190
The Mime Tag
191
The Unless Tag
192
Batch Processing With The In Tag
193
Exception Handling Tags
195
The Raise Tag
195
The Try Tag
195
The Try Tag Optional Else Block
197
The Try Tag Optional Finally Block
197
Other useful examples
198
Forwarding a REQUEST
198
Sorting with the tag
198
Calling a DTML object from a Python Script
199
Explicit Lookups
199
Conclusion
199
Advanced Page Templates
200
Advanced TAL
200
Advanced Content Insertion
200
Inserting Structure
200
Dummy Elements
200
Default Content
201
Advanced Repetition
201
Repeat Variables
201
Repetition Tips
202
Advanced Attribute Control
203
Defining Variables
203
8
The Zope Book (2.6 Edition)Omitting Tags
204
Error Handling
204
Interactions Between TAL Statements
205
Form Processing
207
Expressions
208
Built-in Page Template Variables
208
String Expressions
209
Path Expressions
210
Alternate Paths
210
Not Expressions
211
Nocall Expressions
211
Exists Expressions
211
Python Expressions
212
Comparisons
212
Using other Expression Types
212
Getting at Zope Objects
213
Using Scripts
214
Calling DTML
214
Python Modules
215
Macros
215
Using Macros
216
Macro Details
216
Using Slots
217
Customizing Default Presentation
218
Combining METAL and TAL
219
Whole Page Macros
219
Caching Templates
220
Page Template Utilities
221
Batching Large Sets of Information
221
Miscellaneous Utilities
223
Conclusion
223
Advanced Zope Scripting
224
Zope Scripts
224
Here is an overview of Zope's scripts:
224
Calling Scripts
224
Context
225
Calling Scripts From the Web
225
9
The Zope Book (2.6 Edition)URL Traversal and Acquisition
226
Passing Arguments with an HTTP Query String
226
Calling Scripts from Other Objects
226
Calling Scripts from DTML
226
Calling scripts from Python and Perl
227
Calling Scripts from Page Templates
228
Calling Scripts: Summary and Comparison
229
Using Python-based Scripts
230
The Python Language
230
Creating Python-based Scripts
230
Binding Variables
232
Accessing the HTTP Request
233
String Processing in Python
234
Doing Math
234
Print Statement Support
235
Built-in Functions
236
Using External Methods
236
Processing XML with External Methods
241
External Method Gotchas
242
Using Perl-based Scripts
242
The Perl Language
243
Creating Perl-based Scripts
243
Perl-based Script Security
244
Advanced Acquisition
244
Context Acquisition Gotchas
246
Containment before context
246
One at a time
246
Readability
246
Fragility
247
Calling DTML from Scripts
247
Calling ZPT from Scripts
248
Passing Parameters to Scripts
249
Returning Values from Scripts
253
Script Security
254
Security Restrictions of Script (Python)
254
The Zope API
255
Get all objects in a folder
255
10
Document Outline
- Preface
- How the Book Is Organized
- Conventions Used in This Book
- Contributors to This Book
- Introducing Zope
- What Is A Web Application?
- How You Can Benefit From Using An Application Server
- Zope History
- Why Use Zope Instead of Another Application Server
- Zope Audiences and What Zope Isn't
- Zope's Terms of Use and License and an Introduction to The Zope Community
- Zope Concepts and Architecture
- Fundamental Zope Concepts
- Zope Is A Framework
- Object Orientation
- Object Publishing
- Through-The-Web Management
- Security and Safe Delegation
- Native Object Persistence and Transactions
- Acquisition
- Zope Is Extensible
- Fundamental Zope Components
- Installing and Starting Zope
- Downloading Zope
- Installing Zope
- Installing Zope for Windows With Binaries from Zope.org
- Installing Zope on Linux and Solaris With Binaries from Zope.org
- Compiling and Installing Zope from Source Code
- Starting Zope
- Using Zope With An Existing Webserver
- Starting Zope On Windows
- Starting Zope on UNIX
- Starting Zope As The Root User
- Your Zope Installation
- Logging In
- Controlling the Zope Process With the Control Panel
- Controlling the Zope Process From the Command Line
- Troubleshooting
- Options To The Zope start or start.bat Script
- Environment Variables that Effect Zope at Runtime
- When All Else Fails
- Object Orientation
- Objects
- Attributes
- Methods
- Messages
- Classes and Instances
- Inheritance
- Object Lifetimes
- Summary
- Using The Zope Management Interface
- Introduction
- How The Zope Management Interface Relates to Objects
- ZMI Frames
- The Navigator Frame
- The Workspace Frame
- The Status Frame
- Creating Objects
- Moving and Renaming Objects
- Transactions and Undoing Mistakes
- Undo Details and Gotchas
- Reviewing Change History
- Importing and Exporting Objects
- Using Object Properties
- Using the Help System
- Browsing and Searching Help
- Logging Out
- Using Basic Zope Objects
- Basic Zope Objects
- Content Objects: Folders, Files, and Images
- Folders
- Files
- Creating and Editing Files
- Editing File Contents
- Viewing Files
- Images
- Presentation Objects: Zope Page Templates and DTML Objects
- ZPT vs. DTML: Same Purpose, Different Audiences
- Zope Page Templates
- Creating A Page Template
- Editing A Page Template
- Uploading A Page Template
- Viewing A Page Template
- DTML Objects: DTML Documents and DTML Methods
- Creating DTML Methods
- Editing DTML Methods
- Viewing a DTML Method
- Uploading an HTML File as Content for a DTML Method
- Logic Objects: Script (Python) Objects and External Methods
- Script (Python) Objects
- Creating A Script (Python)
- Editing A Script (Python)
- Testing A Script (Python)
- Uploading A Script (Python)
- External Methods
- Creating and Editing An External Method File
- Creating an External Method Object
- Testing An External Method Object
- SQL Methods: Another Kind of Logic Object
- Creating a Basic Zope Application Using Page Templates and Scripts
- Creating a Data Collection Form
- Creatng A Script To Calculate Interest Rates
- Creating A Page Template To Display Results
- Dealing With Errors
- Using The Application
- The Zope Tutorial
- Acquisition
- Acquisition vs. Inheritance
- Acquisition is about Containment
- Say What?
- Providing Services
- Getting Deeper with Multiple Levels
- Summary
- Basic DTML
- How DTML Relates to Similar Languages and Templating Facilities
- When To Use DTML
- When Not To Use DTML
- The Difference Between DTML Documents and DTML Methods
- DTML Tag Syntax
- DTML Tag Names, Targets, and Attributes
- Creating a "Sandbox" for the Examples in This Chapter
- Examples of Using DTML for Common Tasks
- Inserting Text into HTML with DTML
- Formatting and Displaying Sequences
- Processing Input from Forms
- Dealing With Errors
- Dynamically Acquiring Content
- Using Python Expressions from DTML
- DTML Expression Gotchas
- will call the method. However,
- Common DTML Tags
- The Var Tag
- Var Tag Attributes
- Var Tag Entity Syntax
- The If Tag
- Here's an example condition:
- Name and Expression Syntax Differences
- Else and Elif Tags
- Using Cookies with the If Tag
- The In Tag
- Iterating over Folder Contents
- In Tag Special Variables
- Summary
- Using Zope Page Templates
- Zope Page Templates versus DTML
- How Page Templates Work
- Creating a Page Template
- Simple Expressions
- Inserting Text
- Repeating Structures
- Conditional Elements
- Changing Attributes
- Creating a File Library with Page Templates
- Remote Editing with FTP and WebDAV
- Debugging and Testing
- XML Templates
- Using Templates with Content
- Creating Basic Zope Applications
- Building "Instance-Space" Applications
- Instance-Space Applications vs. Products
- Using A Folder as A Container For Your Intstance-Space Application
- Using Objects as Methods Of Folders Via URLs
- Using Acquisition In Instance-Space Applications
- The Special Folder Object index_html
- Building the Zope Zoo Website
- Navigating the Zoo
- Adding a Front Page to the Zoo
- Improving Navigation
- Factoring out Style Sheets
- Creating a File Library
- Building a Guest Book
- Extending the Guest Book to Generate XML
- The Next Step
- Users and Security
- Introduction to Zope Security
- Review: Logging In and Logging Out of the Zope Management Interface
- Zope's "Stock" Security Setup
- Identification and Authentication
- Authorization, Roles, and Permissions
- Managing Users
- Creating Users in User Folders
- Editing Users
- Defining a User's Location
- Working with Alternative User Folders
- Special User Accounts
- Zope Anonymous User
- Zope Emergency User
- Creating an Emergency User
- Zope Initial Manager
- Protecting Against Password Snooping
- Managing Custom Security Policies
- Working with Roles
- Defining Global Roles
- Understanding Local Roles
- Understanding Permissions
- Defining Security Policies
- Security Policy Acquisition
- Security Usage Patterns
- Security Rules of Thumb
- Global and Local Policies
- Delegating Control to Local Managers
- Different Levels of Access with Roles
- Controlling Access to Locations with Roles
- Performing Security Checks
- Advanced Security Issues: Ownership and Executable Content
- The Problem: Trojan Horse Attacks
- Managing Ownership
- Roles of Executable Content
- Proxy Roles
- Summary
- Advanced DTML
- How Variables are Looked up
- DTML Namespaces
- DTML Client Object
- DTML Method vs. DTML Document
- DTML Request Object
- Rendering Variables
- Modifying the DTML Namespace
- In Tag Namespace Modifications
- Additional Notes
- The With Tag
- The Let Tag
- DTML Namespace Utility Functions
- DTML Security
- Safe Scripting Limits
- Advanced DTML Tags
- The Call Tag
- The Comment Tag
- The Tree Tag
- The Return Tag
- The Sendmail Tag
- The Mime Tag
- The Unless Tag
- Batch Processing With The In Tag
- Exception Handling Tags
- The Raise Tag
- The Try Tag
- The Try Tag Optional Else Block
- The Try Tag Optional Finally Block
- Other useful examples
- Forwarding a REQUEST
- Sorting with the tag
- Calling a DTML object from a Python Script
- Explicit Lookups
- Conclusion
- Advanced Page Templates
- Advanced TAL
- Advanced Content Insertion
- Inserting Structure
- Dummy Elements
- Default Content
- Advanced Repetition
- Repeat Variables
- Repetition Tips
- Advanced Attribute Control
- Defining Variables
- Omitting Tags
- Error Handling
- Interactions Between TAL Statements
- Form Processing
- Expressions
- Built-in Page Template Variables
- String Expressions
- Path Expressions
- Alternate Paths
- Not Expressions
- Nocall Expressions
- Exists Expressions
- Python Expressions
- Comparisons
- Using other Expression Types
- Getting at Zope Objects
- Using Scripts
- Calling DTML
- Python Modules
- Macros
- Using Macros
- Macro Details
- Using Slots
- Customizing Default Presentation
- Combining METAL and TAL
- Whole Page Macros
- Caching Templates
- Page Template Utilities
- Batching Large Sets of Information
- Miscellaneous Utilities
- Conclusion
- Advanced Zope Scripting
- Zope Scripts
- Here is an overview of Zope's scripts:
- Calling Scripts
- Context
- Calling Scripts From the Web
- URL Traversal and Acquisition
- Passing Arguments with an HTTP Query String
- Calling Scripts from Other Objects
- Calling Scripts from DTML
- Calling scripts from Python and Perl
- Calling Scripts from Page Templates
- Calling Scripts: Summary and Comparison
- Using Python-based Scripts
- The Python Language
- Creating Python-based Scripts
- Binding Variables
- Accessing the HTTP Request
- String Processing in Python
- Doing Math
- Print Statement Support
- Built-in Functions
- Using External Methods
- Processing XML with External Methods
- External Method Gotchas
- Using Perl-based Scripts
- The Perl Language
- Creating Perl-based Scripts
- Perl-based Script Security
- Advanced Acquisition
- Context Acquisition Gotchas
- Containment before context
- One at a time
- Readability
- Fragility
- Calling DTML from Scripts
- Calling ZPT from Scripts
- Passing Parameters to Scripts
- Returning Values from Scripts
- Script Security
- Security Restrictions of Script (Python)
- The Zope API
- Get all objects in a folder
- Get the id of an object
- Get the Zope root folder
- Get the physical path to an object
- Get an object by path
- Change the content of an DTML Method or Document
- Change properties of an object
- Get a property
- Change properties of an object
- Execute a DTML Method or DTML Document
- Traverse to an object and add a new property
- Add a new object to the context
- DTML versus Python versus Perl versus Page Templates
- Remote Scripting and Network Services
- Using XML-RPC
- Remote Scripting with HTTP
- Conclusion
- Zope Services
- Access Rule Services
- Temporary Storage Services
- Version Services
- Caveat: Versions and ZCatalog
- Caching Services
- Adding a Cache Manager
- Caching an Object
- Outbound Mail Services
- Error Logging Services
- Virtual Hosting Services
- Searching and Indexing Services
- Sessioning Services
- Internationalization Services
- Searching and Categorizing Content
- Getting started with Mass Cataloging
- Creating a ZCatalog
- Creating Indexes
- Finding and Cataloging Objects
- Search and Report Forms
- Configuring ZCatalogs
- Defining Indexes
- Defining Meta Data
- Searching ZCatalogs
- Searching with Forms
- Searching from Python
- Searching and Indexing Details
- Searching ZCTextIndexes
- Boolean expressions
- Parentheses
- Wild cards
- Phrase search
- Lexicons
- Lexicons can:
- Searching Field Indexes
- Searching Keyword Indexes
- Searching Path Indexes
- Searching DateIndexes
- Searching DateRangeIndexes
- Searching TopicIndexes
- Advanced Searching with Records
- Keyword Index Record Attributes
- FieldIndex Record Attributes
- Allowed values:
- Path Index Record Attributes
- DateIndex Record Attributes
- Allowed values:
- DateRangeIndex Record Attributes
- TopicIndex Record Attributes
- ZCTextIndex Record Attributes
- Creating Records in HTML
- Automatic Cataloging
- Conclusion
- Relational Database Connectivity
- Common Relational Databases
- Database Adapters
- Setting up a Database Connection
- Z SQL Methods
- Examples of ZSQL Methods
- Displaying Results from Z SQL Methods
- Providing Arguments to Z SQL Methods
- Dynamic SQL Queries
- Inserting Arguments with the Sqlvar Tag
- Equality Comparisons with the sqltest Tag
- Creating Complex Queries with the sqlgroup Tag
- Advanced Techniques
- Calling Z SQL Methods with Explicit Arguments
- Acquiring Arguments from other Objects
- Traversing to Result Objects
- Other Result Object Methods
- Binding Classes to Result Objects
- Caching Results
- Transactions
- Further help
- Summary
- Virtual Hosting Services
- Virtual Host Monster
- Where to Put a Virtual Host Monster And What To Name It
- Special VHM Path Elements VirtualHostBase and VirtualHostRoot
- VirtualHostBase
- VirtualHostRoot
- Using VirtualHostRoot and VirtualHostBase Together
- Testing a Virtual Host Monster
- Arranginging for Incoming URLs to be Rewritten
- Virtual Host Monster Mappings Tab
- Apache Rewrite Rules
- "Inside-Out" Virtual Hosting
- Sessions
- Introduction
- Session Configuration
- Using Session Data
- Details
- Terminology
- Default Configuration
- Advanced Development Using Sessioning
- Overview
- Obtaining A Session Data Object
- Modifying A Session Data Object
- Manually Invalidating A Session Data Object
- Manually Invalidating A Browser Id Cookie
- An Example Of Using Session Data from DTML
- Using the mapping Keyword With A Session Data Object in a dtml-with
- Using Session Data From Python
- Interacting with Browser Id Data
- Determining Which Namespace Holds The Browser Id
- Obtaining the Browser Id Name/Value Pair and Embedding It Into A Form
- Determining Whether A Browser Id is "New"
- Determining Whether A Session Data Object Exists For The Browser Id Associated With This Request
- Embedding A Browser Id Into An HTML Link
- Using Session onAdd and onDelete Events
- Writing onAdd and onDelete Methods
- Configuration and Operation
- Setting Initial Transient Object Container Parameters
- Instantiating Multiple Browser Id Managers (Optional)
- Instantiating A Session Data Manager (Optional)
- Instantiating a Transient Object Container
- Configuring Sessioning Permissions
- Permissions related to browser id managers:
- Permissions related to session data managers:
- Permissions related to transient object containers:
- Concepts and Caveats
- Security Considerations
- Browser Id (Non-)Expiration
- Session Data Object Expiration Considerations
- Sessioning and Transactions
- Mutable Data Stored Within Session Data Objects
- Session Data Object Keys
- In-Memory Session Data Container RAM Utilization
- Mounted Transient Object Container Caveats
- Conflict Errors
- Zope Versions and Sessioning
- Further Documentation
- Scalability and ZEO
- What is ZEO?
- When you should use ZEO
- Installing and Running ZEO
- How to Run Multiple ZEO Clients
- How to Distribute Load
- User Chooses a Mirror
- Using Round-robin DNS to Distribute Load
- Using Layer 4 Switching to Distribute Load
- Dealing with the Storage Server as A Single Point of Failure
- ZEO Server Details
- ZEO Caveats
- Conclusion
- Managing Zope Objects Using External Tools
- General Caveats
- FTP and WebDAV
- Using FTP to Manage Zope Content
- Determining Your Zope's FTP Port
- Transferring Files with WS_FTP
- Remote Editing with FTP/DAV-Aware Editors
- Editing Zope Objects with Emacs FTP Modes
- Caveats With FTP
- Editing Zope Objects with WebDAV
- Note
- Using a PUT_factory to Specify the Type of Objects Created With FTP and DAV
- Using The External Editor Product
- Other Integration Facilities
- Chapter 14: Extending Zope
- Creating Zope Products
- Creating A Simple Product
- Creating ZClasses
- Creating Views of Your ZClass
- Creating Properties on Your ZClass
- Creating Methods on your ZClass
- ObjectManager ZClasses
- ZClass Security Controls
- Controlling access to Methods and Property Sheets
- Controlling Access to instances of Your ZClass
- Providing Context-Sensitive Help for your ZClass
- Using Python Base Classes
- Distributing Products
- Maintaining Zope
- Starting Zope Automatically at Boot Time
- Debug Mode and Automatic Startup
- Linux
- Distributions with Prepackaged Zope
- Automatic Startup for Custom-Built Zopes
- This script lets you perform start / stop / restart operations:
- Mac OS X
- MS Windows
- Installing New Products
- Server Settings
- Database Cache
- Interpreter Check Intervals
- ZServer Threads
- Database Connections
- Signals (POSIX only)
- Monitoring
- Monitor the Event Log and the Access Log
- Monitor the HTTP Service
- Log Files
- Access Log
- Event Log
- Log Rotation
- Packing and Backing Up the FileStorage Database
- Database Recovery Tools
- Appendix A: DTML Reference
- call: Call a method
- comment: Comments DTML
- functions: DTML Functions
- Functions
- Attributes
- See Also
- string module
- random module
- math module
- sequence module
- Built-in Python Functions
- if: Tests Conditions
- in: Loops over sequences
- Syntax
- Attributes
- Tag Variables
- Current Item Variables
- Summary Variables
- Grouping Variables
- Batch Variables
- Examples
- let: Defines DTML variables
- mime: Formats data with MIME
- Syntax
- Attributes
- Examples
- See Also
- raise: Raises an exception
- return: Returns data
- sendmail: Sends email with SMTP
- Syntax
- Attributes
- Examples
- See Also
- sqlgroup: Formats complex SQL expressions
- Syntax
- Attributes
- Examples
- See Also
- sqltest: Formats SQL condition tests
- Syntax
- Attributes
- Examples
- See Also
- sqlvar: Inserts SQL variables
- Syntax
- Attributes
- Examples
- See Also
- tree: Inserts a tree widget
- Syntax
- Attributes
- Tag Variables
- Tag Control Variables
- Examples
- try: Handles exceptions
- Syntax
- Attributes
- Tag Variables
- Examples
- See Also
- unless: Tests a condition
- var: Inserts a variable
- with: Controls DTML variable look up
- Syntax
- Attributes
- Examples
- See Also
- Appendix B: API Reference
- module AccessControl
- AccessControl: Security functions and classes
- class SecurityManager
- calledByExecutable(self)
- validate(accessed=None, container=None, name=None, value=None, roles=None)
- checkPermission(self, permission, object)
- getUser(self)
- validateValue(self, value, roles=None)
- def getSecurityManager()
- Returns the security manager. See the SecurityManager class.
- module AuthenticatedUser
- class AuthenticatedUser
- getUserName()
- getId()
- has_role(roles, object=None)
- getRoles()
- has_permission(permission, object)
- getRolesInContext(object)
- getDomains()
- module DTMLDocument
- class DTMLDocument(ObjectManagerItem, PropertyManager)
- manage_edit(data, title)
- document_src()
- __call__(client=None, REQUEST={}, RESPONSE=None, **kw)
- From DTML
- From Python
- By the Publisher
- get_size()
- ObjectManager Constructor
- manage_addDocument(id, title)
- module DTMLMethod
- class DTMLMethod(ObjectManagerItem)
- manage_edit(data, title)
- document_src()
- __call__(client=None, REQUEST={}, **kw)
- From DTML
- From Python
- By the Publisher
- get_size()
- ObjectManager Constructor
- manage_addDTMLMethod(id, title)
- module DateTime
- class DateTime
- strftime(format)
- Return date time string formatted according to format
- dow()
- aCommon()
- h_12()
- Mon_()
- HTML4()
- greaterThanEqualTo(t)
- dayOfYear()
- lessThan(t)
- AMPM()
- isCurrentHour()
- Month()
- mm()
- ampm()
- hour()
- aCommonZ()
- Day_()
- pCommon()
- minute()
- day()
- earliestTime()
- Date()
- Time()
- isFuture()
- greaterThan(t)
- TimeMinutes()
- yy()
- isCurrentDay()
- dd()
- rfc822()
- isLeapYear()
- fCommon()
- isPast()
- fCommonZ()
- timeTime()
- toZone(z)
- lessThanEqualTo(t)
- Mon()
- parts()
- isCurrentYear()
- PreciseAMPM()
- AMPMMinutes()
- equalTo(t)
- pDay()
- notEqualTo(t)
- h_24()
- pCommonZ()
- isCurrentMonth()
- DayOfWeek()
- latestTime()
- dow_1()
- timezone()
- year()
- PreciseTime()
- ISO()
- millis()
- second()
- month()
- pMonth()
- aMonth()
- isCurrentMinute()
- Day()
- aDay()
- module ExternalMethod
- class ExternalMethod
- manage_edit(title, module, function, REQUEST=None)
- __call__(*args, **kw)
- ObjectManager Constructor
- manage_addExternalMethod(id, title, module, function)
- module File
- class File(ObjectManagerItem, PropertyManager)
- getContentType()
- update_data(data, content_type=None, size=None)
- getSize()
- ObjectManager Constructor
- manage_addFile(id, file="", title="", precondition="", content_type="")
- Creates a new File object id with the contents of file
- module Folder
- class Folder(ObjectManagerItem, ObjectManager, PropertyManager)
- ObjectManager Constructor
- manage_addFolder(id, title)
- module Image
- class Image(File)
- tag(height=None, width=None, alt=None, scale=0, xscale=0, yscale=0, **args)
- ObjectManager Constructor
- manage_addImage(id, file, title="", precondition="", content_type="")
- module MailHost
- class MailHost
- send(messageText, mto=None, mfrom=None, subject=None, encode=None)
- simple_send(self, mto, mfrom, subject, body)
- MailHost Constructor
- manage_addMailHost(id, title="", smtp_host=None, localhost=localhost, smtp_port=25, timeout=1.0)
- module ObjectManager
- class ObjectManager
- objectItems(type=None)
- superValues(type)
- objectValues(type=None)
- objectIds(type=None)
- module ObjectManagerItem
- class ObjectManagerItem
- title_or_id()
- getPhysicalRoot()
- manage_workspace()
- getPhysicalPath()
- unrestrictedTraverse(path, default=None)
- getId()
- absolute_url(relative=None)
- this()
- restrictedTraverse(path, default=None)
- title_and_id()
- module PropertyManager
- class PropertyManager
- propertyItems()
- propertyValues()
- propertyMap()
- propertyIds()
- getPropertyType(id)
- getProperty(id, d=None)
- hasProperty(id)
- module PropertySheet
- class PropertySheet
- xml_namespace()
- propertyItems()
- propertyValues()
- getPropertyType(id)
- propertyInfo()
- getProperty(id, d=None)
- manage_delProperties(ids=None, REQUEST=None)
- manage_changeProperties(REQUEST=None, **kw)
- manage_addProperty(id, value, type, REQUEST=None)
- propertyMap()
- propertyIds()
- hasProperty(id)
- module PropertySheets
- class PropertySheets
- get(name, default=None)
- values()
- items()
- module PythonScript
- class PythonScript(Script)
- document_src(REQUEST=None, RESPONSE=None)
- ZPythonScript_edit(params, body)
- ZPythonScript_setTitle(title)
- ZPythonScriptHTML_upload(REQUEST, file="")
- write(text)
- ZScriptHTML_tryParams()
- read()
- ZPythonScriptHTML_editAction(REQUEST, title, params, body)
- ObjectManager Constructor
- manage_addPythonScript(id, REQUEST=None)
- module Request
- class Request
- get_header(name, default=None)
- items()
- keys()
- setVirtualRoot(path, hard=0)
- values()
- set(name, value)
- has_key(key)
- setServerURL(protocol=None, hostname=None, port=None)
- module Response
- class Response
- setHeader(name, value)
- setCookie(name, value, **kw)
- addHeader(name, value)
- appendHeader(name, value, delimiter=,)
- write(data)
- setStatus(status, reason=None)
- setBase(base)
- expireCookie(name, **kw)
- appendCookie(name, value)
- redirect(location, lock=0)
- class Script
- ZScriptHTML_tryAction(REQUEST, argvars)
- module SessionInterfaces
- Session API
- class SessionDataManagerErr
- class BrowserIdManagerInterface
- getBrowserId(self, create=1)
- isBrowserIdFromCookie(self)
- isBrowserIdNew(self)
- encodeUrl(self, url)
- flushBrowserIdCookie(self)
- getBrowserIdName(self)
- isBrowserIdFromForm(self)
- hasBrowserId(self)
- setBrowserIdCookieByForce(self, bid)
- class BrowserIdManagerErr
- class SessionDataManagerInterface
- getSessionDataByKey(self, key)
- getSessionData(self, create=1)
- getBrowserIdManager(self)
- hasSessionData(self)
- module TransienceInterfaces
- class TransientObject
- delete(self, k)
- setLastAccessed(self)
- getCreated(self)
- values(self)
- has_key(self, k)
- getLastAccessed(self)
- getId(self)
- update(self, d)
- clear(self)
- items(self)
- keys(self)
- get(self, k, default=marker)
- set(self, k, v)
- getContainerKey(self)
- invalidate(self)
- class MaxTransientObjectsExceeded
- class TransientObjectContainer
- new(self, k)
- setDelNotificationTarget(self, f)
- getTimeoutMinutes(self)
- has_key(self, k)
- setAddNotificationTarget(self, f)
- getId(self)
- setTimeoutMinutes(self, timeout_mins)
- new_or_existing(self, k)
- get(self, k, default=None)
- getAddNotificationTarget(self)
- getDelNotificationTarget(self)
- module UserFolder
- class UserFolder
- userFolderEditUser(name, password, roles, domains, **kw)
- userFolderDelUsers(names)
- userFolderAddUser(name, password, roles, domains, **kw)
- getUsers()
- getUserNames()
- getUser(name)
- module Vocabulary
- class Vocabulary
- words()
- insert(word)
- query(pattern)
- ObjectManager Constructor
- manage_addVocabulary(id, title, globbing=None, REQUEST=None)
- module ZCatalog
- class ZCatalog
- schema()
- __call__(REQUEST=None, **kw)
- uncatalog_object(uid)
- getobject(rid, REQUEST=None)
- indexes()
- getpath(rid)
- index_objects()
- searchResults(REQUEST=None, **kw)
- There are some rules to consider when querying this method:
- uniqueValuesFor(name)
- catalog_object(obj, uid)
- ObjectManager Constructor
- manage_addZCatalog(id, title, vocab_id=None)
- module ZSQLMethod
- class ZSQLMethod
- manage_edit(title, connection_id, arguments, template)
- __call__(REQUEST=None, **kw)
- ObjectManager Constructor
- manage_addZSQLMethod(id, title, connection_id, arguments, template)
- module ZTUtils
- ZTUtils: Page Template Utilities
- class Batch
- __init__(self, sequence, size, start=0, end=0, orphan=0, overlap=0)
- module math
- module random
- random: Python random module
- module sequence
- sequence: Sequence sorting module
- def sort(seq, sort)
- DTML Examples
- Page Template Examples
- See Also
- module standard
- Products.PythonScripts.standard: Utility functions and classes
- def structured_text(s)
- def html_quote(s)
- def url_quote_plus(s)
- def dollars_and_cents(number)
- def sql_quote(s)
- def whole_dollars(number)
- def url_quote(s)
- class DTML
- __init__(source, **kw)
- call(client=None, REQUEST={}, **kw)
- def thousand_commas(number)
- def newline_to_br(s)
- module string
- string: Python string module
- Appendix C: Zope Page Templates Reference
- TAL Overview
- TAL Namespace
- TAL Statements
- Order of Operations
- See Also
- attributes: Replace element attributes
- Syntax
- Description
- Examples
- condition: Conditionally insert or remove an element
- Syntax
- Description
- Examples
- content: Replace the content of an element
- Syntax
- Description
- Examples
- See Also
- define: Define variables
- Syntax
- Description
- Examples
- omit-tag: Remove an element, leaving its contents
- Syntax
- Description
- Examples
- on-error: Handle errors
- Syntax
- Description
- Examples
- See Also
- repeat: Repeat an element
- Syntax
- Description
- Repeat Variables
- The following information is available from the repeat variable:
- Examples
- replace: Replace an element
- Syntax
- Description
- Examples
- See Also
- TALES Overview
- TALES Expression Types
- Built-in Names
- See Also
- TALES Exists expressions
- Syntax
- Description
- Examples
- TALES Nocall expressions
- Syntax
- Description
- Examples
- TALES Not expressions
- Syntax
- Description
- Examples
- TALES Path expressions
- Syntax
- Description
- Examples
- TALES Python expressions
- Syntax
- Description
- Security Restrictions
- Built-in Functions
- Python Modules
- Examples
- TALES String expressions
- Syntax
- Description
- Examples
- METAL Overview
- METAL Namespace
- METAL Statements
- See Also
- define-macro: Define a macro
- Syntax
- Description
- Examples
- See Also
- define-slot: Define a macro customization point
- Syntax
- Description
- Examples
- See Also
- fill-slot: Customize a macro
- Syntax
- Description
- Examples
- See Also
- use-macro: Use a macro
- Syntax
- Description
- Examples
- See Also
- ZPT-specific Behaviors
- Appendix D: Zope Resources
- Zope Web Sites
- Zope Documentation
- (Other) Zope Books
- Mailing Lists
- Python Information
- DTML Name Lookup Rules
Add New Comment