|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.AbstractSAXTransformer org.apache.cocoon.transformation.SourceWritingTransformer
public class SourceWritingTransformer
Field Summary | |
---|---|
static String |
ACTION_DELETE
|
static String |
ACTION_ELEMENT
|
static String |
ACTION_NEW
|
static String |
ACTION_NONE
|
static String |
ACTION_OVER
|
static String |
BEHAVIOUR_ELEMENT
|
protected String |
configuredSerializerName
The configured serializer name |
static String |
CREATE_ATTRIBUTE
|
static String |
DEFAULT_SERIALIZER
|
static String |
DELETE_ELEMENT
|
static String |
EXECUTION_ELEMENT
|
static String |
FRAGMENT_ELEMENT
|
static String |
INSERT_ELEMENT
|
static String |
MESSAGE_ELEMENT
|
static String |
OVERWRITE_ATTRIBUTE
|
static String |
PATH_ELEMENT
|
static String |
REINSERT_ELEMENT
|
static String |
REPLACE_ELEMENT
|
static String |
RESULT_ELEMENT
outgoing elements |
static String |
RESULT_FAILED
results |
static String |
RESULT_SUCCESS
|
static String |
SERIALIZER_ATTRIBUTE
main (write or insert) tag attributes |
static String |
SERIALIZER_ELEMENT
|
static String |
SOURCE_ELEMENT
|
static String |
SWT_URI
|
static String |
WRITE_ELEMENT
incoming elements |
protected XPathProcessor |
xpathProcessor
The XPath processor |
Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer |
---|
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, emptyAttributes, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
---|
ROLE |
Constructor Summary | |
---|---|
SourceWritingTransformer()
Constructor. |
Method Summary | |
---|---|
void |
configure(Configuration configuration)
Get the current Configuration instance used by this
Configurable . |
void |
dispose()
|
void |
endTransformingElement(String uri,
String name,
String raw)
Receive notification of the end of an element. |
protected void |
insertFragment(String systemID,
String path,
DocumentFragment fragment,
String replacePath,
boolean create,
boolean overwrite,
String reinsertPath,
String localSerializer,
String tagname)
Insert a fragment into a file. |
void |
service(ServiceManager manager)
|
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Get the Parameter called "serializer" from the
Transformer invocation. |
void |
startTransformingElement(String uri,
String name,
String raw,
Attributes attr)
Receive notification of the beginning of an element. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
public static final String SWT_URI
public static final String DEFAULT_SERIALIZER
public static final String WRITE_ELEMENT
public static final String INSERT_ELEMENT
public static final String PATH_ELEMENT
public static final String FRAGMENT_ELEMENT
public static final String REPLACE_ELEMENT
public static final String DELETE_ELEMENT
public static final String SOURCE_ELEMENT
public static final String REINSERT_ELEMENT
public static final String RESULT_ELEMENT
public static final String EXECUTION_ELEMENT
public static final String BEHAVIOUR_ELEMENT
public static final String ACTION_ELEMENT
public static final String MESSAGE_ELEMENT
public static final String SERIALIZER_ELEMENT
public static final String SERIALIZER_ATTRIBUTE
public static final String CREATE_ATTRIBUTE
public static final String OVERWRITE_ATTRIBUTE
public static final String RESULT_FAILED
public static final String RESULT_SUCCESS
public static final String ACTION_NONE
public static final String ACTION_NEW
public static final String ACTION_OVER
public static final String ACTION_DELETE
protected String configuredSerializerName
protected XPathProcessor xpathProcessor
Constructor Detail |
---|
public SourceWritingTransformer()
Method Detail |
---|
public void configure(Configuration configuration) throws ConfigurationException
Configuration
instance used by this
Configurable
.
configure
in interface Configurable
configure
in class AbstractSAXTransformer
ConfigurationException
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
Parameter
called "serializer" from the
Transformer
invocation.
setup
in interface SitemapModelComponent
setup
in class AbstractSAXTransformer
ProcessingException
SAXException
IOException
public void startTransformingElement(String uri, String name, String raw, Attributes attr) throws SAXException, IOException, ProcessingException
startTransformingElement
in class AbstractSAXTransformer
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attr
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
SAXException
IOException
ProcessingException
public void endTransformingElement(String uri, String name, String raw) throws SAXException, IOException, ProcessingException
endTransformingElement
in class AbstractSAXTransformer
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
SAXException
IOException
ProcessingException
protected void insertFragment(String systemID, String path, DocumentFragment fragment, String replacePath, boolean create, boolean overwrite, String reinsertPath, String localSerializer, String tagname) throws SAXException, IOException, ProcessingException
systemID
- The name of the xml file.path
- The XPath specifying the node under which the data is insertedfragment
- The data to be inserted.replacePath
- Optional XPath relative to path
. This path
can specify a node which will be removed if it exists.
So insertFragment can be used as a replace utility.create
- If the file does not exists and this is set to
false
nothing is inserted. If it is set
to true
the file is created and the data
is inserted.overwrite
- If this is set to true
the data is only
inserted if the node specified by the replacePath
does not exists.reinsertPath
- If specified and a node is replaced , all children of
this replaced node will be reinserted at the given path.localSerializer
- The serializer used to serialize the XMLtagname
- The name of the tag that triggered me 'insert' or 'write'
SAXException
IOException
ProcessingException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractSAXTransformer
ServiceException
public void dispose()
dispose
in interface Disposable
dispose
in class AbstractSAXTransformer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |