How to choose the output channel for your Design Studio & Lumira Designer Export!

Just recently I have demonstrated the enhanced Broadcasting, Scheduling & Information Bursting capabilities of biExport: http://www.designstudio-export.com/blog/broadcasting-information-bursting-scheduling-with-sap-design-studio-lumira-designer-136.

In the blog post, I chose MAIL as an output channel. Today, I want to introduce the other possible output channels (we also call them Publish Modes) of biExport. Of course, all these options can be used also for the “online” exports.

Standard output channels

The following options are supported by default for the Publish Mode parameter of the biExport component for SAP Design Studio and Lumira Designer:

Publish Mode Description
ONLINE The document is delivered directly to the user’s web client.
MAIL

The document is delivered via mail. You can maintain subject, mail body, the sender address and one or multiple recipients.

For support of Information Bursting scenarios, you can assign different mail recipients to individual filter selections.

For details, check out my blog post on Broadcasting (see ablove).

FILE[file_path] The document is stored on the file system. The file system path is specified in brackets. Also UNC paths are supported: “//storage/share”.
BO_CMS[Root Folder/UPLOADS] The document is stored in the CMS of the BO platform. Specify the folder path in brackets.
SHAREPOINT[sharepointsite;library] The document is stored in Microsoft Sharepoint. The URI of the SharePoint site (e.g. ”http://yoursite.com/sites/Research” and the name of the library (e.g. ” Shared Documents”) must be specified in brackets, separated by “;”.
PRINT (PDF only) The document is delivered directly back to the user and the web client’s print dialog is called directly.
VIEWER (PDF only) The document is displayed inline the user’s web browser.

The output channel required in your project is not in the list? No problem at all!

biExport also makes use of the powerful plugin framework of the OPENBI platform. This way you can easily create your own implementation for a custom output channel, e.g. to a web service!

Creating your own output channels

I will demonstrate the usage of the plugin framework with a short example.

Let’s say you want to to publish the export document to a Web Service that was implemented in your project. You have also generated the WSDL of that Web Service.

First of all, you have to define the name of the Publish Mode. In my example it is “MY_WEBSERVICE”.

We enter this definition for the Publish Mode parameter of the biExport component:
http://www.biexcellence.com:80/mimes/designstudio_export/LumiraDesigner/PublishMode_01.PNG

Now, we have to implement the logic for this Publish Mode. We will use C# for this.

This is how you access the plugin framework of OPENBI:

namespace com.biexcellence.openbi.export.myWebservice
{
    [OpenBiExportPublisher("MY_WEBSERICE")]
    public class openbiExportMyWebServicePublisher : IOpenBiExportPublisher
    {
        public async Task<string> PublishAsync(openbiExportPublishMode publishMode, IOpenBiExportResult result, openbiExportSettings settings, CancellationToken cancellationToken)
       {
}
    }
}

 You also have to add a reference to com.biexcellence.openbi.export.base, which provides the interface IOpenBiExportPublisher and some other methods that will become very handy for your implementation: For example access to the tracing framework and the all export settings of the Export request!

The custom publishing code will be included in method PublishAsync. You can do practically everything you want there. Just two pieces of advice:

1. How to access the Export document:

 FILE Name:  

Path.GetFileNameWithoutExtension(result.FileName);

FILE Extension:

Path.GetExtension(result.FileName);

FILE Content:

result.Stream.Position = 0;
MemoryStream memoryStream;
if (result.Stream is MemoryStream stream)
{
    memoryStream = stream;
}
else
{
    memoryStream = new MemoryStream();
    await result.Stream.CopyToAsync(memoryStream);
}

2. How to pass your own custom parameters

You can use the parameter Custom Parameters Array of the biExport component to pass your own parameters to the publisher. These parameters can be set either statically:

http://www.biexcellence.com:80/mimes/designstudio_export/LumiraDesigner/PublishMode_02.PNG

… but also via scripting, of course!

var lcomp2 = OPENBIEXPORT1.createNameValuePair("WS_SUBJECT", "My dynamic subject");

var larray2 = [lcomp2];

OPENBIEXPORT1.setCustomParameterArray(larray2);

Then you can access these parameters in your custom publisher code:

if (settings.CustomParameters.ContainsKey("WS_SUBJECT"))
{
     requestType.Subject = settings.CustomParameters["WS_SUBJECT"];
}

Thilo Knötzele
Author: Thilo Knötzele
Creation date: 18.01.2018
Category:
back to overview