package org.kuali.rice.krms.framework.type;

import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
import org.kuali.rice.core.api.uif.RemotableAttributeError;
import org.kuali.rice.core.api.uif.RemotableAttributeField;
import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.soap.SOAPBinding;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.List;
import java.util.Map;

/**
 * Interface to be extended by type services that have remotable attributes that will need to be rendered and
 * validated
 */
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public interface RemotableAttributeOwner {

    /**
     *
     * @return
     */
    @WebMethod(operationName="getAttributeFields")
    @WebResult(name = "attributeFields")
    public List<RemotableAttributeField> getAttributeFields();

    @WebMethod(operationName="validateAttributes")
    @XmlElementWrapper(name = "attributeErrors", required = true)
    @XmlElement(name = "attributeError", required = false)
    @WebResult(name = "attributeErrors")
    public List<RemotableAttributeError> validateAttributes(
            @WebParam(name = "attributes")
            @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
            Map<String, String> attributes
    )  throws RiceIllegalArgumentException;

    @WebMethod(operationName="validateAttributesAgainstExisting")
    @XmlElementWrapper(name = "attributeErrors", required = true)
    @XmlElement(name = "attributeError", required = false)
    @WebResult(name = "attributeErrors")
    public List<RemotableAttributeError> validateAttributesAgainstExisting(
            @WebParam(name = "newAttributes")
            @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
            Map<String, String> newAttributes,
            @WebParam(name = "oldAttributes")
            @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
            Map<String, String> oldAttributes
    ) throws RiceIllegalArgumentException;

}

@@ -944,23 +944,322 @@
    *
-%0A     * @return
+ %3Cp%3Eget the attributes supported by the people flow type with the given krmsTypeId.%3C/p%3E%0A     *%0A     * @param krmsTypeId the people flow type identifier.  Must not be null or blank.%0A     * @return the %7B@link RemotableAttributeField%7Ds that the PeopleFlow type with the given id supports.%0A     * Will not return null.
 %0A   
@@ -1351,39 +1351,32 @@
 uteFields%22)%0A    
-public 
 List%3CRemotableAt
@@ -1412,11 +1412,511 @@
 lds(
-);%0A
+ @WebParam(name = %22krmsTypeId%22) String krmsTypeId );%0A%0A    /**%0A     * %3Cp%3EThis method validates the passed in attributes for a krmsTypeId generating a List of%0A     * %7B@link RemotableAttributeError%7Ds.%3C/p%3E%0A     *%0A     * @param krmsTypeId the people flow type identifier.  Must not be null or blank.%0A     * @param attributes the attributes to validate. Cannot be null.%0A     * @return any errors that are discovered during validation.  Will not return null.%0A     * @throws RiceIllegalArgumentException%0A     */
 %0A   
@@ -2125,39 +2125,32 @@
 uteErrors%22)%0A    
-public 
 List%3CRemotableAt
@@ -2183,16 +2183,80 @@
 ibutes(%0A
+%0A            @WebParam(name = %22krmsTypeId%22) String krmsTypeId,%0A%0A
         
@@ -2399,24 +2399,25 @@
  attributes%0A
+%0A
     )  throw
@@ -2449,16 +2449,691 @@
 ption;%0A%0A
+    /**%0A     * %3Cp%3EThis method validates the passed in attributes for a krmsTypeId generating a List of%0A     * %7B@link RemotableAttributeError%7Ds.  This method used the oldAttributes to aid in validation.  This is useful for%0A     * validating %22new%22 or %22updated%22 attributes.%3C/p%3E%0A     *%0A     * @param krmsTypeId the people flow type identifier.  Must not be null or blank.%0A     * @param newAttributes the kim type attributes to validate. Cannot be null.%0A     * @param oldAttributes the old attributes to use for validation. Cannot be null.%0A     * @return any errors that are discovered during validation.  Will not return null.%0A     * @throws RiceIllegalArgumentException%0A     */%0A
     @Web
@@ -3360,23 +3360,16 @@
 s%22)%0A    
-public 
 List%3CRem
@@ -3425,16 +3425,80 @@
 isting(%0A
+%0A            @WebParam(name = %22krmsTypeId%22) String krmsTypeId,%0A%0A
         
@@ -3652,16 +3652,17 @@
 ibutes,%0A
+%0A
         
@@ -3815,16 +3815,17 @@
 ributes%0A
+%0A
     ) th

Create PeopleFlowActionTypeService