Search in sources :

Example 1 with BookmarksOperationParameters

use of org.ovirt.engine.core.common.action.BookmarksOperationParameters in project ovirt-engine by oVirt.

the class BackendBookmarksResource method add.

@Override
public Response add(Bookmark bookmark) {
    validateParameters(bookmark, "name");
    validateParameters(bookmark, "value");
    return performCreate(ActionType.AddBookmark, new BookmarksOperationParameters(map(bookmark)), new BookmarkNameResolver(bookmark.getName()));
}
Also used : BookmarksOperationParameters(org.ovirt.engine.core.common.action.BookmarksOperationParameters)

Example 2 with BookmarksOperationParameters

use of org.ovirt.engine.core.common.action.BookmarksOperationParameters in project ovirt-engine by oVirt.

the class BookmarkListModel method onSave.

public void onSave() {
    BookmarkModel model = (BookmarkModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.validate()) {
        return;
    }
    org.ovirt.engine.core.common.businessentities.Bookmark tempVar = new org.ovirt.engine.core.common.businessentities.Bookmark();
    tempVar.setId(model.getIsNew() ? Guid.Empty : ((org.ovirt.engine.core.common.businessentities.Bookmark) getSelectedItem()).getId());
    tempVar.setName(model.getName().getEntity());
    tempVar.setValue(model.getSearchString().getEntity());
    org.ovirt.engine.core.common.businessentities.Bookmark bookmark = tempVar;
    model.startProgress();
    Frontend.getInstance().runAction(model.getIsNew() ? ActionType.AddBookmark : ActionType.UpdateBookmark, new BookmarksOperationParameters(bookmark), result -> {
        BookmarkListModel localModel = (BookmarkListModel) result.getState();
        localModel.postOnSave(result.getReturnValue());
    }, this);
}
Also used : Bookmark(org.ovirt.engine.core.common.businessentities.Bookmark) Bookmark(org.ovirt.engine.core.common.businessentities.Bookmark) BookmarksOperationParameters(org.ovirt.engine.core.common.action.BookmarksOperationParameters)

Aggregations

BookmarksOperationParameters (org.ovirt.engine.core.common.action.BookmarksOperationParameters)2 Bookmark (org.ovirt.engine.core.common.businessentities.Bookmark)1