Skip to Content
0

Parse Design Studio Bookmark URL

Dec 14, 2016 at 02:15 PM

116

avatar image

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=AcAwvfZyHA5AhoqUPc6qYgE&BOOKMARK=AWaeOPyb2Q9Is3GKJCWEUqQ

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é

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Andre Jost Dec 15, 2016 at 01:50 PM
1

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);
}
});
}
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Great Andre!!!

0

Nice job ! :)

0
Andre Jost Dec 15, 2016 at 01:50 PM
1

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);
}
});
}
Share
10 |10000 characters needed characters left characters exceeded