- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在很长一段时间没有使用它之后,我又回到使用 Plone 了。我们已经使用 Plone 4.0.5 设置了一个 Intranet。我们已将大量文档(主要是文件)上传到内联网。
该站点是使用带有 ZEO 配置的 Plone Unified Installer 安装的。添加了一些产品(鸡蛋)(如果您需要我们的 buildout.cfg 和/或 versions.cfg 的某些部分;请索取)到我们的 buildout.cfg
ZEO 服务器和客户端都在运行;我正在做:
$ bin/client1 debug
Starting debugger (the name "app" is bound to the top-level Zope object)
... several warnings ...
>>>
>>> len(app.plone.portal_catalog(portal_type="File"))
17
>>> from Products.CMFCore.utils import _getAuthenticatedUser
>>> _getAuthenticatedUser(app.ca.portal_catalog)
<SpecialUser 'Anonymous User'>
最佳答案
目录不返回所有条目可能有多种原因:
Language='all'
此过滤器已禁用。 Manager
角色的用户),请使用以下代码:
from AccessControl.SecurityManagement import newSecurityManager
site = app['Plone'] # Adjust as needed
# Assuming your username is 'admin', adjust as needed again:
user = app.acl_users.getUser('admin').__of__(site.acl_users)
newSecurityManager(None, user)
site_id = '<id of Plone site>' # Adjust as needed
import transaction, pdb
from zope.interface import implementedBy
from zope.component import getUtility, queryUtility, queryAdapter
from Zope2 import debug
from Acquisition import aq_inner, aq_parent, aq_chain
from zope.app.component.hooks import setSite, getSiteManager
from Testing.makerequest import makerequest
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager
try:
import readline
except ImportError:
print "Module readline not available."
else:
import rlcompleter
readline.parse_and_bind("tab: complete")
app = makerequest(app)
site = app[site_id]
setSite(site)
user = app.acl_users.getUser('admin').__of__(site.acl_users)
newSecurityManager(None, user)
关于Plone 的 portal_catalog(portal_type ="File") 没有返回我在 ZMI portal_catalog 页面中看到的所有对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12150401/
在很长一段时间没有使用它之后,我又回到使用 Plone 了。我们已经使用 Plone 4.0.5 设置了一个 Intranet。我们已将大量文档(主要是文件)上传到内联网。 该站点是使用带有 ZEO
我正在文件夹内执行搜索。不幸的是,它还会检索根文件夹,我不希望这样。 例子如下。如果我有一个类似于下面的目录结构: RootFolder ... SubFolder1 ... SubF
我正在查询 portal_catalog 以使用 (UID, Title) 元组填充词汇表。该站点同时包含原型(prototype)和敏捷内容。 brains = portal_catalog.sea
我正在编写一个用于保留不同资源的 Plone 日历模块。该模块具有一个日历,其事件存储在 Postgresql 中。每个日历都是一个存储在 ZODB 中的 Dexterity 对象。 为了在 Plon
我是一名优秀的程序员,十分优秀!