View Javadoc
1   /**
2    * Copyright 2005-2016 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.uif.UifConstants;
19  import org.kuali.rice.krad.uif.view.View;
20  import org.kuali.rice.krad.uif.UifConstants.ViewType;
21  
22  import java.util.Map;
23  
24  /**
25   * Provides service methods for retrieving and updating <code>View</code> instances. The UIF
26   * interacts with this service from the client layer to pull information from the View dictionary
27   * and manage the View instance through its lifecycle
28   *
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   */
31  public interface ViewService {
32  
33      /**
34       * Returns the <code>View</code> entry identified by the given id
35       *
36       * <p>
37       * The id matches the id configured for the View through the dictionary. A new view instance
38       * is returned that is in the created state
39       * </p>
40       *
41       * @param viewId - unique id for view configured on its definition
42       * @return View instance associated with the id or Null if id is not found
43       */
44      public View getViewById(String viewId);
45  
46      /**
47       * Retrieves the <code>View</code> instance that is of the given view type and matches the
48       * given parameters (that are applicable for that type). If more than one views exists for the
49       * type and parameters, the view type may choose a default or throw an exception
50       *
51       * <p>
52       * If a view if found for the type parameters, a new instance is returned that is in the
53       * created state
54       * </p>
55       *
56       * @param viewType - name that identifies the view type
57       * @param parameters - Map of parameter key/value pairs that are used to select the
58       * view, the parameters allowed depend on the view type
59       * @return View instance or Null if a matching view was not found
60       */
61      public View getViewByType(ViewType viewType, Map<String, String> parameters);
62  
63      /**
64       * Retrieves the view id for the view associated with the given view type and view type parameters
65       *
66       * @param viewType name that identifies the view type
67       * @param parameters Map of parameter key/value pairs that are used to select the
68       * view, the parameters allowed depend on the view type
69       * @return id for the view or null if a matching view was not found
70       */
71      public String getViewIdForViewType(ViewType viewType, Map<String, String> parameters);
72  
73      // TODO: remove once can get beans by type
74      public ViewTypeService getViewTypeService(UifConstants.ViewType viewType);
75  
76  }