001/**
002 * Copyright 2005-2016 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.uif.service;
017
018import org.kuali.rice.krad.inquiry.Inquirable;
019
020/**
021 * Provides methods to query the dictionary meta-data for view entries and their
022 * corresponding component entries
023 *
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public interface ViewDictionaryService {
027
028    /**
029     * Queries the dictionary to find the <code>InquiryView</code> configured
030     * for the data object class and returns the configured Inquirable for the
031     * view. If more than one inquiry view exists for the data object class, the
032     * one that matches the given viewName, or the default if viewName is blank
033     * is used
034     *
035     * @param dataObjectClass - class for the inquiry data object
036     * @param viewName - name of the inquiry view, can be blank in which case the
037     * 'default' name will be used
038     * @return Inquirable<?> configured inquirable for the view, or null if view
039     *         is not found
040     */
041    public Inquirable getInquirable(Class<?> dataObjectClass, String viewName);
042
043    /**
044     * Indicates whether the given data object class has an associated
045     * <code>InquiryView</code> configured and thus can have inquiry links built
046     *
047     * @param dataObjectClass - object class to get inquiry view for
048     * @return boolean true if the class has an inquiry view, false if no
049     *         inquiry view exists for the class
050     */
051    public boolean isInquirable(Class<?> dataObjectClass);
052
053    /**
054     * Indicates whether the given data object class has an associated
055     * <code>LookupView</code> configured and thus can have quickfinders
056     * associated with the class
057     *
058     * @param dataObjectClass - object class to get lookup view for
059     * @return boolean true if the class has an lookup view, false if no lookup
060     *         view exists for the class
061     */
062    public boolean isLookupable(Class<?> dataObjectClass);
063
064    /**
065     * Indicates whether the given data object class has an associated
066     * <code>MaintenanceView</code> configured
067     *
068     * @param dataObjectClass - object class to get maintenance view for
069     * @return boolean true if the class has an maintenance view, false if no
070     *         maintenance view exists for the class
071     */
072    public boolean isMaintainable(Class<?> dataObjectClass);
073
074    /**
075     * Attempts to find an associated <code>LookupView</code> for the
076     * given data object class and if found returns the configured result
077     * set limit, if multiple lookup views are found the default is used
078     *
079     * @param dataObjectClass - object class to get lookup view for
080     * @return Integer configured result set limit for lookup, or null if not found (note
081     *         property could also be null on the view itself)
082     */
083    public Integer getResultSetLimitForLookup(Class<?> dataObjectClass);
084}