View Javadoc

1   /*
2    * Copyright 2005-2008 The Kuali Foundation
3    * 
4    * 
5    * Licensed under the Educational Community License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    * 
9    * http://www.opensource.org/licenses/ecl2.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 org.kuali.rice.kew.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.getLogger(WidgetURITestResolver.class);
29  	
30  	public Source resolve(String href, String base) {
31  		   
32  	    try {
33  		    	//EDocLiteService eDocSvc=SpringServiceLocator.getEDocLiteService();
34  		    	//EDocLiteStyle widgetStyle = eDocSvc.getEDocLiteStyle(href);
35  		    	//LOG.debug("Widgets: \n" + widgetStyle.getXmlContent());
36  		    	//return new StreamSource(new StringReader(widgetStyle.getXmlContent()));
37  	    		return new SAXSource(new InputSource(WidgetURITestResolver.class.getResourceAsStream("widgets_pipeTest.xml")));
38  	    		
39  	    }
40  	    catch (Exception e) {
41  	    	LOG.error("Error ocurred getting style " + href, e);
42  	      //e.printStackTrace();
43  	    }
44  	    return null;
45  	  }
46  
47  }