cancel
Showing results for 
Search instead for 
Did you mean: 

EP FLP Extensions

thbuett
Explorer
0 Kudos
738

Hello Experts,

I need to throuh a popup, when opening two tiles. I remember the extension posibility of the EP FLP (https://help.sap.com/). But I can not find any functional example or a fully tutorial how to implement this.

What do we have?

Enterprise Portal on NW 7.5 SP04

SAPUI5 1.38.23

What have I done by now?

Deployed this javascript file to the web repository

//Component.js

(function() {
	"use strict",


	jQuery.sap.declare("xxx.flp.extensions");
	jQuery.sap.require("sap.ui.core.Component");

	sap.ui.core.Component.extend("xxx.flp.extensions.Component", {		
		onInit: function() {
			// just for demo - do NOT directly trigger UI actions for productive plug-ins
			// SAPUI5 is available, but DOM might not be ready yet
			if (sap.ui.getCore().isInitialized()) {
				this._sayHello();
			} else {
				sap.ui.getCore().attachInit(this._sayHello.bind(this));
			}
		},
		_sayHello: function() {
		  sap.m.MessageToast.show("Hello World from SAP Fiori launchpad plug-in");
		}
})();
});

Entered this plugin parameters in the FLP-Page

Name of the custom plugin : xxx.flp.extensions.Component

Custom plugin url : com.sap.portal.resourcerepository/repo/wr_xxx/flpExtensions/Component.js

What do I get?

Plugin CustomBootstrapPlugin cannot get registered, because the module mechanism for plugins is not valid anymore. Plugins need to be defined as SAPUI5 components. - sap.ushell.services.PluginManager

My Question?

What did I wrong, anybody else doing right? Any advises?

Alternatives?

Yes I know the alternative to build a page with two iViews. On that send the popup the other opens the app. This page I would replace with the current iView call in the launchpad. But this looks really dirty for me, so I want a better solution for the future.

Thanks and greeting,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

thbuett
Explorer
0 Kudos

Hello Folks,

I get it running. Thanks to the blog of Michael Günther - How to make use of the Fiori Framework Page Extensions I found the solution. The Plugin has to look like this:

(function () {
	/* global sap, jQuery, fioriTrial, eula */
	'use strict';
	jQuery.sap.declare("tub.portal.PopupPlugin");
	jQuery.sap.require("sap.ffp.utils.ExtensionUtils");
	jQuery.sap.require("sap.m.MessageBox");


	var tiles = {
		periodFilter: {
			msgText: "Hello World",
			navURLs: { // Quick and Dirty, ShorURL's from the EP
				"navurl://a7e407ed8aeb722c06b1f1148bccbb7b": "description1",
				"navurl://b741753f437fc471a9f4c3c23b5782c1": "description2",
				"navurl://659ea6a96ae229d8579bc48967e69f8b": "description3"
			}
		}
	}

	sap.ffp.extensions.registerFFPExtension(sap.ffp.extensions.extensionTypes.CUSTOM_EP_RESOLVER, function (url, navNode) {

		for(var tile in tiles) {
			if (tiles[tile].navURLs[navNode.getName()]) {
				sap.m.MessageBox.information(tiles[tile].msgText, {
					title: "Information", // default
					onClose: null, // default
					styleClass: "", // default
					initialFocus: null, // default
					textDirection: sap.ui.core.TextDirection.Inherit // default


				});
			}
		}
		var oDfd = new jQuery.Deferred();
		return oDfd.resolve(url).promise();
	});
}
	());

Or like the SAP Help says. My Plugin wasn't working, cause I had a syntax-error and this wasn't shown me in the debugger.

In the end, its so easy.

I still get the message,

Plugin CustomBootstrapPlugin cannot get registered, because the module mechanism for plugins is not valid anymore. Plugins need to be defined as SAPUI5 components. - sap.ushell.services.PluginManager 

but I decided to ignore it until it won't work anymore.

Greetings,
Thomas

Answers (0)