1 /**
2 * Copyright 2005-2014 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.service;
17
18 import org.kuali.rice.krad.inquiry.Inquirable;
19 import org.kuali.rice.krad.uif.view.ViewSessionPolicy;
20 import org.kuali.rice.krad.lookup.LookupForm;
21
22 /**
23 * Provides methods to query the dictionary meta-data for view entries and their
24 * corresponding component entries
25 *
26 * @author Kuali Rice Team (rice.collab@kuali.org)
27 */
28 public interface ViewDictionaryService {
29
30 /**
31 * Queries the dictionary to find the <code>InquiryView</code> configured
32 * for the data object class and returns the configured Inquirable for the
33 * view. If more than one inquiry view exists for the data object class, the
34 * one that matches the given viewName, or the default if viewName is blank
35 * is used
36 *
37 * @param dataObjectClass - class for the inquiry data object
38 * @param viewName - name of the inquiry view, can be blank in which case the
39 * 'default' name will be used
40 * @return Inquirable<?> configured inquirable for the view, or null if view
41 * is not found
42 */
43 public Inquirable getInquirable(Class<?> dataObjectClass, String viewName);
44
45 /**
46 * Indicates whether the given data object class has an associated
47 * <code>InquiryView</code> configured and thus can have inquiry links built
48 *
49 * @param dataObjectClass - object class to get inquiry view for
50 * @return boolean true if the class has an inquiry view, false if no
51 * inquiry view exists for the class
52 */
53 public boolean isInquirable(Class<?> dataObjectClass);
54
55 /**
56 * Indicates whether the given data object class has an associated
57 * <code>LookupView</code> configured and thus can have quickfinders
58 * associated with the class
59 *
60 * @param dataObjectClass - object class to get lookup view for
61 * @return boolean true if the class has an lookup view, false if no lookup
62 * view exists for the class
63 */
64 public boolean isLookupable(Class<?> dataObjectClass);
65
66 /**
67 * Indicates whether the given data object class has an associated
68 * <code>MaintenanceDocumentView</code> configured
69 *
70 * @param dataObjectClass - object class to get maintenance view for
71 * @return boolean true if the class has an maintenance view, false if no
72 * maintenance view exists for the class
73 */
74 public boolean isMaintainable(Class<?> dataObjectClass);
75
76 /**
77 * Attempts to find an associated <code>LookupView</code> for the
78 * given data object class and if found returns the configured result
79 * set limit, if multiple lookup views are found the default is used
80 * unless the specific view can be found by view ID
81 *
82 * @param dataObjectClass - object class to get lookup view for
83 * @param form - the LookupForm
84 * @return Integer configured result set limit for lookup, or null if not found (note
85 * property could also be null on the view itself)
86 */
87 public Integer getResultSetLimitForLookup(Class<?> dataObjectClass, LookupForm form);
88
89 /**
90 * Retrieves the <code>ViewSessionPolicy</code> instance associated with the given view id
91 *
92 * @param viewId id for the view whose session policy should be retrieved
93 * @return view session policy instance for view or null if view not found for the given id
94 */
95 public ViewSessionPolicy getViewSessionPolicy(String viewId);
96
97 /**
98 * Indicates whether session storage is enabled for the view associated with the given id
99 *
100 * @param viewId id for the view to check
101 * @return true if session storage is enabled, false if not enabled or the view was not found
102 */
103 public boolean isSessionStorageEnabled(String viewId);
104 }