use of org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder in project scout.rt by eclipse.
the class AbstractBookmarkStorageService method processSpoolToInbox.
/**
* @return true if there was some data to process
*/
private boolean processSpoolToInbox(BookmarkFolder folder) {
if (folder != null) {
BookmarkFolder spoolFolder = folder.getFolder(Bookmark.SPOOL_FOLDER_NAME);
if (spoolFolder != null) {
BookmarkFolder inboxFolder = folder.getFolder(Bookmark.INBOX_FOLDER_NAME);
if (inboxFolder == null) {
inboxFolder = new BookmarkFolder();
inboxFolder.setTitle(Bookmark.INBOX_FOLDER_NAME);
folder.getFolders().add(0, inboxFolder);
}
inboxFolder.addBookmarks(spoolFolder, true, false);
folder.getFolders().remove(spoolFolder);
return true;
}
}
return false;
}
use of org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder in project scout.rt by eclipse.
the class AbstractBookmarkStorageService method publishBookmarkDataToUser.
/**
* add bookmarks to the publish folder of a user
*/
protected void publishBookmarkDataToUser(BookmarkFolder publishFolder, Object userId) {
if (userId != null) {
BookmarkFolder userFolder = readUserFolder(userId);
if (userFolder == null) {
userFolder = new BookmarkFolder();
}
BookmarkFolder userSpool = userFolder.getFolder(Bookmark.SPOOL_FOLDER_NAME);
if (userSpool == null) {
userSpool = new BookmarkFolder();
userSpool.setTitle(Bookmark.SPOOL_FOLDER_NAME);
userFolder.getFolders().add(0, userSpool);
}
userSpool.addBookmarks(publishFolder, true, false);
writeUserFolder(userFolder, userId);
}
}
Aggregations