Author: thorsten
Date: Mon Dec 12 13:54:26 2005
New Revision: 356388
URL: http://svn.apache.org/viewcvs?rev=356388&view=rev
Log:
Updated the transformer to reflect current changes in the contract bean
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
Modified:
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
URL:
http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java?rev=356388&r1=356387&r2=356388&view=diff
==============================================================================
---
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
(original)
+++
forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.structurer/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
Mon Dec 12 13:54:26 2005
@@ -42,7 +42,7 @@
import org.apache.excalibur.source.SourceValidity;
import org.apache.excalibur.xml.xpath.XPathProcessor;
import org.apache.forrest.dispatcher.ContractBean;
-import org.apache.forrest.dispatcher.ContractBeanInterface;
+import org.apache.forrest.dispatcher.ContractBeanDOMImpl;
import org.apache.forrest.dispatcher.DispatcherException;
import org.apache.forrest.dispatcher.DispatcherHelper;
import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
@@ -137,7 +137,7 @@
protected String currentFormat;
- protected ContractBeanInterface contract;
+ protected ContractBean contract;
/**
* The namespace used by the transformer for the SAX events filtering. This
@@ -345,10 +345,10 @@
structurerProcessingStart(attr);
else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
hookProcessingStart(name, raw, attr);
- else if (ContractBeanInterface.CONTRACT_ELEMENT.equals(name)
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name)
& this.includeNodes)
contractProcessingStart(attr);
- else if (ContractBeanInterface.PROPERTY_ELEMENT.equals(name)
+ else if (ContractBean.PROPERTY_ELEMENT.equals(name)
& this.includeNodes) {
this.insideProperties = true;
propertyProcessingStart(uri, name, raw, attr);
@@ -441,7 +441,7 @@
} else if (DispatcherHelper.DISPATCHER_NAMESPACE_URI.equals(uri)) {
if (STRUCTURER_ELEMENT.equals(name))
structurerProcessingEnd(raw);
- else if (ContractBeanInterface.CONTRACT_ELEMENT.equals(name)
+ else if (ContractBean.CONTRACT_ELEMENT.equals(name)
& this.includeNodes)
contractProcessingEnd();
else if (DISPATCHER_HOOK_ELEMENT.equals(name) & this.includeNodes)
@@ -575,7 +575,7 @@
private void contractProcessingStart(Attributes attr) throws SAXException {
try {
if (contract == null)
- contract = new ContractBean(this.manager,parameterHelper);
+ contract = new
ContractBeanDOMImpl(this.manager,parameterHelper);
else
contract.initialize();
} catch (ParserConfigurationException e) {
@@ -589,10 +589,10 @@
for (int i = 0; i < attr.getLength(); i++) {
String localName = attr.getLocalName(i);
String value = attr.getValue(i);
- if (ContractBeanInterface.CONTRACT_ID_ATTRIBUTE.equals(localName))
{
+ if (ContractBean.CONTRACT_ID_ATTRIBUTE.equals(localName)) {
// getting the contract name
contract.setContractName(value);
- String contractUri =
ContractBeanInterface.CONTRACT_RESOLVE_PREFIX + "."
+ String contractUri = ContractBean.CONTRACT_RESOLVE_PREFIX + "."
+ currentFormat + "." + value;
try {
Document doc =
org.apache.forrest.dispatcher.util.SourceUtil
@@ -617,7 +617,7 @@
+ localName + "\n" + "value" + "-->"
+ value);
}
- } else if
(ContractBeanInterface.CONTRACT_NUGGET_ATTRIBUTE.equals(localName)) {
+ } else if
(ContractBean.CONTRACT_NUGGET_ATTRIBUTE.equals(localName)) {
// contract is a nugget-contract
contract.setNugget(true);
try {
@@ -784,14 +784,14 @@
for (int i = 0; i < attr.getLength(); i++) {
String localName = attr.getLocalName(i);
String value = attr.getValue(i);
- if (ContractBeanInterface.PROPERTY_ID_ATTRIBUTE.equals(localName))
+ if (ContractBean.PROPERTY_ID_ATTRIBUTE.equals(localName))
this.propertyID = value;
}
if (this.propertyID.equals("") | this.propertyID == null) {
String error = "dispatcherError: " + DispatcherException.ERROR_500
+ "\n" + "The contract \"" + contract.getContractName()
+ "\" has no identifier attribute \""
- + ContractBeanInterface.PROPERTY_ID_ATTRIBUTE + "\" in the
" + raw;
+ + ContractBean.PROPERTY_ID_ATTRIBUTE + "\" in the " + raw;
getLogger().error(error);
throw new SAXException(error);
}
@@ -809,7 +809,7 @@
*/
private void propertyProcessingEnd(String uri, String name, String raw)
throws SAXException {
- if (ContractBeanInterface.PROPERTY_ELEMENT.equals(name)) {
+ if (ContractBean.PROPERTY_ELEMENT.equals(name)) {
this.insideProperties = false;
if (this.includeNodes) {
this.builder.endElement(uri, name, raw);