View Javadoc

1   /**
2    * Copyright 2005-2013 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.routeheader.service;
17  
18  import java.math.BigDecimal;
19  import java.sql.Timestamp;
20  import java.util.Collection;
21  import java.util.List;
22  import java.util.Map;
23  import java.util.Set;
24  
25  import org.kuali.rice.kew.api.action.ActionItem;
26  import org.kuali.rice.kew.docsearch.SearchableAttributeBase;
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);
48      public DocumentRouteHeaderValue 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 Returns the application document status for the given document id
83       *
84       * @param documentId
85       * @return String
86       */
87      public String getAppDocStatus(String documentId);
88      
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<String> getSearchableAttributeStringValuesByKey(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<Timestamp> getSearchableAttributeDateTimeValuesByKey(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<BigDecimal> getSearchableAttributeFloatValuesByKey(String documentId, String key);
116     /**
117      *
118      * This method is a more direct way to get the searchable attribute values
119      *
120      * @param documentId
121      * @param key
122      * @return
123      */
124     public List<Long> getSearchableAttributeLongValuesByKey(String documentId, String key);
125 
126 }