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.coreservice.api.style;
17
18 import java.util.List;
19
20 import javax.xml.transform.Templates;
21 import javax.xml.transform.TransformerConfigurationException;
22
23 import org.springframework.cache.annotation.CacheEvict;
24 import org.springframework.cache.annotation.Cacheable;
25
26 /**
27 * Service for working with stylesheets. This service provides pure data-oriented
28 * operations as well as operations dealing with pre-compiled stylesheets. It's
29 * intended that most clients will interact with this service in lieu of the
30 * lower-level {@link StyleRepositoryService}.
31 *
32 * @see Style
33 * @see StyleRepositoryService
34 *
35 * @author Kuali Rice Team (rice.collab@kuali.org)
36 *
37 */
38 public interface StyleService {
39
40 /**
41 * @see StyleRepositoryService#getStyle(String)
42 */
43 public Style getStyle(String styleName);
44
45 /**
46 * @see StyleRepositoryService#getAllStyleNames()
47 */
48 public List<String> getAllStyleNames();
49
50 /**
51 * @see StyleRepositoryService#saveStyle(Style)
52 */
53 @CacheEvict(value={Style.Cache.NAME}, allEntries = true)
54 public void saveStyle(Style data);
55
56 /**
57 * Gets a compiled version of the style with the given name.
58 *
59 * @param styleName the name of the style for which to retrieve a compiled version
60 *
61 * @return a compiled version of the stylesheet as a {@link Templates} instance
62 *
63 * @throws TransformerConfigurationException if compilation of the stylesheet fails
64 * @throws IllegalArgumentException if the given styleName is null or blank
65 */
66 @Cacheable(value= Style.Cache.NAME, key="'styleName=' + #p0")
67 public Templates getStyleAsTranslet(String styleName) throws TransformerConfigurationException;
68
69
70 }