Personal tools
You are here: Home Plone Plone从无到有教程 安装Zope的产品
Document Actions

安装Zope的产品

by 潘俊勇 last modified 2006-08-23 21:55

按此觀看繁體版本

安装Plone 的产品一般都是很方便,可参看前一章 安装产品 。但是,有时候有些Zope产品很好用,我们可否加至Plone之中呢?

答案是yes和 no, 一般来说,是可以的,但要看情况才知怎样修改。这里我试范怎样将ZWeatherApplet 这个Zope 的天气报告加至你的Plone之中,你可以从中获得一些怎样在Plone使用其他Zope产品的头绪。

准备

  • 下载ZWeatherApplet (Zope Product)

  • 将下载档案解压至:

    C:\Program Files\Plone 2\Data\Products 
    
解压ZWeatherApplet
  • 下载pymetar (Python Module)

  • ZWeatherAppleat 还未支援最新的版本,建议使用这个0.5版本

  • 将下载档案解压至:

    C:\Program Files\Plone 2\Python\Lib\site-packages 
    
解压Pymetar

安装

好了,准备了所有档案。可以安装了。

  • 打开pythonwin.exe
解压PythonWin
  • 打开pymetar setup 档,
打开Setup.py
  • 按"Ctrl + R" 打开pythonWin 执行视窗。在Arguments及debugging栏键入"build" 及 "No debugging",然后按 "OK"
执行build
  • 重覆上一步,按"Ctrl + R" 打开pythonWin 执行视窗。不过在Arguments 栏键入"install" debugging 键入 "No debugging",然后按 "OK"
  • restart Zope
  • 在ZMI浏览至Plone,然后加上一个"ZWeatherApplet"。在新跳出的表格填上以下资料(在将来你可修改为适合你的资料),然后按 "Sumbit Query"
ZMI加入page_tempate

将Zope产品加入Plone的Slot面板中

  • 浏览至 Plone > portal_skins > custom ,加入一个新的 page_template
ZMI加入page_tempate
  • 键入id 为weatherslot,然后按"Add and Edit"。在新的文字栏贴上以下资料,然后按"Save":

    <html xmlns:tal="http://xml.zope.org/namespaces/tal"
    xmlns:metal="http://xml.zope.org/namespaces/metal"
    i18n:domain="plone">
    
    <body>
    <div metal:define-macro="weatherBox"
    tal:omit-tag="">
    <div class="portlet"
    tal:content="structure here/hkweather"> 
    customize your code here, read README in ZWeatherApplet
    </div>
    </div>
    </body>
    </html>
    
  • 浏览至Plone,按Properties格,在left_slots键入:

    here/weatherslot/macros/weatherBox 
    
加入ZWeatherAppletProperties

完成

ZWeatherApplet完成

啊,今天下雨呢!


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: