Re: [Zope3-Users] Two content objects' simultaneous adding

2006-05-20 Thread Jean-Marc Orliaguet

Jonathan wrote:


- Original Message - From: baiju m [EMAIL PROTECTED]

I have two content objects (both are containers) but I cannot add one
to another as give here :
...



I don't use zope 3 (yet!) but a quick look at the above code seems to 
indicate that this is not a zope 3 issue:...

   square['Comp1'] = company
This line treats square as if it were a python dictionary (not an 
object, which it is!)




but he wrote that both are containers. zope3 use __setitem__ as a way to 
add items to containers, see: zope.app.container.interfaces.


class IWriteContainer(Interface):
   An interface for the write aspects of a container.

   def __setitem__(name, object):
   Add the given `object` to the container under the given 
name...:


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


Re: [Plone-developers] Re: [Zope3-Users] Re: [z3-five] zope.viewlet and zope.contentprovider - options for Zope 2 and Plone 3

2006-04-11 Thread Jean-Marc Orliaguet

Stephan Richter wrote:


On Monday 10 April 2006 08:50, Jean-Marc Orliaguet wrote:
 


Stephan Richter wrote:
   


On Sunday 09 April 2006 20:33, David Pratt wrote:
 


The Z2 integration will be started soon at a sprint soon. Viewlets and
portlets seem pretty synonymous and cpsskins provides a way to
manipulate portlets visually which is very nice.
   


Viewlets are not portlets! Portlets are much more restrictive and the
industry has a very specific meaning for the term, which differs from
both, Plone's and CPS skins', usage of the term.

Regards,
Stephan
 


Actually I've looked into creating a generic viewlet portlet that
would make it possible to reuse viewlets in cpsskins (for instance by
using the visual portlet editor). A feature that is missing is that
there is no easy way to find the list of registered viewlets. A viewlet
lookup mechanism would be needed, for instance a utility that returns a
list vocabulary items with viewlet's name and the factory.

also something that seems strange is that some viewlets are dependent on
viewlet managers:
   



There is nothing strange at all about that. Viewlet managers are very 
important for deciding which and how viewlets are shown. If you want viewlets 
without viewlet managers, then use content providers. BTW, I do use both in 
development depending on my needs.


 


see for instance: zope/app/boston/viewlets/toolbar:

class ToolBarViewlet(object):
   I18n info viewlet.

   implements(IToolBarViewlet)

   def macros(self, name):
   return self.manager.macros(name) 

   def menus(self, menuId):
   return getMenu(menuId, self.context, self.request)


So if I want to render a toolbar viewlet I need to instanciate the
corresponding viewlet manager. I would understand this if I wanted to
render all viewlets in a given area of the page, but if I want to render
just one viewlet?
   



Use a content provider then.

 


Basically it introduces a cycle in the design: viewlet managers depend
on viewlets and viewlets depend on viewlet managers to be rendered.
   



Absolutely! This is the point. The API and communication between a viewlet 
manager and its viewlets is very well defined. This is a win. Again, just use 
content providers to have simple HTML snippets.


Regards,
Stephan
 



Hi Stephan,

I do understand this. My point was that to reuse what other developers 
already have created, not necessarily to create new content providers 
from scratch. For instance I look at zope.app.boston.viewlets, I see 3 
interesting viewlets:  'addinginfo', 'toolbar' and 'xmltree', none of 
which can be reused in other projects without instanciating a viewlet 
managers (which by the way are extremely specific to the boston skin).


an 'onion skin' type of design, would have been possible. Now, one has 
to buy the entire onion.


( ( ( ContentProvider ) Viewlet ) Viewlet manager )

regards
/JM

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


Re: [Zope3-Users] What attributes are made persistent

2006-02-16 Thread Jean-Marc Orliaguet

Peter Bengtsson wrote:


On 2/16/06, Jeff Shell [EMAIL PROTECTED] wrote:
 


One could, but it's really not worth it. It's just the laws of Python
and mutability and immutability :). (It took me years to understand
those terms. I kept associating them with 'mutable' in the can be
made quiet sense... Eventually my music brain stepped back and I went
oh, MUTATE! Ahhh!. Seriously, it took me about four years to
understand that :).

   


