Skip to Content
0

Is there a way to share compositions in such a way that it's still editable?

May 23, 2017 at 09:32 PM

257

avatar image
Former Member

Hello all,

I was wondering whether there was a way, in Design Studio 1.6 SP04, to share compositions created using the Online Composition template on a BI Platform with other users on the same BI Platform in a way where the composition is still editable (and can be saved or shared) by those other users. The reason I'm asking is the Split Cell Container component, where you drag and drop fragments from the Fragment Gallery component, cannot be saved as a part of a Portable Fragment Bookmark; Fragment Bookmarks are, as I understand it, user-specific and cannot be shared. Sharing hyperlinks to my composition isn't good enough; the composition wouldn't be editable by other users. Any suggestions?

Thanks,

Krishna

10 |10000 characters needed characters left characters exceeded

Hi Krishna,

Let's assume for a minute that there was a way to load a SplitCell Container fragment bookmark created by another user. In this scenario, how would you expect users to select which SplitCell Container fragment bookmark from another user to load within the Online Composition application?

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

Hi Mustafa,

As long as we're assuming, I would have a listbox or other component listing the bookmarks available to that user's group. The user would be able to select from the list to specify which bookmark to load. I'm also assuming that I have a folder structure in place where I could save my dashboard to a particular folder with some security applied to it, and that the other user(s) have access to that folder).

Krishna

0

Hi Krishna,

Thanks for the clarification. That makes sense. Taking it a step at a time, here are some more comments and questions. It sounds like you require a user other than the creator of the original SplitCell Container fragment bookmark to be able to edit it and then save the changes by updating the SAME bookmark rather than creating a new bookmark based on the original. Is that right? If so, the inability to edit another user's SplitCell Fragment Bookmark is not related to whether the bookmark is shared by URL or via the LoadBookmark() script method (which incidentally you can do for regular Fragment Bookmarks as long as you know the BookmarkID in advance), the issue is that it is technically not possible to use the SaveBookmark() method to update a bookmark originally created by another user. If you attempt to do this, even if you have specified the BookmarkID of the original bookmark, Design Studio will simply create a new bookmark and return a new BookmarkID rather than updating the original because it recognises that you are not the "owner" and therefore does not allow you to overwrite it with an update.

Have I understood your requirement correctly? Or by "editing the composition" do you mean being able to save an updated/edited version as a NEW BOOKMARK instead of overwriting the original author's bookmark?

We can explore further options based on your answer.

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

Hi Mustafa,

I don't need users to be able to update the same bookmark created by other users. They just need to be able to receive or otherwise access compositions made by other users, edit them, and save their changes as a bookmark. It's probably better that they don't directly update the same bookmark.

Thanks,

Krishna

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Mustafa Bensan May 25, 2017 at 02:19 AM
0

Hi Krishna,

Based on your comment clarifications, here is an approach you can try:

----------------------------------------------------------------------

1. In the Online Composition template, add a Panel component and inside the Panel component add a text component, say TEXT_BOOKMARK_ID and TEXT_BOOKMARK_TITLE. Make this Panel component invisible

2. Modify the Online Composition template such that when the user saves their Split Cell Container as a Fragment Bookmark, the following additional steps occur:

(i) TEXT_BOOKMARK_ID is set to the BookmarkID of the just saved Split Cell Container Fragment Bookmark ID

(ii) TEXT_BOOKMARK_TITLE is set to the just saved Split Cell Container Fragment Bookmark Title

(iii) Save a Portable Fragment Bookmark with a suitable Group ID (for example "CompositionList") using the Panel component in Step 1 as the container. The purpose of this new Portable Fragment Bookmark is to be able to globally access the BookmarkIDs of the Split Cell container Fragment Bookmarks in order to later build a list of all available Compositions to present to the user for selection.

3) To build the list of available Compositions for user selection when needed:

(i) Execute a Bookmark.PortableFragmentBookmark.getAllBookmarkInfosForApplication(groupIdentifier) script call based on the Group ID specified in Step 2 (iii)

(ii) Iterate through the returned array of PortableFragmentBookmarkInfos and build your list in a List Box component say, by:

(a) Loading each Portable Fragment Bookmark element in the array

(b) Getting the values of the TEXT_BOOKMARK_ID and TEXT_BOOKMARK_TITLE components

(c) Adding these value/text pairs to the List Box component

4) When the user then selects an item from the list, you can get the corresponding Composition's Fragment Bookmark ID using getSelectedValue(), then navigate to the existing Composition Editing Page and load the selected Composition with a Bookmark.FragmentBookmark.loadBookmark(id) script call. The rest of the Online Composition workflow should work as it currently does.

----------------------------------------------------------------------

Now, all of the above being said, for future-proofing your application, you should keep in mind the following points:

  • The Online Composition feature is only available in "Commons Mode" (i.e. SAPUI5 Mode and not the new SAPUI5 M Mode)
  • Commons Mode will be deprecated in Lumira Designer 2.0, although of course you will still be able to execute these "legacy" applications in "Compatibility Mode" for the foreseeable future but they will not be able to take advantage of any new 2.0 features

Personally, given the above and with the GA release of Lumira 2.0 just around the corner (scheduled for July this year), I would not recommend developing any new Design Studio applications that rely on the Commons Mode or the Online Composition feature. Instead I would re-architect the solution targeting the features of Lumira 2.0.

