Raphael,
Thanks for your reply. I agree with your reasoning. I attempted to use
addEntry method originally but I was thrown off by the exception that was
occuring (about new entry being not found in registry). It bugged me so much
that I stayed up late last night (don't we all) and traced down a possible
bug in this method. The original call to inherited BaseRegistry.getEntry
would result in InvalidEntryException and thus preventing the addEntry to
continue. Not sure if that's what was intended but I think the proper course
of action here would be to call this.getEntry which will not throw an
exception if new entry was not found. After making the change as shown
below, I can add new entries to registry at runtime and they will be saved
to disk on shutdown. This way the usage of registry fragments is transparent
to me.
<patch>
cvs diff -c CastorRegistryService.java
Index: CastorRegistryService.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jetspeed/src/java/org/apache/jetspeed/services/regis
try/CastorRegistryService.java,v
retrieving revision 1.9
diff -c -r1.9 CastorRegistryService.java
*** CastorRegistryService.java 2001/09/13 13:53:02 1.9
--- CastorRegistryService.java 2001/11/21 15:17:56
***************
*** 214,220 ****
synchronized (entryIndex)
{
! if (registry.getEntry(entry.getName())!=null)
{
fragment.setEntry(regName,entry);
registry.setEntry(entry);
--- 214,220 ----
synchronized (entryIndex)
{
! if (this.getEntry(regName, entry.getName())!=null)
{
fragment.setEntry(regName,entry);
registry.setEntry(entry);
</patch>
Hope this makes sense. If this is a legitimate bug, should I submit it
(along with the patch) to Bugzilla?
Best regards,
Mark C. Orciuch
Next Generation Solutions, Ltd.
Voice: 219-365-0691
e-Mail: [EMAIL PROTECTED]
web: http://www.ngsltd.com
-----Original Message-----
From: Raphael Luta [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 21, 2001 2:22 AM
To: Jetspeed Users List
Subject: Re: FW: Adding portlets to registry at runtime
The idea of the Registry interface is to abstract from the implementation
of teh Registry so that your addENtry will work wether the registry is file
based or DB-based.
In the default file based implementation (CastorRegistryService), all new
entries are stored into the fragment defined in the JR.p file (by default
local-portlet.xreg for Portlet, local-control.xreg from Controls, etc...)
This mechanism will give you the same functionality than the previous
1.3a1 / JetspeedConfig behavior while still allow you to edit in place
entries that come from another fragment...
If you need to specifically manage fragments (I'd advise you against though)
you can access them through the
org.apache.jetspeed.services.registry.FileRegistry interface
which is implemented by CastorRegistryService (and used by the FeedDaemon
to create new xreg files based on an OCS feed). Using this interface however
will tie you to fragment based implementations of the registry.
If you want to expand the CastorRegistryService to allow adding entries in a
specific fragment, I'd recommend that you expose these methods through the
FileRegistry interface and implement the new methods in the
CastorRegistryService.
Mark Orciuch wrote:
> Did I post to the wrong mailing list?
>
> -----Original Message-----
> From: Mark Orciuch [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 4:35 PM
> To: Jetspeed Users List
> Subject: RE: Adding portlets to registry at runtime
>
>
> OK. I got a little further in my search for answer. Even before making my
> original post, I searched for this functionality in CastorRegistryService
> but I could not find a way to access a specific RegistryFragment. Method
> addEntry does not seetm to be appropriate since there's no way to specify
> which fragment to add the entry to (or at least, I can't see how).
>
> I have pulled out code to load/save registry fragment from
> CastorRegistryService and used it to created quick test for adding a new
> portlet entry (see attached). It seems that perhaps there could be
> functionality in CastorRegistryService to gain access to particular
fragment
> (or I'd be curious to know why not). Thanks!
>
>
> Best regards,
>
> Mark C. Orciuch
> Next Generation Solutions, Ltd.
> Voice: 219-365-0691
> e-Mail: [EMAIL PROTECTED]
> web: http://www.ngsltd.com
>
>
> -----Original Message-----
> From: Mark Orciuch [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 16, 2001 1:50 PM
> To: Jetspeed Users List
> Subject: Adding portlets to registry at runtime
>
>
> In previous version of jetspeed, there used to be JetspeedConfig class
which
> allowed for reading and writing portlet entries at runtime. This class is
> gone from the current release. What would be the equivalent of this in
> current release? I am trying to write an administrative app which allows
to
> add portlet entries to registry and then write them to appropriate
registry
> fragment. Any pointers would be appreciated.
>
> Best regards,
>
> Mark C. Orciuch
> IT Consultant
> Voice: 219-647-4122
> e-Mail: [EMAIL PROTECTED]
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> ------------------------------------------------------------------------
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--
--
Raphael Luta - [EMAIL PROTECTED]
Vivendi Universal Networks - Paris
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>