| Method from org.apache.cocoon.webapps.session.transformation.SessionPreTransformer Detail: |
public void endElement(String uri,
String name,
String raw) throws SAXException {
super.endElement(uri, name, raw);
if (namespaceURI.equals(uri)
&& this.processingGetXML > 0
&& name.equals(GETXML_ELEMENT)) {
this.processingGetXML--;
this.ignoreEventsCount--;
this.ignoreHooksCount--;
}
} Deprecated!Process the SAX event.
The namespace of the event is checked. If it is the defined namespace
for this transformer the endTransformingElement() hook is called. |
public void endTransformingElement(String uri,
String name,
String raw) throws IOException, SAXException, ProcessingException {
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("BEGIN endTransformingElement uri=" + uri + ", name=" + name + ", raw=" + raw);
}
if (name.equals(CREATECONTEXT_ELEMENT) == true) {
// do nothing, the context was created on the startElement event
} else if (name.equals(GETXML_ELEMENT) == true) {
// do nothing
// Element: loadxml
} else if (name.equals(LOADCONTEXT_ELEMENT) == true) {
String path = (String)stack.pop();
String contextName = (String)stack.pop();
SourceParameters pars = this.endParametersRecording((SourceParameters)null);
pars.setSingleParameterValue("contextname", contextName);
pars.setSingleParameterValue("path", path);
this.getContextManager().getContext(contextName).loadXML(path,
pars);
// Element context url
} else if (name.equals(SessionPreTransformer.CONTEXT_URL_ELEMENT) == true) {
this.ignoreEventsCount--;
String contextUrl = this.request.getScheme() + "://" +
this.request.getServerName() + ":" +
this.request.getServerPort() +
this.request.getContextPath();
this.sendTextEvent(contextUrl);
// DEFAULT
} else {
super.endTransformingElement(uri, name, raw);
}
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("END endTransformingElement");
}
} Deprecated! |
public void setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par) throws IOException, SAXException, ProcessingException {
super.setup(resolver, objectModel, src, par);
this.processingGetXML = 0;
} Deprecated!Setup the next round.
The instance variables are initialised. |
public void startElement(String uri,
String name,
String raw,
Attributes attr) throws SAXException {
if (namespaceURI.equals(uri)
&& this.processingGetXML > 0
&& name.equals(GETXML_ELEMENT)) {
this.processingGetXML++;
this.ignoreEventsCount++;
this.ignoreHooksCount++;
}
super.startElement(uri, name, raw, attr);
} Deprecated!Process the SAX event.
The namespace of the event is checked. If it is the defined namespace
for this transformer the endTransformingElement() hook is called. |
public void startTransformingElement(String uri,
String name,
String raw,
Attributes attr) throws IOException, SAXException, ProcessingException {
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("BEGIN startTransformingElement uri=" + uri +
", name=" + name +
", raw=" + raw +
", attr=" + attr);
}
if (name.equals(CREATECONTEXT_ELEMENT) == true) {
this.getContextManager().createContext(attr.getValue(CREATECONTEXT_NAME_ATTRIBUTE),
attr.getValue(CREATECONTEXT_LOAD_ATTRIBUTE),
attr.getValue(CREATECONTEXT_SAVE_ATTRIBUTE));
} else if (name.equals(GETXML_ELEMENT) == true) {
final String path = attr.getValue(GETXML_PATH_ATTRIBUTE);
final String contextName = attr.getValue(GETXML_CONTEXT_ATTRIBUTE);
if (this.getSessionManager().streamContextFragment(contextName,
path,
this) == true) {
this.ignoreEventsCount++;
this.ignoreHooksCount++;
this.processingGetXML++;
}
} else if (name.equals(LOADCONTEXT_ELEMENT) == true) {
this.startParametersRecording();
stack.push(attr.getValue(LOADCONTEXT_CONTEXT_ATTRIBUTE));
if (attr.getValue(LOADCONTEXT_PATH_ATTRIBUTE) != null) {
stack.push(attr.getValue(LOADCONTEXT_PATH_ATTRIBUTE));
} else {
stack.push("/");
}
// Element context url
} else if (name.equals(SessionPreTransformer.CONTEXT_URL_ELEMENT) == true) {
this.ignoreEventsCount++;
// DEFAULT
} else {
super.startTransformingElement(uri, name, raw, attr);
}
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("END startTransformingElement");
}
} Deprecated!This is the real implementation of the startElement event for the transformer
The event is checked for a valid element and the corresponding command
is executed. |