| Method from org.apache.cocoon.sunshine.context.ResponseSessionContext Detail: |
public void appendXML(String path,
DocumentFragment fragment) throws ProcessingException {
if (this.response == null) {
throw new ProcessingException("Response Object missing");
}
if (path != null) {
if (path.startsWith("/header/") == true) {
String name = path.substring(8);
this.response.addHeader(name, XMLUtil.createText(fragment));
} else if (path.equals("/cookie") == true) {
this.response.addCookie(this.createCookie(XMLUtil.createParameters(fragment, null)));
} else {
throw new ProcessingException("Invalid response path '"+path+"'");
}
}
}
Append a document fragment at the given path. The implementation of this
method is context specific. |
public Object getAttribute(String key) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of attributes not allowed");
}
|
public Object getAttribute(String key,
Object defaultObject) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of attributes not allowed");
}
|
public String getName() {
return this.name;
}
Get the name of the context |
public NodeList getNodeList(String path) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of xml not allowed");
}
Get a copy all the nodes specified by the path. |
public Node getSingleNode(String path) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of xml not allowed");
}
Get a copy the first node specified by the path. |
public String getValueOfNode(String path) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of xml not allowed");
}
Get the value of this node. This is similiar to the xsl:value-of
function. If the node does not exist, null is returned. |
public DocumentFragment getXML(String path) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of xml not allowed.");
}
Get the XML from the response object |
public void loadXML(String path,
SourceParameters parameters,
Map objectModel,
SourceResolver resolver,
ComponentManager manager) throws IOException, SAXException, ProcessingException {
throw new ProcessingException("The context " + this.name + " does not support loading.");
}
Try to load XML into the context.
If the context does not provide the ability of loading,
an exception is thrown. |
public void removeXML(String path) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Removing of xml not allowed");
}
|
public void saveXML(String path,
SourceParameters parameters,
Map objectModel,
SourceResolver resolver,
ComponentManager manager) throws IOException, SAXException, ProcessingException {
throw new ProcessingException("The context " + this.name + " does not support saving.");
}
Try to save XML from the context.
If the context does not provide the ability of saving,
an exception is thrown. |
public void setAttribute(String key,
Object value) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Setting of attributes not allowed");
}
|
public void setNode(String path,
Node node) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Setting of XML not allowed");
}
Set the value of a node. The node is copied before insertion. |
public void setValueOfNode(String path,
String value) throws ProcessingException {
throw new ProcessingException("ResponseSessionContext: Setting of xml not allowed");
}
Set the value of this node. |
public void setXML(String path,
DocumentFragment fragment) throws ProcessingException {
if (this.response == null) {
throw new ProcessingException("Response Object missing");
}
if (path != null) {
if (path.startsWith("/header/") == true) {
String name = path.substring(8);
this.response.setHeader(name, XMLUtil.createText(fragment));
} else if (path.equals("/cookie") == true) {
this.response.addCookie(this.createCookie(XMLUtil.createParameters(fragment, null)));
} else {
throw new ProcessingException("Invalid response path '"+path+"'");
}
}
}
|
public void setup(Map objectModel) {
this.response = ObjectModelHelper.getResponse(objectModel);
}
|
public void setup(String value,
Resource load,
Resource save) {
name = value;
}
|
public boolean streamXML(String path,
ContentHandler contentHandler,
LexicalHandler lexicalHandler) throws SAXException, ProcessingException {
throw new ProcessingException("ResponseSessionContext: Getting of xml not allowed");
}
Stream the XML directly to the handler. This streams the contents of getXML()
to the given handler without creating a DocumentFragment containing a copy
of the data |