You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Eshan Sudharaka <es...@gmail.com> on 2010/06/07 00:59:35 UTC

getting the list of available artifacts in the source repository

In order to copy artifacts from one repository to another i need to get a
list of available list of artifacts in the source repository. So  i need to
have a list of ArtifactMetadata objects  so i can have more information
about source artifacts.

here i am going to use following method in the  DefaultMetadataResolver
class to get that list.

public Collection<ArtifactMetadata> getArtifacts( String repoId, String
namespace, String projectId, String projectVersion )

but my problem is i have only one input data to get that list which is
repoId.

may be i can generate other required parameters for the particular artifact
by using other methods in that defaultMetadataResolver class.

so i need to know what are the thing return from following methods.

1).   public Collection<String> getRootNamespaces( String repoId )
                  for the internal repo what could be that list ..?

2).   public Collection<String> getNamespaces( String repoId, String
namespace )
                >> what is returning here

3).  public Collection<String> getProjects( String repoId, String namespace
)
    >>> this will return a list of available projects in that particular
repo. eg : log4j,Junit, (list of griop id's)
           here what is the namespace parameter ..?

4). public Collection<String> getProjectVersions( String repoId, String
namespace, String projectId )
    >>> here we can get the list of available projects in a particular
group.

5).  public Collection<ArtifactMetadata> getArtifacts( String repoId, String
namespace, String projectId, String projectVersion )

 /// actually i need to get this list so i can proceed with more details.



-- 
P.A.Eshan Sudharaka
Dept of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Re: getting the list of available artifacts in the source repository

Posted by Eshan Sudharaka <es...@gmail.com>.
thankz Deng.  :)

On Tue, Jun 8, 2010 at 3:43 PM, Deng Ching <oc...@apache.org> wrote:

> On Tue, Jun 8, 2010 at 5:15 PM, Eshan Sudharaka <esudharaka@gmail.com
> >wrote:
>
> > On Tue, Jun 8, 2010 at 11:32 AM, Deng Ching <oc...@apache.org> wrote:
> >
> > > On Tue, Jun 8, 2010 at 10:08 AM, Deng Ching <od...@gmail.com>
> wrote:
> > >
> > > > On Tue, Jun 8, 2010 at 8:14 AM, Eshan Sudharaka <
> esudharaka@gmail.com
> > > >wrote:
> > > >
> > > >> to gather the source artifacts details (actually source repo
> details)
> > i
> > > >> have planned to create a class named SourceAritfacts  and inside
> that
> > > class
> > > >> i am going to use the services of defaultmetadata data resolver
> class.
> > > >>
> > > >> structure
> > > >>
> > > >> List<Artifacts> SourceArtifactsList
> > > >>
> > > >> List<String> rootNameSpaces;  store values as org,com
> > > >> List<String> groupIdList ;   >>>>>>   store values as org.apache,
> > > >> org.codehaus
> > > >> List<String> artifactsList;  >>>>>>   store values as
> > > org.apache.archiva,
> > > >> org.codehaus.redback
> > > >> List<String> artifactsVersionList;  >>>>> here we store values as
> > > >> org.apache.archiva-1.0 , org.apache.archiva-1.1
> > > >>
> > > >> void setRootNameSpaces(String repoId);
> > > >> void setGruopIdList(List<String> rootNameSpaces);
> > > >> void setArtifactsList(List<String> gruopIdList);
> > > >> void setArtifactsVersionList(List<String> artifactsList)
> > > >>
> > > >
> > > Hmm, I don't think you need the above setter methods and the
> > corresponding
> > > lists. It might be good to just maintain one list of artifact objects
> for
> > > the artifacts in the repo..
> > >
> >
> > >>>>  we need to get the list of available artifacts by calling
> > DefaultMetaData Resolver;s methods iteratively. first we need to get the
> >  root name spaces. then the  group id list and then artifact id list and
> > finally the version list. then we can assign those details to the
> artifacts
> > objects. some how we need to store those intermediate values. so what is
> > the preferred data structure to store those intermediate data.?
> >
>
> OK, makes sense now. I don't think the variables should be declared
> globally
> though and the set methods exposed publicly. Maybe you can just get the
> root
> namespaces and have a method that recurses through the list to get the
> nodes?
>
> Anyway, these are class implementation details.. I suggest you start
> writing
> the class (plus the unit tests) based on what we have discussed then we can
> review it :)
>
>
> > >
> > >
> > > > void setSourceArtifactList(List<String> artifactsVersionList )
> >>>>>>
> > > >> here retirieve values from the artifactsVersionList and create new
> > > objects
> > > >> of Artifacts and set the parameters and add objects to the
> > > >> SourceArtifactsList
> > > >>
> > > >
> > > Should this be getSourceArtifactList(..) instead?
> > >
> > >
> >     ya. i think caller has to just pass repo id and then he should able
> to
> > get the source artifact list. so we can have a method
> > call getSourceArtifactList().  it will call other methods and produce the
> > artifacts list.
> >
>
> +1
>
> Thanks,
> Deng
>



