[Zope3-Users] How to register multiple view for the same content class

2007-09-28 Thread Yuan HOng
Hi,

I thought this would be a simple case for Zope3, but after one whole
day I am not able to find a clean solution. Must be missing something.

Suppose I have a BookShelf  which contains lots of Books. The view for
BookShelf will show a list of Books contained in the shelf, and when
the user click on a book, a detailed view for the Book will be opened.

Of course the Book rendered in the shelf will be different from the
same rendered in the book detail view. But how best to achieve this in
zope3?

The triditional solution (zope 2) I am familar with would be to use
tal:repeat in the page template for the shelf like this:

div tal:repeat=book shelf/books
  h3 tal:content=book/title /
  p tal:content=book/auther /
  ...
/div

This however mixes the presentation of the shelf itself with the books
on the shelf. If I want to change how books looks like on the shelf, I
have to modify the shelf template, which doesn't seem to be a good
separation of concerns.

Is it possible to register two different views for the Book, one for
display in shelf, another for the detailed view? The one for the
detailed view is simply a BrowerPage, but how to do the book-in-shelf
view? I'd like for my shelf template to look something like this:

div tal:repeat=book shelf/books
  div tal:replace=structure book/in-shelf-view /
/div

Then I can maybe register different in-shelf-view's for different type
of shelves.

I tried registering a browser:view named 'in-shelf-view' for IBook. It
doesn't work, because TALES doesn't know about the view.

Thanks for any suggesions as to in what direction I shall research.

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: [Zope] Static Zope 3 APIDOC available!

2007-09-28 Thread Baiju M

Stephan Richter wrote:

 Hi everyone,

 I am happy to announce that the second Foliage sprint task is
 completed. Julian Bonilla, Graham Stratton and I worked on the
 outstanding issues on creating a functional version of the APIDOC,
 which comes with Zope.

 Thanks to Jens Vagelpohl, the static APIDOC is now available at:

 http://apidoc.zope.org

 I have also uploaded a TGZ archive to:

 http://download.zope.org/distribution/static-apidoc.tgz

 I hope that this development will spark renewed interest in the tool.
 In the future I plan to make more packages available in APIDOC and
 make it work with eggs. If you are interested, please let me know!


Great news !
Congratulations to you all !!

Regards,
Baiju M


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


[Zope3-Users] Re: [Zope3-dev] Re: [Zope] Static Zope 3 APIDOC available!

2007-09-28 Thread David Pratt

Very nice. Many thanks for this.

Regards,
David

Baiju M wrote:

Stephan Richter wrote:

 Hi everyone,

 I am happy to announce that the second Foliage sprint task is
 completed. Julian Bonilla, Graham Stratton and I worked on the
 outstanding issues on creating a functional version of the APIDOC,
 which comes with Zope.

 Thanks to Jens Vagelpohl, the static APIDOC is now available at:

 http://apidoc.zope.org

 I have also uploaded a TGZ archive to:

 http://download.zope.org/distribution/static-apidoc.tgz

 I hope that this development will spark renewed interest in the tool.
 In the future I plan to make more packages available in APIDOC and
 make it work with eggs. If you are interested, please let me know!


Great news !
Congratulations to you all !!

Regards,
Baiju M


___
Zope3-dev mailing list
[EMAIL PROTECTED]
Unsub: 
http://mail.zope.org/mailman/options/zope3-dev/fairwinds%40eastlink.ca



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


[Zope3-Users] zopeproject auto create instance

2007-09-28 Thread Michael Ang
Hi, I am new to zope3 and zopeproject.
I have a question, how do I create an instance of my (IContainer) class
when initial startup of a zopeproject?

For Plone, I can inject in Extensions/Install.py.

Hope you understand my question, thanks.

:]Michael


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


[Zope3-Users] Plone Conference 2007 Registration Closes October 5th!

2007-09-28 Thread vincenzo barone
Don't miss this fantastic event, hurry up, register now before the 
deadline! Plone Conference 2007 Registration Closes October 5th! Only 
one week left !!!


With over 300 people already registered for Plone Conference 2007, we're 
going to close registration on October 5th at 11:59PM (Italian Time).


So if you're thinking about coming, register now!