Regards,

Mustafa.

Show 13 Share
10 |10000 characters needed characters left characters exceeded
Former Member
Thanks for your detailed answer, Mustafa. I just wanted to clarify what you said in part 4 of your answer: are you saying that I can load, using the Portable Fragment Bookmark loadBookmark function, a composition saved as a Fragment bookmark?

Regards,

Krishna

0

Hi Krishna,

Sorry, that was a typo. I have updated part 4 with the intended script call which was:

Bookmark.FragmentBookmark.loadBookmark(id)

I'd be interested to know how it works out if you decide to go down that route.

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

Hi Mustafa,

I was pleased to see that your answer works just as you described. I'm in the process of testing security for the fragments in shared compositions, but regardless of how that turns out the compositions are editable after sharing.

Thanks,

Krishna

0

Thanks for the confirmation, Krishna. As per my previous comments though, I would caution you against building any new applications based on the online composition feature as it will have a limited lifespan.

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

I have one additional related question for you Mustafa. Right now, as you suggested, I'm using the getAllBookmarkInfosForApplication(groupIdentifier) function. If I change this part to getAllBookmarkInfos(groupIdentifier), to view all portable fragment bookmarks across multiple Online Composition applications with a particular group identifier that I'm using to share the fragment bookmark info, the ListBox doesn't populate. Is there a technical reason for this, or did I just implement something incorrectly?

My use case is, some users will have access to an Online composition application with the ability to share compositions with others, and others will have access to an application where while they can see shared compositions, they can only save private, unshared versions.

Thanks again,

Krishna

0

Hi Krishna,

Can you provide the following additional information?:

1) A screen shot of your application showing the ListBox;

2) The exact script code you are applying to save the Portable Fragment Bookmarks;

3) The exact script code you are applying to load the Portable Fragment Bookmarks into the ListBox;

4) Also, make sure that the ListBox itself is not part of a bookmark.

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

1) For some context, there are ~55 portable fragment bookmarks with the group identifier "COMPSHARE", which is unique to the invisible panels that I am sharing. TEXT_1 and TEXT_2 are the text components in the invisible panel which contain the Fragment bookmark ID and the composition title respectively, and are present in both Online Composition applications. If I set the Listbox to display the count of portable fragment bookmarks with ID COMPSHARE, it will display correctly. If I set the Listbox to display every portable fragment bookmark ID, it will do that correctly.

2) In the BUTTON_SAVE_FRAGMENT component in an Online Composition template:

if (g_fragment_id != " ") {
Bookmark.FragmentBookmark.deleteBookmark(g_fragment_id);

var id_over = Bookmark.FragmentBookmark.saveBookmark(COMPOSITON_BODY_PANEL, COMPOSITION_HEADER_TITLE.getText());
TEXT_1.setText(id_over.id);
TEXT_2.setText(id_over.title);

Bookmark.PortableFragmentBookmark.saveBookmark("COMPSHARE",FRAG_SHARE);
STATUS_INFO.setText(id_over.title + " is saved");
}else {
var id = Bookmark.FragmentBookmark.saveBookmark(COMPOSITON_BODY_PANEL, COMPOSITION_HEADER_TITLE.getText());
TEXT_1.setText(id.id);
TEXT_2.setText(id.title);

Bookmark.PortableFragmentBookmark.saveBookmark("COMPSHARE",FRAG_SHARE);
STATUS_INFO.setText(id.title + " is saved");
}

3) In the On Startup property of a different Online Composition application:

var shared = Bookmark.PortableFragmentBookmark.getAllBookmarkInfos("COMPSHARE");

var count = 0; //for testing purposes

shared.forEach(function(element, index){

Bookmark.PortableFragmentBookmark.loadBookmark(element.id);

count = count+1;

var t1 = TEXT_1.getText();

var t2 = TEXT_2.getText();

if(t1 == ""){

t1 = "no id "+count;

}

if(t2 == ""){

t2 = "no title "+count;

}

LISTBOX_1.addItem(t1,t2);

});

LISTBOX_1.setSelectedValue("");

0
Former Member
Former Member

After looking at it a bit more, it seems like the Text components in the invisible panel in the Online composition application aren't being populated from the bookmark load, which is why I get a single item in the Listbox named "Sample Text". Currently looking into why the bookmarks didn't load.

Thanks,

Krishna

0
Former Member
Former Member

Found a workaround using just one application, please disregard my question.

Thanks,

Krishna

0

What was your workaround by the way?

0
Former Member
Mustafa Bensan

My workaround was creating a single "admin" user who can create compositions that are shareable. My application would then check to see which user was saving compositions and change the save function based on which user was saving. Users other than the admin would be unable to share compositions with all other users, but would be able to edit compositions shared with them by the admin. The saved edits would then reside with that user while the original shared compositions would remain unchanged until the admin changed them.

It wasn't the best solution, but from my research Portable Fragment Bookmarks can't be loaded by script outside of the application in which they were created. I suspect the only exception to that would be loading them by dragging and dropping from a Fragment Gallery to a Split Cell Container, and I think I wouldn't be able to read the Text components in those anyway.

0
Show more comments

I suspected that might be the problem. Do the Text components and the containing Panel have identical names to the counterparts in the other Online Composition application?

0