[ 
http://issues.apache.org/jira/browse/JCR-616?page=comments#action_12449676 ] 
            
Julian Reschke commented on JCR-616:
------------------------------------

OK.

I have a prototype running which at least fixes the problem for me.

Changes: 

1) NamespaceStorage: add method "getRegisteredNamespaces()",

2) add that to WorkspaceManager,

3) use it in NamespaceRegistryImpl to get a new map when the local one is 
incomplete.

(What's currently missing in NamespaceRegistryImpl is a way to add the newly 
retrieved mapping to the local map, so the refresh logic only needs to be 
applied once per new entry).

If people think I'm on the right track with this, I will complete the fix and 
submit a patch.

The optimizations we discussed can then be discussed separately.



> Completeness/Freshness of Namespace Registry
> --------------------------------------------
>
>                 Key: JCR-616
>                 URL: http://issues.apache.org/jira/browse/JCR-616
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: SPI
>            Reporter: Julian Reschke
>
> We need to define the requirements on completeness and freshness of 
> RepositoryService.getRegisteredNamespaces().
> Right now the optimistic assumption seems to be that an SPI provider is able 
> to report all namespaces that can occur in a repository beforehand. Even if 
> it can do that (and I know of potential targets for SPI that simply can't), 
> this seems to be quite a waste of time if these namespace prefixes aren't 
> actually used later on.
> Furthermore, in SPI namespace prefixes aren't really relevant, except to 
> enable the transient layer to return "meaningful" prefixes instead of 
> automatically generated ones.
> Therefore my propoal would be to:
> 1) Clarify that the Map returned from getRegisteredNamespaces() isn't 
> required to be complete,
> 2) Enhance JCR2SPI to auto-generate prefixes when it encounters namespaces 
> not in the registry.
> I expect this to also affect RepositoryService.(un)registerNamespace(...), 
> but let's discuss the underlying issue first...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to