portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeremy Ford" <caius1...@hotmail.com>
Subject RE: [PROPOSAL] allow xreg to be loaded from subdirectory
Date Mon, 25 Nov 2002 15:45:56 GMT
In my experience with Jetspeed, currently, I tend to create many HTML files, 
each representing an individual portlet.  I then group the HTML files 
together logically based on some criteria, generally resulting in a xreg 
file with 8-10 portlet entries.  I can foresee a possibility where I will 
have over 1000 xreg files.  I was thinking that I would like to be able to 
place xreg files in subdirectories in order to make this more manageable.  
Also, I just tend to like to group things together in directories.  I just 
like to have things ordered.

Here's an example directory structure:

registry
    security
        security.xreg
        local-security.xreg
        mysecurity.xreg
        ...
    skins
        skins.xreg
        local-skins.xreg
        myskins.xreg
        ...
    controllers
        ...
    controls
        ...
    portlets
        HTMLPortlets
            Html1.xreg
            Html2.xreg
            ...
            Htmln.xreg
        WebPagePortlets
            ...
        VelocityPortlets
        demo-portlets.xreg
        local-portlets.xreg

This is just an example that I cooked up.  It might not be practical.


The benefit might not be that great for some jetspeed users, but I think 
that it might come in handy for me.  I might be looking down the road a bit, 
but I thought I would go ahead and provide the capability if and when I 
needed it.

In terms of hot deployment, if a portlet is using a pre-existing parent such 
as the HTML portlet, then I do not believe that hot deployment is an issue.  
Jetspeed will just pick up the new xreg when it scans the directory.  I 
agree that there is an issue with hot deployment when you have written a new 
action that your portlet uses.

Jeremy


>From: "Luta, Raphael  (VUN)" <Raphael.Luta@groupvu.Com>
>Reply-To: "Jetspeed Developers List" <jetspeed-dev@jakarta.apache.org>
>To: 'Jetspeed Developers List' <jetspeed-dev@jakarta.apache.org>
>Subject: RE: [PROPOSAL] allow xreg to be loaded from subdirectory
>Date: Mon, 25 Nov 2002 11:03:43 +0100
>
>I share the same concern. The initial Registry implementation did recurse
>into directories to look for Registry files because I wanted to support a
>kind of runtime deployment model where you would place your portlet classes
>and registry fragment in WEB-INF/classes and the Registry would
>automatically
>pick up these definitions.
>
>Unfortunately, this model has some limitations:
>- it is not always possible to deploy on runtime if you have Turbine 
>modules
>   like Actions because you need to ensure that the packages are registered
>   in TR.p and Turbine 2 does is not reconfigurable.
>- it's harder to maintain with scripts and automated processing tools
>
>De : Paul Spencer [mailto:paulspencer@mindspring.com]
> >
> > Jeremy,
> > What is the reason or need to do this?
> >
> > In general I do not envision enough xreg files that would require a
> > directory structure.  Also Jetspeed configuration can be complicated
> > enough without adding another set of directories.
> >
> > I am not saying "No" to this proposal, but I am not convinced of the
> > need or benefit.
> >
> > Paul Spencer
> >
> >
> > Jeremy Ford wrote:
> >
> > >I would like to propose a change to the registry watcher in
> > order to allow
> > >it to load xreg files from subdirectories beneath the base directory.
> > >Below, I have pasted the patches that are needed in order to add this
> > >ability.
> > >
> > >Jeremy Ford
> > >
> > >Index: RegistryWatcher.java
> > >===================================================================
> > >RCS file:
> > >/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed
> > /services/regis
> > >try/RegistryWatcher.java,v
> > >retrieving revision 1.7
> > >diff -u -r1.7 RegistryWatcher.java
> > >--- RegistryWatcher.java 6 Nov 2002 00:00:24 -0000 1.7
> > >+++ RegistryWatcher.java 24 Nov 2002 22:06:01 -0000
> > >@@ -222,6 +222,10 @@
> > >      */
> > >     private void findFiles(File f)
> > >     {
> > >+     if(Log.getLogger().isDebugEnabled()) {
> > >+            Log.debug("RegistryWatcher: Find files for " + f);
> > >+        }
> > >+
> > >         File[] contents = null;
> > >
> > >         if (f.exists() && f.canRead())
> > >@@ -240,19 +244,26 @@
> > >                 {
> > >                     for (int i=0; i< contents.length; i++)
> > >                     {
> > >-                        files.put(contents[i],new
> > >Long(contents[i].lastModified()));
> > >-
> > >-                        if (subscriber!=null)
> > >-                        {
> > >-                            try
> > >-                            {
> > >-
> > >subscriber.loadFragment(contents[i].getCanonicalPath());
> > >-                            }
> > >-                            catch (Exception e)
> > >-                            {
> > >-                                Log.error("RegistryWatcher:
> > Can't load
> > >fragment", e);
> > >-                            }
> > >-                        }
> > >+                     if(contents[i].isDirectory())
> > >+                     {
> > >+                      findFiles(contents[i]);
> > >+                     }
> > >+                     else
> > >+                     {
> > >+                         files.put(contents[i],new
> > >Long(contents[i].lastModified()));
> > >+
> > >+                         if (subscriber!=null)
> > >+                         {
> > >+                             try
> > >+                             {
> > >+
> > >subscriber.loadFragment(contents[i].getCanonicalPath());
> > >+                             }
> > >+                             catch (Exception e)
> > >+                             {
> > >+
> > Log.error("RegistryWatcher: Can't load
> > >fragment", e);
> > >+                             }
> > >+                         }
> > >+                     }
> > >                     }
> > >                 }
> > >             }
> > >
> > >
> > >Index: CastorRegistryService.java
> > >===================================================================
> > >RCS file:
> > >/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed
> > /services/regis
> > >try/CastorRegistryService.java,v
> > >retrieving revision 1.27
> > >diff -u -r1.27 CastorRegistryService.java
> > >--- CastorRegistryService.java 17 Nov 2002 03:05:41 -0000 1.27
> > >+++ CastorRegistryService.java 24 Nov 2002 22:06:52 -0000
> > >@@ -926,6 +926,9 @@
> > >
> > >         public boolean accept(File f)
> > >         {
> > >+         if(f.isDirectory()) {
> > >+          return true;
> > >+         }
> > >             return f.toString().endsWith(extension);
> > >         }
> > >     }
> > >
> > >--
> > >To unsubscribe, e-mail:
> > <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
> > >For additional commands, e-mail:
> > <mailto:jetspeed-dev-help@jakarta.apache.org>
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:jetspeed-dev-help@jakarta.apache.org>
> >
>
>--
>To unsubscribe, e-mail:   
><mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:jetspeed-dev-help@jakarta.apache.org>


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message