Wow! I think I love you Jeff. Not only do you reply with
non-condencending constructive advise you also confess to [past]
weaknesses.

 


good try:-)
but that's a totally different ethymology, to mute is to make silent, 
to tone down (muet in French)


mutate c.1374, action of changing, from L. mutationem (nom. mutatio)
http://www.etymonline.com/index.php?search=mutate

/JM

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


Re: [Zope3-Users] Simple Acquisition

2006-02-04 Thread Jean-Marc Orliaguet

David Johnson wrote:


I have created a ZPT Page which I have no trouble accessing:

http://localhost/index.html



However, if I try to access it from the following URL, I see the
contents of MyFolder instead of the index.html.

http://localhost/MyFolder/index.html

What is the proper way to acquire index.html in other contexts?
 


Zope 3 dropped implicit acquisition.  You could write a traverser
that did this trick, I suppose.  The standard Zope 3 way is to
define the views explicitly, though: connecting them through
interfaces does everything I've wanted in this regard, but YMMV.
   



If I understand correctly, a non-technical web designer would not be able to
do much design work with Zope 3 unless they understand how to program
interfaces also or they would have to design the old-fashioned way by
creating a separate page for each item/folder they want to display?

 



you can specify * as an interface, then you don't have to write an 
interface.


 browser:page
 for=*
 name=somepage.html
 permission=zope.Public
 template=some_template.pt
 /


/JM

/JM


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


Re: [Zope3-Users] Please Guido, pick me, pick me!

2006-02-02 Thread Jean-Marc Orliaguet

Stefane Fermigier wrote:


Wade Leftwich wrote:
 


Guido van Rossum is looking for a web app framework.

http://blog.delaguardia.com.mx/index.php?op=ViewArticlearticleId=34blogId=1

Zope is conspicuous by its absence from the discussion. Hardly a
mention, and no advocacy at all.  Is Zope just too heavyweight for the
project he has in mind? Or what?
   



I don't think the point is trying to convince guido to use Zope for his
pet project, the point is global advocacy:

- Guido's word is considered gospel by many people (in that occurrence,
I must confess that I have been profoundly disappointed by his attitude
- his utter and a priori rejection of XML for a template language, that
will be used 95% for the time to produce (X)HTML and the 5% remaining
other variant of XML, with all that it implies in terms of validation,
etc. is plainly stupid).

- Like you noticed, Zope quasi-absence from the discussion is suspicious.

Lennart did a reply on his blog
(http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2006_02_01_guido-webframeworks).

Anyway, I'm saddened by both the quasi-absence of the Zope community in
this debate, and also the badmouthing of Zope (even sometimes, the
hatred) by some Python developpers taking part in the discussion.

There are, however, some constructive remarks like Ian Bicking's:
http://blogs.nuxeo.com/sections/blogs/lennart_regebro/2006_02_01_guido-webframeworks?post_id=if-mohammed-won-t-come

 S.

 



I think this has to do with python being used both as a scripting 
language and as a language to create high-level components. There will 
always be a category of users looking for quick-and-dirty templating 
capabilities in web frameworks and others looking for more abstract 
components that address issues from a more abstract and certainly more 
complex perspective.


In zope itself level the same opposition can be found between 
file-system vs TTW python-script-based development.


I wonder how those who criticize zope3 for being too big a framework and 
too complex to understand, would figure out how to use Java-based web 
application frameworks...


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


Re: [Zope3-Users] How to render PageTemplate manually?

2006-01-05 Thread Jean-Marc Orliaguet

Stephan Richter wrote:


On Wednesday 04 January 2006 07:55, Łukasz Łakomy wrote:
 


Create content type 'Portlet' that could have TAL as its content and when
watched in browser TAL should be redered. My code is below.
   



You really should not call this a portlet. A portlet is very well defined by 
JSR 168. Note that the Zope community -- specifically CMF and Plone -- have 
misused the term for a long time.
 


this is very developer-specific.
people started using telephones before phone companies agreed on a 
common standard I guess.


PS: note that viewlets are known outside the Zope3 world as being 
small tutorial movies:

http://psptips.com/6/viewlets/
http://www.pmwdc.com/skies/
http://www.geek.com/tipstrix/qarbon/
http://www.djdenham.com/Basic_Windows.htm
http://www.datacad.com/support/bulletin/Viewlets/viewlets.htm

