[Zope3-Users] Kupu and Zope3

2007-08-20 Thread Jeremy Cook
Is anyone using Kupu (or any other visual editor) with zope3? I saw
hints that it might be ported to zope3 or conversely that kupu must
die. When I tried installing it under zope3 I didn't get awfully far.

Any ideas how to proceed?

Jeremy

-- 
[EMAIL PROTECTED]tlf: +47 55 58 40 65
Parallab  Bergen Centre for Computational Science
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: ObjectModifiedEvent but not ContainerModifiedEvent

2007-08-20 Thread Chris Withers

Jeff Shell wrote:


Well,

a container is an object.

It's being modified by the sake of its content changing.


Yeah, but the reason there's two types of events would probably be so 
you can differentiate between them with subscribers.


The inheritence structure and nature of how adapters/subscribers works 
seems to be sub-optimal, especially for my use case, which I suspect may 
be a common one: the set of operations you want to do when a container's 
properties change doesn't have much intersection with those you want to 
do when the contents of a container changes.


Better way? The only better way, really, would be doing a re-dispatch. 
Or fire off your own event when you modify other properties on a container.


Indeed. I think a better long term solution would be to have 
ContainerModified be seperate from ObjectModified, no?


Or kick all of the code that sends modified events so that they send 
along descriptions of what has changed. 


You're still filtering then, and I don't think we want ot be filtering 
in that way here...


cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Kupu and Zope3

2007-08-20 Thread Tom Dossis


On 20/08/2007, at 7:45 PM, Jeremy Cook wrote:


Is anyone using Kupu (or any other visual editor) with zope3? I saw
hints that it might be ported to zope3 or conversely that kupu must
die. When I tried installing it under zope3 I didn't get awfully far.

Any ideas how to proceed?


There's also zope.html which incorporates fckeditor.
http://svn.zope.org/zope.html/
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Creating edit form with z3c.form

2007-08-20 Thread Hermann Himmelbauer
Am Montag, 20. August 2007 12:09 schrieb Florian Lindner:
 Am Sonntag, 19. August 2007 schrieb Hermann Himmelbauer:
  Am Samstag, 18. August 2007 12:53 schrieb Florian Lindner:
  Hmmm, perhaps the browser request is not marked with the IFormLayer
  layer? (Hence you need a skin that derives from it.)

 It's a real browser request (not generated by some piece of test code, but
 from a real browser) with no layer (thus the default layer). Moreover
 mostly indentical code that uses formlib works perfectly.

As far as I know, formlib-based forms work with the default layer, while 
z3c.form-based forms need the IFormLayer.

I recommend you to have a look at the z3c.formdemo package, there you will 
find working z3c.form examples which you can then clone.

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Creating edit form with z3c.form

2007-08-20 Thread Darryl Cousins
Hey Hermann,

On Sun, 2007-08-19 at 00:45 +0200, Hermann Himmelbauer wrote:
  raise ComponentLookupError(objects, interface, name)
  ComponentLookupError:
 ((zope.app.publisher.browser.viewmeta.EditEntry
  object at 0x9f6c68c, zope.publisher.browser.BrowserRequest
 instance
  URL=http://localhost:8080/Blog/2007_08_16_abc/EditEntry.html,
  Blog.blog.BlogEntry object at 0x9264d2c), InterfaceClass
  z3c.form.interfaces.IWidgets, u'') 

This tells us that we are looking for a multi-adapter to view, request
and context that adapts IWidgets (Have I got that right?). Florian was
on the right track to ask about the layer and pagelet but you might be
missing a configure / include where an adapter for IWidgets is
registered.

Hope that helps,
Darryl

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Kupu and Zope3

2007-08-20 Thread Jeff Shell
On Aug 20, 2007, at 3:45 AM, Jeremy Cook [EMAIL PROTECTED]  
wrote:



Is anyone using Kupu (or any other visual editor) with zope3? I saw
hints that it might be ported to zope3 or conversely that kupu must
die. When I tried installing it under zope3 I didn't get awfully far.


I tried and tried to use Kupu, and it was damn near impossible. I  
wouldn't recommend it to anybody. Which is too bad - the editor itself  
is great. But integrating it into custom environments was way too  
difficult.


We went with TinyMCE. It gets the job done. I yearn for more though.  
Kupu's ability to have link and image browsers is great. TinyMCE has  
them available, but as commercial add-ons.


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Kupu and Zope3

2007-08-20 Thread Jeremy Cook
Hi Darryl,

before I left work I did get tinymce installed :) without errors. Now
I was just wondering what:

 from training.forms import interfaces, mycontent

refers to in the example given? Is this something from 'formlib',  can
I find them somewhere else, or do I have to implement these myself,?
If the latter then a more complete example would help me!

Thanks,  Jeremy

On 20/08/07, Darryl Cousins [EMAIL PROTECTED] wrote:
 Hey Jeremy,

 On Mon, 2007-08-20 at 11:45 +0200, Jeremy Cook wrote:
  Is anyone using Kupu (or any other visual editor) with zope3? I saw
  hints that it might be ported to zope3 or conversely that kupu must
  die. When I tried installing it under zope3 I didn't get awfully far.

 tinymce implementation is straightforward, I began with a post from
 lovely:
 http://www.lovelysystems.com/reutz/2007/02/19/howto-use-tiny-mce-in-zope3/
 and with z3c.widget (svn.zope.org/z3c.widget)

 http://demo.tfws.org.nz/

 Hope that helps.
 Darryl

 
  Any ideas how to proceed?
 
  Jeremy
 




