Hi Nils,
sorry for the confusion. The names of Magnolia Repositories are in default
setup equivalent to the JCR workspaces in Magnolia repository.
This discrepancy is one of the things that comes from the fact that Magnolia
was around since very early prototypes of JCR and before all terminology was
stable. This was also one of the reasons for extra API layer on top of JCR - to
allow users of Magnolia to use stable API at the time when JCR was changing
rapidly.
The most of the reasons for that are gone now and we are planning to address
this together with addressing other JCR API related issues in Magnolia for 5.0
or shortly after.
Cheers,
Jan
On Mar 6, 2011, at 4:10 PM, Nils Breunese wrote:
>
> By the way, the method name getAllRepositoryNames() suggests it returns names
> of repositories, when in fact in returns the names of the *workspaces*. I
> believe there are more areas in Magnolia where repository and workspace are
> mixed up. Is this something that is already planned to be addressed or should
> I file a JIRA issue for this?
>
> Nils.
> ________________________________________
> Van: Nils Breunese
> Verzonden: donderdag 24 februari 2011 11:07
> Aan: Magnolia User-List
> Onderwerp: Re: [magnolia-user] RE: Get list of all workspaces
>
> Ronald Ten Berge wrote:
>
>> Maybe the following code (that is being used in ACLSDialogControl) will work:
>> SecurityConfiguration securityConf =
>> AdminInterfaceModule.getInstance().getSecurityConfiguration();
>> securityConf.getVisibleRepositories();
>
> Thanks, that led me to ContentRepository.getAllRepositoryNames(), which does
> exactly what I was looking for. It allowed me to write this bit of Groovy
> code to look for a UUID in all workspaces, which can come in handy from time
> to time (mainly when error messages throw you a UUID and you'd like to know
> in which workspace it is and what its path is, etc.):
>
> ----
> import info.magnolia.cms.beans.config.ContentRepository
> import info.magnolia.cms.core.Content
> import info.magnolia.cms.util.ContentUtil
> import info.magnolia.cms.util.DumperUtil
>
> def find(uuid) {
> for (workspace in ContentRepository.getAllRepositoryNames()) {
> Content content = ContentUtil.getContentByUUID(workspace, uuid)
> if (content) {
> return "Found UUID '${uuid}' in workspace '${workspace}':
> ${DumperUtil.dump(content)}"
> }
> }
> return "No content found for UUID '${uuid}'"
> }
>
> find 'a9ceabd4-a3a1-4234-9354-0c328407ca77'
> ----
>
> Nils.
>
> ------------------------------------------------------------------------
> VPRO www.vpro.nl
> ------------------------------------------------------------------------
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------