Hello Ghania,

On Sep 18, 2013, at 22:55 PM, ghania ferrag <[email protected]> wrote:

> I’m working on new WEB UI that use ACE rest client to communicate with ACE 
> server.
> Now I need to add Artifacts or bundles to repository. I did put the 
> artifacts, that I want to add,  somewhere where I can reference with a URL 
> and use the REST client API to add the metadata for the artifact(s). 
> I’m following the user guide of Client REST Api 
> http://ace.apache.org/user-doc/restapi.html, and I’m having the following 
> error when I tried to upload a new Artifact [Error 400 Could not add entity 
> of type artifact].
> 
> Here is the JSON that I’m sending to upload new artifact
> {"attributes":{
> "artifactName":"js-1.7R2-osgi",
> "artifactDescription":"uploaded package js-1.7R2-osgi.jar",
> "url":"file:///C:/proj-test/upload/js-1.7R2-osgi.jar",
> "Bundle-Name":"bn",
> "Bundle-SymbolicName":"bsn",
> "Bundle-Version":"1.0"
> }, "tags":{}}  
> 
> Anyone have an idea what I’m missing here? Also what we have to set in the 
> processorPid property?
> Thank you very much in advance for your response,

Yes. Since ACE can store many different types of "artifacts" one thing you must 
always supply is a specific mimetype.

We have an ArtifactRecognizer that has a method called extractMetadata() and is 
implemented for every type of artifact we support. So in this case, if you look 
in BundleHelperImpl you will see what attributes it extracts from a bundle. One 
of which is:

            metadata.put(ArtifactHelper.KEY_MIMETYPE, MIMETYPE);

The constants evaluate to: "mimetype", "application/vnd.osgi.bundle".

That same piece of code also answers your question about what to set in the 
processorPid property (an empty string is fine).

Greetings, Marcel

Reply via email to