org.carrot2.source.xml
Class XmlDocumentSourceHelper

java.lang.Object
  extended by org.carrot2.source.xml.XmlDocumentSourceHelper

public class XmlDocumentSourceHelper
extends Object

Exposes the common functionality a IDocumentSource based on XML/XSLT is likely to need. This helper does note expose any attributes, so that different implementations can decide which attributes they expose.


Field Summary
 int timeout
          Data transfer timeout.
 
Constructor Summary
XmlDocumentSourceHelper()
           
 
Method Summary
 ProcessingResult loadProcessingResult(InputStream xml, Templates stylesheet, Map<String,String> xsltParameters)
          Loads a ProcessingResult from the provided InputStream, applying XSLT transform if specified.
 ProcessingResult loadProcessingResult(String url, Templates stylesheet, Map<String,String> xsltParameters, Map<String,Object> metadata, String user, String password)
          Loads a ProcessingResult from the provided remote URL, applying XSLT transform if specified.
 Templates loadXslt(IResource xslt)
          Loads the XSLT stylesheet from the provided IResource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeout

public int timeout
Data transfer timeout. Specifies the data transfer timeout, in seconds. A timeout value of zero is interpreted as an infinite timeout.

Attribute label:
Data transfer timeout
Attribute level:
Advanced
Attribute group:
Service
Constructor Detail

XmlDocumentSourceHelper

public XmlDocumentSourceHelper()
Method Detail

loadProcessingResult

public ProcessingResult loadProcessingResult(String url,
                                             Templates stylesheet,
                                             Map<String,String> xsltParameters,
                                             Map<String,Object> metadata,
                                             String user,
                                             String password)
                                      throws Exception
Loads a ProcessingResult from the provided remote URL, applying XSLT transform if specified. This method can handle gzip-compressed streams if supported by the data source.

Parameters:
metadata - if a non-null map is provided, request metadata will be put into the map.
user - if not null, the user name to use for HTTP Basic Authentication
password - if not null, the password to use for HTTP Basic Authentication
Throws:
Exception

loadProcessingResult

public ProcessingResult loadProcessingResult(InputStream xml,
                                             Templates stylesheet,
                                             Map<String,String> xsltParameters)
                                      throws Exception
Loads a ProcessingResult from the provided InputStream, applying XSLT transform if specified. The provided InputStream will be closed.

Throws:
Exception

loadXslt

public Templates loadXslt(IResource xslt)
Loads the XSLT stylesheet from the provided IResource.



Copyright (c) Dawid Weiss, Stanislaw Osinski