阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]



init()
override this to perform custom initialization at load time
重载这个方法,当加载的时候执行自定义的初始化。

getDescription()
override to return a description string for the snakelet
为snakelet返回描述字符串

requiresSession()
override this to return one of the special SESSION_* values defined in the Snakelet class (for instance return self.SESSION_WANTED), that signify what kind of session is required. Also see the session Ypage-declaration below. The possible values are: SESSION_NOT_NEEDED (no session and session cookie), SESSION_WANTED (use session and session cookie), SESSION_REQUIRED (requires a synchronised session), SESSION_LOGIN_REQUIRED (requires a session with a logged in user), SESSION_DONTCREATE (use existing session, if available, if not: do NOT create a new session). If you use the last one and you do not provide a means of user-authentication (see getAuthMethod below), Snakelets will return a 403-error page when you try to access the page if you are not logged in.
返回在Snakelet 类中定义的特殊 SESSION_* 的值(比如返回self.SESSION_WANTED),见下文的 session 的 Ypage声明。可能存在的值:SESSION_NOT_NEEDED (没有session 和 session cookie),SESSION_WANTED (使用session 和 session cookie), SESSION_REQUIRED (请求同步session),SESSION_LOGIN_REQUIRED(请求已经登陆的用户session),SESSION_DONTCREATE(如果已经存在的session,使用这个session,如果没有也不另外创建新的)。如果您使用最后一个并且您没有提供用户验证的方法或手段(见 getAuthMethod),当您在没有登陆的情况下试图访问页面,Snakelets将返回 403-error 页面错误

getAuthorizedRoles()
override this to return a list or set of privilige names that are allowed to access this snakelet. Default is None (no access control).
返回可以访问snakelet的特权名称列表或者设置列表。默认是None。

getAuthMethod()
override this to return a tuple (method,argument) that defines the authentication method to use for this snakelet. See authorization.
返回一个定义了验证方法的数组。

allowCaching()
override this to return True if the browser is allowed to cache the page, False otherwise. Default is False.
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.