Search in sources :

Example 1 with SetFormDataResult

use of edu.stanford.bmir.protege.web.shared.form.SetFormDataResult in project webprotege by protegeproject.

the class SetFormDataActionHandler method execute.

@Nonnull
@Override
public SetFormDataResult execute(@Nonnull SetFormDataAction action, @Nonnull ExecutionContext executionContext) {
    FormData formData = action.getFormData();
    CollectionItemData data = null;
    if (formData.isEmpty()) {
        data = new CollectionItemData(action.getCollectionId(), action.getElementId());
    } else {
        data = new CollectionItemData(action.getCollectionId(), action.getElementId(), formData);
    }
    repository.save(data);
    return new SetFormDataResult();
}
Also used : FormData(edu.stanford.bmir.protege.web.shared.form.FormData) CollectionItemData(edu.stanford.bmir.protege.web.shared.collection.CollectionItemData) SetFormDataResult(edu.stanford.bmir.protege.web.shared.form.SetFormDataResult) Nonnull(javax.annotation.Nonnull)

Aggregations

CollectionItemData (edu.stanford.bmir.protege.web.shared.collection.CollectionItemData)1 FormData (edu.stanford.bmir.protege.web.shared.form.FormData)1 SetFormDataResult (edu.stanford.bmir.protege.web.shared.form.SetFormDataResult)1 Nonnull (javax.annotation.Nonnull)1