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.Set;
24  
25  import org.kuali.rice.kew.docsearch.SearchableAttributeValue;
26  import org.kuali.rice.kew.doctype.bo.DocumentType;
27  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
28  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValueContent;
29  
30  
31  /**
32   * A service providing data access for documents (a.k.a route headers).
33   *
34   * @see DocumentRouteHeaderValue
35   *
36   * @author Kuali Rice Team (rice.collab@kuali.org)
37   */
38  public interface RouteHeaderService {
39  
40      public DocumentRouteHeaderValue getRouteHeader(Long routeHeaderId);
41      public DocumentRouteHeaderValue getRouteHeader(Long routeHeaderId, boolean clearCache);
42      public void lockRouteHeader(Long routeHeaderId, boolean wait);
43      public void saveRouteHeader(DocumentRouteHeaderValue routeHeader);
44      public void deleteRouteHeader(DocumentRouteHeaderValue routeHeader);
45      public Long getNextRouteHeaderId();
46      public void validateRouteHeader(DocumentRouteHeaderValue routeHeader);
47      public Collection findPendingByResponsibilityIds(Set responsibilityIds);
48      public Collection findByDocTypeAndAppId(String documentTypeName, String appId);
49      
50      /**
51       * Removes all SearchableAttributeValues associated with the RouteHeader.
52       * @param routeHeader
53       */
54      public void clearRouteHeaderSearchValues(Long routeHeaderId);
55  
56      /**
57       * Updates the searchable attribute values for the document with the given id to the given values.
58       * This method will clear existing search attribute values and replace with the ones given.
59       */
60      public void updateRouteHeaderSearchValues(Long routeHeaderId, List<SearchableAttributeValue> searchAttributes);
61      
62      /**
63       * Returns the Service Namespace of the {@link DocumentType} for the Document with the given ID.
64       */
65      public String getServiceNamespaceByDocumentId(Long documentId);
66  
67      public DocumentRouteHeaderValueContent getContent(Long routeHeaderId);
68  
69      public boolean hasSearchableAttributeValue(Long documentId, String searchableAttributeKey, String searchableAttributeValue);
70  
71      public String getDocumentStatus(Long documentId);
72  
73      public String getAppDocId(Long documentId);
74      
75      /**
76       *
77       * This method is a more direct way to get the searchable attribute values
78       *
79       * @param documentId
80       * @param key
81       * @return
82       */
83      public List<String> getSearchableAttributeStringValuesByKey(Long documentId, String key);
84      /**
85       *
86       * This method is a more direct way to get the searchable attribute values
87       *
88       * @param documentId
89       * @param key
90       * @return
91       */
92      public List<Timestamp> getSearchableAttributeDateTimeValuesByKey(Long documentId, String key);
93      /**
94       *
95       * This method is a more direct way to get the searchable attribute values
96       *
97       * @param documentId
98       * @param key
99       * @return
100      */
101     public List<BigDecimal> getSearchableAttributeFloatValuesByKey(Long documentId, String key);
102     /**
103      *
104      * This method is a more direct way to get the searchable attribute values
105      *
106      * @param documentId
107      * @param key
108      * @return
109      */
110     public List<Long> getSearchableAttributeLongValuesByKey(Long documentId, String key);
111 
112 }