-- 
P.A.Eshan Sudharaka
Dept of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Re: getting the list of available artifacts in the source repository

Posted by Deng Ching <oc...@apache.org>.
On Tue, Jun 8, 2010 at 5:15 PM, Eshan Sudharaka <es...@gmail.com>wrote:

> On Tue, Jun 8, 2010 at 11:32 AM, Deng Ching <oc...@apache.org> wrote:
>
> > On Tue, Jun 8, 2010 at 10:08 AM, Deng Ching <od...@gmail.com> wrote:
> >
> > > On Tue, Jun 8, 2010 at 8:14 AM, Eshan Sudharaka <esudharaka@gmail.com
> > >wrote:
> > >
> > >> to gather the source artifacts details (actually source repo details)
> i
> > >> have planned to create a class named SourceAritfacts  and inside that
> > class
> > >> i am going to use the services of defaultmetadata data resolver class.
> > >>
> > >> structure
> > >>
> > >> List<Artifacts> SourceArtifactsList
> > >>
> > >> List<String> rootNameSpaces;  store values as org,com
> > >> List<String> groupIdList ;   >>>>>>   store values as org.apache,
> > >> org.codehaus
> > >> List<String> artifactsList;  >>>>>>   store values as
> > org.apache.archiva,
> > >> org.codehaus.redback
> > >> List<String> artifactsVersionList;  >>>>> here we store values as
> > >> org.apache.archiva-1.0 , org.apache.archiva-1.1
> > >>
> > >> void setRootNameSpaces(String repoId);
> > >> void setGruopIdList(List<String> rootNameSpaces);
> > >> void setArtifactsList(List<String> gruopIdList);
> > >> void setArtifactsVersionList(List<String> artifactsList)
> > >>
> > >
> > Hmm, I don't think you need the above setter methods and the
> corresponding
> > lists. It might be good to just maintain one list of artifact objects for
> > the artifacts in the repo..
> >
>
> >>>>  we need to get the list of available artifacts by calling
> DefaultMetaData Resolver;s methods iteratively. first we need to get the
>  root name spaces. then the  group id list and then artifact id list and
> finally the version list. then we can assign those details to the artifacts
> objects. some how we need to store those intermediate values. so what is
> the preferred data structure to store those intermediate data.?
>

OK, makes sense now. I don't think the variables should be declared globally
though and the set methods exposed publicly. Maybe you can just get the root
namespaces and have a method that recurses through the list to get the
nodes?

Anyway, these are class implementation details.. I suggest you start writing
the class (plus the unit tests) based on what we have discussed then we can
review it :)


> >
> >
> > > void setSourceArtifactList(List<String> artifactsVersionList )   >>>>>>
> > >> here retirieve values from the artifactsVersionList and create new
> > objects
> > >> of Artifacts and set the parameters and add objects to the
> > >> SourceArtifactsList
> > >>
> > >
> > Should this be getSourceArtifactList(..) instead?
> >
> >
>     ya. i think caller has to just pass repo id and then he should able to
> get the source artifact list. so we can have a method
> call getSourceArtifactList().  it will call other methods and produce the
> artifacts list.
>

+1

Thanks,
Deng

Re: getting the list of available artifacts in the source repository

Posted by Eshan Sudharaka <es...@gmail.com>.
On Tue, Jun 8, 2010 at 11:32 AM, Deng Ching <oc...@apache.org> wrote:

> On Tue, Jun 8, 2010 at 10:08 AM, Deng Ching <od...@gmail.com> wrote:
>
> > On Tue, Jun 8, 2010 at 8:14 AM, Eshan Sudharaka <esudharaka@gmail.com
> >wrote:
> >
> >> to gather the source artifacts details (actually source repo details) i
> >> have planned to create a class named SourceAritfacts  and inside that
> class
> >> i am going to use the services of defaultmetadata data resolver class.
> >>
> >> structure
> >>
> >> List<Artifacts> SourceArtifactsList
> >>
> >> List<String> rootNameSpaces;  store values as org,com
> >> List<String> groupIdList ;   >>>>>>   store values as org.apache,
> >> org.codehaus
> >> List<String> artifactsList;  >>>>>>   store values as
> org.apache.archiva,
> >> org.codehaus.redback
> >> List<String> artifactsVersionList;  >>>>> here we store values as
> >> org.apache.archiva-1.0 , org.apache.archiva-1.1
> >>
> >> void setRootNameSpaces(String repoId);
> >> void setGruopIdList(List<String> rootNameSpaces);
> >> void setArtifactsList(List<String> gruopIdList);
> >> void setArtifactsVersionList(List<String> artifactsList)
> >>
> >
> Hmm, I don't think you need the above setter methods and the corresponding
> lists. It might be good to just maintain one list of artifact objects for
> the artifacts in the repo..
>

>>>>  we need to get the list of available artifacts by calling
DefaultMetaData Resolver;s methods iteratively. first we need to get the
 root name spaces. then the  group id list and then artifact id list and
finally the version list. then we can assign those details to the artifacts
objects. some how we need to store those intermediate values. so what is
the preferred data structure to store those intermediate data.?

>
>
> > void setSourceArtifactList(List<String> artifactsVersionList )   >>>>>>
> >> here retirieve values from the artifactsVersionList and create new
> objects
> >> of Artifacts and set the parameters and add objects to the
> >> SourceArtifactsList
> >>
> >
> Should this be getSourceArtifactList(..) instead?
>
>
    ya. i think caller has to just pass repo id and then he should able to
get the source artifact list. so we can have a method
call getSourceArtifactList().  it will call other methods and produce the
artifacts list.

>
> >
> >> i have another doubt regarding get the usage of defaultmetadata
> resolver.
> >> here it use
> >>     *   private MetadataRepository metadataRepository;
> >>     *   private StorageMetadataResolver storageResolver
> >>
> >> and wondering why there are no any setter methods to set them. and i
> want
> >> to know how to set them.
> >>
> >
> > These are injected by Plexus through the @plexus.requirement annotation,
> so
> > there's no need for setter methods. If you build the
> metadata-repository-api
> > module, you'll see a generated Plexus descriptor file (components.xml) in
> > the target/classes/META-INF/plexus/. It is similar to Spring's context
> file.
> > Archiva is using the plexus-spring adapter to translate the plexus
> > components into Spring components during runtime.
> >
> >
> >>
> >>
> >> once we got the source artifacts list we can check for the  availability
> >> of a particular artifacts in the target repository and then allow
> replacing
> >> function and the copying function.
> >>
> >> may be this module should be put in to the plugging.
> >>
> >>
> > +1 :)
> >
> > Thanks,
> > Deng
> >
> >
> >>
> >>
> >> On Mon, Jun 7, 2010 at 3:49 PM, Deng Ching <od...@gmail.com> wrote:
> >>
> >>> On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <esudharaka@gmail.com
> >>> >wrote:
> >>>
> >>> > In order to copy artifacts from one repository to another i need to
> get
> >>> a
> >>> > list of available list of artifacts in the source repository. So  i
> >>> need to
> >>> > have a list of ArtifactMetadata objects  so i can have more
> information
> >>> > about source artifacts.
> >>> >
> >>> > here i am going to use following method in the
>  DefaultMetadataResolver
> >>> > class to get that list.
> >>> >
> >>> > public Collection<ArtifactMetadata> getArtifacts( String repoId,
> String
> >>> > namespace, String projectId, String projectVersion )
> >>> >
> >>> > but my problem is i have only one input data to get that list which
> is
> >>> > repoId.
> >>> >
> >>> > may be i can generate other required parameters for the particular
> >>> artifact
> >>> > by using other methods in that defaultMetadataResolver class.
> >>> >
> >>> > so i need to know what are the thing return from following methods.
> >>> >
> >>> > 1).   public Collection<String> getRootNamespaces( String repoId )
> >>> >                   for the internal repo what could be that list ..?
> >>> >
> >>>
> >>> This returns a list of the root of the groupIds of the artifacts in the
> >>> repository. For example, if the groupIds are org.apache.archiva and
> >>> org.codehaus.redback, the root namespace is "org".
> >>>
> >>>
> >>> >
> >>> > 2).   public Collection<String> getNamespaces( String repoId, String
> >>> > namespace )
> >>> >                 >> what is returning here
> >>> >
> >>>
> >>> This returns a list of the node of the specified namespace (or a chunk
> of
> >>> the groupId) of the artifacts in the repository. Using the same
> example,
> >>> if
> >>> you have org.apache.archiva & org.codehaus.redback as the groupIds of
> the
> >>> artifacts in the repo then you called the method getNamespaces(
> >>> "internal",
> >>> "org"), you'd get "apache" and "codehaus" in the list. If you passed
> >>> "org.apache" as the namespace param (e.g. getNamespaces( "internal",
> >>> "org.apache"), the list will only contain "archiva"), and so on..
> >>>
> >>>
> >>> >
> >>> > 3).  public Collection<String> getProjects( String repoId, String
> >>> namespace
> >>> > )
> >>> >     >>> this will return a list of available projects in that
> >>> particular
> >>> > repo. eg : log4j,Junit, (list of griop id's)
> >>> >            here what is the namespace parameter ..?
> >>> >
> >>>
> >>> This returns a list of the artifactIds under the specified
> >>> namespace/groupId.
> >>>
> >>>
> >>> >
> >>> > 4). public Collection<String> getProjectVersions( String repoId,
> String
> >>> > namespace, String projectId )
> >>> >     >>> here we can get the list of available projects in a
> particular
> >>> > group.
> >>> >
> >>>
> >>> This returns a list of the versions of the specific artifact/project.
> >>>
> >>>
> >>> >
> >>> > 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
> >>> > String namespace, String projectId, String projectVersion )
> >>> >
> >>> >  /// actually i need to get this list so i can proceed with more
> >>> details.
> >>> >
> >>>
> >>>
> >>> Thanks,
> >>> Deng
> >>>
> >>
> >>
> >>
> >> --
> >> P.A.Eshan Sudharaka
> >> Dept of Computer Science and Engineering
> >> University of Moratuwa
> >> Sri Lanka
> >>
> >
> >
>