-- 
[EMAIL PROTECTED]tlf: +47 55 58 40 65
Parallab  Bergen Centre for Computational Science
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Request in Zope3-Thread

2007-08-20 Thread Markus Leist
Hi Philipp,
hi list,

maybe I'm wrong, but after several tests i have noticed this change
(caused by threading environment):

...
setSite(old_site)
transaction.get().commit()
conn.close()
...

with transaction.commit() there are some:
 ZODB.POSException.ConnectionStateError: Cannot close a connection joined to a 
 transaction
under special circumstances (more threads, some commits)

Does this transaction.get()... is the right way to interact with the
Thread-aware transaction manager?

Markus

Am Samstag 04 August 2007 um 11:13 Uhr schrieb Philipp von Weitershausen 
[EMAIL PROTECTED]:
 Markus Leist wrote:
  i have created a thread in my zope3-application like the 
  zope.sendmail.QueueProcessorThread.
  
  What i want to do: fake a request-context to get a local Utility 
  (via Sitemanager) configured in ZODB and call some methods which will
  change some object-attributes in ZODB.
 
 You'll have to open a new connection to the database in the thread and 
 get the root object from it (you'll have to give the thread a reference 
 to the database, which can be accessed from any persistent object thru 
 obj._p_jar, IIRC):
 
conn = db.open()
root = conn.root()
root_folder = root['Application']
 
 Now you can traverse to the site that contains the local utilities 
 (unless that's the root_folder) and make the current active site 
 (current = for this particular thread):
 
from zope.app.component.hooks import setSite
site = root_folder['path']['to']['the']['site']
setSite(site)
 
 Now do your component lookups, object modifications, etc. Don't forget 
 to commit the transaction at the end:
 
import transaction
transaction.commit()
 
 and close the connection:
 
conn.close()
 
 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Request in Zope3-Thread

2007-08-20 Thread Philipp von Weitershausen

On 20 Aug 2007, at 19:29 , Markus Leist wrote:

maybe I'm wrong, but after several tests i have noticed this change
(caused by threading environment):

...
setSite(old_site)
transaction.get().commit()
conn.close()
...

with transaction.commit() there are some:
ZODB.POSException.ConnectionStateError: Cannot close a connection  
joined to a transaction

under special circumstances (more threads, some commits)

Does this transaction.get()... is the right way to interact with the
Thread-aware transaction manager?


transaction.get().commit() should be completely equivalent to  
transaction.commit(). The setSite(old_site) call doesn't look  
necessary since the reference to the site is local to the thread.



Am Samstag 04 August 2007 um 11:13 Uhr schrieb Philipp von  
Weitershausen [EMAIL PROTECTED]:

Markus Leist wrote:
i have created a thread in my zope3-application like the  
zope.sendmail.QueueProcessorThread.


What i want to do: fake a request-context to get a local Utility
(via Sitemanager) configured in ZODB and call some methods which  
will

change some object-attributes in ZODB.


You'll have to open a new connection to the database in the thread  
and
get the root object from it (you'll have to give the thread a  
reference
to the database, which can be accessed from any persistent object  
thru

obj._p_jar, IIRC):

   conn = db.open()
   root = conn.root()
   root_folder = root['Application']

Now you can traverse to the site that contains the local utilities
(unless that's the root_folder) and make the current active site
(current = for this particular thread):

   from zope.app.component.hooks import setSite
   site = root_folder['path']['to']['the']['site']
   setSite(site)

Now do your component lookups, object modifications, etc. Don't  
forget

to commit the transaction at the end:

   import transaction
   transaction.commit()

and close the connection:

   conn.close()






___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Kupu and Zope3

2007-08-20 Thread Martin Aspeli

Jeff Shell wrote:
On Aug 20, 2007, at 3:45 AM, Jeremy Cook [EMAIL PROTECTED]  
wrote:



Is anyone using Kupu (or any other visual editor) with zope3? I saw
hints that it might be ported to zope3 or conversely that kupu must
die. When I tried installing it under zope3 I didn't get awfully far.


I tried and tried to use Kupu, and it was damn near impossible. I  
wouldn't recommend it to anybody. Which is too bad - the editor itself  
is great. But integrating it into custom environments was way too  
difficult.


Note that the Plone community has an interest in getting a kupu Zope 3 
widget. We haven't had much time since it wasn't in scope for 3.0, but I 
know of several people who need/want it.


And yeah... it's not the easiest thing in the world, unfortunately. :-/

Martin

--
Acquisition is a jealous mistress

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Request in Zope3-Thread

2007-08-20 Thread Markus Leist
Hi,

i don't understand, you are right:
class TransactionManager(object):
def commit(self):
return self.get().commit()

after deletion of
setSite(old_site)
it seems to be better, but under some circumstances there still is:
ZODB.POSException.ConnectionStateError: Cannot close a connection joined to a 
transaction
(sometimes).

Hmm, it's hard to debug this part of my app. I will do some kind of
printf-debugging in a few days.

the problem appears in an error-handler of my app ... and there are no
errors in/with the application ;-)

Thanx for the quick answer.

Markus

Am Montag 20 August 2007 um 19:30 Uhr schrieb Philipp von Weitershausen [EMAIL 
PROTECTED]:
 [...] 
 transaction.get().commit() should be completely equivalent to  
 transaction.commit(). The setSite(old_site) call doesn't look  
 necessary since the reference to the site is local to the thread.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users