org-scn-design-studio-community / sdkpackage

SDK Package of SCN Design Studio Community
Apache License 2.0
32 stars 29 forks source link

Use OpenDocument Syntax for the SDK FioriLink component #150

Open ephraimrosenfeld opened 7 years ago

ephraimrosenfeld commented 7 years ago

I'd like to specify an OpenDocument Url in the href attribute of the SDK's FioriLink component, e.g. /BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ATW1_JXnUuZEipZvOsfVJIE.

The purpose of this is to navigate from a Design Studio application to another BusinessObjects reporting element in the same browser window/tab as that of the original application.

From what I've seen, there are two methods of navigation using the out-of-the-box features:

  1. Using a standard Design Studio link
  2. Calling the APPLICATION.openNewWindow() function inside the onclick() method of a button, icon, etc. Both of these methods open in a new browser window.

The nice feature of the FioriLink component is that the user can set the 'target' attribute to '_self' to allow for navigation inside of the same browser window.

However, when I apply an OpenDocument Url to the href property of a FioriLink component, I get the following error: MIME object "AQVI1TDEYSXCQ5RHIBNUACS/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=ATW1_JXnUuZEipZvOsfVJIE" contains the invalid character string "?" in the path

ds_fiori_link_warning_msg

The link is not functional.

Calling Convert.urlEncode() to encode the URL did not make the link functional either.

I have attached a sample Design Studio application to demonstrate the behavior: TestFioriLinkSameWindow-20161229164012.zip.

Thank you for your time and efforts,

Ephraim

entmike commented 7 years ago

I suspect this may be because Karol specified the Url property as type Url versus String, and that the Design Studio runtime is re-writing the URL in an effort to "help" when it encounters certain BOE-like URL patterns.

https://github.com/org-scn-design-studio-community/sdkpackage/blob/master/src/org.scn.community.databound/res/FioriLink/def/contribution.xml#L46-L54

I'm wondering if we could simply change it from Url type to String, or if that would break other things. If so, we could introduce a separate Url property that's a String as an alternative, perhaps.

ephraimrosenfeld commented 7 years ago

Hi Mike,

Thank you for the explanation.

For now, I found that I can open a link in the same window using the OpenUrlInPlace component.

I found that, first the component must be initialized using the setUrl() method, and then, inside of the onClick method of a link, icon, etc. the triggerExecution() method can be called to execute the navigation.