1616 */
1717package org .exoplatform .processes .service ;
1818
19- import java .io .IOException ;
2019import java .util .List ;
2120
2221import org .exoplatform .commons .exception .ObjectNotFoundException ;
23- import org .exoplatform .commons .file .services .FileStorageException ;
2422import org .exoplatform .processes .model .*;
25- import org .exoplatform .social .core .identity .model .Identity ;
2623
27- public interface ProcessesService {
24+ public interface RequestService {
2825
29- /**
30- * Retrieves a list of accessible WorkFlows, for a selected user, by applying
31- * the designated filter. The returned results will be of type
32- * {@link WorkFlow} only. The ownerId of filter object will be used to select
33- * the list of accessible WorkFlows to retrieve.
34- *
35- * @param filter {@link ProcessesFilter} that contains filtering criteria
36- * @param offset Offset of the result list
37- * @param limit Limit of the result list
38- * @param userIdentityId {@link Identity} technical identifier of the user
39- * acessing files
40- * @return {@link List} of {@link WorkFlow}
41- * @throws IllegalAccessException when the user isn't allowed to access
42- * documents of the designated ownerId
43- */
44- List <WorkFlow > getWorkFlows (ProcessesFilter filter ,
45- int offset ,
46- int limit ,
47- long userIdentityId ) throws IllegalAccessException ;
48-
49-
50- int countWorkFlows (ProcessesFilter filter ,
51- long userIdentityId ) throws IllegalAccessException ;
52-
53- WorkFlow getWorkFlow (long id ,
54- long userIdentityId ) throws IllegalAccessException ;
55-
56- WorkFlow getWorkFlow (long id ) throws IllegalAccessException ;
57-
58- WorkFlow createWorkFlow (WorkFlow workFlow , long userId ) throws IllegalAccessException ;
59-
60- WorkFlow updateWorkFlow (WorkFlow workFlow ,
61- long userId ) throws IllegalArgumentException , ObjectNotFoundException , IllegalAccessException ;
6226
6327 /**
6428 * Retrieves list of filtered works
@@ -72,9 +36,6 @@ WorkFlow updateWorkFlow(WorkFlow workFlow,
7236 */
7337 List <Work > getWorks (long userIdentityId , WorkFilter workFilter , int offset , int limit ) throws Exception ;
7438
75- WorkFlow getWorkFlowByProjectId (long projectId , long userId ) throws IllegalAccessException ;
76-
77- WorkFlow getWorkFlowByProjectId (long projectId );
7839
7940 /**
8041 * Creates a work from new work object or from exiting work draft
@@ -84,27 +45,11 @@ WorkFlow updateWorkFlow(WorkFlow workFlow,
8445 * @return {@link Work}
8546 * @throws IllegalAccessException
8647 */
87- Work createWork (Work work , long userId ) throws IllegalAccessException ;
48+ Work createWork (Work work , long userId ) throws IllegalAccessException , ObjectNotFoundException ;
8849
8950 Work updateWork (Work work , long userId ) throws IllegalArgumentException ,
9051 ObjectNotFoundException ,
9152 IllegalAccessException ;
92- /**
93- * Delete a workflow by its given Id.
94- *
95- * @param workflowId : workflow id
96- * @param userId user id
97- */
98- void deleteWorkflowById (Long workflowId , long userId ) throws IllegalAccessException , ObjectNotFoundException ;
99-
100- /**
101- * @param projectId: Tasks project id
102- * @param isCompleted: filter by completed and uncompleted tasks
103- * @param userId user id
104- * @return Filtered tasks count
105- * @throws Exception
106- */
107- int countWorksByWorkflow (Long projectId , long userId , Boolean isCompleted ) throws Exception ;
10853
10954 /**
11055 * Delete a work by its given id.
@@ -167,47 +112,21 @@ Work updateWork(Work work, long userId) throws IllegalArgumentException,
167112 */
168113 void deleteWorkDraftById (Long draftId , long userId ) throws IllegalAccessException , ObjectNotFoundException ;
169114
170- /**
171- * Retrieves the list of available statuses in all workflows
172- *
173- * @return {@link List} of {@link WorkStatus}
174- */
175- List <WorkStatus > getAvailableWorkStatuses ();
176-
177115 /**
178116 * Retrieves a Work by its given id
179117 *
180118 * @param userId user identity id
181119 * @param workId Work id
182120 * @return {@link Work}
183121 */
184- Work getWorkById (long userId , Long workId ) throws IllegalAccessException ;
122+ Work getWorkById (long userId , Long workId ) throws IllegalAccessException , ObjectNotFoundException ;
185123
186- /**
187- * Retrieves an illustration image by its given id
188- *
189- * @param illustrationId illustration file id
190- * @param userId user id
191- * @return {@link IllustrativeAttachment}
192- * @throws FileStorageException
193- * @throws ObjectNotFoundException
194- */
195- IllustrativeAttachment getIllustrationImageById (Long illustrationId ,
196- long userId ) throws FileStorageException ,
197- ObjectNotFoundException ,
198- IOException ;
199-
200- boolean canAccess (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
201-
202- boolean canAdd (org .exoplatform .services .security .Identity identity );
203-
204- boolean canEdit (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
205-
206- boolean canDelete (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
207124
208125 boolean canAddRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
209126
210127 boolean canEditRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
211128
212129 boolean canDeleteRequest (WorkFlow workFlow , org .exoplatform .services .security .Identity identity );
130+
131+ boolean canCompleteRequest (Work work , org .exoplatform .services .security .Identity identity ) throws ObjectNotFoundException ;
213132}
0 commit comments