001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.web.service;
017
018import org.kuali.rice.krad.uif.field.AttributeQueryResult;
019import org.kuali.rice.krad.web.form.UifFormBase;
020import org.springframework.web.servlet.ModelAndView;
021
022/**
023 * Controller service that provides handling for query methods suggest as performing a lookup, field suggest,
024 * and field query.
025 *
026 * @author Kuali Rice Team (rice.collab@kuali.org)
027 */
028public interface QueryControllerService {
029
030    /**
031     * Handles the perform lookup action by building up a URL to the lookup view and configuring
032     * a redirect.
033     *
034     * @param form form instance containing the model data
035     * @return ModelAndView configured for redirecting to the lookup view
036     */
037    ModelAndView performLookup(UifFormBase form);
038
039    /**
040     * Invoked to provides options (execute a query) for a field that contains a suggest widget.
041     *
042     * @param form form instance containing the model data
043     * @return AttributeQueryResult containing the results of the suggest query
044     */
045    AttributeQueryResult performFieldSuggest(UifFormBase form);
046
047    /**
048     * Invoked to execute the attribute query associated with a field given the query parameters
049     * found in the request
050     *
051     * @param form form instance containing the model data
052     * @return AttributeQueryResult containing the results of the field query
053     */
054    AttributeQueryResult performFieldQuery(UifFormBase form);
055}