on 05-23-2017 10:32 PM
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
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:
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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("");
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
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.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.