Search in sources :

Example 11 with BookmarkFolder

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;
}
Also used : BookmarkFolder(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder)

Example 12 with BookmarkFolder

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);
    }
}
Also used : BookmarkFolder(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder)

Aggregations

BookmarkFolder (org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder)12 Bookmark (org.eclipse.scout.rt.shared.services.common.bookmark.Bookmark)4 IBookmarkService (org.eclipse.scout.rt.client.services.common.bookmark.IBookmarkService)3 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)3 ArrayList (java.util.ArrayList)2 ITreeVisitor (org.eclipse.scout.rt.client.ui.basic.tree.ITreeVisitor)2 Comparator (java.util.Comparator)1 AbstractMenuSeparator (org.eclipse.scout.rt.client.ui.action.menu.AbstractMenuSeparator)1 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)1 MenuSeparator (org.eclipse.scout.rt.client.ui.action.menu.MenuSeparator)1 BookmarkForm (org.eclipse.scout.rt.client.ui.desktop.bookmark.BookmarkForm)1 IBookmarkForm (org.eclipse.scout.rt.client.ui.desktop.bookmark.IBookmarkForm)1 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)1 ReadGlobalBookmarkPermission (org.eclipse.scout.rt.shared.security.ReadGlobalBookmarkPermission)1 BookmarkData (org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData)1