You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Felipe Roos da Rosa <fe...@yahoo.com> on 2009/03/28 23:46:56 UTC

OMG RAS on Archiva

Hi Folks!

I'm planning to implement OMG Reusable Asset Specification within Archiva. The "quest" involves having archiva supporting the .ras file format, which is a zip file with a xml descriptor in it, and also supporting HTTP request for searching artifacts and download them. First part of the task is almost done, since I've written a Archiva consumer which reads .ras descriptor and indexes the file based on its descriptor. This was needed in order to enable searches using some fields of the file descriptor. 

Another part of the work is to show some valuable information on the Archiva interface. This is not required to be compliant with the spec, but I would like to do that because it makes sense in an environment that supports software reuse. I was looking at the showArtifact.jsp and I noticed that all information comes through a ArtifactProjectModel (am I right?). I suppose the instance of this class is created based on POM information, so I would like to know if there is an entry point or reader class that allows me to write my own model reader - the information will be contained in the RAS descriptor file.

Also, I've seen that all artifacts are uploaded based on group, id and version information. I'm planning to retrieve group, id and version from the RAS descriptor file. I've also seen that the "copy" to the repository from UI is made by the UploadAction, so probably I would write another method for treating that, and also enable an upload for RAS files based only on the artifact file name on upload.jsp. Is there any other file upload point in the system? 

This is part of my graduation final paper, and I'm currently working on a 1.1.3 version on my machine.  I don't have plans for integrating that yet, but if you guys find it interesting, we can arrange a review and merge of the changes with the recent 1.2 version after the work is done.


Thanks in advance,


Kind regards,

 Felipe Roos
http://www.linkedin.com/in/feliperoos


Achar desculpas para os nossos 
defeitos não nos torna melhores



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Res: OMG RAS on Archiva

Posted by Felipe Roos da Rosa <fe...@yahoo.com>.
Hi Deng, 

thanks for your clarifications. I'll be looking into creating the issue on Jira.


 Felipe Roos
http://www.linkedin.com/in/feliperoos 


Achar desculpas para os nossos 
defeitos não nos torna melhores 



----- Mensagem original ----
De: Deng Ching <oc...@apache.org>
Para: dev@archiva.apache.org
Enviadas: Terça-feira, 31 de Março de 2009 7:36:37
Assunto: Re: OMG RAS on Archiva

Hi Felipe,

On Sun, Mar 29, 2009 at 6:46 AM, Felipe Roos da Rosa
<fe...@yahoo.com>wrote:

>
> Hi Folks!
>
> I'm planning to implement OMG Reusable Asset Specification within Archiva.
> The "quest" involves having archiva supporting the .ras file format, which
> is a zip file with a xml descriptor in it, and also supporting HTTP request
> for searching artifacts and download them. First part of the task is almost
> done, since I've written a Archiva consumer which reads .ras descriptor and
> indexes the file based on its descriptor. This was needed in order to enable
> searches using some fields of the file descriptor.
>
> Another part of the work is to show some valuable information on the
> Archiva interface. This is not required to be compliant with the spec, but I
> would like to do that because it makes sense in an environment that supports
> software reuse. I was looking at the showArtifact.jsp and I noticed that all
> information comes through a ArtifactProjectModel (am I right?).


Correct :)


> I suppose the instance of this class is created based on POM information,
> so I would like to know if there is an entry point or reader class that
> allows me to write my own model reader - the information will be contained
> in the RAS descriptor file.


As for the reader, you might need to implement your own reader for the RAS
descriptor. You can take a look at the different implementations of the
ProjectModelReader which Archiva uses for reading the pom files in the
archiva-repository-layer module for an example. You might also want to take
a look at the ProjectModelToDatabaseConsumer (in archiva-database-consumers)
which invokes the POM reader and adds the POM info to the database.


>
> Also, I've seen that all artifacts are uploaded based on group, id and
> version information. I'm planning to retrieve group, id and version from the
> RAS descriptor file. I've also seen that the "copy" to the repository from
> UI is made by the UploadAction, so probably I would write another method for
> treating that, and also enable an upload for RAS files based only on the
> artifact file name on upload.jsp. Is there any other file upload point in
> the system?


Uploads via DAV is also supported (see archiva-webdav module) :)


>
>
> This is part of my graduation final paper, and I'm currently working on a
> 1.1.3 version on my machine.  I don't have plans for integrating that yet,
> but if you guys find it interesting, we can arrange a review and merge of
> the changes with the recent 1.2 version after the work is done.
>

That would be great! Could you create a jira issue for this? We can use that
to keep track of your patches and for reviewing them as well :)

Thanks,
Deng