-- 
P.A.Eshan Sudharaka
Dept of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Re: getting the list of available artifacts in the source repository

Posted by Deng Ching <oc...@apache.org>.
On Tue, Jun 8, 2010 at 10:08 AM, Deng Ching <od...@gmail.com> wrote:

> On Tue, Jun 8, 2010 at 8:14 AM, Eshan Sudharaka <es...@gmail.com>wrote:
>
>> to gather the source artifacts details (actually source repo details) i
>> have planned to create a class named SourceAritfacts  and inside that class
>> i am going to use the services of defaultmetadata data resolver class.
>>
>> structure
>>
>> List<Artifacts> SourceArtifactsList
>>
>> List<String> rootNameSpaces;  store values as org,com
>> List<String> groupIdList ;   >>>>>>   store values as org.apache,
>> org.codehaus
>> List<String> artifactsList;  >>>>>>   store values as org.apache.archiva,
>> org.codehaus.redback
>> List<String> artifactsVersionList;  >>>>> here we store values as
>> org.apache.archiva-1.0 , org.apache.archiva-1.1
>>
>> void setRootNameSpaces(String repoId);
>> void setGruopIdList(List<String> rootNameSpaces);
>> void setArtifactsList(List<String> gruopIdList);
>> void setArtifactsVersionList(List<String> artifactsList)
>>
>
Hmm, I don't think you need the above setter methods and the corresponding
lists. It might be good to just maintain one list of artifact objects for
the artifacts in the repo..


> void setSourceArtifactList(List<String> artifactsVersionList )   >>>>>>
>> here retirieve values from the artifactsVersionList and create new objects
>> of Artifacts and set the parameters and add objects to the
>> SourceArtifactsList
>>
>
Should this be getSourceArtifactList(..) instead?


