cancel
Showing results for 
Search instead for 
Did you mean: 

How to use parameters in publication extension?

Former Member
0 Kudos
59

Hi all,

I'm quite new to the SDK and Publication Extension topic, so please excuse the question of a complete newbie;)

I created a publication extension which converts the pdfs generated by the publication in bytestreams and passes them to a webservice running on another server. Currently the webservice address is hard-coded in my java code which is neither maintainable nor flexible 

Now I found out that there is a possibility to pass parameters to the publication extension using the CMC, which would suit perfectly to pass the WebService-URL to the publication extension. However, I have no idea how to handle them in my java code. Does anyone of you have a very basic example of how I can access a parameter in java which was passed to the publication extension?

best regards and thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Pascal,

You can retrieve a publication and add an event handler that invokes a custom data provider publication extension using SDK. Here is an example:


//Execute a query on the CMS repository to retrieve the publication object. 

IPublication publication = (IPublication) infostore.query(publicationQuery).get(0);

//Retrieve the collection of publication event handlers associated with the publication, and add an event handler that corresponds to the type of the publication extension you want to invoke.

IPublicationEventHandler handler = publication.getPublicationEventHandlers().addPublicationEventHandler(CePropertyID.SI_ON_READ_RECIPIENTS);

//Configure the publication extension name, class name and pass additional information in the event handler.

IPublicationEventHandlerInfo handlerInfo = handler.add();

handlerInfo.setName("My Plugin");

handlerInfo.setPluginClassName("pluginClass");

handlerInfo.setGenericParameter("parameterValue");  // specify your web services URL here

//Save the changes

publication.save();

.

For detailed information, please refer to developers guide:

http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip

Regards,

Anchal