2

我有一个非常令人沮丧的开始学习 Plone 开发。我想为 Plone 4 开发一个基于灵巧的内容类型。我是一位经验丰富的 python 开发人员,对 Zope 和 Grok 有一定的了解,对于构建来说相当陌生。也就是说,我读了 Martin Aspeli 的“Professional Plone 4 Development”,但书中的相当多的版本信息似乎已经过时了。

使用 buildout,我能够启动并运行一个 Plone 实例。ZopeSkel 已安装,但当我尝试创建新包时,出现如下错误:

**************************************************************************
**  Your new package supports local commands.  To access them, change
**  directories into the 'src' directory inside your new package.
**  From there, you will be able to run the command `paster add
**  --list` to see the local commands available for this package.
**************************************************************************


ERROR: No egg-info directory found (looked in ./domma.voucher/./domma.voucher.egg-info, ./domma.voucher/bootstrap.py/domma.voucher.egg-info, ./domma.voucher/bootstrap.pyo/domma.voucher.egg-info, ./domma.voucher/buildout.cfg/domma.voucher.egg-info, ./domma.voucher/CHANGES.txt/domma.voucher.egg-info, ./domma.voucher/CONTRIBUTORS.txt/domma.voucher.egg-info, ./domma.voucher/docs/domma.voucher.egg-info, ./domma.voucher/domma/domma.voucher.egg-info, ./domma.voucher/README.txt/domma.voucher.egg-info, ./domma.voucher/setup.cfg/domma.voucher.egg-info, ./domma.voucher/setup.py/domma.voucher.egg-info, ./domma.voucher/src/domma.voucher.egg-info)

如果我尝试从给定目录中运行 paste,它会告诉我,命令“add”是未知的。我尝试了不同版本的 ZopeSkel,并尝试了原始 plone 模板和 zopeskel.dexterity。输出根据版本和模板略有变化,但结果保持不变。

Obvisouly Plone 开发似乎对版本更改非常敏感,这使得旧文档非常无用。http://plone.org/products/dexterity/documentation/manual/developer-manual告诉我,它上次更新是在 1114 年前。

有人可以给我一个起点,为 Plone 4 开发一个非常简单的灵巧内容类型,它真的有效吗?

4

4 回答 4

4

值得一提的是,虽然某些软件包有一些较新版本,但 Professional Plone 4 Development 是 Plone 4.1 的最新版本。我建议你使用它,并从它的示例代码开始。在你知道你有一个工作的起点之前,不要试图随意升级东西,你应该没问题。

于 2012-08-12T16:04:56.153 回答
3

http://pigeonflight.blogspot.com/2012/01/dexterity-development-quickstart-using.html提供了一个不错的快速入门。最新的 Dexterity 文档位于http://dexterity-developer-manual.readthedocs.org/en/latest/index.html。是的,从文档角度来看,这有点移动目标,与其说是因为 Dexterity 是稳定的而且在生产中,但主要是因为 Zopeskel 目前正在大力开发/现代化。对于那个很抱歉。

于 2012-08-12T14:34:18.037 回答
2

来自 [https://github.com/collective/templer.plone/blob/master/README.txt][1]

Templer 不能与旧版 ZopeSkel 或 Python virtualenv 共存。

否则在尝试创建包时会遇到以下错误::

  IOError: No egg-info directory found (looked in ./mycompany.content/./mycompany.content.egg-info, ....

Templer 是 ZopeSkel(版本 3)的最新版本。我不确定您拥有什么版本的 ZopeSkel,或者您是否在 buildout 或 virtualenv 中安装了混合版本。但是 ZopeSkel 的安装冲突可能是罪魁祸首。

我将从头开始并重新创建 vitualenv,然后通过 buildout 安装最新版本的 ZopeSkel 2。ZopeSkel 3 或 Templer 仍在大量开发中,并非所有模板都已迁移。

于 2012-08-13T14:16:59.457 回答
1

我能够使用这个构建创建一个具有新的敏捷内容类型的新 Plone 4.1.4 站点。这不应该是官方的回答,但是将配置粘贴到像 pastebin 这样的易失性服务并不是永久文档的选项。

# buildout.cfg file for Plone 4 development work
# - for production installations please use http://plone.org/download
# Each part has more information about its recipe on PyPi
# http://pypi.python.org/pypi 
# ... just reach by the recipe name
[buildout]
parts =  
    instance
    zopepy
    i18ndude
    zopeskel
    test
#    omelette

extends = 
    http://dist.plone.org/release/4.1-latest/versions.cfg
    http://good-py.appspot.com/release/dexterity/1.2.1?plone=4.1.4

# Add additional egg download sources here. dist.plone.org contains archives
# of Plone packages.
find-links =
    http://dist.plone.org/release/4.1-latest
    http://dist.plone.org/thirdparty

extensions = 
    mr.developer
    buildout.dumppickedversions

sources = sources

versions = versions

auto-checkout = 
    nva.borrow

# Create bin/instance command to manage Zope start up and shutdown
[instance]
recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 16080
debug-mode = off
verbose-security = on
blob-storage = var/blobstorage
zope-conf-additional = %import sauna.reload

eggs =
    Pillow
    Plone
    nva.borrow
    sauna.reload
    plone.app.dexterity

# Some pre-Plone 3.3 packages may need you to register the package name here in 
# order their configure.zcml to be run (http://plone.org/products/plone/roadmap/247)
# - this is never required for packages in the Products namespace (Products.*)
zcml =
#    nva.borrow
    sauna.reload


# zopepy commands allows you to execute Python scripts using a PYTHONPATH 
# including all the configured eggs
[zopepy]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = zopepy
scripts = zopepy

# create bin/i18ndude command
[i18ndude]
unzip = true
recipe = zc.recipe.egg
eggs = i18ndude

# create bin/test command
[test]
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress']
eggs =
    ${instance:eggs}

# create ZopeSkel and paster commands with dexterity support
[zopeskel]
recipe = zc.recipe.egg
eggs =
    ZopeSkel<=2.99
    PasteScript
    zopeskel.dexterity<=2.99
    ${instance:eggs}

# symlinks all Python source code to parts/omelette folder when buildout is run
# windows users will need to install additional software for this part to build 
# correctly.  See http://pypi.python.org/pypi/collective.recipe.omelette for
# relevant details.
# [omelette]
# recipe = collective.recipe.omelette
# eggs = ${instance:eggs}

# Put your mr.developer managed source code repositories here, see
# http://pypi.python.org/pypi/mr.developer for details on the format of
# this part
[sources]
nva.borrow = svn https://novareto.googlecode.com/svn/nva.borrow/trunk

# Version pindowns for new style products go here - this section extends one 
# provided in http://dist.plone.org/release/
[versions]
于 2012-08-12T17:47:20.767 回答