org.apache.jetspeed.services.transformer
Interface TransformerService

All Superinterfaces:
org.apache.turbine.services.Initable, org.apache.turbine.services.Service
All Known Implementing Classes:
JetspeedTransformerService

public interface TransformerService
extends org.apache.turbine.services.Service

This service is responsible for locate and transform HTML content

Version:
$Id: TransformerService.java,v 1.2 2004/02/23 03:39:10 jford Exp $
Author:
Marco Mari

Field Summary
static java.lang.String SERVICE_NAME
          The name of this service
 
Method Summary
 java.lang.String clipElements(java.io.Reader htmlReader, java.lang.String url, java.lang.String startElement, java.lang.String stopElement)
          Clips the part of a web page between startElement and stopElement
 java.lang.String clipElementsNumber(java.io.Reader htmlReader, java.lang.String url, java.lang.String startElement, java.lang.String stopElement, int tagNumber)
          Clips a part of a web page, starting from the "tagNumber" "startElement" Example: startElement = "p", tagNumber = "3", stopElement = "img" Page content:
 java.lang.String findElement(java.io.Reader htmlReader, java.lang.String url, java.lang.String element)
          Finds an element in a web page
 java.lang.String findElementNumber(java.io.Reader htmlReader, java.lang.String url, java.lang.String element, int tagNumber)
          Finds in an HTML page the "tagNumber" tag of type "element" Example: element = "p", tagNumber = "3" Page content:
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
The name of this service

See Also:
Constant Field Values
Method Detail

findElement

public java.lang.String findElement(java.io.Reader htmlReader,
                                    java.lang.String url,
                                    java.lang.String element)
Finds an element in a web page

Parameters:
htmlReader - Reader for the html rewriter
url - page address
element - the element to search

clipElements

public java.lang.String clipElements(java.io.Reader htmlReader,
                                     java.lang.String url,
                                     java.lang.String startElement,
                                     java.lang.String stopElement)
Clips the part of a web page between startElement and stopElement

Parameters:
htmlReader - Reader for the html rewriter
url - page address
startElement - the first element to clip
stopElement - the last element to clip

findElementNumber

public java.lang.String findElementNumber(java.io.Reader htmlReader,
                                          java.lang.String url,
                                          java.lang.String element,
                                          int tagNumber)
Finds in an HTML page the "tagNumber" tag of type "element" Example: element = "p", tagNumber = "3" Page content:

..

..

.. <---Finds this

Parameters:
htmlReader - Reader for the html rewriter
url - page address
element - the element to search
tagNumber - the number of the element to search

clipElementsNumber

public java.lang.String clipElementsNumber(java.io.Reader htmlReader,
                                           java.lang.String url,
                                           java.lang.String startElement,
                                           java.lang.String stopElement,
                                           int tagNumber)
Clips a part of a web page, starting from the "tagNumber" "startElement" Example: startElement = "p", tagNumber = "3", stopElement = "img" Page content:

..

..

.. <---Starts here ........ <---Stops here

Parameters:
htmlReader - Reader for the html rewriter
url - page address
startElement - the first element to clip
stopElement - the last element to clip
tagNumber - the number of the first element to clip


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.