01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.transformation;
18:
19: import javax.xml.transform.Source;
20: import javax.xml.transform.URIResolver;
21: import javax.xml.transform.sax.SAXSource;
22:
23: import org.apache.log4j.Logger;
24: import org.xml.sax.InputSource;
25:
26: public class WidgetURITestResolver implements URIResolver {
27:
28: private static final Logger LOG = Logger
29: .getLogger(WidgetURITestResolver.class);
30:
31: public Source resolve(String href, String base) {
32:
33: try {
34: //EDocLiteService eDocSvc=SpringServiceLocator.getEDocLiteService();
35: //EDocLiteStyle widgetStyle = eDocSvc.getEDocLiteStyle(href);
36: //LOG.debug("Widgets: \n" + widgetStyle.getXmlContent());
37: //return new StreamSource(new StringReader(widgetStyle.getXmlContent()));
38: return new SAXSource(
39: new InputSource(
40: WidgetURITestResolver.class
41: .getResourceAsStream("widgets_pipeTest.xml")));
42:
43: } catch (Exception e) {
44: LOG.error("Error ocurred getting style " + href, e);
45: //e.printStackTrace();
46: }
47: return null;
48: }
49:
50: }
|