I wonder why portlets are called viewlets in Zope3.

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


Re: [Zope3-Users] How to render PageTemplate manually?

2006-01-05 Thread Jean-Marc Orliaguet

Stephan Richter wrote:


On Thursday 05 January 2006 08:28, Jean-Marc Orliaguet wrote:
 


PS: note that viewlets are known outside the Zope3 world as being
small tutorial movies:
http://psptips.com/6/viewlets/
http://www.pmwdc.com/skies/
http://www.geek.com/tipstrix/qarbon/
http://www.djdenham.com/Basic_Windows.htm
http://www.datacad.com/support/bulletin/Viewlets/viewlets.htm
   



Viewlets in our case are a wordplay on the term view, because they are 
sub-views or view fragments. In any case, the meaning of viewlets in both 
settings is very different and thus hard to confuse.



 


I wonder why portlets are called viewlets in Zope3.
   



Because viewlets do not fulfill all the requirements of a portlet. Portlets 
have to provide very specific user interactions, which viewlets do not 
promise. For example, portlets must be able to be minimized, selectively be 
removed, be fully self-contained and sharable across servers.


The reason we should not use the term portlet lightly is because we are 
working in the same industry, Content Management. People from the Java world 
have (rightfully) very specific expectations of portlets.


Regards,
Stephan



Yes, portlets that implement JSR-168 must be able to be minimized, 
others don't since they don't implement the specification.


cf http://en.wikipedia.org/wiki/Portlet
Portlets are reusable Web components that display relevant information 
to portal users.


this definition is simple enough that anyone can relate to it. But 
there's a sense of confusion that arises from inventing new words for 
API reasons. Namespaces are sufficient for that, I think when used as 
adjectives:


jsr168.portlet
ibm.portlet
zope3.portlet
zope2.portlet
cpsskins.portlet
cmf.portlet
plone.portlet
...

why invent a new word? these are just different specifications / 
implementation of a same thing.


Regards

/JM



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


Re: [Zope3-Users] problem Z3+cpsskins

2006-01-03 Thread Jean-Marc Orliaguet

Stephan Richter wrote:


On Saturday 31 December 2005 18:58, Hector Miuler Malpica Gallegos wrote:
 


Hi friends, i have a problem actually use cpsskins of svn.z3lab.org
and the zope3 of svn (svn.zope.org), whenever I want to create a
subject shows the following error:
   



You might have more luck asking on the z3-labs mailing list, since Jean-Marc 
is more active there.


Regards,
Stephan
 



I answered on the z3lab list already since I didn't want to cross-post. 
Very specific cpsskins questions are better asked there I think.

http://lists.nuxeo.com/pipermail/z3lab/2006-January/000852.html

