001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kew.api.doctype;
017
018import javax.jws.WebMethod;
019import javax.jws.WebParam;
020import javax.jws.WebResult;
021import javax.jws.WebService;
022import javax.jws.soap.SOAPBinding;
023import javax.xml.bind.annotation.XmlElement;
024
025import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
026import org.kuali.rice.kew.api.KewApiConstants;
027import org.kuali.rice.kew.api.document.node.RouteNodeInstance;
028import org.kuali.rice.kew.api.rule.Rule;
029import org.springframework.cache.annotation.Cacheable;
030
031import java.util.List;
032
033/**
034 * TODO ...
035 * 
036 * @author Kuali Rice Team (rice.collab@kuali.org)
037 */
038@WebService(name = "documentTypeService", targetNamespace = KewApiConstants.Namespaces.KEW_NAMESPACE_2_0)
039@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
040public interface DocumentTypeService {
041
042    @WebMethod(operationName = "getIdByName")
043    @WebResult(name = "documentTypeId")
044    @XmlElement(name = "documentTypeId", required = false)
045    String getIdByName(@WebParam(name = "documentTypeName") String documentTypeName)
046            throws RiceIllegalArgumentException;
047
048    @WebMethod(operationName = "getNameById")
049    @WebResult(name = "documentTypeName")
050    @XmlElement(name = "documentTypeName", required = false)
051    String getNameById(@WebParam(name = "documentTypeId") String documentTypeId)
052            throws RiceIllegalArgumentException;
053
054    @WebMethod(operationName = "getDocumentTypeById")
055    @WebResult(name = "documentType")
056    @XmlElement(name = "documentType", required = false)
057    @Cacheable(value= DocumentType.Cache.NAME, key="'documentTypeId=' + #p0")
058    DocumentType getDocumentTypeById(@WebParam(name = "documentTypeId") String documentTypeId)
059            throws RiceIllegalArgumentException;
060
061    @WebMethod(operationName = "getDocumentTypeByName")
062    @WebResult(name = "documentType")
063    @XmlElement(name = "documentType", required = false)
064    @Cacheable(value= DocumentType.Cache.NAME, key="'documentTypeName=' + #p0")
065    DocumentType getDocumentTypeByName(@WebParam(name = "documentTypeName") String documentTypeName)
066            throws RiceIllegalArgumentException;
067
068    @WebMethod(operationName = "findAllDocumentTypes")
069    @WebResult(name = "documentTypes")
070    @XmlElement(name = "documentTypes", required = false)
071    @Cacheable(value= DocumentType.Cache.NAME, key="'all'")
072    List<DocumentType> findAllDocumentTypes();
073
074    @WebMethod(operationName = "isSuperUserForDocumentTypeId")
075    @WebResult(name = "isSuperUser")
076    @XmlElement(name = "isSuperUser", required = true)
077    boolean isSuperUserForDocumentTypeId(
078            @WebParam(name = "principalId") String principalId,
079            @WebParam(name = "documentTypeId") String documentTypeId)
080            throws RiceIllegalArgumentException;
081
082    @WebMethod(operationName = "isSuperUserForDocumentTypeName")
083    @WebResult(name = "isSuperUser")
084    @XmlElement(name = "isSuperUser", required = true)
085    boolean isSuperUserForDocumentTypeName(
086            @WebParam(name = "principalId") String principalId,
087            @WebParam(name = "documentTypeName") String documentTypeName)
088            throws RiceIllegalArgumentException;
089    
090    @WebMethod(operationName = "canSuperUserApproveSingleActionRequest")
091    @WebResult(name = "isSuperUser")
092    @XmlElement(name = "isSuperUser", required = true)
093    boolean canSuperUserApproveSingleActionRequest(
094            @WebParam(name = "principalId") String principalId,
095            @WebParam(name = "documentTypeName") String documentTypeName,
096            @WebParam(name = "routeNodeInstances") List<RouteNodeInstance> routeNodeInstances,
097            @WebParam(name = "routeStatusCode") String routeStatusCode)
098            throws RiceIllegalArgumentException;
099
100    @WebMethod(operationName = "canSuperUserApproveDocument")
101    @WebResult(name = "isSuperUser")
102    @XmlElement(name = "isSuperUser", required = true)
103    boolean canSuperUserApproveDocument(
104            @WebParam(name = "principalId") String principalId,
105            @WebParam(name = "documentTypeName") String documentTypeName,
106            @WebParam(name = "routeNodeInstances") List<RouteNodeInstance> routeNodeInstances,
107            @WebParam(name = "routeStatusCode") String routeStatusCode)
108            throws RiceIllegalArgumentException;
109
110    @WebMethod(operationName = "canSuperUserDisapproveDocument")
111    @WebResult(name = "isSuperUser")
112    @XmlElement(name = "isSuperUser", required = true)
113    boolean canSuperUserDisapproveDocument(
114            @WebParam(name = "principalId") String principalId,
115            @WebParam(name = "documentTypeName") String documentTypeName,
116            @WebParam(name = "routeNodeInstances") List<RouteNodeInstance> routeNodeInstances,
117            @WebParam(name = "routeStatusCode") String routeStatusCode)
118            throws RiceIllegalArgumentException;
119
120    @WebMethod(operationName = "hasRouteNodeForDocumentTypeName")
121    @WebResult(name = "hasRouteNode")
122    @XmlElement(name = "hasRouteNode", required = true)
123    boolean hasRouteNodeForDocumentTypeName(
124            @WebParam(name = "routeNodeName") String routeNodeName,
125            @WebParam(name = "documentTypeName") String documentTypeName)
126            throws RiceIllegalArgumentException;
127
128    @WebMethod(operationName = "hasRouteNodeForDocumentTypeId")
129    @WebResult(name = "hasRouteNode")
130    @XmlElement(name = "hasRouteNode", required = true)
131    boolean hasRouteNodeForDocumentTypeId(
132            @WebParam(name = "routeNodeName") String routeNodeName,
133            @WebParam(name = "documentTypeId") String documentTypeId)
134            throws RiceIllegalArgumentException;
135
136    @WebMethod(operationName = "isActiveById")
137    @WebResult(name = "isActive")
138    @XmlElement(name = "isActive", required = true)
139    boolean isActiveById(@WebParam(name = "documentTypeId") String documentTypeId)
140            throws RiceIllegalArgumentException;
141
142    @WebMethod(operationName = "isActiveByName")
143    @WebResult(name = "isActive")
144    @XmlElement(name = "isActive", required = true)
145    boolean isActiveByName(@WebParam(name = "documentTypeName") String documentTypeName)
146            throws RiceIllegalArgumentException;
147
148    @WebMethod(operationName = "getRoutePathForDocumentTypeId")
149    @WebResult(name = "routePath")
150    @XmlElement(name = "routePath", required = false)
151    @Cacheable(value= RoutePath.Cache.NAME, key="'documentTypeId=' + #p0")
152    RoutePath getRoutePathForDocumentTypeId(@WebParam(name = "documentTypeId") String documentTypeId)
153            throws RiceIllegalArgumentException;
154    
155    @WebMethod(operationName = "getRoutePathForDocumentTypeName")
156    @WebResult(name = "routePath")
157    @XmlElement(name = "routePath", required = false)
158    @Cacheable(value= RoutePath.Cache.NAME, key="'documentTypeName=' + #p0")
159    RoutePath getRoutePathForDocumentTypeName(@WebParam(name = "documentTypeName") String documentTypeName)
160            throws RiceIllegalArgumentException;
161
162}