克隆/缩放的外部方法 [英] External Methods for Plone/Zope
问题描述
我有两个在服务器上运行的Plone实例-它们的位置是/usr/local/Plone/Inst1和/usr/local/Plone/Inst2.我正在尝试设置外部方法,但是很难弄清楚应该在哪里放置扩展"文件夹.似乎无论我将其放置在什么地方,ZMI都不会看到它.我已经尝试过:
I have two instances of Plone running on a server - their locations are /usr/local/Plone/Inst1 and /usr/local/Plone/Inst2. I'm trying to setup external methods, but am having a difficult time figuring out where my "Extensions" folder should be placed. It seems that where ever I place it, the ZMI never sees it. I have tried:
/usr/local/Plone/Extensions /usr/local/Plone/Inst1/Extensions
/usr/local/Plone/Extensions /usr/local/Plone/Inst1/Extensions
...以及"Inst1"目录中的各种其他子文件夹.添加外部方法时,我尝试将其添加到ZMI的根目录("/")和实例文件夹("/Inst1/")中.当我将其添加到根目录时,会收到一条消息,指出找不到指定的模块demo."当我尝试将其添加到实例文件夹中时,出现错误页面,提示此页面似乎不存在..."
...and various other sub-folders within the "Inst1" directory. When I add an external method, I've tried adding it at both the root of the ZMI ("/") and in the Instance folder ("/Inst1/"). When I add it to the root, I get a message that says "The specified module, demo, could not be found." When I try to add it in the instance folder, I get an error page that says "This page does not seem to exist..."
似乎ZMI无法找到该文件("demo.py").有应存放的特定地方吗?
It appears that the ZMI is failing to find that file ("demo.py"). Is there a particular place it should be stored?
从Zope网站上查看了文档(以及许多教程)后,它应该位于"Zope"文件夹中-但是我没有任何此类文件夹(文件系统上也没有任何名为扩展名"的文件夹,除了我在"Plone"和"Plone/Inst1"目录中创建的那个).
After looking over documentation from Zope's site (and numerous tutorials), it should be in the "Zope" folder - but I don't have any such folder (nor does any folder named "Extensions" exist on the file system, other than the one I created in the "Plone" and "Plone/Inst1" directories).
推荐答案
取决于您所安装的Plone版本会对此进行更改,但可能类似于:
Depending on what version of Plone you have installed will change this, but it is likely something like:
/path/to/plone/install/parts/instance/Extensions
/path/to/plone/install/parts/instance/Extensions
或
/path/to/plone/install/parts/client1/扩展
/path/to/plone/install/parts/client1/Extensions
您最好将外部方法放入产品中,因为将外部方法放入产品的"parts"实例文件夹中意味着每次运行buildout都会将其清除.然后,如果要使用它来制造产品,则可能会像"@@ plone_context_state"和"@@ plone_portal_state"那样使用可遍历的视图实用程序,通常是一种更好的制作方法.
You're probably better off putting the external method in a product though since placing an external method in it's "parts" instance folder will mean it will be wiped out every time you run buildout. Then if you're going to make a product out of it, you might as will do a traversable view utility like "@@plone_context_state" and "@@plone_portal_state" which is usually a better way to do it.
这篇关于克隆/缩放的外部方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!