You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@incubator.apache.org by Eran Bartenstein <eb...@hotmail.com> on 2006/12/07 15:32:13 UTC

Ivy List modules with extra attributes

Hello,

I am trying to list a module for a specified organisation and revision with 
an extra attribute: kind.
However, it seems that Ivy ignores the extra attribute.

Also when checking into the code I can see no use of the extra attrbute 
specified in the passed ModuleReviosionId.

I use the following:

                        HashMap extraAttributes = new HashMap();
                        extraAttributes.put("kind", "gsce");
                        ModuleRevisionId currModuleRevisionId =
                                
ModuleRevisionId.newInstance(currOrganizationName, currModuleName,
                                        currRevisionName, extraAttributes);
                        PatternMatcher matcher = 
_ivy.getMatcher(PatternMatcher.EXACT);
                        ModuleRevisionId[] moduleRevisionIds = 
_ivy.listModules(currModuleRevisionId, matcher);

                        // Populate revisions array - with childs of type: 
revision
                        RepositoryItem currRevisionRepositoryItem =
                                new RepositoryItem(currRevisionName, 
currModuleRepositoryItem);
                        
revisionRepositoryItemsList.add(currRevisionRepositoryItem);


My main purpose is to try and list all modules under all organizations that 
match the specific extra attrbute.

Does anyone know how I can do that ?

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@incubator.apache.org
For additional commands, e-mail: general-help@incubator.apache.org


Re: Ivy List modules with extra attributes

Posted by Xavier Hanin <xa...@gmail.com>.
On 12/7/06, Eran Bartenstein <eb...@hotmail.com> wrote:
>
> Hello,
>
> I am trying to list a module for a specified organisation and revision
> with
> an extra attribute: kind.
> However, it seems that Ivy ignores the extra attribute.
>
> Also when checking into the code I can see no use of the extra attrbute
> specified in the passed ModuleReviosionId.
>
> I use the following:
>
>                         HashMap extraAttributes = new HashMap();
>                         extraAttributes.put("kind", "gsce");
>                         ModuleRevisionId currModuleRevisionId =
>
> ModuleRevisionId.newInstance(currOrganizationName, currModuleName,
>                                         currRevisionName,
> extraAttributes);
>                         PatternMatcher matcher =
> _ivy.getMatcher(PatternMatcher.EXACT);
>                         ModuleRevisionId[] moduleRevisionIds =
> _ivy.listModules(currModuleRevisionId, matcher);


The listModules   method do not take extra attributes into account because
it doesn't know if the extra attribute is mandatory or not, more important
than another field, or things like that. As I write that I realise that the
pattern could help to know that, and could be used to review the code to
take extra attribute into account depending on the pattern. But this is not
the case now. So what I suggest as workaround is to write your own
listModules method, inspired by the existing one in Ivy code, but using your
extra attribute.

Xavier

                        // Populate revisions array - with childs of type:
> revision
>                         RepositoryItem currRevisionRepositoryItem =
>                                 new RepositoryItem(currRevisionName,
> currModuleRepositoryItem);
>
> revisionRepositoryItemsList.add(currRevisionRepositoryItem);
>
>
> My main purpose is to try and list all modules under all organizations
> that
> match the specific extra attrbute.
>
> Does anyone know how I can do that ?
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@incubator.apache.org
> For additional commands, e-mail: general-help@incubator.apache.org
>
>