Re: [Zope3-Users] Building an admin interface

2007-07-17 Thread Hermann Himmelbauer
Am Montag, 16. Juli 2007 22:44 schrieb Stephan Richter:
 On Monday 16 July 2007 15:58, Benji York wrote:
  This reminds me of something I've been curious about but haven't had
  time to research lately.  What are the differences between pagelets and
  viewlets and their various strengths/weaknesses.  An acceptable answer
  is read the docs and decide for yourself. wink

 Viewlets-pure UI design is a great approach, if you have portal, where
 there is really never a main content area, since you can reuse viewlets
 accross many pages. So in this UI pattern, you would create a Contents
 viewlet manager, and register viewlets for this manager. Depending on which
 page you are looking at, viewlets are picked up and displayed.
 Unfortunately, for simple pages, this requires two directives: One to
 define the page and one to define its Contents viewlet. This cost is very
 acceptable to a portal site where those simple pages are rare, but are
 impractical for more traditional Web applications.

 Also, any piece of dynamic code is a viewlet manager with viewlets or a
 simple content provider: left menu, right menu, header, CSS files, JS
 files, title, etc.

 Pagelet-based UI design is pretty much the same pattern, except that it
 allows you to define a main content area. Here you define a layout template
 that is used to define the O-wrap (pretty much like standard_macros/page).
 A page is then registered as a pagelet, which defines a second template
 that defines the content area of the page. As for macros, the advantage
 here is that you only need one generic UI layout directive plus one other
 directive per page. But something that is much nicer in pagelets is that
 you do not have to include the macro from within the pagelet, but that the
 layout is driving everything. Also, it is much simpler to register an
 alternative layout template for a particular view or context.

That leads me to the question if it's possible to mix pagelets/viewlets? In my 
case, I have one main content area but I have some dynamic code, e.g. a 
navigation box, a login box, later perhaps a search box etc. How would I 
implement them? Perhaps I use a viewlet manager / viewlet in the layout 
template?

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] Building an admin interface

2007-07-17 Thread Darryl Cousins
Hi,

On Tue, 2007-07-17 at 08:45 +0200, Hermann Himmelbauer wrote:
 Am Montag, 16. Juli 2007 22:44 schrieb Stephan Richter:
  On Monday 16 July 2007 15:58, Benji York wrote:
   This reminds me of something I've been curious about but haven't had
   time to research lately.  What are the differences between pagelets and
   viewlets and their various strengths/weaknesses.  An acceptable answer
   is read the docs and decide for yourself. wink

snip

 That leads me to the question if it's possible to mix pagelets/viewlets? In 
 my 
 case, I have one main content area but I have some dynamic code, e.g. a 
 navigation box, a login box, later perhaps a search box etc. How would I 
 implement them? Perhaps I use a viewlet manager / viewlet in the layout 
 template?

I recommend reading the README's of z3c.template and z3c.pagelet (and
z3c.macro for good measure). Also study of z3c.formdemo teaches much
about the patterns developed in the z3c packages.

But I think I can answer your question.

1. Register a layout template to your layer using z3c:layout (see
z3c.formdemo/skin for an example)
2. It could contain:

tal:block replace=structure provider:leftcol /!--dynamic code --
tal:block replace=structure provider:pagelet /!-- content area --
tal:block replace=structure provider:rightcol /!--dynamic code --

3. left and right columns are your own viewlet managers registered with
browser:viewletManager
4. `pagelet` is special, you can register a view using z3c:pagelet (and
a template for it with z3c:template) and the `pagelet` provider will do
the rest.

This pattern is used in z3c.formdemo.

Hope this helps.
Regards,
Darryl

 Best Regards,
 Hermann
 

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


Re: [Zope3-Users] Building an admin interface

2007-07-17 Thread Stephan Richter
On Tuesday 17 July 2007 02:45, Hermann Himmelbauer wrote:
 That leads me to the question if it's possible to mix pagelets/viewlets? In
 my case, I have one main content area but I have some dynamic code, e.g. a
 navigation box, a login box, later perhaps a search box etc. How would I
 implement them? Perhaps I use a viewlet manager / viewlet in the layout
 template?

Exactely. Of course we use viewlet managers in pagelet-based UI design as 
well.

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


Re: [Zope3-Users] Building an admin interface

2007-07-16 Thread Joachim Schmitz

hi Florian,

perhaps you should take a look at grok http://grok.zope.org. Look there 
for grokstar, which is a blog with nearly no user-interface. During the 
recent grog-sprint at EuroPython in Vilnius, I started working to 
improve it a little bit. It will soon be checked in.



Florian Lindner schrieb:

Hello,
I have a rather fundamental problem.

Until now the editor of my bloggin software has added, modified and removed 
blog entries by logging in to the ZMI and use the filesystem like view there.


This gives me (as the developer) only very limited control about how it is 
done. For example: A newly created entry should be stored in the subfolder 
year/month/day/entry_id. I can modify the entry_id by using a NamesChooser 
adapter but I can't (AFAIK) modify the actual location.


