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.framework.rule.attribute;
17  
18  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
19  import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
20  import org.kuali.rice.kew.api.KewApiConstants;
21  import org.kuali.rice.kew.api.extension.ExtensionDefinition;
22  import org.kuali.rice.kew.api.rule.RoleName;
23  import org.kuali.rice.kew.framework.KewFrameworkServiceLocator;
24  
25  import javax.jws.WebMethod;
26  import javax.jws.WebParam;
27  import javax.jws.WebResult;
28  import javax.jws.WebService;
29  import javax.jws.soap.SOAPBinding;
30  import javax.xml.bind.annotation.XmlElement;
31  import javax.xml.bind.annotation.XmlElementWrapper;
32  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
33  import java.util.List;
34  import java.util.Map;
35  
36  /**
37   * A remotable service which handles processing of a client application's document search customizations.
38   *
39   * @author Kuali Rice Team (rice.collab@kuali.org)
40   */
41  @WebService(name = KewFrameworkServiceLocator.WORKFLOW_RULE_ATTRIBUTE_HANDLER_SERVICE, targetNamespace = KewApiConstants.Namespaces.KEW_NAMESPACE_2_0)
42  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
43  public interface WorkflowRuleAttributeHandlerService {
44  
45      /**
46       * Using the WorkflowRuleAttribute defined by the given extension definition, does the following: validates the
47       * given rule attribute parameters, fetches the list of RemotableAttributeField objects to display for the rule, and
48       * then determines the rule extension values produced by the attribute and returns this information as a
49       * WorkflowRuleAttributeFields object.
50       *
51       * @param parameters the parameters against which to validate
52       * @param extensionDefinition extension definition of the WorkflowRuleAttribute, cannot be null or blank.
53       * @param required the required flag which should be passed to the WorkflowRuleAttribute prior to processing
54       *
55       * @return the WorkflowRuleAttributeFields, will not return null.
56       *
57       * @throws RiceIllegalArgumentException if the extensionDefinition is null or blank
58       * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
59       */
60      @WebMethod(operationName = "getRuleFields")
61      @XmlElement(name = "ruleFields", required = true)
62      @WebResult(name = "ruleFields")
63      WorkflowRuleAttributeFields getRuleFields(@WebParam(name = "parameters")
64                                                @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
65                                                Map<String, String> parameters,
66                                                @WebParam(name = "extensionDefinition")
67                                                ExtensionDefinition extensionDefinition,
68                                                @WebParam(name = "required")
69                                                boolean required)
70              throws RiceIllegalArgumentException;
71  
72      /**
73       * Using the WorkflowRuleAttribute defined by the given extension definition, does the following: validates the
74       * given rule attribute parameters, fetches the list of RemotableAttributeField objects to display for the rule
75       * search, and then determines the rule extension values produced by the attribute and returns this information as a
76       * WorkflowRuleAttributeFields object.
77       *
78       * @param parameters the parameters against which to validate
79       * @param extensionDefinition extension definition of the WorkflowRuleAttribute, cannot be null or blank.
80       * @param required the required flag which should be passed to the WorkflowRuleAttribute prior to processing
81       *
82       * @return the WorkflowRuleAttributeFields, will not return null.
83       *
84       * @throws RiceIllegalArgumentException if the extensionDefinition is null or blank
85       * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
86       */
87      @WebMethod(operationName = "getSearchFields")
88      @XmlElement(name = "searchFields", required = true)
89      @WebResult(name = "searchFields")
90      WorkflowRuleAttributeFields getSearchFields(@WebParam(name = "parameters")
91                                                  @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
92                                                  Map<String, String> parameters,
93                                                  @WebParam(name = "extensionDefinition")
94                                                  ExtensionDefinition extensionDefinition,
95                                                  @WebParam(name = "required")
96                                                  boolean required)
97              throws RiceIllegalArgumentException;
98  
99      /**
100      * Using the WorkflowRuleAttribute defined by the given extension definition, does the following: validates the
101      * given rule attribute parameters, fetches the list of RemotableAttributeField objects to display for rule 
102      * reporting then determines the rule extension values produced by the attribute and returns this information as a
103      * WorkflowRuleAttributeFields object.
104      *
105      * @param parameters the parameters against which to validate
106      * @param extensionDefinition extension definition of the WorkflowRuleAttribute, cannot be null or blank.
107      * @param required the required flag which should be passed to the WorkflowRuleAttribute prior to processing
108      *
109      * @return the WorkflowRuleAttributeFields, will not return null.
110      *
111      * @throws RiceIllegalArgumentException if the extensionDefinition is null or blank
112      * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
113      */
114     @WebMethod(operationName = "getRoutingDataFields")
115     @XmlElement(name = "routingDataFields", required = true)
116     @WebResult(name = "routingDataFields")
117     WorkflowRuleAttributeFields getRoutingDataFields(@WebParam(name = "parameters")
118                                               @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
119                                               Map<String, String> parameters,
120                                               @WebParam(name = "extensionDefinition")
121                                               ExtensionDefinition extensionDefinition,
122                                               @WebParam(name = "required")
123                                               boolean required)
124             throws RiceIllegalArgumentException;
125  
126     /**
127      * Gets a List of {@link RoleName} objects produced by the RoleAttribute defined by the given extension definition.
128      *
129      * @param extensionDefinition extension definition of the RoleAttribute, cannot be null or blank.
130      *
131      * @return an immutable list of RoleName objects, if none are defined or the supplied extension definition is not
132      * an instance of RoleAttribute, this will return an empty list. This method will never return null.
133      *
134      * @throws RiceIllegalArgumentException if the extensionDefinition is null or blank
135      * @throws RiceIllegalArgumentException if the RoleAttribute is not found
136      */
137     @WebMethod(operationName = "getRoleNames")
138     @XmlElementWrapper(name = "roleNames", required = true)
139     @XmlElement(name = "roleName", required = false)
140     @WebResult(name = "roleNames")
141     List<RoleName> getRoleNames(@WebParam(name = "extensionDefinition")
142                                 ExtensionDefinition extensionDefinition)
143             throws RiceIllegalArgumentException;
144 
145 }