>
>> i have another doubt regarding get the usage of defaultmetadata resolver.
>> here it use
>>     *   private MetadataRepository metadataRepository;
>>     *   private StorageMetadataResolver storageResolver
>>
>> and wondering why there are no any setter methods to set them. and i want
>> to know how to set them.
>>
>
> These are injected by Plexus through the @plexus.requirement annotation, so
> there's no need for setter methods. If you build the metadata-repository-api
> module, you'll see a generated Plexus descriptor file (components.xml) in
> the target/classes/META-INF/plexus/. It is similar to Spring's context file.
> Archiva is using the plexus-spring adapter to translate the plexus
> components into Spring components during runtime.
>
>
>>
>>
>> once we got the source artifacts list we can check for the  availability
>> of a particular artifacts in the target repository and then allow replacing
>> function and the copying function.
>>
>> may be this module should be put in to the plugging.
>>
>>
> +1 :)
>
> Thanks,
> Deng
>
>
>>
>>
>> On Mon, Jun 7, 2010 at 3:49 PM, Deng Ching <od...@gmail.com> wrote:
>>
>>> On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <esudharaka@gmail.com
>>> >wrote:
>>>
>>> > In order to copy artifacts from one repository to another i need to get
>>> a
>>> > list of available list of artifacts in the source repository. So  i
>>> need to
>>> > have a list of ArtifactMetadata objects  so i can have more information
>>> > about source artifacts.
>>> >
>>> > here i am going to use following method in the  DefaultMetadataResolver
>>> > class to get that list.
>>> >
>>> > public Collection<ArtifactMetadata> getArtifacts( String repoId, String
>>> > namespace, String projectId, String projectVersion )
>>> >
>>> > but my problem is i have only one input data to get that list which is
>>> > repoId.
>>> >
>>> > may be i can generate other required parameters for the particular
>>> artifact
>>> > by using other methods in that defaultMetadataResolver class.
>>> >
>>> > so i need to know what are the thing return from following methods.
>>> >
>>> > 1).   public Collection<String> getRootNamespaces( String repoId )
>>> >                   for the internal repo what could be that list ..?
>>> >
>>>
>>> This returns a list of the root of the groupIds of the artifacts in the
>>> repository. For example, if the groupIds are org.apache.archiva and
>>> org.codehaus.redback, the root namespace is "org".
>>>
>>>
>>> >
>>> > 2).   public Collection<String> getNamespaces( String repoId, String
>>> > namespace )
>>> >                 >> what is returning here
>>> >
>>>
>>> This returns a list of the node of the specified namespace (or a chunk of
>>> the groupId) of the artifacts in the repository. Using the same example,
>>> if
>>> you have org.apache.archiva & org.codehaus.redback as the groupIds of the
>>> artifacts in the repo then you called the method getNamespaces(
>>> "internal",
>>> "org"), you'd get "apache" and "codehaus" in the list. If you passed
>>> "org.apache" as the namespace param (e.g. getNamespaces( "internal",
>>> "org.apache"), the list will only contain "archiva"), and so on..
>>>
>>>
>>> >
>>> > 3).  public Collection<String> getProjects( String repoId, String
>>> namespace
>>> > )
>>> >     >>> this will return a list of available projects in that
>>> particular
>>> > repo. eg : log4j,Junit, (list of griop id's)
>>> >            here what is the namespace parameter ..?
>>> >
>>>
>>> This returns a list of the artifactIds under the specified
>>> namespace/groupId.
>>>
>>>
>>> >
>>> > 4). public Collection<String> getProjectVersions( String repoId, String
>>> > namespace, String projectId )
>>> >     >>> here we can get the list of available projects in a particular
>>> > group.
>>> >
>>>
>>> This returns a list of the versions of the specific artifact/project.
>>>
>>>
>>> >
>>> > 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
>>> > String namespace, String projectId, String projectVersion )
>>> >
>>> >  /// actually i need to get this list so i can proceed with more
>>> details.
>>> >
>>>
>>>
>>> Thanks,
>>> Deng
>>>
>>
>>
>>
>> --
>> P.A.Eshan Sudharaka
>> Dept of Computer Science and Engineering
>> University of Moratuwa
>> Sri Lanka
>>
>
>

Re: getting the list of available artifacts in the source repository

Posted by Deng Ching <od...@gmail.com>.
On Tue, Jun 8, 2010 at 8:14 AM, Eshan Sudharaka <es...@gmail.com>wrote:

> to gather the source artifacts details (actually source repo details) i
> have planned to create a class named SourceAritfacts  and inside that class
> i am going to use the services of defaultmetadata data resolver class.
>
> structure
>
> List<Artifacts> SourceArtifactsList
>
> List<String> rootNameSpaces;  store values as org,com
> List<String> groupIdList ;   >>>>>>   store values as org.apache,
> org.codehaus
> List<String> artifactsList;  >>>>>>   store values as org.apache.archiva,
> org.codehaus.redback
> List<String> artifactsVersionList;  >>>>> here we store values as
> org.apache.archiva-1.0 , org.apache.archiva-1.1
>
> void setRootNameSpaces(String repoId);
> void setGruopIdList(List<String> rootNameSpaces);
> void setArtifactsList(List<String> gruopIdList);
> void setArtifactsVersionList(List<String> artifactsList)
> void setSourceArtifactList(List<String> artifactsVersionList )   >>>>>>
> here retirieve values from the artifactsVersionList and create new objects
> of Artifacts and set the parameters and add objects to the
> SourceArtifactsList
>
> i have another doubt regarding get the usage of defaultmetadata resolver.
> here it use
>     *   private MetadataRepository metadataRepository;
>     *   private StorageMetadataResolver storageResolver
>
> and wondering why there are no any setter methods to set them. and i want
> to know how to set them.
>

