1 /** 2 * Copyright 2005-2012 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.kew.impl.document.search; 17 18 import org.kuali.rice.kew.api.document.search.DocumentSearchCriteria; 19 20 import java.util.Map; 21 22 /** 23 * Handles translating between parameters submitted to the document search and {@link org.kuali.rice.kew.api.document.search.DocumentSearchCriteria}. 24 * 25 * @author Kuali Rice Team (rice.collab@kuali.org) 26 */ 27 public interface DocumentSearchCriteriaTranslator { 28 29 /** 30 * Translates the given map of fields values into a {@link org.kuali.rice.kew.api.document.search.DocumentSearchCriteria}. The given map of 31 * field values is keyed based on the name of the field being submitted and the value represents that field value, 32 * which may contain wildcards and other logical operators supported by the KNS lookup framework. 33 * 34 * @param fieldValues the map of field names and values from which to populate the criteria 35 * @return populated document search criteria which contains the various criteria components populated based on the 36 * interpretation of the given field values 37 */ 38 DocumentSearchCriteria translateFieldsToCriteria(Map<String, String> fieldValues); 39 40 /** 41 * Translates the given {@link org.kuali.rice.kew.api.document.search.DocumentSearchCriteria} into a map of fields values. Reverse of 42 * {@link #translateFieldsToCriteria(java.util.Map)} 43 * 44 * @param criteria document search criteria 45 * @return Map populated with the various criteria components 46 */ 47 Map<String, String[]> translateCriteriaToFields(DocumentSearchCriteria criteria); 48 }