New Riders -- The Zope Book

VIP免费
2025-02-27 0 0 4.98MB 303 页 5.9玖币
侵权投诉
The Zope Book
By Amos Latteier and Michel Pelletier
Copyright © 2000 by New Riders Publishing
This material may be distributed only subject to the terms and conditions set forth in the Open Publication
License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/).
Table of Contents
Introduction.........................................................................................................................................................1
Why Should I Read this Book?...............................................................................................................1
How the Book Is Organized....................................................................................................................1
Part I: Introducing Zope.............................................................................................................1
Part II: Creating Web Applications with Zope..........................................................................2
Part III: Developing Advanced Web Applications with Zope...................................................2
Conventions Used in This Book.............................................................................................................3
This book uses the following typographical conventions:.........................................................3
Chapter 1: Introducing Zope.............................................................................................................................4
What Is Zope?.........................................................................................................................................4
Powerful Collaboration...........................................................................................................................5
Simple Content Management..................................................................................................................5
Web Components....................................................................................................................................5
Zope History...........................................................................................................................................6
Who Can Benefit from Zope?.................................................................................................................6
How Can You Benefit From Zope?........................................................................................................6
What Zope Gives You............................................................................................................................7
Zope Alternatives....................................................................................................................................8
Zope Community....................................................................................................................................8
Chapter 2: Using Zope........................................................................................................................................9
Downloading Zope..................................................................................................................................9
Installing Zope........................................................................................................................................9
Installing Zope for Windows.....................................................................................................9
Downloading Linux and Solaris Binaries..................................................................................9
Getting Zope in RPM and deb format.....................................................................................10
Compiling Zope from Source Code.........................................................................................10
Starting Zope.........................................................................................................................................10
Starting Zope On Windows.....................................................................................................11
Starting Zope on UNIX............................................................................................................11
Logging In.............................................................................................................................................11
Controlling Zope with Management Interface......................................................................................12
Using the Navigator..............................................................................................................................12
Using The Workspace...........................................................................................................................13
Understanding Users in Zope................................................................................................................13
Creating Users.......................................................................................................................................14
Changing Logins...................................................................................................................................15
Creating Objects....................................................................................................................................15
Moving Objects ....................................................................................................................................16
Undoing Mistakes.................................................................................................................................17
Undo Details and Gotchas....................................................................................................................18
Administering and Monitoring Zope....................................................................................................18
Using the Help System.........................................................................................................................19
Browsing and Searching Help .............................................................................................................20
Starting with the Zope Tutorial ............................................................................................................21
Chapter 3: Using Basic Zope Objects.............................................................................................................22
Using Zope Folders...............................................................................................................................22
Managing Folder Contents....................................................................................................................23
Importing and Exporting Objects..........................................................................................................23
Table of Contents
Using Zope Documents ........................................................................................................................24
DTML Documents................................................................................................................................24
Creating DTML Documents.................................................................................................................25
Editing DTML Documents...................................................................................................................25
Uploading an HTML File.....................................................................................................................26
Remote Editing with FTP, WebDAV, and PUT...................................................................................26
Uploading Documents and Files with WS_FTP...................................................................................27
Editing Zope Objects with Emacs.........................................................................................................28
Editing DTML Documents with WebDAV..........................................................................................29
Reviewing Changes to Documents.......................................................................................................30
Viewing DTML Documents.................................................................................................................30
Calling Through the Web........................................................................................................31
Calling from Another Object...................................................................................................31
Using Zope Files...................................................................................................................................32
Uploading Files.....................................................................................................................................32
Viewing Files........................................................................................................................................33
Using Zope Images ..............................................................................................................................33
Viewing Images with HTML................................................................................................................33
Viewing Images Through the Web.......................................................................................................34
Using Object Properties........................................................................................................................34
Coding Logic with Scripts...................................................................................................................36
Using Methods .....................................................................................................................................37
Comparing DTML Documents and Methods.......................................................................................39
Using Versions......................................................................................................................................40
Cache Manager.....................................................................................................................................42
Adding a Cache Manager......................................................................................................................43
Caching a Document.............................................................................................................................44
Virtual Hosting Objects........................................................................................................................44
Sending mail with MailHost.................................................................................................................45
Chapter 4: Dynamic Content with DTML.....................................................................................................46
Who is DTML For?..............................................................................................................................46
What is DTML Good for?.....................................................................................................................46
When Not to Use DTML......................................................................................................................47
DTML Tag Syntax................................................................................................................................48
Using DTML Tag Attributes...................................................................................................48
Inserting Variables with DTML............................................................................................................49
Processing Input from Forms................................................................................................................50
Dynamically Acquiring Content...........................................................................................................51
Using Python Expressions from DTML...............................................................................................53
DTML Expression Gotchas.....................................................................................................54
The Var Tag..........................................................................................................................................55
Var Tag Attributes...................................................................................................................55
Var Tag Entity Syntax.............................................................................................................56
The If Tag.............................................................................................................................................56
Here's an example condition:...................................................................................................56
Name and Expression Syntax Differences...............................................................................57
Else and Elif Tags....................................................................................................................57
Using Cookies with the If Tag..............................................................................................................58
The In Tag.............................................................................................................................................59
Iterating over Folder Contents.................................................................................................59
Table of Contents
In Tag Special Variables..........................................................................................................61
Chapter 5: Creating Basic Zope Applications................................................................................................63
Building Applications with Folders......................................................................................................63
Calling Objects on Folders with URLs ...................................................................................63
The Special Folder Object index_html....................................................................................64
Building the Zope Zoo Website............................................................................................................64
Navigating the Zoo..................................................................................................................64
Adding a Front Page to the Zoo...............................................................................................66
Improving Navigation..............................................................................................................67
Factoring out Style Sheets.......................................................................................................69
Creating a File Library.............................................................................................................70
Building a Guest Book.............................................................................................................72
Extending the Guest Book to Generate XML..........................................................................76
The Next Step.......................................................................................................................................77
Chapter 6: Users and Security.........................................................................................................................78
Introducing Security..............................................................................................................................78
Logging in and Logging Out of Zope......................................................................................78
Authentication and Authorization............................................................................................78
Authentication and Managing Users.....................................................................................................79
Creating Users in User Folders................................................................................................79
Editing Users............................................................................................................................80
Defining a User's Location......................................................................................................80
Working with Alternative User Folders ..................................................................................81
Special User Accounts.............................................................................................................82
Authorization and Managing Security..................................................................................................84
Working with Roles.................................................................................................................85
Defining Roles.........................................................................................................................85
Understanding Local Roles......................................................................................................86
Understanding Permissions......................................................................................................86
Defining Security Policies.......................................................................................................87
Security Policy Acquisition.....................................................................................................88
Security Usage Patterns........................................................................................................................88
Security Rules of Thumb.........................................................................................................88
Global and Local Policies........................................................................................................89
Delegating Control to Local Managers....................................................................................89
Different Levels of Access with Roles....................................................................................90
Controlling Access to Locations with Roles............................................................................91
Performing Security Checks.................................................................................................................91
Advanced Security Issues: Ownership and Executable Content..........................................................92
The Problem: Trojan Horse Attacks........................................................................................92
Managing Ownership...............................................................................................................93
Roles of Executable Content....................................................................................................94
Proxy Roles..............................................................................................................................94
Summary...............................................................................................................................................95
Chapter 7: Variables and Advanced DTML..................................................................................................96
How Variables are Looked up..............................................................................................................96
DTML Namespaces..............................................................................................................................97
DTML Client Object ...............................................................................................................98
Table of Contents
DTML Request Object.............................................................................................................99
Rendering Variables..............................................................................................................101
Modifying the DTML Namespace......................................................................................................101
In Tag Namespace Modifications..........................................................................................101
The With Tag.........................................................................................................................101
The Let Tag............................................................................................................................102
DTML Namespace Utility Functions .................................................................................................103
DTML Security...................................................................................................................................105
Safe Scripting Limits.............................................................................................................106
Advanced DTML Tags.......................................................................................................................106
The Call Tag.......................................................................................................................................106
The Comment Tag..............................................................................................................................107
The Tree Tag.......................................................................................................................................107
The Return Tag...................................................................................................................................110
The Sendmail Tag...............................................................................................................................110
The Mime Tag.....................................................................................................................................111
The Unless Tag...................................................................................................................................112
Batch Processing With The In Tag.....................................................................................................113
Exception Handling Tags....................................................................................................................115
The Raise Tag........................................................................................................................115
The Try Tag...........................................................................................................................115
Conclusion..........................................................................................................................................118
Chapter 8: Advanced Zope Scripting...........................................................................................................119
Zope Scripts........................................................................................................................................119
Calling Scripts.....................................................................................................................................119
Calling Scripts From the Web...............................................................................................120
Calling Scripts from other Objects........................................................................................121
Passing Parameters to Scripts................................................................................................123
Script Security.....................................................................................................................................127
The Zope API......................................................................................................................................127
Using Python−based Scripts...............................................................................................................128
The Python Language............................................................................................................128
Creating Python−based Scripts..............................................................................................129
String Processing...................................................................................................................131
Doing Math............................................................................................................................132
Binding Variables..................................................................................................................132
Print Statement Support.........................................................................................................133
Security Restrictions..............................................................................................................134
Built−in Functions.................................................................................................................134
Using External Methods.....................................................................................................................135
Processing XML with External Methods...............................................................................139
External Method Gotchas......................................................................................................140
Using Perl−based Scripts....................................................................................................................141
The Perl Language.................................................................................................................141
Creating Perl−based Scripts...................................................................................................141
Perl−based Script Security.....................................................................................................142
DTML versus Python versus Perl.......................................................................................................142
Remote Scripting and Network Services............................................................................................143
Using XML−RPC..................................................................................................................143
Remote Scripting with HTTP................................................................................................144
摘要:

TheZopeBookByAmosLatteierandMichelPelletierCopyright©2000byNewRidersPublishingThismaterialmaybedistributedonlysubjecttothetermsandconditionssetforthintheOpenPublicationLicense,v1.0orlater(thelatestversionispresentlyavailableathttp://www.opencontent.org/openpub/).TableofContentsIntroduction.............

展开>> 收起<<
New Riders -- The Zope Book.pdf

共303页,预览5页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:计算机 价格:5.9玖币 属性:303 页 大小:4.98MB 格式:PDF 时间:2025-02-27

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 303
客服
关注