incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christophe Lombart <>
Subject Proposal : Graffito/J2 portlet framework
Date Tue, 17 May 2005 05:33:31 GMT
Hi all,

I'm currently thinking about a small "Graffito portlet  frameworks" 
which can solve some classic issues. I think this one can be donate
later (after some discussion between us) to Jetspeed project.Here is a 
brief summary. Can you tell me what do you think about that
? In order to give you more details, I can commit the code of this 
proposal this week.  I'm ready to see other solutions and if needed
I'm ready to review the complete code.

Situation :
1. The Graffito browser portlet has to manage different kind of cms 
objects (folders, binaries, simple texts, html docs, ...). It is a
nice portlet to manage the complete content tree in one place but it 
contains many templates and actions to process.  This causes too many
checks and important amount of code in the different portlet methods 
(doView, doEdit and processAction). This complexity will increase when
we will add server references, articles, news, ...

2. Moving from the view mode to edit mode is not so simple. Depending on 
the cms object nature, this portlet has to choose the appropriate
template and method used to retrieve the correct information. For 
example : in the view mode, it is possible to navigate across the
content tree and select an HTML document. When the user switch to the 
edit mode, an html editor should be display.
On the other hand, if the user select another kind of cms object, other 
information has to be display in the edit mode.

3. This Graffito portlet uses tabs (in the edit mode) to show details on 
the selected cms object (eg. for a folder : its children, its
attributes ans its associated permissions).

4. Last point, it should be nice to have some "wizard" fonctionnalities 
to manage cms object creation, delete, ...

Features/solution :

Note : this framework is not usefull for simple portlets containing a 
few amount of templates and actions to proceed or when no wizard and
no tab are required.

* Declarative page management :
- The framework engine uses an xml config file containing each "page" 
available in the view & edit mode and the relation between them ( eg.
: the "folderView" page is linked to the "folderEdit" page).
- A page is associated to a template (VM or jsp, ...) and an action.This 
action is used to retrieve the correct information. Maybe
"action" is not the correct name and can give some confusion 
with"processAction". Optionnally, a page can contains one or more tabs.
There is a default page for the view mode and another one for the edit mode.
- a template href  or a submit button can be used to forward to a page 
just by specifying its name. In function of this name, the engine will
display the page template and execute the page action.
- a template href  or a submit button can execute an simple action (like 
delete a cms object). After executing this action, the engine
will render the current page.

* Tab management :
- A tab is composed of different tab page. A tab page is associated to a 
template and also an action. This action is used to populate the tab
page. No additionnal code is required to navigate across the different 
tab pages. It is also possible to add some condition to show a tab
page. Eg. if the document is an article, display the article editor 
otherwise the html editor.

* Other features :
- Upload support
- Populate beans from portlet request
- Velocity macros and jsp custom tags used display document links, cms 
path, tabs, ...

Plan to do  :
- Wizard is not yet supported. I would like to define also the wizards 
in a config file. This one can specify how to naviagate across the
different wizard pages.
- Treeview (with lazy loading) : I would like to use more and more tools 
like XMLHttpRequest which can increase portlet performances. It
just an idea - let me know you point of view.

What the developer has to do ?

Programming with this framework , the developers has only to do :
* Define the page structures in an xml config file.
* Build some action classes and templates.
* The same portlet can be used to manage an important number of
actions and template. One ancestor portlet can be defined.

Other solutions (?)

Another solution is to split this Browser portlet into smaller
portlets. This approach can gives more complexities in the psml file
(compare to this "all in one" portlet :-) )

Page config file sample

               <page id = "folderViewer" action="folder.retrieve" 
template="/WEB-INF/view/folder/folder-browser.vm" defaultPage="true" />

               <page id = "documentHtmlTextViewer" 

               <page id = "documentUploadViewer" 

               <page id = "folderEdit" 
template="/WEB-INF/view/folder/folder-tab.vm" defaultPage="true">
                       <tab id="folder-edit">
                               <page id="children" 
template="/WEB-INF/view/folder/folder-children.vm" action =
defaultTabPage="true" />
                               <page id="metadata" 
template="/WEB-INF/view/folder/folder-metadata.vm" action =
                                       "folder.retrieve" />
                               <page id="security" label="" 
template="/WEB-INF/view/security/security-browser.vm" action
                                       ="permission.retrieve" />
               <page id = "folderCreate" action="folder.create" 
template="/WEB-INF/view/folder/folder-metadata.vm" >
                       <viewPage>folderViewer< /viewPage>

               <page id = "documentEdit" 
                       <tab id="document-edit">
                               <page id="content" 
label="tab.document-edit.content" template= 
defaultTabPage="true" />
                               <page id="metadata" 
label="tab.document-edit.metadata" template= 
action="document.retrieve" />
                               <page id="security" label="" 
action="permission.retrieve" />
               <page id = "documentCreate" 
template="/WEB-INF/view/document/document-edit-metadata.vm" />

               <page id = "textEdit" action="document.createWizard" 
template="/WEB-INF/view/document/document-edit-text.vm" >
               <page id = "htmlEdit" action="document.createWizard" 
template="/kupu/kupu.vm" >
               <page id = "uploadEdit" action="document.createWizard" 
template="/WEB-INF/view/document/document-edit-upload.vm" >
               <page id = "permissionCreate" action="permission.create" 
template="/WEB-INF/view/security/security-permission.vm" />

What do you think ?

Kind regards,

View raw message