Docs on how to create component Extension Java class

I’m trying to create a component extension. I’ve got through EntX Mediator (7.4.2) documentation and succseeded to create a sceleton WAR that is correctly seen my Studio as an component extension definition.
I have not run this yet. I have found couple of examples of extensions and configurations on each of them differs from the one provided in SampleExtension.

It is not clear what should be signatures of Java class implementing component extension. I supposed (and reading of this discussion list acknoleges me on that) that String is a main type accepted as a params type.
But what’s a possibilities for parameters accepting payloads - that’s not so clear. I’ve found in this list information it should be ByteArray, but is that mean byte or ByteArrayInputStream.
To be honest I found here in other inforamtion, that should be ByteArrayInputStream. But then in one of examples simple byte is used!

Another issue is how method calls results are returned???

Yet another problem is the way the payload is transfered to extension differs:

  1. I’ve seen one example with JOG.getContent before and JOG.addContent after an actuall component extension call,
  2. Other example just the component extension with configuration suggestiong methods getContent and addContent are implemented within it (but it well my be that those methds are available to every extension - kind of Mediator environment convinience methods).

That’s just couple of examples of how things can differ from one solution to the other.

I think I need a documentation describing how to develop extensions more presisly then the standard documentation presents. Not just a directories plan but some ideology that’s on the basis of mechanism of creating extensions.
Is such documenta available for SAG internal use?

Hi Adam,

There is no special information available on Custom Component development that we don’t already provide in the documentation.

One major help for you might be the more recent MessageAPI which was released with Mediator 7.4.2. This allows you to comfortably retrieve payloads and property values. The API has methods like getPayloadAsBytes(), getPayloadAsDocument() and getPayloadAsStream() which can be directed to either the current content or a specific contentID of the current message. There are methods for property handling, logging and exceptions as well.

The interface to a custom component is of course limited to the environment it lives in so any additional information that needs to be passed to it will probably be in the form of a Message property value which is always string. If this is not the correct data type for your classes you will have to perform some conversions after passing it to your component.

I hope that helps some. If you have any specific questions or problems you need to overcome, I will be pleased to discuss them with you here in the community.

Kind Regards,