Hello,

as far as I understood the ArtifactRecognizer try to recognize the mime of a given artifact. So if i add myartifact.custom to ACE it should call recognize on MyArtifactHelper, but no method’s where called. Or where does the mime matching happens? I use the ArtifactRecognizer and Helper from the docs.

Kind regards,
Simon


On 12/07/17 15:10, Jan Willem Janssen wrote:
Hi,

On 11 Jul 2017, at 14:20, Simon Huebner <[email protected]> wrote:

Hello,

i am currently trying to add an resource processor for an custom artifact, 
following the docs (they are outdated) under:
https://ace.apache.org/docs/adding-custom-artifact-types.html

I written a bundle with an Activator and a class implements ArtifactRecognizer, 
ArtifactHelper.
Currently we are running an ACE 2.1.0 allinone server. The bundle was installed 
and started over the gogo shell.
If i add a custom artifact over the ui, it seams the recognizer is not called 
for a custom artifact. None off my debug outputs where logged.
ACE shows an error: "Artifact <> not recognized!"

I think I'm doing something wrong in the Activator, here is the start method:

@Override
public void start(BundleContext context) throws Exception {
    String[] services = {ArtifactRecognizer.class.getName(), 
ArtifactHelper.class.getName()};

    MyArtifactHelper recognizer = new MyArtifactHelper();
    Hashtable<String, String> properties = new Hashtable<String, String>();
    properties.put(ArtifactObject.KEY_MIMETYPE, MyArtifactHelper.MIMETYPE);

    context.registerService(
        services,
        recognizer,
        properties
    );
}

I have a processor as well, but as i understand this is not necessary at these 
place.
Can anyone help me, or has a guide with more details?
There’s nothing wrong with your Activator: you provide the right service 
interfaces and
the right properties. My guess is that the problem is in MyArtifactHelper. 
Would you be
able to share that one as well? If not, you should verify that:

1) the `canHandle`, `canUse` methods both check for the right MIME type;
2) the `extractMetaData` sets the right constants, at least;
    - ArtifactObject.KEY_PROCESSOR_PID (fill this with the name of the resource
      processor that should be used to handle your resource in a deployment 
package);
    - ArtifactObject.KEY_MIMETYPE (fill this with `MyArtifactHelper.MIMETYPE`);
    - ArtifactObject.KEY_ARTIFACT_NAME (fill this with a unique name for your 
artifacts
      so that you can recognise it in the OBR).
    should be set and returned.

Hope this helps,

--
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814


My world is something with Amdatu and Apache

Luminis Technologies
John F. Kennedylaan 32
7314 PS  Apeldoorn
+31 88 586 46 25

https://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8170.94.441.B.01


--
Simon Huebner, B.Sc.
Information Technology
Fraunhofer-Institut für Solare Energiesysteme ISE
Heidenhofstrasse 2, 79110 Freiburg, Germany
Phone: +49(0)761/4588-5695  Fax: +49(0)761/4588-9123
[email protected]
http://www.ise.fraunhofer.de

Reply via email to