These are injected by Plexus through the @plexus.requirement annotation, so
there's no need for setter methods. If you build the metadata-repository-api
module, you'll see a generated Plexus descriptor file (components.xml) in
the target/classes/META-INF/plexus/. It is similar to Spring's context file.
Archiva is using the plexus-spring adapter to translate the plexus
components into Spring components during runtime.


>
>
> once we got the source artifacts list we can check for the  availability of
> a particular artifacts in the target repository and then allow replacing
> function and the copying function.
>
> may be this module should be put in to the plugging.
>
>
+1 :)

Thanks,
Deng


>
>
> On Mon, Jun 7, 2010 at 3:49 PM, Deng Ching <od...@gmail.com> wrote:
>
>> On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <esudharaka@gmail.com
>> >wrote:
>>
>> > In order to copy artifacts from one repository to another i need to get
>> a
>> > list of available list of artifacts in the source repository. So  i need
>> to
>> > have a list of ArtifactMetadata objects  so i can have more information
>> > about source artifacts.
>> >
>> > here i am going to use following method in the  DefaultMetadataResolver
>> > class to get that list.
>> >
>> > public Collection<ArtifactMetadata> getArtifacts( String repoId, String
>> > namespace, String projectId, String projectVersion )
>> >
>> > but my problem is i have only one input data to get that list which is
>> > repoId.
>> >
>> > may be i can generate other required parameters for the particular
>> artifact
>> > by using other methods in that defaultMetadataResolver class.
>> >
>> > so i need to know what are the thing return from following methods.
>> >
>> > 1).   public Collection<String> getRootNamespaces( String repoId )
>> >                   for the internal repo what could be that list ..?
>> >
>>
>> This returns a list of the root of the groupIds of the artifacts in the
>> repository. For example, if the groupIds are org.apache.archiva and
>> org.codehaus.redback, the root namespace is "org".
>>
>>
>> >
>> > 2).   public Collection<String> getNamespaces( String repoId, String
>> > namespace )
>> >                 >> what is returning here
>> >
>>
>> This returns a list of the node of the specified namespace (or a chunk of
>> the groupId) of the artifacts in the repository. Using the same example,
>> if
>> you have org.apache.archiva & org.codehaus.redback as the groupIds of the
>> artifacts in the repo then you called the method getNamespaces(
>> "internal",
>> "org"), you'd get "apache" and "codehaus" in the list. If you passed
>> "org.apache" as the namespace param (e.g. getNamespaces( "internal",
>> "org.apache"), the list will only contain "archiva"), and so on..
>>
>>
>> >
>> > 3).  public Collection<String> getProjects( String repoId, String
>> namespace
>> > )
>> >     >>> this will return a list of available projects in that particular
>> > repo. eg : log4j,Junit, (list of griop id's)
>> >            here what is the namespace parameter ..?
>> >
>>
>> This returns a list of the artifactIds under the specified
>> namespace/groupId.
>>
>>
>> >
>> > 4). public Collection<String> getProjectVersions( String repoId, String
>> > namespace, String projectId )
>> >     >>> here we can get the list of available projects in a particular
>> > group.
>> >
>>
>> This returns a list of the versions of the specific artifact/project.
>>
>>
>> >
>> > 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
>> > String namespace, String projectId, String projectVersion )
>> >
>> >  /// actually i need to get this list so i can proceed with more
>> details.
>> >
>>
>>
>> Thanks,
>> Deng
>>
>
>
>
> --
> P.A.Eshan Sudharaka
> Dept of Computer Science and Engineering
> University of Moratuwa
> Sri Lanka
>

Re: getting the list of available artifacts in the source repository

Posted by Eshan Sudharaka <es...@gmail.com>.
to gather the source artifacts details (actually source repo details) i have
planned to create a class named SourceAritfacts  and inside that class i am
going to use the services of defaultmetadata data resolver class.

structure

List<Artifacts> SourceArtifactsList

List<String> rootNameSpaces;  store values as org,com
List<String> groupIdList ;   >>>>>>   store values as org.apache,
org.codehaus
List<String> artifactsList;  >>>>>>   store values as org.apache.archiva,
org.codehaus.redback
List<String> artifactsVersionList;  >>>>> here we store values as
org.apache.archiva-1.0 , org.apache.archiva-1.1

