View Javadoc

1   /**
2    * Copyright 2005-2012 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.uif.RemotableAttributeField;
20  import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
21  import org.kuali.rice.kew.api.KewApiConstants;
22  import org.kuali.rice.kew.api.rule.RoleName;
23  import org.kuali.rice.kew.api.validation.ValidationResults;
24  import org.kuali.rice.kew.framework.KewFrameworkServiceLocator;
25  
26  import javax.jws.WebMethod;
27  import javax.jws.WebParam;
28  import javax.jws.WebResult;
29  import javax.jws.WebService;
30  import javax.jws.soap.SOAPBinding;
31  import javax.xml.bind.annotation.XmlElement;
32  import javax.xml.bind.annotation.XmlElementWrapper;
33  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
34  import java.util.List;
35  import java.util.Map;
36  
37  /**
38   * A remotable service which handles processing of a client application's document search customizations.
39   *
40   * @author Kuali Rice Team (rice.collab@kuali.org)
41   */
42  @WebService(name = KewFrameworkServiceLocator.WORKFLOW_RULE_ATTRIBUTE_HANDLER_SERVICE, targetNamespace = KewApiConstants.Namespaces.KEW_NAMESPACE_2_0)
43  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
44  public interface WorkflowRuleAttributeHandlerService {
45  
46      /**
47       * Returns true if the attribute with the provided name is an instance of WorkflowRuleAttribute
48       *
49       * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
50       * @throws RiceIllegalArgumentException if the attributeName is null or blank
51       * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
52       */
53      @WebMethod(operationName = "isWorkflowRuleAttribute")
54      @WebResult(name = "workflowRuleAttribute")
55      @XmlElement(name = "workflowRuleAttribute", required = false)
56      boolean isWorkflowRuleAttribute(String attributeName);
57  
58      /**
59       * Gets a List of {@link RemotableAttributeField} based on the passed workflow rule attribute name.  This
60       * method loads loads up a WorkflowRuleAttribute and determines the fields for a RuleExtension
61       *
62       * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
63       * @return an immutable list of RemotableAttributeField. Will not return null.
64       * @throws RiceIllegalArgumentException if the attributeName is null or blank
65       * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
66       */
67      @WebMethod(operationName = "getRuleRows")
68      @XmlElementWrapper(name = "ruleRows", required = true)
69      @XmlElement(name = "ruleRow", required = false)
70      @WebResult(name = "ruleRows")
71      List<RemotableAttributeField> getRuleRows(@WebParam(name="attributeName") String attributeName)
72          throws RiceIllegalArgumentException;
73  
74      /**
75       * Gets a List of {@link RemotableAttributeField} based on the passed workflow rule or searchable attribute name.
76       * This method loads loads up either a WorkflowRuleAttribute or WorkflowRuleSearchAttribute and determines the
77       * fields for a RuleExtension.
78       *
79       * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
80       * @return an immutable list of RemotableAttributeField. Will not return null.
81       * @throws RiceIllegalArgumentException if the attributeName is null or blank
82       * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
83       */
84      @WebMethod(operationName = "getSearchRows")
85      @XmlElementWrapper(name = "searchRows", required = true)
86      @XmlElement(name = "searchRow", required = false)
87      @WebResult(name = "searchRows")
88      List<RemotableAttributeField> getSearchRows(@WebParam(name="attributeName") String attributeName)
89          throws RiceIllegalArgumentException;
90  
91  
92      /**
93       * Gets a List of {@link RemotableAttributeField} based on the passed workflow rule or searchable attribute name.
94       * This method loads loads up either a WorkflowRuleAttribute or WorkflowRuleSearchAttribute and determines the
95       * routing data fields for a RuleExtension.
96       *
97       * <p> RoutingDataRows contain Rows describing the UI-level presentation of the ruleData fields
98       * used to determine where a given document would be routed according to the associated rule.</p>
99       *
100      * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
101      * @return an immutable list of RemotableAttributeField. Will not return null.
102      * @throws RiceIllegalArgumentException if the attributeName is null or blank
103      * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
104      */
105     @WebMethod(operationName = "getRoutingDataRows")
106     @XmlElementWrapper(name = "routingDataRows", required = true)
107     @XmlElement(name = "routingDataRow", required = false)
108     @WebResult(name = "routingDataRows")
109     List<RemotableAttributeField> getRoutingDataRows(@WebParam(name="attributeName") String attributeName)
110         throws RiceIllegalArgumentException;
111 
112     /**
113      * Validates routingData values in the incoming map.  Called by the UI during rule creation.
114      *
115      * This method is responsible for validating and setting the data entered on the form from the UI of the routing report to the Rule's attribute.
116      * The values will be in a Map with the key being the key of the RuleExtensionValue and the value being the value of the data entered from the
117      * UI. This method is used for the routing report which may have different fields than the rule data.
118      *
119      * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
120      * @param paramMap Map containing the names and values of the routing data for this Attribute
121      * @return ValidationResults. Will not return null.
122      * @throws RiceIllegalArgumentException if the attributeName is null or blank
123      * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
124      */
125     @WebMethod(operationName = "validateRoutingData")
126     @WebResult(name = "validationResults")
127     @XmlElement(name = "validationResults", required = false)
128     ValidationResults validateRoutingData(@WebParam(name="attributeName")
129                              String attributeName,
130                              @WebParam(name = "parmMap")
131                              @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
132                              Map<String, String> paramMap)
133         throws RiceIllegalArgumentException;
134 
135     /**
136      * Validates searchData values in the incoming map.  Called by the UI during rule creation.
137      *
138      * This method is responsible for validating and setting the data entered on the form from the UI of the routing report to the Rule's attribute.
139      * The values will be in a Map with the key being the key of the RuleExtensionValue and the value being the value of the data entered from the
140      * UI.
141      *
142      * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
143      * @param paramMap Map containing the names and values of the routing data for this Attribute
144      * @return ValidationResults. Will not return null.
145      * @throws RiceIllegalArgumentException if the attributeName is null or blank
146      * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
147      */
148     @WebMethod(operationName = "validateSearchData")
149     @WebResult(name = "validationResults")
150     @XmlElement(name = "validationResults", required = false)
151     ValidationResults validateSearchData(@WebParam(name="attributeName")
152                              String attributeName,
153                              @WebParam(name = "parmMap")
154                              @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
155                              Map<String, String> paramMap)
156         throws RiceIllegalArgumentException;
157 
158     /**
159      * Validates ruleExtension values in the incoming map.  Called by the UI during rule creation.
160      *
161      * This method is responsible for validating and setting the data entered on the form from the UI of the rule creation to the Rule's attribute.
162      * The values will be in a Map with the key being the key of the RuleExtensionValue and the value being the value of the data entered from the UI.
163      * This method is used for rule creation which may have different fields than the routing report data.
164      *
165      * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
166      * @param paramMap Map containing the names and values of the routing data for this Attribute
167      * @return ValidationResults. Will not return null.
168      * @throws RiceIllegalArgumentException if the attributeName is null or blank
169      * @throws RiceIllegalArgumentException if the WorkflowRuleAttribute is not found
170      */
171     @WebMethod(operationName = "validateRuleData")
172     @WebResult(name = "validationResults")
173     @XmlElement(name = "validationResults", required = false)
174     ValidationResults validateRuleData(@WebParam(name="attributeName")
175                              String attributeName,
176                              @WebParam(name = "parmMap")
177                              @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
178                              Map<String, String> paramMap)
179         throws RiceIllegalArgumentException;
180 
181 
182     /**
183      * Gets a List of {@link RoleName} based on the passed role attribute name.  This
184      * method loads loads up a RoleAttribute and determines the RoleNames for a RuleExtension
185      *
186      * @param attributeName name of the WorkflowRuleAttribute.  cannot be null or blank.
187      * @return an immutable list of RoleName. Will not return null.
188      * @throws RiceIllegalArgumentException if the attributeName is null or blank
189      * @throws RiceIllegalArgumentException if the RoleAttribute is not found
190      */
191     @WebMethod(operationName = "getRoleNames")
192     @XmlElementWrapper(name = "roleNames", required = true)
193     @XmlElement(name = "roleName", required = false)
194     @WebResult(name = "roleNames")
195     List<RoleName> getRoleNames(@WebParam(name="attributeName") String attributeName)
196         throws RiceIllegalArgumentException;
197 }