Search in sources :

Example 16 with Bookmark

use of org.ovirt.engine.core.common.businessentities.Bookmark in project ovirt-engine by oVirt.

the class UpdateBookmarkCommand method validate.

@Override
protected boolean validate() {
    Bookmark updated = getBookmark();
    if (updated == null) {
        return failValidation(EngineMessage.ACTION_TYPE_FAILED_BOOKMARK_INVALID_ID);
    }
    Bookmark current = bookmarkDao.getByName(updated.getName());
    if (current != null && !current.getId().equals(updated.getId())) {
        return failValidation(EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED);
    }
    return true;
}
Also used : Bookmark(org.ovirt.engine.core.common.businessentities.Bookmark)

Aggregations

Bookmark (org.ovirt.engine.core.common.businessentities.Bookmark)16 Test (org.junit.Test)8 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Inject (com.google.inject.Inject)2 HandlerRegistration (com.google.web.bindery.event.shared.HandlerRegistration)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 BookmarksOperationParameters (org.ovirt.engine.core.common.action.BookmarksOperationParameters)2 QueryParametersBase (org.ovirt.engine.core.common.queries.QueryParametersBase)2 Guid (org.ovirt.engine.core.compat.Guid)2 AsyncCallback (org.ovirt.engine.ui.frontend.AsyncCallback)2 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)2 SearchableListModel (org.ovirt.engine.ui.uicommonweb.models.SearchableListModel)2 BookmarkListModel (org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkListModel)2 IFrontendActionAsyncCallback (org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)2 BookmarkModelProvider (org.ovirt.engine.ui.webadmin.uicommon.model.BookmarkModelProvider)2 Scheduler (com.google.gwt.core.client.Scheduler)1 HasClickHandlers (com.google.gwt.event.dom.client.HasClickHandlers)1 HasKeyDownHandlers (com.google.gwt.event.dom.client.HasKeyDownHandlers)1 KeyCodes (com.google.gwt.event.dom.client.KeyCodes)1