Also I'm not sure if I have subscribed with different addresses on the 
different lists so I don't know if I can simply reply to all the lists 
at once (let's see..).


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


Re: [Zope3-Users] Re: ZCML, practicality, purity (was Excellent perspective...)

2005-12-22 Thread Jean-Marc Orliaguet

Jim Fulton wrote:


Jean-Marc Orliaguet wrote:

The problem with ZCML is not the language (XML). Writing the same 
description in python would not address such issues as:


- when looking at a component, how can I know how it is wired inside 
the application without doing a grep on 100 files?
- when looking at the wires, how do I quickly get access to the 
components that they connect together?



I agree.  This is an issue with any system with lots of indirection.
It's even a hassle with lots of inheritence, although at least base 
classes

provide an avenue of search.


This is all I need in order to understand how an application is 
built. If it was easier to navigate between the components by 
following the wires, there wouldn't be such an issue with ZCML I 
think. Maybe a GUI, or IDE would help a lot.



Have you looked at apidoc? If not you should. It's far from perfect, but
it's a great start.  It needs more people contributing ideas.



Yes, I have indeed. Though I was thinking about the development of new 
applications,  not about API documentation. Probably this could be done 
with the Eclipse IDE: for instance when creating an adapter, I would 
first register an empty adapter object then I would add code to some 
skeleton class. And conversely, when browsing the code, I would get the 
list of adapters that use the code, but in a live manner, i.e inside 
some integrated development environment that support zope3 types of 
components (adapters, utilities, ..). Maybe an Eclipse plugin would do..


This key is to be able to see both the components and the relations 
between the components at the same time and to rapidly switch between 
the two views. That would improve productivity a lot.




It could also be that ZCML is cluttered with too much information 
that really doesn't belong there.



Yup.

For instance ZCML should not be used for the application setup (for 
creating menus, actions, workflows, etc.) because this has nothing to 
do with connecting components. This could be done in python or be 
stored in archives in XML (.tgz, .zip, ..).



Except that these all *are* components.



These are *implemented* as components, indeed. But the data registered 
in ZCML is not the data used to register new components, it is the data 
used to create new instances of a same component by passing it as 
parameters to the component's factory.


For example the browser:menu directive registers new menu instances (not 
new types or classes of menus, there is only one type of menu called 
browser:menu). I think I got burnt by this confusion by mixing those 
levels (e.g. portlets as components and portlet instances created 
from a same portlet component). Now I have placed the definition of 
components inside ZCML directives and the application setup part is done 
with .zip or .tgz, or xml files (in the spirit of CMFSetup or 
GenericSetup). The former are registered during the configuration phase 
(configure.zcml) , the latter are loaded after the application server 
has started. They could even be loaded later on by doing TTW data 
imports ...


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


Re: [Zope3-Users] Help us! Calling a Python Script from ZPT

2005-10-31 Thread Jean-Marc Orliaguet
Wade Leftwich wrote:

 Stephan Richter wrote:



 Why not have those templates on the file system? Is there a need for
 users to modify those templates?


 Yes, users with the job description web producers, which is to say
 people who can do HTML and a bit of scripting, but who do not get
 access to the file system. Kind of like the Zope 2 model. We even use
 acquisition.

 Also, it seemed to me unwieldy to put 50 directories in the filesystem
 to contain the templates for all the sites. But because of my
 experience with Zope 2, I assumed TTW was the best way to customize
 the application for each site, and I guess I should re-examine that
 assumption.

Hi!
there is indeed such a category of users, i.e. somewhere between
filesystem developers and application users. There will be support for
this kind of TTW editing in cpsskins (cf Custom Portlet), but it will be
purely limited to simple presentation  logic.

cf. http://www.z3lab.org/sections/front-page/design-features/custom-portlet

the difference with the Zope2 model I think is that web producers are
not going to be ZPT programmers, but more like site composers with the
ability to do minimal TTW template editing such as shown in the animation.

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


Re: [Zope3-Users] images in a content object

2005-09-27 Thread Jean-Marc Orliaguet
Duncan McGreggor wrote:


 On Sep 27, 2005, at 11:54 AM, Benji York wrote:

 Duncan McGreggor wrote:

 My problem is that I haven't figured out how to point to this image,
 as it is part of the content object itself. Ideally, I would like to
 be able to refer to it in a ZPT via a URL. Something on the order of
 img tal:attributes=src
 string:${context/@@absolute_url}/image_file /
 Any ideas or code to which I could be pointed?


 You could make the content object traversable, so you could do
 http://path_to_object/image_file.


 Man, that sounds perfect...

 But! *sheepish grin* I've never done that before... is there someplace
 you could point me (and future readers of the list archives) where I
 could read about doing that (chapter of a book?) or some code in svn
 that shoes an example in a zcml file (I'm assuming this would be done
 in zcml?).

 Thanks, man!

 d


I've done something similar for caching images in a RAM Cache and
accessing them through a url. I simply added a page / BrowserView.

see:
http://svn.nuxeo.org/trac/pub/file/z3lab/cpsskins/branches/jmo-perspectives/browser/caching.py

If you remove the RAM cache part, your code could look like this (not
tested ):

__init__.py:

from zope.app.file.browser.image import ImageData
from zope.app.file.image import Image
from zope.app.publisher.browser import BrowserView

class ImageView(BrowserView):
A view for accessing images.


def show(self)
viewer = ImageData()
viewer.context = Image(context.data)
viewer.request = self.request
return viewer()


configure.zcml :

  pages
  for=zope.app.file.interfaces.IImage
  class=.ImageView
  permission=zope.Public

page
name=show
attribute=show
/

  /pages


then access your image with http://path_to_object/image_file/show

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