1 17 18 package org.pentaho.core.util; 19 20 import java.io.InputStream ; 21 22 import javax.xml.transform.Source ; 23 import javax.xml.transform.URIResolver ; 24 import javax.xml.transform.stream.StreamSource ; 25 26 import org.pentaho.core.repository.ISolutionRepository; 27 import org.pentaho.core.session.IPentahoSession; 28 import org.pentaho.core.system.PentahoSystem; 29 30 public class SolutionURIResolver implements URIResolver { 31 32 IPentahoSession session = null; 33 34 public SolutionURIResolver(IPentahoSession session) { 35 super(); 36 this.session = session; 37 } 38 39 40 46 public Source resolve(String href, String base) { 47 48 ISolutionRepository repository = PentahoSystem.getSolutionRepository(session); 49 StreamSource xslSrc = null; 50 if (repository != null) { 51 InputStream xslIS = repository.getResourceInputStream(href); 52 xslSrc = new StreamSource (xslIS); 53 } 54 55 return xslSrc; 56 } 57 } 58 | Popular Tags |