cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Design Studio Bookmark URL

Former Member
0 Kudos

Dear SCN-Community,

is it possible to parse the BOOKMARK parameter from the URL? I´m using the Bookmark.FragmentBookmark.shareBookmark(url); function to generate an OpenDocument link for the applikation/bookmark. The generated link is something like

http://bo_server:8080/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID=AcAwvfZyHA5AhoqU...

As you can see there is a &BOOKMARK parameter. Is there a function to fetch the value of this parameter to load for example the bookmark name?

Kind regards

André

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

I have found a solution. I´m replacing the default bookmark parameter and changed it to the custom X_BOOK parameter. Within the on_startup script I can parse the parameter and do my custom stuff.

/* Share bookmark */
var sel_bookmark = LISTBOX_CREATED_BOOKMARKS.getSelectedValue();
var url = Bookmark.PortableFragmentBookmark.getBookmarkUrl(sel_bookmark);
/*Define custom url and set X_BOOK parameter */
Bookmark.FragmentBookmark.shareBookmark(Convert.replaceAll(url, "&BOOKMARK", "&X_BOOK"));
/*Check if X_BOOK paramter != INITIAL*/
if(X_BOOK != "INITIAL") {
var bookmarks = Bookmark.PortableFragmentBookmark.getAllBookmarkInfos(g_bookmark_group);
bookmarks.forEach(function(element, index)
{
if (element.id == X_BOOK) {
TEXT_HEADER_TITLE.setText(element.title);
Bookmark.PortableFragmentBookmark.loadBookmark(X_BOOK);
}
});
}
Vidhya
Active Participant
0 Kudos

Great Andre!!!

Former Member
0 Kudos

Nice job ! 🙂

Answers (1)

Answers (1)

Former Member

I have found a solution. I´m replacing the default bookmark parameter and changed it to the custom X_BOOK parameter. Within the on_startup script I can parse the parameter and do my custom stuff.

/* Share bookmark */
var sel_bookmark = LISTBOX_CREATED_BOOKMARKS.getSelectedValue();
var url = Bookmark.PortableFragmentBookmark.getBookmarkUrl(sel_bookmark);
/*Define custom url and set X_BOOK parameter */
Bookmark.FragmentBookmark.shareBookmark(Convert.replaceAll(url, "&BOOKMARK", "&X_BOOK"));
/*Check if X_BOOK paramter != INITIAL*/
if(X_BOOK != "INITIAL") {
var bookmarks = Bookmark.PortableFragmentBookmark.getAllBookmarkInfos(g_bookmark_group);
bookmarks.forEach(function(element, index)
{
if (element.id == X_BOOK) {
TEXT_HEADER_TITLE.setText(element.title);
Bookmark.PortableFragmentBookmark.loadBookmark(X_BOOK);
}
});
}