cancel
Showing results for 
Search instead for 
Did you mean: 

How do I specify Bookmark-Folder?

0 Kudos

Hi,

I have created an application with multiple components and now I want to create a (portable fragment) bookmark of each component.

With Bookmark.PortableFragmentBookmark.saveBookmark("Test", Component, "BookmarkTitle") I have created the bookmark in the root directory (Analysis Application Bookmarks).

But how can I save the bookmark in a different folder, e.g. "Analysis Application Bookmarks/Sales"?

With Bookmark.PortableFragmentBookmark.assignToFolder it should be possible, but how do I get the folderID and bookmarkID?

Isn't it possible to define the folder directly when I save the bookmark?

Thanks in advance.

Regards,

Christoph

Accepted Solutions (0)

Answers (2)

Answers (2)

MustafaBensan
Active Contributor
0 Kudos

Hi Christoph,

Based on the BIAL script methods it doesn't look like you can save a bookmark directly to a specific folder at the time of creation.  It would be a two step process as follows:

(a)  First save into the default root folder with Bookmark.PortableFragmentBookmark.saveBookmark()

(b)  Then reassign the bookmark to the desired folder with Bookmark.PortableFragmentBookmark.assignToFolder(folderId, bookmarkId)

The bookmarkId parameter in (b) can be obtained from the PortableFragmentBookmarkInfo.id object element returned by the saveBookmark() method in (a).

I think the best way to allow the user to choose the appropriate bookmark folder and obtain the folderID parameter value for step (b) above is as follows:

i.  Retrieve the bookmark folder structure as a Tree Model using the Bookmark.getBookmarkFoldersTreeModel() method

ii.  Assign the Tree Model to a Tree component with setModel()

iii.  Obtain the selected folder ID in the "On Select" event script of the Tree component using the getSelectedValue() method

Regards,

Mustafa.

0 Kudos

Hi Tammy, hi Mustafa,

thanks for your answers.

I have already implemented it as you can see in the attached file.

I just hoped that there is an easier way but I can use this workaround as well.

because I have nearly 100 components it is a bit of work.

but when i save Bookmarks with the same Group identifier in the corresponding Folder I think I can reduce the rows of Scripting.

By the way:

I will use this PortableFragmentBookmarks in a Fragment Gallery so that the enduser can place the Bookmarks in a splitcellcontainer.

what is the right technique to save the state of the splitcellcontainer that I can load this state at next Startup?

will this be a Bookmark or a Fragment Bookmark?

should i save the splitcellcontainer as a user-specific Bookmark and load this Bookmark on Startup?

TammyPowlas
Active Contributor
0 Kudos

Christoph - Kevin's code in this discussion thread identifies a way of finding the folder ID How to transport Bookmark folders? | SCN - maybe make use of that to find a way to save to a specific folder?  I haven't tried it myself but it's a consideration.