View Javadoc
1   /**
2    * Copyright 2005-2015 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.actionlist.service;
17  
18  import java.util.Collection;
19  import java.util.List;
20  
21  import org.kuali.rice.kew.actionitem.ActionItem;
22  import org.kuali.rice.kew.actionitem.OutboxItem;
23  import org.kuali.rice.kew.actionlist.ActionListFilter;
24  import org.kuali.rice.kew.actionrequest.ActionRequestValue;
25  import org.kuali.rice.kew.actionrequest.Recipient;
26  import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue;
27  
28  
29  
30  
31  /**
32   * Main service for doing action list data access work
33   *
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   *
36   */
37  public interface ActionListService {
38      public ActionItem createActionItemForActionRequest(ActionRequestValue actionRequest);
39  
40      public Collection<ActionItem> getActionList(String principalId, ActionListFilter filter);
41  
42      public Collection<ActionItem> getActionListForSingleDocument(String documentId);
43  
44      /**
45       * Returns a list of recipients <i>which secondary-delegate to</i> the target principalId
46       * @param principalId the target principalId/delegate
47       * @return a list of recipients <i>which secondary-delegate to</i> the target principalId
48       */
49      public Collection<Recipient> findUserSecondaryDelegators(String principalId);
50  
51      /**
52       * Retruns a list of recipients <i>which are primary-delegated to by</i> the source principalId
53       * @param principalId the source principalId to query for primary delegates
54       * @return a list of recipients <i>which are primary-delegated to by</i> the source principalId
55       */
56      public Collection<Recipient> findUserPrimaryDelegations(String principalId);
57  
58      public ActionItem saveActionItem(ActionItem actionItem);
59  
60      public void deleteActionItemNoOutbox(ActionItem actionItem);
61  
62      public void deleteActionItem(ActionItem actionItem);
63  
64      public void deleteActionItem(ActionItem actionItem, boolean forceIntoOutbox);
65  
66      public void deleteByDocumentId(String documentId);
67  
68      public Collection<ActionItem> findByPrincipalId(String principalId);
69  
70      public Collection<ActionItem> findByWorkflowUserDocumentId(String workflowUserId, String documentId);
71  
72      public Collection<ActionItem> findByDocumentId(String documentId);
73  
74      public Collection<ActionItem> findByDocumentTypeName(String documentTypeName);
75  
76      public void updateActionItemsForTitleChange(String documentId, String newTitle);
77  
78      public ActionItem findByActionItemId(String actionItemId);
79  
80      /**
81       * Retrieves the number of Action List items in the given user's primary Action List (does not include secondary delegations)
82       */
83      public int getCount(String principalId);
84  
85      /**
86       * Retrieves the max action item Id  and the total number of action items for the given user's primary Action List
87       * (does not include secondary delegations)
88       * @param principalId
89       */
90      public List<Object> getMaxActionItemDateAssignedAndCountForUser(String principalId);
91  
92      public Collection<ActionItem> findByActionRequestId(String actionRequestId);
93  
94      /**
95       *
96       * Retrieves {@link OutboxItem} items for the given user
97       *
98       * @param principalId
99       * @param filter
100      * @return
101      */
102     public Collection<OutboxItem> getOutbox(String principalId, ActionListFilter filter);
103     public Collection<OutboxItem> getOutboxItemsByDocumentType(String documentTypeName);
104     public void removeOutboxItems(String principalId, List<String> outboxItems);
105     public OutboxItem saveOutboxItem(ActionItem actionItem);
106     public OutboxItem saveOutboxItem(ActionItem actionItem, boolean forceIntoOutbox);
107     public OutboxItem saveOutboxItem(OutboxItem outboxItem);
108 
109     /**
110      * Pulls a proxied version of the document route header with only the properties needed by the
111      * action list display.
112      */
113     DocumentRouteHeaderValue getMinimalRouteHeader( String documentId );
114 }