001 /**
002 * Copyright 2005-2012 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 */
016 package org.kuali.rice.kew.framework.document.search;
017
018 import org.kuali.rice.core.api.uif.RemotableAttributeFieldContract;
019
020 import java.util.List;
021
022 /**
023 * Defines how the display of results on the document search should be customized and configured. This class can be
024 * used to remove standard fields from the result set that are typically show on document search results. This class
025 * is also used to add additional fields
026 *
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029 public interface DocumentSearchResultSetConfigurationContract {
030
031 /**
032 * Returns true if the custom field names returned by {@link #getCustomFieldNamesToAdd()} should be used to define
033 * the order of searchable attributes as well as additional custom additional fields. Returns false if any
034 * searchable attribute values should be included in the result set according to their existing configuration.
035 *
036 * @return true if custom field names defined by this object should override any default searchable attribute result
037 * field display behavior, flase if searchable attribute fields should still be displayed in the result set
038 * according to their own configuration
039 */
040 boolean isOverrideSearchableAttributes();
041
042 /**
043 * Returns a list of field names of custom fields representing document attributes which should be added to the
044 * result set. This may contains fields that are defined in {@link #getAdditionalAttributeFields()} or also fields
045 * defined as part of a {@link org.kuali.rice.kew.framework.document.attribute.SearchableAttribute} (see {@code isOverrideSearchableAttributes()}).
046 *
047 * @return a list of field names of custom document attributes which should be added to the result set, can be an
048 * empty or null list in which case no fields will be added
049 */
050 List<String> getCustomFieldNamesToAdd();
051
052 /**
053 * Returns a list of the standard (built-in) document search result fields which should not be displayed in the
054 * result set. The document search implementation should do it's best to honor the request to remove standard
055 * fields from the result set, but it is free to ignore such requests if needed. An example of this would be a
056 * preference for the implementation of document search that requires certain result set fields to remain (such as
057 * the document id and route log which is usually recommended to display).
058 *
059 * @return a list of standard result fields to remove from inclusion in the result set, may be an empty or null
060 * list if no standard result fields should be removed
061 */
062 List<StandardResultField> getStandardResultFieldsToRemove();
063
064 /**
065 * Gets attribute field definitions for additional attributes that may be displayed in the result set. This simply
066 * defines the attribute field definition for each of these fields, their inclusion here does not necessarily mean
067 * they will be visible in the result set. This is controlled primarily by {@link #getCustomFieldNamesToAdd()}.
068 *
069 * @return a list containing additional attribute fields to define for use when constructing the result set, this
070 * method can return a null or empty list if there are no additional attribute fields to define
071 */
072 List<? extends RemotableAttributeFieldContract> getAdditionalAttributeFields();
073
074 }