http://ploneconference2007.bookdirect.it/


If you can't register online, and need to mail in your registration 
form, please get them in the mail by Friday October 5th, and email 
vincenzo at abstract.it to let us know you're sending in a 
close-to-the-wire registration.


See you all in Naples!
Vincenzo

--
Vincenzo Barone - Web Architect - Project Manager 
[EMAIL PROTECTED]

Abstract Open Solutions [ http://www.abstract.it ]
Mobile +39 328 3358110 Tel. 02320624747 Tel./Fax +39 081 0608213
PGP Public Key: http://www.abstract.it/gpg/vincenzo.barone
begin:vcard
fn:Vincenzo Barone
n:Barone;Vincenzo
org:Abstract snc
adr;dom:Via Maroncelli, 12 - 20154 Milano ;;Via Coroglio, 57 d - 80124 Napoli
email;internet:[EMAIL PROTECTED]
tel;work:081 0608213
tel;fax:081 0608213
tel;cell:3283358110
x-mozilla-html:FALSE
url:http://www.abstract.it
version:2.1
end:vcard

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


[Zope3-Users] Re: Grok or raw Zope?

2007-09-28 Thread Michael Ang
You mention

need a bug tracking system, a support platform for our customers, a
knowledge base for our employees and customers, an many other
applications...

very CMS to me.

:]Michael



Matias Surdi wrote:
 We Don't want a CMS. We need a framework to build an application which can
 grow with us, and be adapted to our needs, needs that are very likely to
 change over time.
 
 Thanks for your comments.
 
 
 Michael Ang wrote:
 
 Use Plone, best for Intranet.

 Matias Emanuel Surdi wrote:
 
 I've posted this same message on grok-devel mailing list.
 I'm just looking for comments from the other side
 Thanks a lot in advance.
 

 Hi,
 I'm going to start a new project in a few weeks and I'm evaluating
 possible frameworks to use.
 My best candidate at the momment is Zope 3, since I have a couple of
 years of experience with Python and Zope 3 provides most things I will
 need (such as authentication, templates, database access, workflows,
 etc..).

 We are going to build an intranet portal, where each department of the
 company (a software development one)  has it's own area, and the
 application should provide applications for the needs of everyone, we
 need a bug tracking system, a support platform for our customers, a
 knowledge base for our employees and customers, an many other
 applications...


 So, I've no experience with Zope nor Grok.
 I would like to receive some advice about choosing Grok or Zope. I think
 Grok is more easy to start with, but... ¿will it in the future put any
 limit on a very big intranet application for an entire company?

 Thanks for your comments.

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


Re: [Zope3-Users] How to register multiple view for the same content class

2007-09-28 Thread Frank Burkhardt
Hi,

On Fri, Sep 28, 2007 at 05:33:56PM +0800, Yuan HOng wrote:
 On 9/28/07, Frank Burkhardt [EMAIL PROTECTED] wrote:
 
 
  You just need another browser:page here. Name it 'in-shelf-view' and
  use something like
 
   div tal:replace=structure book/@@in-shelf-view /
 
  to embed it.
 
 
 Thanks, that works. So all was missing is the '@@' notation to tell
 TALES to look up a view for Book.
 
  Registering the view for different shelves is possible, too. But this not
  a simple view anymore - it's a Multiview. You need an adapter for
  (book,shelve,request) to do that which means, a simple browser:page won't
  work and you'll be not able to use the object/@@view notation for that.
 
 
 If not object/@@view, what then? A custom traverse to lookup the
 Multiview maybe?

You could use a view as dispatcher which then would be traversed like 
object/@@view:

class MyDispatcher(object):
   def __call__(self):
  
realview=zapi.getMultiAdapter((self.context,self.context.__parent__,self.request))
  return realview()

class MyExampleView(object):
   def __init__(context,parent,request):
  self.context=context
  self.parent=parent
  self.request=request
   
   def __call__(self):
  return Book/shelf-specific html

*configure.zcml*
configure
   browser:page for=.interfaces.IMyBook name=view class=MyDispatcher ... 
/
   zope:adapter for=.interfaces.IMyBook .interfaces.IMyShelf IBrowserRequest 
... /
/configure

Regards,

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


