archiva-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eshan Sudharaka <esudhar...@gmail.com>
Subject Re: getting the list of available artifacts in the source repository
Date Tue, 08 Jun 2010 00:14:13 GMT
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 <odeaching@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message