View Javadoc

1   /*
2    * Copyright 2005-2007 The Kuali Foundation
3    *
4    *
5    * Licensed under the Educational Community License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    * http://www.opensource.org/licenses/ecl2.php
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.kuali.rice.kew.routeheader.service;
18  
19  import java.math.BigDecimal;
20  import java.sql.Timestamp;
21  import java.util.Collection;
22  import java.util.List;
23  import java.util.Map;
24  import java.util.Set;
25  
26  import org.kuali.rice.kew.actionitem.ActionItem;
27  import org.kuali.rice.kew.docsearch.SearchableAttributeValue;
28  import org.kuali.rice.kew.doctype.bo.DocumentType;
29  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
30  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValueContent;
31  
32  
33  /**
34   * A service providing data access for documents (a.k.a route headers).
35   *
36   * @see DocumentRouteHeaderValue
37   *
38   * @author Kuali Rice Team (rice.collab@kuali.org)
39   */
40  public interface RouteHeaderService {
41  
42      public DocumentRouteHeaderValue getRouteHeader(String documentId);
43      public DocumentRouteHeaderValue getRouteHeader(String documentId, boolean clearCache);
44      public Collection<DocumentRouteHeaderValue> getRouteHeaders (Collection<String> documentIds);
45      public Collection<DocumentRouteHeaderValue> getRouteHeaders (Collection<String> documentIds, boolean clearCache);
46      public Map<String,DocumentRouteHeaderValue> getRouteHeadersForActionItems(Collection<ActionItem> actionItems);
47      public void lockRouteHeader(String documentId, boolean wait);
48      public void saveRouteHeader(DocumentRouteHeaderValue routeHeader);
49      public void deleteRouteHeader(DocumentRouteHeaderValue routeHeader);
50      public String getNextDocumentId();
51      public void validateRouteHeader(DocumentRouteHeaderValue routeHeader);
52      public Collection findPendingByResponsibilityIds(Set responsibilityIds);
53      public Collection findByDocTypeAndAppId(String documentTypeName, String appId);
54      
55      /**
56       * Removes all SearchableAttributeValues associated with the RouteHeader.
57       * @param routeHeader
58       */
59      public void clearRouteHeaderSearchValues(String documentId);
60  
61      /**
62       * Updates the searchable attribute values for the document with the given id to the given values.
63       * This method will clear existing search attribute values and replace with the ones given.
64       */
65      public void updateRouteHeaderSearchValues(String documentId, List<SearchableAttributeValue> searchAttributes);
66      
67      /**
68       * Returns the application id of the {@link DocumentType} for the Document with the given ID.
69       */
70      public String getApplicationIdByDocumentId(String documentId);
71  
72      public DocumentRouteHeaderValueContent getContent(String documentId);
73  
74      public boolean hasSearchableAttributeValue(String documentId, String searchableAttributeKey, String searchableAttributeValue);
75  
76      public String getDocumentStatus(String documentId);
77  
78      public String getAppDocId(String documentId);
79      
80      /**
81       *
82       * This method is a more direct way to get the searchable attribute values
83       *
84       * @param documentId
85       * @param key
86       * @return
87       */
88      public List<String> getSearchableAttributeStringValuesByKey(String documentId, String key);
89      /**
90       *
91       * This method is a more direct way to get the searchable attribute values
92       *
93       * @param documentId
94       * @param key
95       * @return
96       */
97      public List<Timestamp> getSearchableAttributeDateTimeValuesByKey(String documentId, String key);
98      /**
99       *
100      * This method is a more direct way to get the searchable attribute values
101      *
102      * @param documentId
103      * @param key
104      * @return
105      */
106     public List<BigDecimal> getSearchableAttributeFloatValuesByKey(String documentId, String key);
107     /**
108      *
109      * This method is a more direct way to get the searchable attribute values
110      *
111      * @param documentId
112      * @param key
113      * @return
114      */
115     public List<Long> getSearchableAttributeLongValuesByKey(String documentId, String key);
116 
117 }