在Plone 4应用程序中动态加载MathJax时,我遇到了性能问题。因此,我在https://github.com/collective/collective.mathjax中找到了Plone集成,并且,正如我注意到的那样,它分叉工作,运行良好;我包含了当前的MathJax 2.3,并将配置文件更改为使用“本地”副本。
现在,我想知道是否可以在"online"/"remote“行为(从rackcdn.com加载所有内容)和”默认“行为(使用包含的副本)之间进行选择,方法是在Plone QuickInstaller工具中安装产品时选择配置文件。
我像这样改变了configure.zcml:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="collective.mathjax">
<browser:resourceDirectory
name="mathjax"
directory="resources/MathJax" />
<genericsetup:registerProfile
name="default"
title="collective.mathjax: default"
directory="profiles/default"
description="collective.mathjax default profile: Includes MathJax 2.3."
provides="Products.GenericSetup.interfaces.EXTENSION" />
<genericsetup:registerProfile
name="online"
title="collective.mathjax: online"
directory="profiles/online"
description="collective.mathjax online profile: Load MathJax dynamically from rackcdn.com."
provides="Products.GenericSetup.interfaces.EXTENSION" />
</configure>不幸的是,我无法在QuickInstaller中看到“在线”配置文件,甚至在卸载产品和更改版本号之后也看不到。
更新:在控制台输出中,我找到了以下文本:
INFO CMFQuickInstallerTool产品
collective.mathjax的多个扩展配置文件。二手配置文件:collective.mathjax:default
是否有一些根本性的误解,或者我能做些什么让人们选择?
发布于 2014-04-22 15:35:13
从Ida和Keul的有益评论中可以得到一个答案:
git checkout <branch name>buildout.cfg以反映更改。
发布于 2014-04-14 11:28:29
profile ( ZMI和Plone )将只显示一个配置文件作为“安装”配置文件。被选中的人将是第一个被发现的(按字母顺序)。
要手动运行配置文件,请转到ZMI中的portal_setup工具,然后转到“导入”选项卡并选择您想要的配置文件(这里提供的订单一团糟).你可能会找到一个很长的组合盒)。在页面末尾选择“导入所有步骤”
发布于 2015-02-05 11:16:44
实际上,可以在Quickinstaller中显示多个“替代”配置文件--您只需通过为自己的(子)包注册每个配置文件就可以‘欺骗’GenericSetup。
因此,诀窍是将配置文件定义放在驻留在不同包(目录)中的不同configure.zcml文件中,并确保在每个configure.zcml文件中包含<five:registerPackage package="."/>指令。
虽然它有效,但我不知道这个技巧有多值得推荐:我在dexterity.membrane包中找到了它,在这里用作示例:
首先,“默认”配置文件完全正常地在configure.zcml包的主dexterity.membrane中注册。没有什么特别的-,但请注意,它包括子包。
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="dexterity.membrane">
<!-- Include configuration for dependencies listed in setup.py -->
<includeDependencies package="." />
<!-- Grok the package to initialise schema interfaces and content classes -->
<i18n:registerTranslations directory="locales" />
<include package=".behavior" />
<include package=".content" />
<!-- Register an extension profile to make the product installable -->
<genericsetup:registerProfile
name="default"
title="dexterity.membrane: behaviors"
description="Configuration for the dexterity.membrane behaviors"
directory="profiles/default"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<!-- Note that the example profile is registered in the content
directory. It is registered in such a way that both profiles
are visible and can be installed separately. Any upgrade steps
for that profile are also defined there. -->
<genericsetup:upgradeStep
title="Update profile"
description="Dummy step to fix profile registration after rename."
source="1000"
destination="1001"
handler="dexterity.membrane.migration.dummy_step"
profile="dexterity.membrane:default" />
<adapter name="Title" factory=".indexers.Title" />
<!-- -*- extra stuff goes here -*- -->
</configure>这里是上述registerPackage的configure.zcml:也没有什么特别的,除了(第二个)指令和第二个profile
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="dexterity.membrane">
<!-- make this show up in the quickinstaller separately -->
<five:registerPackage package="."/>
<genericsetup:registerProfile
name="example"
title="dexterity.membrane: content"
description="Configuration for the dexterity.membrane example content type"
directory="../profiles/example"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
</configure>https://stackoverflow.com/questions/23056387
复制相似问题