Re: [Zope3-Users] How to register multiple view for the same content class

2007-09-28 Thread Yuan HOng
On 9/28/07, Frank Burkhardt [EMAIL PROTECTED] wrote:


 You just need another browser:page here. Name it 'in-shelf-view' and
 use something like

  div tal:replace=structure book/@@in-shelf-view /

 to embed it.


Thanks, that works. So all was missing is the '@@' notation to tell
TALES to look up a view for Book.

 Registering the view for different shelves is possible, too. But this not
 a simple view anymore - it's a Multiview. You need an adapter for
 (book,shelve,request) to do that which means, a simple browser:page won't
 work and you'll be not able to use the object/@@view notation for that.


If not object/@@view, what then? A custom traverse to lookup the
Multiview maybe?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] How to register multiple view for the same content class

2007-09-28 Thread Frank Burkhardt
Hi,

On Fri, Sep 28, 2007 at 03:19:10PM +0800, Yuan HOng wrote:

[snip]

 Is it possible to register two different views for the Book, one for
 display in shelf, another for the detailed view? The one for the
 detailed view is simply a BrowerPage, but how to do the book-in-shelf
 view?

Exactly the same way.

 I'd like for my shelf template to look something like this:
 
 div tal:repeat=book shelf/books
   div tal:replace=structure book/in-shelf-view /
 /div
 
 Then I can maybe register different in-shelf-view's for different type
 of shelves.
 
 I tried registering a browser:view named 'in-shelf-view' for IBook. It
 doesn't work, because TALES doesn't know about the view.

You just need another browser:page here. Name it 'in-shelf-view' and
use something like

 div tal:replace=structure book/@@in-shelf-view /

to embed it.

Registering the view for different shelves is possible, too. But this not
a simple view anymore - it's a Multiview. You need an adapter for
(book,shelve,request) to do that which means, a simple browser:page won't
work and you'll be not able to use the object/@@view notation for that.

Regards,

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


[Zope3-Users] Static Zope 3 APIDOC available!

2007-09-28 Thread Stephan Richter
Hi everyone,

I am happy to announce that the second Foliage sprint task is completed. 
Julian Bonilla, Graham Stratton and I worked on the outstanding issues on 
creating a functional version of the APIDOC, which comes with Zope.

Thanks to Jens Vagelpohl, the static APIDOC is now available at:

http://apidoc.zope.org

I have also uploaded a TGZ archive to:

http://download.zope.org/distribution/static-apidoc.tgz

I hope that this development will spark renewed interest in the tool. In the 
future I plan to make more packages available in APIDOC and make it work with 
eggs. If you are interested, please let me know!

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: zopeproject auto create instance

2007-09-28 Thread Philipp von Weitershausen

Michael Ang wrote:

Hi, I am new to zope3 and zopeproject.
I have a question, how do I create an instance of my (IContainer) class
when initial startup of a zopeproject?

For Plone, I can inject in Extensions/Install.py.

Hope you understand my question, thanks.


Write an IDatabaseOpenedWithRootEvent handler:


import zope.component
from zope.app.appsetup.interfaces import IDatabaseOpenedWithRootEvent
from zope.app.appsetup.bootstrap import getInformationFromEvent

  @zope.componen.adapter(IDatabaseOpenedWithRootEvent)
  def createInitialFolder(event):
  db, connection, root, root_folder = getInformationFromEvent(event)
  if 'myfolder' not in root_folder:
  root_folder['myfolder'] = MyContainer()


and register it as a subscriber:

  subscriber handler=...createInitialFolder /

--
http://worldcookery.com -- Professional Zope documentation and training

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


Re: [Zope3-Users] Re: Grok or raw Zope?

2007-09-28 Thread Robert-Reinder Nederhoed
Plone is not just a CMS. Since Plone is built on Zope, you can develop
extensions as you would in Zope.

I'm no Plone expert, but our company chose Plone and my colleagues
implemented custom functionality when needed.
You will have to know how to integrate your new components (Zope
Products) with Plone.

good luck! Robert-Reinder

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


[Zope3-Users] Re: ftp server and zopeproject?

2007-09-28 Thread Philipp von Weitershausen

Myles English wrote:

I am getting on so well with what I have now as a result of virtualenv
and zopeproject0.4 that I don't want to break it by mistake so I am
asking people who know.

On the sandbox I had before, I edited zope.conf to start an ftp server
as well as http on startup.  This was necessary to upload files
(jpegs) created external to zope.

How do I install and start an ftp server within the zopeproject/buildout/paste?


The short answer is: You don't.

The long answer: WSGI is HTTP only. Paste is just a way to stack WSGI 
components (gatway, middlewares, application) via a configuration file. 
It has no support for FTP. I currently have no plans to bring FTP to the 
zopeproject story, though I might change my mind if enough people ask 
for it.


That said, I think WebDAV (which works over HTTP) is an adequate 
alternative to FTP. I guess there might be edge cases where you *really* 
need FTP, otherwise WebDAV should suit you just as well if not better.


To enable WebDAV, add the following two directives to your configure.zcml:

  include package=zope.app.dav file=meta.zcml /
  include package=zope.app.dav /

and don't forget to add 'zope.app.dav' to the dependencies in setup.py. 
Then run bin/buildout and start the application again.


I haven't tried using z3c.dav instead, which is a much richer WebDAV 
implementation for Zope 3, but I suspect it would work just as well.



Added this to buildout.cfg:

[app]
eggs = ...
zope.app.ftp

...and this to setup.py...

setup(
   install_requires=[ ...
   'zope.app.ftp'
   ]
)


You shouldn't have to do both to make sure a package is installed. One 
of them is enough. Adding it to setup.py (install_requires) means that 
the package is an integral, intrinsic dependency of your code. Adding it 
to buildout.cfg means it's something that's needed for this particular 
deployment.


Anyway, you won't need zope.app.ftp as it can't be used by a 
zopeproject-generated sandbox.



--
http://worldcookery.com -- Professional Zope documentation and training

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


[Zope3-Users] Buildout recipe to create config file from contents in buildout.cfg?

2007-09-28 Thread Derek Richardson
I am using hexagonit.recipe.cmmi to install pound (www.apsis.ch/pound) in front 
of zope. After I cmmi, I need to install a config file. I'd like to include the 
pound config file in buildout.cfg, like the zcml section in 
zc.zope3recipes:application. Is there a simple recipe for making a file out of a 
section in the buildout.cfg and putting it in a particular place? Or is there a 
'best' recipe to use to get close? Or is this a reason to write a new recipe 
from scratch and contribute it? I see this simple functionality as having many 
use cases.


Thanks,

Derek

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


[Zope3-Users] Installing a run script in bin/ after using cmmi

2007-09-28 Thread Derek Richardson
After I install pound using cmmi, I want to create a run script in bin/. This 
should be easy - the script should be boilerplate and not require mods for 
individual installs. I can use the os command recipe to put it in bin/.


My question: where is best to store the script? Does it belong rightfully in 
src/, since it is source code that will be used by the buildout? Or should it go 
somewhere else, since it's merely a production artifact and not a develop egg?


Just checking to make sure I stay in line with best practices

Thanks,

Derek

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


Re: [Zope3-Users] How to register multiple view for the same content class

2007-09-28 Thread Yuan HOng
On 9/28/07, Frank Burkhardt [EMAIL PROTECTED] wrote:


 You could use a view as dispatcher which then would be traversed like 
 object/@@view:

 class MyDispatcher(object):
def __call__(self):
   
 realview=zapi.getMultiAdapter((self.context,self.context.__parent__,self.request))
   return realview()

 class MyExampleView(object):
def __init__(context,parent,request):
   self.context=context
   self.parent=parent
   self.request=request

def __call__(self):
   return Book/shelf-specific html

 *configure.zcml*
 configure
browser:page for=.interfaces.IMyBook name=view class=MyDispatcher 
 ... /
zope:adapter for=.interfaces.IMyBook .interfaces.IMyShelf 
 IBrowserRequest ... /
 /configure


Got it. Thanks.

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ATDocument-like content component

2007-09-28 Thread Yuan HOng
Hi,

Does there exists for Zope3 a content component for creating/editing
HTML pages through the Web, preferably with the ability to upload
images related to the HTML document? Something similiar to ATDocument
for Plone/Zope2?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users