void setRootNameSpaces(String repoId);
void setGruopIdList(List<String> rootNameSpaces);
void setArtifactsList(List<String> gruopIdList);
void setArtifactsVersionList(List<String> artifactsList)
void setSourceArtifactList(List<String> artifactsVersionList )   >>>>>> here
retirieve values from the artifactsVersionList and create new objects   of
Artifacts and set the parameters and add objects to the SourceArtifactsList

i have another doubt regarding get the usage of defaultmetadata resolver.
here it use
    *   private MetadataRepository metadataRepository;
    *   private StorageMetadataResolver storageResolver

and wondering why there are no any setter methods to set them. and i want to
know how to set them.



once we got the source artifacts list we can check for the  availability of
a particular artifacts in the target repository and then allow replacing
function and the copying function.

may be this module should be put in to the plugging.

thanks.



On Mon, Jun 7, 2010 at 3:49 PM, Deng Ching <od...@gmail.com> wrote:

> On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <esudharaka@gmail.com
> >wrote:
>
> > In order to copy artifacts from one repository to another i need to get a
> > list of available list of artifacts in the source repository. So  i need
> to
> > have a list of ArtifactMetadata objects  so i can have more information
> > about source artifacts.
> >
> > here i am going to use following method in the  DefaultMetadataResolver
> > class to get that list.
> >
> > public Collection<ArtifactMetadata> getArtifacts( String repoId, String
> > namespace, String projectId, String projectVersion )
> >
> > but my problem is i have only one input data to get that list which is
> > repoId.
> >
> > may be i can generate other required parameters for the particular
> artifact
> > by using other methods in that defaultMetadataResolver class.
> >
> > so i need to know what are the thing return from following methods.
> >
> > 1).   public Collection<String> getRootNamespaces( String repoId )
> >                   for the internal repo what could be that list ..?
> >
>
> This returns a list of the root of the groupIds of the artifacts in the
> repository. For example, if the groupIds are org.apache.archiva and
> org.codehaus.redback, the root namespace is "org".
>
>
> >
> > 2).   public Collection<String> getNamespaces( String repoId, String
> > namespace )
> >                 >> what is returning here
> >
>
> This returns a list of the node of the specified namespace (or a chunk of
> the groupId) of the artifacts in the repository. Using the same example, if
> you have org.apache.archiva & org.codehaus.redback as the groupIds of the
> artifacts in the repo then you called the method getNamespaces( "internal",
> "org"), you'd get "apache" and "codehaus" in the list. If you passed
> "org.apache" as the namespace param (e.g. getNamespaces( "internal",
> "org.apache"), the list will only contain "archiva"), and so on..
>
>
> >
> > 3).  public Collection<String> getProjects( String repoId, String
> namespace
> > )
> >     >>> this will return a list of available projects in that particular
> > repo. eg : log4j,Junit, (list of griop id's)
> >            here what is the namespace parameter ..?
> >
>
> This returns a list of the artifactIds under the specified
> namespace/groupId.
>
>
> >
> > 4). public Collection<String> getProjectVersions( String repoId, String
> > namespace, String projectId )
> >     >>> here we can get the list of available projects in a particular
> > group.
> >
>
> This returns a list of the versions of the specific artifact/project.
>
>
> >
> > 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
> > String namespace, String projectId, String projectVersion )
> >
> >  /// actually i need to get this list so i can proceed with more details.
> >
>
>
> Thanks,
> Deng
>



-- 
P.A.Eshan Sudharaka
Dept of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Re: getting the list of available artifacts in the source repository

Posted by Eshan Sudharaka <es...@gmail.com>.
On Mon, Jun 7, 2010 at 3:49 PM, Deng Ching <od...@gmail.com> wrote:

> On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <esudharaka@gmail.com
> >wrote:
>
> > In order to copy artifacts from one repository to another i need to get a
> > list of available list of artifacts in the source repository. So  i need
> to
> > have a list of ArtifactMetadata objects  so i can have more information
> > about source artifacts.
> >
> > here i am going to use following method in the  DefaultMetadataResolver
> > class to get that list.
> >
> > public Collection<ArtifactMetadata> getArtifacts( String repoId, String
> > namespace, String projectId, String projectVersion )
> >
> > but my problem is i have only one input data to get that list which is
> > repoId.
> >
> > may be i can generate other required parameters for the particular
> artifact
> > by using other methods in that defaultMetadataResolver class.
> >
> > so i need to know what are the thing return from following methods.
> >
> > 1).   public Collection<String> getRootNamespaces( String repoId )
> >                   for the internal repo what could be that list ..?
> >
>
> This returns a list of the root of the groupIds of the artifacts in the
> repository. For example, if the groupIds are org.apache.archiva and
> org.codehaus.redback, the root namespace is "org".
>
>
> >
> > 2).   public Collection<String> getNamespaces( String repoId, String
> > namespace )
> >                 >> what is returning here
> >
>
> This returns a list of the node of the specified namespace (or a chunk of
> the groupId) of the artifacts in the repository. Using the same example, if
> you have org.apache.archiva & org.codehaus.redback as the groupIds of the
> artifacts in the repo then you called the method getNamespaces( "internal",
> "org"), you'd get "apache" and "codehaus" in the list.

 >>>> i have a question regarding returning list of getNamespaces() method.