Because of this I want to develop an admin interface. The application 
generally shoud work stand alone (eg. not integrated in Plone) but should act 
as a well behaving citizen in the Zope3 world. (make integration easy).


How is this done the best way?

- What skins to use?

- How should authentication be done?
Just rely on the authentication source being around and use it  with 
getUtility(IAuthentication)?


- How to design my ZPTs to make them fit in the skin/interface?

- What else to pay attention to?

Thanks for all tips!

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


--

Gruß Joachim

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


[Zope3-Users] Building an admin interface

2007-07-16 Thread Florian Lindner
Hello,
I have a rather fundamental problem.

Until now the editor of my bloggin software has added, modified and removed 
blog entries by logging in to the ZMI and use the filesystem like view there.

This gives me (as the developer) only very limited control about how it is 
done. For example: A newly created entry should be stored in the subfolder 
year/month/day/entry_id. I can modify the entry_id by using a NamesChooser 
adapter but I can't (AFAIK) modify the actual location.

Because of this I want to develop an admin interface. The application 
generally shoud work stand alone (eg. not integrated in Plone) but should act 
as a well behaving citizen in the Zope3 world. (make integration easy).

How is this done the best way?

- What skins to use?

- How should authentication be done?
Just rely on the authentication source being around and use it  with 
getUtility(IAuthentication)?

- How to design my ZPTs to make them fit in the skin/interface?

- What else to pay attention to?

Thanks for all tips!

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


Re: [Zope3-Users] Building an admin interface

2007-07-16 Thread Stephan Richter
On Monday 16 July 2007 12:29, Florian Lindner wrote:
 - What skins to use?

Don't use any of the shipped skins at all. You may want to start with 
z3c.layer.minimal or z3c.layer.pagelet (if you are using pagelets) to get 
some initial registrations like error pages, widgets, etc.

 - How should authentication be done?
 Just rely on the authentication source being around and use it  with
 getUtility(IAuthentication)?

That's good, though for custom projects I always create a custom site object 
and use some mechanism, like z3c.configurator, to add a configured 
authentication utility.

 - How to design my ZPTs to make them fit in the skin/interface?

That depends on the UI pattern you decide to use. There are several choices:

- Use macros to define O-wrap, bits and pieces and so on. This is the way the 
default skins are done.

- Use viewlets to do the entire UI.

- Use pagelets to do the entire UI.

For a simple, non-portal application, I would choose the last option.

 - What else to pay attention to?

Don't anticipate! And don't over-engineer the UI! Get something working that 
works for your specific project.

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


Re: [Zope3-Users] Building an admin interface

2007-07-16 Thread Benji York

Stephan Richter wrote:

- Use viewlets to do the entire UI.

- Use pagelets to do the entire UI.


This reminds me of something I've been curious about but haven't had 
time to research lately.  What are the differences between pagelets and 
viewlets and their various strengths/weaknesses.  An acceptable answer 
is read the docs and decide for yourself. wink

--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Building an admin interface

2007-07-16 Thread Stephan Richter
On Monday 16 July 2007 15:58, Benji York wrote:
 This reminds me of something I've been curious about but haven't had
 time to research lately.  What are the differences between pagelets and
 viewlets and their various strengths/weaknesses.  An acceptable answer
 is read the docs and decide for yourself. wink

Viewlets-pure UI design is a great approach, if you have portal, where there 
is really never a main content area, since you can reuse viewlets accross 
many pages. So in this UI pattern, you would create a Contents viewlet 
manager, and register viewlets for this manager. Depending on which page you 
are looking at, viewlets are picked up and displayed. Unfortunately, for 
simple pages, this requires two directives: One to define the page and one to 
define its Contents viewlet. This cost is very acceptable to a portal site 
where those simple pages are rare, but are impractical for more traditional 
Web applications.

Also, any piece of dynamic code is a viewlet manager with viewlets or a simple 
content provider: left menu, right menu, header, CSS files, JS files, title, 
etc.

Pagelet-based UI design is pretty much the same pattern, except that it allows 
you to define a main content area. Here you define a layout template that is 
used to define the O-wrap (pretty much like standard_macros/page). A page is 
then registered as a pagelet, which defines a second template that defines 
the content area of the page. As for macros, the advantage here is that you 
only need one generic UI layout directive plus one other directive per page. 
But something that is much nicer in pagelets is that you do not have to 
include the macro from within the pagelet, but that the layout is driving 
everything. Also, it is much simpler to register an alternative layout 
template for a particular view or context.


All this can be combined with a simpler implementation of macros, provided by 
z3c.macro, which only provides a flat namespace for all macros. Defining a 
macro is a matter of doing something like this:

z3c:macro
template=mytemplate.pt
name=macroname /

(Optionally, you can specify the context, view and layer for which the macro 
is available.)

It can be used like this:

div metal:use-macro=macro:macroname /

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


Re: [Zope3-Users] Building an admin interface

2007-07-16 Thread Benji York
Thanks for the info.  I really need to dig into both viewlets and 
pagelets the next time I do a new UI from scratch.

--
Benji York
Senior Software Engineer
Zope Corporation
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users