| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| StyleRepositoryService |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 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.core.api.style; | |
| 17 | ||
| 18 | import java.util.List; | |
| 19 | ||
| 20 | import javax.jws.WebMethod; | |
| 21 | import javax.jws.WebParam; | |
| 22 | import javax.jws.WebResult; | |
| 23 | import javax.jws.WebService; | |
| 24 | import javax.jws.soap.SOAPBinding; | |
| 25 | import javax.xml.bind.annotation.XmlElement; | |
| 26 | import javax.xml.bind.annotation.XmlElementWrapper; | |
| 27 | ||
| 28 | import org.kuali.rice.core.api.CoreConstants; | |
| 29 | import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; | |
| 30 | ||
| 31 | /** | |
| 32 | * Service for interacting with {@link Style} data. This service primarily | |
| 33 | * consists of pure data-access operations on a repository of styles which are | |
| 34 | * accessible based on their name or id which are both unique. | |
| 35 | * | |
| 36 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 37 | */ | |
| 38 | @WebService(name = "styleRepositoryService", targetNamespace = CoreConstants.Namespaces.CORE_NAMESPACE_2_0) | |
| 39 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
| 40 | public interface StyleRepositoryService { | |
| 41 | ||
| 42 | /** | |
| 43 | * Returns the style with the given name. If no style with the given name | |
| 44 | * can be found, this method will return null. | |
| 45 | * | |
| 46 | * @param styleName the name of the style to retrieve, must not be null or | |
| 47 | * blank | |
| 48 | * | |
| 49 | * @return the style with the given name, or null if no style with the given | |
| 50 | * name could be found | |
| 51 | * | |
| 52 | * @throws IllegalArgumentException if the given styleName is null or blank | |
| 53 | */ | |
| 54 | @WebMethod(operationName = "getStyle") | |
| 55 | @WebResult(name = "style") | |
| 56 | Style getStyle(@WebParam(name = "styleName") String styleName) throws RiceIllegalArgumentException; | |
| 57 | ||
| 58 | /** | |
| 59 | * Creates or updates the Style represented by the given record. If the | |
| 60 | * styleId on the style is not null, then it will update the existing | |
| 61 | * style record which has that id. Otherwise it will create a new style in | |
| 62 | * the repository. | |
| 63 | * | |
| 64 | * <p>When updating an existing style, the caller needs to ensure that the | |
| 65 | * styleId, versionNumber, and objectId values are set on the given Style | |
| 66 | * object. | |
| 67 | * | |
| 68 | * @param style the style data to create or update in the repository | |
| 69 | * | |
| 70 | * @return the style with the given name, or null if no style with the given | |
| 71 | * name could be found | |
| 72 | * | |
| 73 | * @throws IllegalArgumentException if the given style is null | |
| 74 | */ | |
| 75 | @WebMethod(operationName = "saveStyle") | |
| 76 | void saveStyle(@WebParam(name = "style") Style style) throws RiceIllegalArgumentException; | |
| 77 | ||
| 78 | /** | |
| 79 | * Returns a list of the names for all active styles in the repository. If | |
| 80 | * there are no active styles, this list will be empty. It will never | |
| 81 | * return null. | |
| 82 | * | |
| 83 | * @return the list of names for all active styles | |
| 84 | */ | |
| 85 | @WebMethod(operationName="getStyleNames") | |
| 86 | @XmlElementWrapper(name = "names", required = true) | |
| 87 | @XmlElement(name = "name", required = false) | |
| 88 | @WebResult(name = "styleNames") | |
| 89 | List<String> getAllStyleNames(); | |
| 90 | ||
| 91 | } |