From raina.gamboa at gmail.com Fri May 4 08:21:23 2007 From: raina.gamboa at gmail.com (Raina) Date: Fri, 4 May 2007 15:21:23 +0900 Subject: [kupu-dev] Kupu Invalid Characters Message-ID: Hi, I'm new to kupu and I'm developing a Japanese web application. I want to where in the kupu code does it recognize invalid characters? Thank you -- ~ Hevn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-dev/attachments/20070504/d5a556ee/attachment.htm From duncan.booth at suttoncourtenay.org.uk Fri May 4 10:40:01 2007 From: duncan.booth at suttoncourtenay.org.uk (Duncan Booth) Date: Fri, 4 May 2007 08:40:01 +0000 (UTC) Subject: [kupu-dev] Kupu Invalid Characters References: Message-ID: Raina wrote: > Hi, I'm new to kupu and I'm developing a Japanese web application. I > want to where in the kupu code does it recognize invalid characters? > Thank you > It doesn't. Tags and attributes are filtered but character codes are not. From kumar.raveendran at gmail.com Sat May 5 08:51:31 2007 From: kumar.raveendran at gmail.com (kumar r) Date: Sat, 5 May 2007 12:21:31 +0530 Subject: [kupu-dev] regarding calling kupu editor through ajax Message-ID: i am able to call the page having kupu editor in it. its rendering kupu editor but no other functionality of kupu editor is getting activated. is there ne solution for that. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-dev/attachments/20070505/450ac259/attachment.htm From duncan.booth at suttoncourtenay.org.uk Tue May 15 12:37:19 2007 From: duncan.booth at suttoncourtenay.org.uk (Duncan Booth) Date: Tue, 15 May 2007 10:37:19 +0000 (UTC) Subject: [kupu-dev] Kupu Flash Support Message-ID: I've checked in support for Flash files on the trunk. This is somewhat experimental, but it should have no impact unless you actually enable it from the configlet. I'd love to get feedback especially if anyone can suggest better ways to handle the issues. The biggest issue is that when editing in Firefox you cannot see the Flash object at all without a kludge in the CSS, and even with that there is no way to move or resize the Flash object once it has been inserted. IE has its own problems: if you click inside the Flash object kupu gets no event to trigger the code which tracks the selection. You have to click on the edge of the Flash object to get it properly selected. Fortunately there is visual feedback (a cross-hatched border means that kupu will mess up if you try to replace the Flash object, a border with sizing handles only means you got it right). >From the documentation: Flash ----- Kupu has some support for embedding Flash objects using the ATFlashMovie content type, but requires some configuration. Other Flash content types may also work but have not been tested. 1. Install ATFlashMovie. 2. Got to the resource types tab of the configlet. 3. Under the resource ``mediaobject`` add Flash Movie to the selection and save. 4. In the action urls table at the bottom of the page, add a new entry for the type Flash Movie. The preview may be left blank or be the same as the 'normal' image. For 'normal image' you should enter ``string:${object_url}/download``. Leave fieldname blank and in the 'type' field select 'Flash'. Flash movies should now appear in the image drawer and be insertable into the document. Using IE the Flash movie will appear in the document and may be edited or moved as desired. Firefox will not play the movie while you are editing, so a 'flash placeholder' image is displayed instead: you cannot select it in Firefox so if you need to delete a Flash movie you will need to include the image in a slightly larger selection (e.g. spaces before and after) and delete that. From TurnerLC at ldschurch.org Tue May 15 16:17:40 2007 From: TurnerLC at ldschurch.org (Lynn Turner) Date: Tue, 15 May 2007 08:17:40 -0600 Subject: [kupu-dev] Staging Addon 1.6.1 and Kupu Message-ID: <46496CA4020000A600025BD1@inet-wh1.gmhwh.org> We recently installed Staging Addon 1.6.1 on our site to have staging/versioning of our documents (pages) created in Kupu. We configured our workflow, which works great, except for one thing, and I was hoping that you guys could help out. I've created an issue on the Staging Addon project page (issue #32), but suggested that I create a patch for the fix, which I don't have time to do, nor the expertise to do...so I turn to you. We have many documents on our site, most of which link to another (or multiple) document inside the site. We have configured the workflow to archive the old version of a document, when a new version of it has been published. However this does not update all the internal links that pointed to the original document, which means that we have to manually go into the site and update all the links that pointed to the old version and redirect them to the new version. The Staging Addon developers responded the following way: "I suppose that you use Kupu's "resolve uids" mechanism? Is that right? If not, you should not have this problem. For now, StagingAddOn only swaps ids (hence the URLs) of the old version and the new one upon publishing. To let Kupu's "resolve uid" feature work, we should also swap their UIDs. I had not been so keen to do that, until now. However, we already change all references from the old version to the new one. Changing the UID would be very similar and actually achieve more than what we do now. I may implement that, someday (though if you have a patch and tests, I will happily use them)." Do any of you know how I would "swap" UIDs (between versions) so that when we publish the new version of a document that all links that pointed to the old version are updated and point to the new version? Would anyone have suggestions for creating that patch? Is there an easier way to do this? Thank you very much for any help you may be able to provide! sincerely, Lynn Turner Research Support, Family History Dept. ---------------------------------------------------------------------- NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://codespeak.net/pipermail/kupu-dev/attachments/20070515/1cf30bec/attachment.htm From duncan.booth at suttoncourtenay.org.uk Tue May 15 21:16:01 2007 From: duncan.booth at suttoncourtenay.org.uk (Duncan Booth) Date: Tue, 15 May 2007 19:16:01 +0000 (UTC) Subject: [kupu-dev] Staging Addon 1.6.1 and Kupu References: <46496CA4020000A600025BD1@inet-wh1.gmhwh.org> Message-ID: "Lynn Turner" wrote: > The Staging Addon developers responded the following way: > "I suppose that you use Kupu's "resolve uids" mechanism? Is that > right? If not, you should not have this problem. For now, > StagingAddOn only swaps ids (hence the URLs) of the old version > and the new one upon publishing. To let Kupu's "resolve uid" > feature work, we should also swap their UIDs. I had not been so > keen to do that, until now. However, we already change all > references from the old version to the new one. Changing the UID > would be very similar and actually achieve more than what we do > now. I may implement that, someday (though if you have a patch and > tests, I will happily use them)." > > Do any of you know how I would "swap" UIDs (between versions) so that > when we publish the new version of a document that all links that > pointed to the old version are updated and point to the new version? > Would anyone have suggestions for creating that patch? Is there an > easier way to do this? > > Thank you very much for any help you may be able to provide! > > I'm afraid I don't know anything about Staging Addon, at Oxfam we use Plone Multisite to provide staging (but not versioning) and that deliberately preserves uids specifically to avoid problems. You (or the developer of staging addon) might be able to get somewhere by using the RefTextField type in kupu for your content types. That ensures (when you use uid linking) that you have genuine Archetypes references for all the objects linked from the kupu editable field. That should make it comparatively easy for the staging product to find affected documents and update them when it wants to change the uids. From deo at plonesolutions.com Thu May 17 04:41:54 2007 From: deo at plonesolutions.com (=?UTF-8?B?RG9ybmVsZXMgVHJlbcOpYQ==?=) Date: Wed, 16 May 2007 23:41:54 -0300 Subject: [kupu-dev] UnicodeDecodeError in kupu_migration.xml.pt Message-ID: Hey Duncan, folks, we hit a problem today: when trying to access the 'links' tab, the following exception is raised: > 2007-05-16 20:30:36 ERROR Zope.SiteErrorLog http://localhost:8080/test/kupu_library_tool/kupu_migration.xml > Traceback (innermost last): > Module ZPublisher.Publish, line 115, in publish > Module ZPublisher.mapply, line 88, in mapply > Module ZPublisher.Publish, line 41, in call_object > Module Shared.DC.Scripts.Bindings, line 311, in __call__ > Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec > Module Products.CMFCore.FSPageTemplate, line 195, in _exec > Module Products.CacheSetup.patch_cmf, line 18, in FSPT_pt_render > Module Products.CacheSetup.patch_utils, line 9, in call_pattern > Module Products.CMFCore.FSPageTemplate, line 134, in pt_render > Module Products.CacheSetup.patch_cmf, line 68, in PT_pt_render > Module Products.CacheSetup.patch_utils, line 9, in call_pattern > Module Products.PageTemplates.PageTemplate, line 104, in pt_render > - > Module TAL.TALInterpreter, line 238, in __call__ > Module TAL.TALInterpreter, line 281, in interpret > Module TAL.TALInterpreter, line 457, in do_optTag_tal > Module TAL.TALInterpreter, line 442, in do_optTag > Module TAL.TALInterpreter, line 437, in no_tag > Module TAL.TALInterpreter, line 281, in interpret > Module TAL.TALInterpreter, line 715, in do_condition > Module TAL.TALInterpreter, line 281, in interpret > Module TAL.TALInterpreter, line 691, in do_loop_tal > Module TAL.TALInterpreter, line 281, in interpret > Module TAL.TALInterpreter, line 457, in do_optTag_tal > Module TAL.TALInterpreter, line 442, in do_optTag > Module TAL.TALInterpreter, line 437, in no_tag > Module TAL.TALInterpreter, line 281, in interpret > Module TAL.TALInterpreter, line 310, in do_startEndTag > Module TAL.TALInterpreter, line 339, in do_startTag > Module TAL.TALInterpreter, line 405, in attrAction_tal > Module Products.PageTemplates.TALES, line 227, in evaluateText > Module Products.PageTemplates.TALES, line 221, in evaluate > - URL: file:kupu/plone/kupu_plone_layer/kupu_migration.xml.pt > - Expression: string:u'${f/label}' > - Names: > {'container': , > 'context': , > 'default': , > 'here': , > 'loop': , > 'modules': , > 'nothing': None, > 'options': {'args': ()}, > 'repeat': , > 'request': , > 'root': , > 'template': , > 'traverse_subpath': [], > 'user': } > Module Products.PageTemplates.Expressions, line 229, in __call__ > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 14: ordinal not in range(128) I tracked the problem down and it happens in this situation: - you have a content-type with a field which is editable using kupu (RichWidget, VisualWidget) - that particular field has a given msgid for the widget label - that msgid has a translation containing non-ascii chars in some languages Then, when you access the 'links' tab with a browser configured to use one of those languages with has a non-ascii translation, kupu tries to list all content-types and the respective available fields. This is provided by the getKupuFields method from kupu.plone.plonedrawers.py which returns a dictionary with these keys: 'type', 'name', 'portal_type' and 'label'. As the above traceback, the exception is caused by the 'f/label' expression. The 'label' value is calculated with: f.widget.Label(self) It returns an encoded string (not an unicode) and then, later, when using it in the kupu_migration.xml, Zope internally seems to try to interpolate the 'label' value to generate the proper 'value' attribute for the input tag: At that point, the 'value' label is a string containing non-ascii chars encoded with the encoding defined in portal_properties/site_properties/default_charset. It will obviously fail when interpolated against any unicode object. The proposed fix for this issue is to transform the 'label' value into an unicode again, as in: f.widget.Label(self).decode(site_encoding) The site_encoding can be get via CMFPlone.utils.getSiteEncoding method, this is the complete patch: > Index: kupu/plone/plonedrawers.py > =================================================================== > --- kupu/plone/plonedrawers.py (revis?o 43446) > +++ kupu/plone/plonedrawers.py (c?pia de trabalho) > @@ -23,6 +23,7 @@ > from Products.PythonScripts.standard import html_quote, newline_to_br > from Products.kupu.plone.librarytool import KupuError > from Products.CMFCore.utils import getToolByName > +from Products.CMFPlone.utils import getSiteEncoding > import html2captioned > > try: > @@ -762,9 +763,11 @@ > def getKupuFields(self, filter=1): > """Returns a list of all kupu editable fields""" > inuse = getToolByName(self, 'portal_catalog').uniqueValuesFor('portal_type') > + site_encoding = getSiteEncoding(self) > for t,f,pt in self._getKupuFields(): > if html2captioned.sanitize_portal_type(pt) in inuse or not filter: > - yield { 'type': t, 'name': f.getName(), 'label': f.widget.Label(self), 'portal_type':pt } > + yield dict(type=t, name=f.getName(), portal_type=pt, > + label=f.widget.Label(self).decode(site_encoding)) > > def _getKupuFields(self): > """Yield all fields which are editable using kupu""" I can commit it, but I thought it would be nice to raise the question here first. Thoughts? -- ___________________________________________________________________ Dorneles Trem?a ? Developer ? Plone Solutions ? Brazil Consulting ? Training ? Development ? http://plonesolutions.com ___________________________________________________________________ Plone Foundation ? http://plone.org/foundation ? Protecting Plone From deo at plonesolutions.com Wed May 23 17:38:13 2007 From: deo at plonesolutions.com (=?UTF-8?B?RG9ybmVsZXMgVHJlbcOpYQ==?=) Date: Wed, 23 May 2007 12:38:13 -0300 Subject: [kupu-dev] UnicodeDecodeError in kupu_migration.xml.pt In-Reply-To: References: Message-ID: Hello, > I can commit it, but I thought it would be nice to raise the > question here first. committed: http://codespeak.net/pipermail/kupu-checkins/2007-May/003047.html -- ___________________________________________________________________ Dorneles Trem?a ? Developer ? Plone Solutions ? Brazil Consulting ? Training ? Development ? http://plonesolutions.com ___________________________________________________________________ Plone Foundation ? http://plone.org/foundation ? Protecting Plone