>
>
> Thanks in advance,
>
>
> Kind regards,
>
>  Felipe Roos
> http://www.linkedin.com/in/feliperoos
>
>
> Achar desculpas para os nossos
> defeitos não nos torna melhores
>
>
>
>      Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>



      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: OMG RAS on Archiva

Posted by Felipe Roos da Rosa <fe...@yahoo.com>.
Hi Folks,


Deng Ching said:
"As for the reader, you might need to implement your own reader for the RAS
descriptor. You can take a look at the different implementations of the
ProjectModelReader which Archiva uses for reading the pom files in the
archiva-repository-layer module for an example. You might also want to take
a look at the ProjectModelToDatabaseConsumer (in archiva-database-consumers)
which invokes the POM reader and adds the POM info to the database."

I've looked both readers and the ProjectModelToDatabaseConsumer. It would not be a problem to create such readers and a consumer to deal with RAS information to database. However, one thing worried me. The DefaultRepositoryBrowsing used by ProjectModelDatabaseConsumer seems to have hardcode filter to look only for "pom" artifact types. The code from that class is below:

    private ArchivaArtifact getArtifact( String principle, List<String> observableRepositoryIds, String groupId,
                                         String artifactId, String version )
        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        ArchivaArtifact pomArtifact = null;

        try
        {
            pomArtifact = dao.getArtifactDAO().getArtifact( groupId, artifactId, version, null, "pom" );
        [...]


Am I getting it right? I was trying to avoid creating the POM file, since all information that I need is contained within the RAS file. My goal is to have RAS information retrieved by ShowArtifactAction to the Archiva Interface, and on the "Download" box on the interface I would like to have a link to the RAS file, and a link to the rasset.xml (RAS descriptor). 

Right now I'm a little bit confused whether I need one of the two options below:
1. Create a POM writer that processes RAS files and then create the RasProjectModelToDatabaseConsumer and ProjectModelRasReader
2. Create another repository browsing that looks only for RAS files and then RasProjectModelToDatabaseConsumer and ProjectModelRasReader.



Kind regards,

 Felipe Roos
http://www.linkedin.com/in/feliperoos


Achar desculpas para os nossos 
defeitos não nos torna melhores


      Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: OMG RAS on Archiva

Posted by Deng Ching <oc...@apache.org>.
Hi Felipe,

On Sun, Mar 29, 2009 at 6:46 AM, Felipe Roos da Rosa
<fe...@yahoo.com>wrote:

>
> Hi Folks!
>
> I'm planning to implement OMG Reusable Asset Specification within Archiva.
> The "quest" involves having archiva supporting the .ras file format, which
> is a zip file with a xml descriptor in it, and also supporting HTTP request
> for searching artifacts and download them. First part of the task is almost
> done, since I've written a Archiva consumer which reads .ras descriptor and
> indexes the file based on its descriptor. This was needed in order to enable
> searches using some fields of the file descriptor.
>
> Another part of the work is to show some valuable information on the
> Archiva interface. This is not required to be compliant with the spec, but I
> would like to do that because it makes sense in an environment that supports
> software reuse. I was looking at the showArtifact.jsp and I noticed that all
> information comes through a ArtifactProjectModel (am I right?).


Correct :)


> I suppose the instance of this class is created based on POM information,
> so I would like to know if there is an entry point or reader class that
> allows me to write my own model reader - the information will be contained
> in the RAS descriptor file.


As for the reader, you might need to implement your own reader for the RAS
descriptor. You can take a look at the different implementations of the
ProjectModelReader which Archiva uses for reading the pom files in the
archiva-repository-layer module for an example. You might also want to take
a look at the ProjectModelToDatabaseConsumer (in archiva-database-consumers)
which invokes the POM reader and adds the POM info to the database.


>
> Also, I've seen that all artifacts are uploaded based on group, id and
> version information. I'm planning to retrieve group, id and version from the
> RAS descriptor file. I've also seen that the "copy" to the repository from
> UI is made by the UploadAction, so probably I would write another method for
> treating that, and also enable an upload for RAS files based only on the
> artifact file name on upload.jsp. Is there any other file upload point in
> the system?


Uploads via DAV is also supported (see archiva-webdav module) :)


>
>
> This is part of my graduation final paper, and I'm currently working on a
> 1.1.3 version on my machine.  I don't have plans for integrating that yet,
> but if you guys find it interesting, we can arrange a review and merge of
> the changes with the recent 1.2 version after the work is done.
>

That would be great! Could you create a jira issue for this? We can use that
to keep track of your patches and for reviewing them as well :)

Thanks,
Deng


>
>
> Thanks in advance,
>
>
> Kind regards,
>
>  Felipe Roos
> http://www.linkedin.com/in/feliperoos
>
>
> Achar desculpas para os nossos
> defeitos não nos torna melhores
>
>
>
>      Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
>