zope

Authentication from multi source in Plone 4?

核能气质少年 提交于 2019-12-11 12:25:42
问题 How can I authenticate user from multiple source altogether ? For example local (ZODB or ldap), facebook and openid. Do I need to write a new PAS plugin ? Or We can achieve this the existed products ? 回答1: There's no need to do anything. The authentication is already done from all sources at the same time. For ex, if you configure the ldap plugin, Plone's local users can still do login. 来源: https://stackoverflow.com/questions/7552423/authentication-from-multi-source-in-plone-4

Plone 4 : How to create Multiple Plone Sites

放肆的年华 提交于 2019-12-11 11:09:37
问题 I am using Plone 4 and I need to add another Plone Site in my Zope Instance i.e. One Plone site for testing/development and the other Plone site for production. I already have one Plone site installed and wonder how to install the other in the same instance. I have followed the steps listed here but have not been successful. I am using buildout. Could anyone tell me how to go about it or if I'm doing something wrong. Thanks. EDIT: I am looking for a way that will result in a different Data.fs

How to set TAL condition to check the file type and accordingly render the template in Plone 4.1

懵懂的女人 提交于 2019-12-11 09:42:25
问题 How to use the tal condition to check the file type and render the template in Plone 4.1 My file preview template rendering depends upon the file extension. If file extension is 'pdf', I wish to use something like this:(just started working with TAL, TALES, METAL) <tal:define="file_nm global string:${here/absolute_url}" <tal:condition="file_nm.slice[-3:] = 'pdf'"> <embed width="100%" height="100%" name="plug-in" tal:attributes="src string:${here/absolute_url}#" draggable="false" onselectstart

Save file to plone site using python

天大地大妈咪最大 提交于 2019-12-11 09:38:03
问题 I am generating an xml file in python, I need to save it to my plone site but am unsure how to. def generate_sitemap_index_file(self, sites): """ Generate a google sitemap index file """ root = ET.Element("sitemapindex") for site in sites: sitemap = ET.SubElement(root, "sitemap") loc = ET.SubElement(sitemap, "loc") loc.text = self.aq_parent.absolute_url() + "/googlesitemap/" + site ET.ElementTree(root).write("sitemap_index.xml") This function saves the file into my zinstance folder, but zope

Python multithreading

时间秒杀一切 提交于 2019-12-11 08:03:37
问题 I have this scenario: A web page created with Zope/Plone and some mine python API. There's a web page, call it "a", that by a python method calls a database (Postgres) and returns some information. On page "a" you can modify database data "offline" (I intend that the changes aren't written in the database instantly but in a second moment when you press "save" and call a python API method). So, imagine this scenario: an user, called "Sam", loads the page and start to modify data. Meanwhile an

How to inject template code in Plone?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 07:54:12
问题 My goal is to inject some HTML-Code in front of every Plone article (between the page's header and the first paragraph)? I'm running Plone 4. Does anyone have a hint on how to realize that? The other question is: is it possible to place some HTML code randomly in every Plone article? 回答1: Use viewlets for both usecases. A viewlet can be inserted in different parts of the rendered page, depending on both the viewlet manager you register it to and and what interfaces the viewlet applies to. The

Plone: Up and Down arrows in Contents page of folder missing. Cannot move items up or down

可紊 提交于 2019-12-11 05:05:42
问题 We are using Plone 4.1.3. When we go to the Contents page of a folder, there appears to be Up and Down arrows in the first column of the table in the page for a split second. I suppose these Up and Down arrow are for changing the display order of the items and subfolders inside the folder. Since these arrows are now gone, there is no way we can change the display order of an item in a folder. Instead Up and Down arrows, there is just a icon showing 2 columns x 4 rows of tiny dots which does

Less Conflicting Session Manager for Zope 2

拈花ヽ惹草 提交于 2019-12-11 02:38:44
问题 Zope2 Sessioning documentation: "Conflict errors will be retried automatically by Zope, and the end user should never see one." However, although I think I have the best setup for a high traffic deployment (temporary storage for session data on ZEO, shared by four clients, zope instances with identical setup), end user still gets Database ConflictErrors. Searching the mail lists, it seems this is a common issue for Zope's implementation of session data based on OOBTree. Some suggest using

How to set `secure` and `httpOnly` for Plones `__ac` cookie?

醉酒当歌 提交于 2019-12-11 02:19:14
问题 I have Plone 4.3.2 (Zope 2.13.21) installed. As mentioned in the documentation (http://plone.org/documentation/kb/securing-plone) cookies should be secure and httpOnly with Zope 2.12 or higher. Also note that the suggested patch has been included in Zope 2.12.0 b1, so Plone 4, which will use Zope 2.12 or higher, won't have this problem But if I log in as admin (or another user that is defined at zope-root) the __ac cookie is not secure and not httpOnly . If I log in as a user created in a

Logger does on work in RestrictedPython script in Plone

我的未来我决定 提交于 2019-12-11 00:08:39
问题 How to print in a .cpy file (python) ? I'm using Zope/Plone and I've just started with Python. I've tried this import logging logger = logging.getLogger() logger.info("hello plone") But it doesn't work. Thank you for your answer 回答1: The answer above means that you cannot import any modules in RestrictedPython scripts which are through-the-web editable Plone scripts. These scripts have end-user permissions, so they are not allowed to run arbitrary Python code. http://collective-docs