Search in sources :

Example 1 with BookmarkData

use of org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData in project scout.rt by eclipse.

the class AbstractBookmarkStorageService method readBookmarks.

protected BookmarkData readBookmarks(Object userId) {
    BookmarkData model = new BookmarkData();
    // user
    BookmarkFolder folder = readUserFolder(userId);
    if (folder != null) {
        model.setUserBookmarks(folder);
    }
    // global
    if (ACCESS.check(new ReadGlobalBookmarkPermission())) {
        folder = readGlobalFolder();
        if (folder != null) {
            model.setGlobalBookmarks(folder);
        }
    }
    return model;
}
Also used : BookmarkData(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData) BookmarkFolder(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder) ReadGlobalBookmarkPermission(org.eclipse.scout.rt.shared.security.ReadGlobalBookmarkPermission)

Example 2 with BookmarkData

use of org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData in project scout.rt by eclipse.

the class AbstractBookmarkStorageService method getBookmarkData.

@Override
public BookmarkData getBookmarkData() {
    Object userId = getCurrentUserId();
    BookmarkData newData = readBookmarks(userId);
    if (processSpoolToInbox(newData.getUserBookmarks())) {
        writeUserFolder(newData.getUserBookmarks(), userId);
    }
    return newData;
}
Also used : BookmarkData(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData)

Example 3 with BookmarkData

use of org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData in project scout.rt by eclipse.

the class BookmarkService method getServiceState.

private ServiceState getServiceState() {
    IClientSession session = ClientSessionProvider.currentSession();
    if (session == null) {
        throw new IllegalStateException("null client session in current job context");
    }
    ServiceState data = (ServiceState) session.getData(SESSION_DATA_KEY);
    if (data == null) {
        data = new ServiceState();
        data.m_model = new BookmarkData();
        session.setData(SESSION_DATA_KEY, data);
    }
    return data;
}
Also used : BookmarkData(org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData) IClientSession(org.eclipse.scout.rt.client.IClientSession)

Aggregations

BookmarkData (org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkData)3 IClientSession (org.eclipse.scout.rt.client.IClientSession)1 ReadGlobalBookmarkPermission (org.eclipse.scout.rt.shared.security.ReadGlobalBookmarkPermission)1 BookmarkFolder (org.eclipse.scout.rt.shared.services.common.bookmark.BookmarkFolder)1