resulting list objects (String) contains   "apache" and "codehaus"  or
"org.apache" and "org.codehaus".
if it only "apache" i need to format it in to "org.apache" and then passs it
to following getNamespaces method u mensioned.

>



> If you passed "org.apache" as the namespace param (e.g. getNamespaces(
> "internal",
> "org.apache"), the list will only contain "archiva"), and so on..
>
>
> >
> > 3).  public Collection<String> getProjects( String repoId, String
> namespace
> > )
> >     >>> this will return a list of available projects in that particular
> > repo. eg : log4j,Junit, (list of griop id's)
> >            here what is the namespace parameter ..?
> >
>
> This returns a list of the artifactIds under the specified
> namespace/groupId.
>
>
> >
> > 4). public Collection<String> getProjectVersions( String repoId, String
> > namespace, String projectId )
> >     >>> here we can get the list of available projects in a particular
> > group.
> >
>
> This returns a list of the versions of the specific artifact/project.
>
>
> >
> > 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
> > String namespace, String projectId, String projectVersion )
> >
> >  /// actually i need to get this list so i can proceed with more details.
> >
>
>
> Thanks,
> Deng
>



-- 
P.A.Eshan Sudharaka
Dept of Computer Science and Engineering
University of Moratuwa
Sri Lanka

Re: getting the list of available artifacts in the source repository

Posted by Deng Ching <od...@gmail.com>.
On Mon, Jun 7, 2010 at 6:59 AM, Eshan Sudharaka <es...@gmail.com>wrote:

> In order to copy artifacts from one repository to another i need to get a
> list of available list of artifacts in the source repository. So  i need to
> have a list of ArtifactMetadata objects  so i can have more information
> about source artifacts.
>
> here i am going to use following method in the  DefaultMetadataResolver
> class to get that list.
>
> public Collection<ArtifactMetadata> getArtifacts( String repoId, String
> namespace, String projectId, String projectVersion )
>
> but my problem is i have only one input data to get that list which is
> repoId.
>
> may be i can generate other required parameters for the particular artifact
> by using other methods in that defaultMetadataResolver class.
>
> so i need to know what are the thing return from following methods.
>
> 1).   public Collection<String> getRootNamespaces( String repoId )
>                   for the internal repo what could be that list ..?
>

This returns a list of the root of the groupIds of the artifacts in the
repository. For example, if the groupIds are org.apache.archiva and
org.codehaus.redback, the root namespace is "org".


>
> 2).   public Collection<String> getNamespaces( String repoId, String
> namespace )
>                 >> what is returning here
>

This returns a list of the node of the specified namespace (or a chunk of
the groupId) of the artifacts in the repository. Using the same example, if
you have org.apache.archiva & org.codehaus.redback as the groupIds of the
artifacts in the repo then you called the method getNamespaces( "internal",
"org"), you'd get "apache" and "codehaus" in the list. If you passed
"org.apache" as the namespace param (e.g. getNamespaces( "internal",
"org.apache"), the list will only contain "archiva"), and so on..


>
> 3).  public Collection<String> getProjects( String repoId, String namespace
> )
>     >>> this will return a list of available projects in that particular
> repo. eg : log4j,Junit, (list of griop id's)
>            here what is the namespace parameter ..?
>

This returns a list of the artifactIds under the specified
namespace/groupId.


>
> 4). public Collection<String> getProjectVersions( String repoId, String
> namespace, String projectId )
>     >>> here we can get the list of available projects in a particular
> group.
>

This returns a list of the versions of the specific artifact/project.


>
> 5).  public Collection<ArtifactMetadata> getArtifacts( String repoId,
> String namespace, String projectId, String projectVersion )
>
>  /// actually i need to get this list so i can proceed with more details.
>


Thanks,
Deng