This example shows how to add a URL mashup as a link in a floorplan that you have designed.
You have created the mashup. For more information, see:
You must enable the admin mode for the solution in which you create the mashup to ensure that the system saves your content and any changes you make in the solution. To do this, open your solution and select
Administration
Switch On/Off Admin Mode in SAP Solution
. For more information about the admin mode, see Working in the Integrated Development Environment.
Add a link to your floorplan.
In the studio, in the Solution Explorer, right–click your floorplan and select Open in UI Designer.
The UI designer opens.
Go to the Toolbox tab.
|
If the Toolbox tab is not visible, make it visible by going to |
In the Controls section, drag and drop Link to the floorplan.
The Link element is displayed on the floorplan. It contains a Link field and a Link hyperlink.
You can rename the text of the Link field. To do this, ensure that the Link element is selected.
On the Properties tab, under Text Information, click on the dropdown arrow in the Label field.
In the dialog box, enter the required text, and click OK.
The renaming of the hyperlink will be described later on in this document.
Add your mashup.
In the UI designer, go to the Controller tab of the floorplan.
Right-click on Mashup Components, and select Add Mashup Component from the dropdown list.
In the dialog box, go to the main folder of your solution and the folder where the mashups are stored.
|
This name starts with |
Select your mashup as follows.
A URL mashup that is displayed in a new window
A data mashup that writes data back into the solution
Click OK
The mashup is displayed on the Controller tab underneath Mashup Components.
Add an event.
In the UI designer, on the Designer tab, select the Link element in the floorplan.
On the Properties tab, under Data Information, select EventArguments and click ...
Click the Add Argument button.
A new event argument is added.
Under ArgumentName, rename the event argument to $MashupPipeID.
|
We recommend that you copy the name $MashupPipeID from this document and paste it in the ArgumentName field. |
Leave the dialog box open, and go to the .
In the , on the Solution Explorer tab, under
MashupConfiguration
Mashup Authoring
, select the mashup.
On the Properties tab, copy the value in the Repository field. This value has the format MAIN_Solution Name>/<Pipe ID>.
Go back to the open dialog box in the UI designer, paste the value of the Repository field under Constant, and click OK.
Save your changes.
Create a new outport.
On the Controller tab, right-click Outports.and choose Add Outport.
The new outport is displayed under Outports.
Right-click the outport and select Rename; then enter a new name for the outport.
Select a port type package for the outport.
In the Port Type Package field, click ...
In the dialog box, go to
SAP_BYD_TF
Mashups
, choose globalmashupporttypes, and click OK.
Configure a port type reference for the outport.
In the Port Type Reference field, select a port type reference from the dropdown list.
If there are parameters displayed in the table below, you can bind them. To do this, click ... next to Parameter Binding.
|
If you do not bind the parameters, you will not be able to pass the values from the floorplan to the mashup. |
In the dialog box, choose the required element of the business object and click OK.
Create an event handler.
On the Controller tab, right-click Event Handlers and select Add EventHandler..
The new event handler is displayed under Event Handlers.
Right-click the new event handler and select Rename; then enter a new name for the event handler, for example, MashupHandler.
Under EventHandler Operations, click the Add Operation button twice to add two new operations.
For each operation, under Type, click in the field and select the following operation types:
SyncDataContainer
FireOutport
Under Name, you can change the names of these operation types
For FireOutport, under Configure the operation, choose the outport that you created previously.
Save and activate your changes.
Specify the navigation for the mashup.
On the Controller tab, under Mashup Components, select the mashup.
Go to the Simple Navigation tab.
In the Navigations folder, right-click and select Add Navigation from the context menu.
The Navigation Details tab opens.
Select the outport and the inport from the dropdown lists.
|
The source is the outport of your floorplan; the target is the inport of the mashup category. |
To map the outport and inport parameters from the floorplan to the mashup, select these, and click Bind.
The results are displayed in the table below.
Save and activate your changes.
Assign the event handler to the mashup in your floorplan
Go to the Designer tab.
Select the Link element in the floorplan.
On the Properties tab, under Events, select OnClick, and select the event handler that you created previously from the dropdown list.
Add a data field to your business object.
Go to the Data Model tab.
Right-click on your business object, and select Add Data Field from the context menu.
The data field is added to your business object.
Select DataField.
On the Properties tab, under Design, enter a text for Initial Value.
This text is used for the hyperlink that is displayed on the floorplan.
|
This text is not displayed in the floorplan in the UI designer, but you will see it when you test the mashup. |
Assign the data field to the mashup on your floorplan
Go to the Designer tab.
Select the Link element.
In the Properties tab, under Data Information, click the dropdown arrow next to Text.
In the dialog box, go to the Data Model tab.
Select DataField underneath your business object, and click OK.
Save and activate your changes.
You can now test the mashup in your floorplan by clicking the Run the Component button (green triangle) in the toolbar.