You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2006/01/09 00:27:27 UTC
svn commit: r367127 - in /cocoon:
blocks/forms/trunk/java/org/apache/cocoon/forms/binding/
blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/
blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/
blocks/forms/trunk/java/org/apache/cocoon/fo...
Author: antonio
Date: Sun Jan 8 15:26:58 2006
New Revision: 367127
URL: http://svn.apache.org/viewcvs?rev=367127&view=rev
Log:
Relax to protected some variables to allow faster access from the inner classes.
Modified:
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/StaticSelectionList.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Repeater.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Union.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectPipe.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/CombiningMap.java
cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/ContainerWidgetAsMap.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/LocationTrackingDebugger.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/CompilingClassLoader.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/XModuleSource.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/IncludeTransformer.java
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/binding/JXPathBindingManager.java Sun Jan 8 15:26:58 2006
@@ -58,38 +58,38 @@
public class JXPathBindingManager extends AbstractLogEnabled implements
BindingManager, Contextualizable, Serviceable, Disposable, Initializable, Configurable,
ThreadSafe {
-
+
private static final String PREFIX = "CocoonFormBinding:";
-
- private ServiceManager manager;
-
- private DatatypeManager datatypeManager;
-
+
+ protected ServiceManager manager;
+
+ protected DatatypeManager datatypeManager;
+
private Configuration configuration;
-
- private SimpleServiceSelector bindingBuilderSelector;
-
+
+ protected SimpleServiceSelector bindingBuilderSelector;
+
private CacheManager cacheManager;
-
+
private Context avalonContext;
-
- private LibraryManagerImpl libraryManager;
-
+
+ protected LibraryManagerImpl libraryManager;
+
public void contextualize(Context context) throws ContextException {
this.avalonContext = context;
}
-
+
public void service(ServiceManager manager) throws ServiceException {
this.manager = manager;
this.datatypeManager = (DatatypeManager) manager.lookup(DatatypeManager.ROLE);
this.cacheManager = (CacheManager) manager.lookup(CacheManager.ROLE);
}
-
+
public void configure(Configuration configuration)
throws ConfigurationException {
this.configuration = configuration;
}
-
+
public void initialize() throws Exception {
bindingBuilderSelector = new SimpleServiceSelector("binding",
JXPathBindingBuilderBase.class);
@@ -98,7 +98,7 @@
this.avalonContext,
this.manager,
configuration.getChild("bindings"));
-
+
libraryManager = new LibraryManagerImpl();
libraryManager.setBindingManager(this);
LifecycleHelper.setupComponent(libraryManager,
@@ -107,18 +107,18 @@
this.manager,
configuration.getChild("library"));
}
-
+
public Binding createBinding(Source source) throws BindingException {
Binding binding = (Binding) this.cacheManager.get(source, PREFIX);
-
+
if (binding != null && !binding.isValid())
binding = null; //invalidate
-
+
if (binding == null) {
try {
InputSource is = new InputSource(source.getInputStream());
is.setSystemId(source.getURI());
-
+
Document doc = DomHelper.parse(is, this.manager);
Element rootElm = doc.getDocumentElement();
if (BindingManager.NAMESPACE.equals(rootElm.getNamespaceURI())) {
@@ -133,7 +133,7 @@
getLogger().debug("Root Element of said binding file is in wrong namespace.");
}
}
-
+
this.cacheManager.set(binding, source, PREFIX);
} catch (BindingException e) {
throw e;
@@ -142,14 +142,13 @@
source.getURI(), e);
}
}
-
return binding;
}
-
+
public Binding createBinding(String bindingURI) throws BindingException {
SourceResolver sourceResolver = null;
Source source = null;
-
+
try {
try {
sourceResolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
@@ -168,11 +167,11 @@
}
}
}
-
+
public Assistant getBuilderAssistant() {
return new Assistant();
}
-
+
public void dispose() {
if (this.bindingBuilderSelector != null) {
this.bindingBuilderSelector.dispose();
@@ -184,7 +183,7 @@
this.cacheManager = null;
this.manager = null;
}
-
+
/**
* Assistant Inner class discloses enough features to the created
* childBindings to recursively
@@ -199,7 +198,7 @@
* implement an explicit access method for the logger in the outer class.
*/
public class Assistant {
-
+
private BindingBuilderContext context = new BindingBuilderContext();
private Stack contextStack = new Stack();
@@ -214,7 +213,7 @@
+ bindingType + "\".", e);
}
}
-
+
/**
* Creates a {@link Binding} following the specification in the
* provided config element.
@@ -223,60 +222,58 @@
Element configElm) throws BindingException {
String bindingType = configElm.getLocalName();
JXPathBindingBuilderBase bindingBuilder = getBindingBuilder(bindingType);
-
+
boolean flag = false;
- if(context.getLocalLibrary() == null) {
+ if (context.getLocalLibrary() == null) {
Library lib = new Library(libraryManager);
context.setLocalLibrary(lib);
lib.setAssistant(getBuilderAssistant());
lib.setSourceURI(LocationAttributes.getURI(configElm));
flag = true;
}
-
- if(context.getLocalLibrary()!=null
- && configElm.hasAttribute("extends")) {
+
+ if (context.getLocalLibrary() != null && configElm.hasAttribute("extends")) {
try {
context.setSuperBinding(context.getLocalLibrary().getBinding(configElm.getAttribute("extends")));
-
+
} catch(LibraryException e) {
- //throw new RuntimeException("Error extending binding! (at "+DomHelper.getLocation(configElm)+")",e);
- throw new NestableRuntimeException("Error extending binding! (at "+DomHelper.getLocation(configElm)+")",e);
+ // throw new RuntimeException("Error extending binding! (at "+DomHelper.getLocation(configElm)+")", e);
+ throw new NestableRuntimeException("Error extending binding! (at " + DomHelper.getLocation(configElm) + ")", e);
}
} else {
context.setSuperBinding(null);
}
-
+
JXPathBindingBase childBinding = bindingBuilder.buildBinding(configElm, this);
-
- if(flag && childBinding != null) {
+
+ if (flag && childBinding != null) {
childBinding.setLocalLibary(context.getLocalLibrary());
}
-
+
// this might get called unnecessarily, but solves issues with the libraries
- if(childBinding != null)
+ if (childBinding != null) {
childBinding.enableLogging(getLogger());
-
-
+ }
return childBinding;
}
-
+
private JXPathBindingBase[] mergeBindings(JXPathBindingBase[] existing, JXPathBindingBase[] extra) {
-
- if(existing == null || existing.length == 0)
+
+ if (existing == null || existing.length == 0) {
return extra;
-
- if(extra == null || extra.length == 0)
+ }
+ if (extra == null || extra.length == 0) {
return existing;
-
+ }
// have to do it the stupid painter way..
ArrayList list = new ArrayList(existing.length);
- for(int i=0; i<existing.length; i++)
+ for (int i = 0; i < existing.length; i++) {
list.add(existing[i]);
-
- for(int i=0; i<extra.length; i++) {
- if(extra[i].getId()==null)
+ }
+ for (int i = 0; i < extra.length; i++) {
+ if (extra[i].getId() == null) {
list.add(extra[i]);
- else {
+ } else {
// try to replace existing one
boolean match = false;
for(int j=0; j<list.size(); j++) {
@@ -287,13 +284,14 @@
}
}
// if no match, just add
- if(!match)
+ if (!match) {
list.add(extra[i]);
+ }
}
}
return (JXPathBindingBase[])list.toArray(new JXPathBindingBase[list.size()]);
}
-
+
/**
* proxy for compatibility
*
@@ -301,7 +299,7 @@
public JXPathBindingBase[] makeChildBindings(Element parentElement) throws BindingException {
return makeChildBindings(parentElement,new JXPathBindingBase[0]);
}
-
+
/**
* Makes an array of childBindings for the child-elements of the
* provided configuration element.
@@ -310,33 +308,31 @@
throws BindingException {
if (existingBindings == null)
existingBindings = new JXPathBindingBase[0];
-
+
if (parentElement != null) {
Element[] childElements = DomHelper.getChildElements(
parentElement, BindingManager.NAMESPACE);
if (childElements.length > 0) {
JXPathBindingBase[] childBindings = new JXPathBindingBase[childElements.length];
for (int i = 0; i < childElements.length; i++) {
-
+
pushContext();
context.setSuperBinding(null);
-
+
String id = DomHelper.getAttribute(childElements[i], "id", null);
String path = DomHelper.getAttribute(childElements[i], "path", null);
if(context.getLocalLibrary()!=null && childElements[i].getAttribute("extends")!=null) {
try {
context.setSuperBinding(context.getLocalLibrary().getBinding(childElements[i].getAttribute("extends")));
-
+
if(context.getSuperBinding() == null) // not found in library
context.setSuperBinding(getBindingByIdOrPath(id,path,existingBindings));
-
+
} catch(LibraryException e) {
throw new BindingException("Error extending binding! (at "+DomHelper.getLocation(childElements[i])+")",e);
}
}
-
childBindings[i] = getBindingForConfigurationElement(childElements[i]);
-
popContext();
}
return mergeBindings(existingBindings,childBindings);
@@ -344,32 +340,32 @@
}
return existingBindings;
}
-
+
private JXPathBindingBase getBindingByIdOrPath(String id, String path, JXPathBindingBase[] bindings) {
String name = id;
- if(name == null) {
+ if (name == null) {
name = "Context:"+path;
}
-
- for(int i=0; i<bindings.length; i++) {
- if(name.equals(bindings[i].getId()))
+ for (int i = 0; i < bindings.length; i++) {
+ if (name.equals(bindings[i].getId())) {
return bindings[i];
+ }
}
return null;
}
-
+
public DatatypeManager getDatatypeManager() {
return datatypeManager;
}
-
+
public ServiceManager getServiceManager() {
return manager;
}
-
+
public LibraryManager getLibraryManager() {
return libraryManager;
}
-
+
public BindingBuilderContext getContext() {
return this.context;
}
@@ -378,6 +374,7 @@
contextStack.push(context);
context = c;
}
+
private void popContext() {
if(!contextStack.empty()) {
context = (BindingBuilderContext)contextStack.pop();
@@ -385,6 +382,5 @@
context = new BindingBuilderContext();
}
}
-
}
}
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/DynamicSelectionList.java Sun Jan 8 15:26:58 2006
@@ -203,7 +203,7 @@
if (localName.equals("item")) {
if (convertor == null) {
// if no convertor was explicitely configured, use the default one of the datatype
- convertor = datatype.getConvertor();
+ convertor = getDatatype().getConvertor();
}
hasLabel = false;
@@ -217,7 +217,7 @@
throw new SAXException("Could not interpret the following value: \"" + unparsedValue + "\".");
}
currentValue = conversionResult.getResult();
- currentValueAsString = datatype.getConvertor().convertToString(currentValue, locale, toFormatCache);
+ currentValueAsString = getDatatype().getConvertor().convertToString(currentValue, locale, toFormatCache);
}
AttributesImpl attrs = new AttributesImpl();
attrs.addCDATAAttribute("value", currentValueAsString);
@@ -250,7 +250,7 @@
if (convertorConfigNestingLevel == 0) {
Element convertorElement = convertorConfigDOMBuilder.getDocument().getDocumentElement();
try {
- convertor = datatype.getBuilder().buildConvertor(convertorElement);
+ convertor = getDatatype().getBuilder().buildConvertor(convertorElement);
} catch (Exception e) {
throw new SAXException("Error building convertor from convertor configuration embedded in selection list XML.", e);
}
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/StaticSelectionList.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/StaticSelectionList.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/StaticSelectionList.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/datatype/StaticSelectionList.java Sun Jan 8 15:26:58 2006
@@ -101,7 +101,7 @@
throws SAXException {
String stringValue;
if (this.value != null) {
- stringValue = datatype.getConvertor().convertToString(this.value, locale, formatCache);
+ stringValue = getDatatype().getConvertor().convertToString(this.value, locale, formatCache);
} else {
// Null value translates into the empty string
stringValue = "";
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Repeater.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Repeater.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Repeater.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Repeater.java Sun Jan 8 15:26:58 2006
@@ -54,7 +54,7 @@
private static final String REPEATER_SIZE_EL = "repeater-size";
private final RepeaterDefinition definition;
- private final List rows = new ArrayList();
+ protected final List rows = new ArrayList();
protected ValidationError validationError;
@@ -441,7 +441,7 @@
}
public WidgetDefinition getDefinition() {
- return Repeater.this.definition;
+ return Repeater.this.getDefinition();
}
private int cachedPosition = -100;
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/RepeaterActionDefinition.java Sun Jan 8 15:26:58 2006
@@ -153,29 +153,29 @@
* or at the end of the repeater if no row is selected.
*/
public static class InsertRowsActionDefinition extends RepeaterActionDefinition {
-
- private String selectName;
-
+
+ protected String selectName;
+
/**
* initialize this definition with the other, sort of like a copy constructor
*/
public void initializeFrom(WidgetDefinition definition) throws Exception {
super.initializeFrom(definition);
-
+
if(definition instanceof InsertRowsActionDefinition) {
InsertRowsActionDefinition other = (InsertRowsActionDefinition)definition;
-
+
this.selectName = other.selectName;
-
+
} else {
throw new Exception("Definition to inherit from is not of the right type! (at "+getLocation()+")");
}
}
-
+
public InsertRowsActionDefinition(String repeaterName, String selectWidgetName) {
super(repeaterName);
this.selectName = selectWidgetName;
-
+
this.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
Repeater repeater = ((RepeaterAction)event.getSource()).getRepeater();
@@ -189,7 +189,7 @@
foundSelection = true;
}
}
-
+
if (!foundSelection) {
// Add a row at the end
repeater.addRow();
@@ -198,7 +198,7 @@
});
}
}
-
+
public static class MoveRowActionDefinition extends RepeaterActionDefinition {
public MoveRowActionDefinition(String repeaterName) {
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Union.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Union.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Union.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/formmodel/Union.java Sun Jan 8 15:26:58 2006
@@ -37,7 +37,7 @@
private static final String UNION_EL = "field";
private Widget caseWidget;
- private String caseValue;
+ protected String caseValue;
private final UnionDefinition definition;
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectPipe.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectPipe.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectPipe.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectPipe.java Sun Jan 8 15:26:58 2006
@@ -423,13 +423,13 @@
protected final Handler hNull = new NullHandler();
protected final Handler hBuffer = new BufferHandler();
- private Locator locator;
+ protected Locator locator;
private LinkedList handlers;
private Handler handler;
private LinkedList buffers;
private LinkedList locators;
- private SaxBuffer buffer;
+ protected SaxBuffer buffer;
/**
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/transformation/EffectWidgetReplacingPipe.java Sun Jan 8 15:26:58 2006
@@ -90,24 +90,24 @@
private final AggregateWidgetHandler hAggregate = new AggregateWidgetHandler();
private final ChooseHandler hChoose = new ChooseHandler();
- private final ChoosePassThruHandler hChoosePassThru = new ChoosePassThruHandler();
+ protected final ChoosePassThruHandler hChoosePassThru = new ChoosePassThruHandler();
private final ClassHandler hClass = new ClassHandler();
private final ContinuationIdHandler hContinuationId = new ContinuationIdHandler();
private final DocHandler hDocument = new DocHandler();
- private final FormHandler hForm = new FormHandler();
+ protected final FormHandler hForm = new FormHandler();
private final GroupHandler hGroup = new GroupHandler();
- private final NestedHandler hNested = new NestedHandler();
+ protected final NestedHandler hNested = new NestedHandler();
private final NewHandler hNew = new NewHandler();
private final RepeaterSizeHandler hRepeaterSize = new RepeaterSizeHandler();
private final RepeaterHandler hRepeater = new RepeaterHandler();
private final RepeaterRowsHandler hRepeaterRows = new RepeaterRowsHandler();
private final RepeaterWidgetHandler hRepeaterWidget = new RepeaterWidgetHandler();
private final RepeaterWidgetLabelHandler hRepeaterWidgetLabel = new RepeaterWidgetLabelHandler();
- private final SkipHandler hSkip = new SkipHandler();
+ protected final SkipHandler hSkip = new SkipHandler();
private final StructHandler hStruct = new StructHandler();
- private final StylingContentHandler hStyling = new StylingContentHandler();
+ protected final StylingContentHandler hStyling = new StylingContentHandler();
private final UnionHandler hUnion = new UnionHandler();
- private final UnionPassThruHandler hUnionPassThru = new UnionPassThruHandler();
+ protected final UnionPassThruHandler hUnionPassThru = new UnionPassThruHandler();
private final ValidationErrorHandler hValidationError = new ValidationErrorHandler();
private final WidgetHandler hWidget = new WidgetHandler();
private final WidgetLabelHandler hWidgetLabel = new WidgetLabelHandler();
@@ -128,7 +128,7 @@
* True if instance namespace has been mapped to the
* 'fi' prefix.
*/
- private boolean hasInstanceNamespace;
+ protected boolean hasInstanceNamespace;
protected Widget contextWidget;
protected LinkedList contextWidgets;
@@ -246,7 +246,7 @@
* Needed to get things working with JDK 1.3. Can be removed once we
* don't support that platform any more.
*/
- private ContentHandler getContentHandler() {
+ protected ContentHandler getContentHandler() {
return this.contentHandler;
}
@@ -254,11 +254,10 @@
* Needed to get things working with JDK 1.3. Can be removed once we
* don't support that platform any more.
*/
- private LexicalHandler getLexicalHandler() {
+ protected LexicalHandler getLexicalHandler() {
return this.lexicalHandler;
}
-
/**
* Process the SAX event.
* @see org.xml.sax.ContentHandler#startPrefixMapping
@@ -354,7 +353,6 @@
throw new SAXException("Element '" + loc + "' is not permitted outside of " +
"'form-template', at " + getLocation());
}
-
return hForm;
}
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/CombiningMap.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/CombiningMap.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/CombiningMap.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/CombiningMap.java Sun Jan 8 15:26:58 2006
@@ -31,7 +31,7 @@
*/
public class CombiningMap extends AbstractMap {
- private List maps = new ArrayList();
+ protected List maps = new ArrayList();
private boolean locked = false;
/**
Modified: cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/ContainerWidgetAsMap.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/ContainerWidgetAsMap.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/ContainerWidgetAsMap.java (original)
+++ cocoon/blocks/forms/trunk/java/org/apache/cocoon/forms/util/ContainerWidgetAsMap.java Sun Jan 8 15:26:58 2006
@@ -45,7 +45,7 @@
* @version $Id$
*/
public class ContainerWidgetAsMap extends AbstractMap {
- private AbstractContainerWidget container;
+ protected AbstractContainerWidget container;
private boolean lowerCase;
/**
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/bean/CocoonWrapper.java Sun Jan 8 15:26:58 2006
@@ -183,13 +183,15 @@
}
private Cocoon getCocoon() {
- return new CocoonAccess() {
- final Cocoon instance() {
- return super.getCocoon();
- }
- }.instance();
+ return new CocoonInstance().instance();
}
-
+
+ private static class CocoonInstance extends CocoonAccess {
+ final Cocoon instance() {
+ return super.getCocoon();
+ }
+ }
+
protected ExcaliburComponentManager getComponentManager() {
return cocoon.getComponentManager();
}
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java Sun Jan 8 15:26:58 2006
@@ -45,7 +45,7 @@
*/
public class SimpleCocoonCrawlerImpl extends AbstractLogEnabled
implements CocoonCrawler, Configurable, Disposable, Recyclable {
-
+
/**
* Config element name specifying expected link content-typ.
* <p>
@@ -53,7 +53,7 @@
* </p>
*/
public final static String LINK_CONTENT_TYPE_CONFIG = "link-content-type";
-
+
/**
* Default value of <code>link-content-type</code> configuration value.
* <p>
@@ -61,7 +61,7 @@
* </p>
*/
public final String LINK_CONTENT_TYPE_DEFAULT = Constants.LINK_CONTENT_TYPE;
-
+
/**
* Config element name specifying query-string appendend for requesting links
* of an URL.
@@ -70,7 +70,7 @@
* </p>
*/
public final static String LINK_VIEW_QUERY_CONFIG = "link-view-query";
-
+
/**
* Default value of <code>link-view-query</code> configuration option.
* <p>
@@ -78,7 +78,7 @@
* </p>
*/
public final static String LINK_VIEW_QUERY_DEFAULT = "cocoon-view=links";
-
+
/**
* Config element name specifying excluding regular expression pattern.
* <p>
@@ -86,7 +86,7 @@
* </p>
*/
public final static String EXCLUDE_CONFIG = "exclude";
-
+
/**
* Config element name specifying including regular expression pattern.
* <p>
@@ -94,7 +94,7 @@
* </p>
*/
public final static String INCLUDE_CONFIG = "include";
-
+
/**
* Config element name specifying http header value for user-Agent.
* <p>
@@ -102,13 +102,13 @@
* </p>
*/
public final static String USER_AGENT_CONFIG = "user-agent";
-
+
/**
* Default value of <code>user-agent</code> configuration option.
* @see Constants#COMPLETE_NAME
*/
public final static String USER_AGENT_DEFAULT = Constants.COMPLETE_NAME;
-
+
/**
* Config element name specifying http header value for accept.
* <p>
@@ -116,7 +116,7 @@
* </p>
*/
public final static String ACCEPT_CONFIG = "accept";
-
+
/**
* Default value of <code>accept</code> configuration option.
* <p>
@@ -124,23 +124,19 @@
* </p>
*/
public final static String ACCEPT_DEFAULT = "*/*";
-
-
+
private String linkViewQuery = LINK_VIEW_QUERY_DEFAULT;
private String linkContentType = LINK_CONTENT_TYPE_DEFAULT;
private HashSet excludeCrawlingURL;
private HashSet includeCrawlingURL;
private String userAgent = USER_AGENT_DEFAULT;
private String accept = ACCEPT_DEFAULT;
-
- private int depth;
-
private HashSet crawled;
- private HashSet urlsToProcess;
- private HashSet urlsNextDepth;
-
-
-
+
+ protected int depth;
+ protected HashSet urlsToProcess;
+ protected HashSet urlsNextDepth;
+
/**
* Constructor for the SimpleCocoonCrawlerImpl object
*/
@@ -150,8 +146,7 @@
// by default exclude common image patterns
excludeCrawlingURL = null;
}
-
-
+
/**
* Configure the crawler component.
* <p>
@@ -175,7 +170,7 @@
*/
public void configure(Configuration configuration)
throws ConfigurationException {
-
+
Configuration[] children;
children = configuration.getChildren(INCLUDE_CONFIG);
if (children.length > 0) {
@@ -198,7 +193,7 @@
getLogger().debug("Include all URLs");
}
}
-
+
children = configuration.getChildren(EXCLUDE_CONFIG);
if (children.length > 0) {
excludeCrawlingURL = new HashSet();
@@ -222,7 +217,7 @@
getLogger().debug("Exclude default URLs only");
}
}
-
+
Configuration child;
String value;
child = configuration.getChild(LINK_CONTENT_TYPE_CONFIG, false);
@@ -239,7 +234,7 @@
this.linkViewQuery = value.trim();
}
}
-
+
child = configuration.getChild(USER_AGENT_CONFIG, false);
if (child != null) {
value = child.getValue();
@@ -247,7 +242,7 @@
this.userAgent = value;
}
}
-
+
child = configuration.getChild(ACCEPT_CONFIG, false);
if (child != null) {
value = child.getValue();
@@ -257,8 +252,7 @@
}
}
-
-
+
/**
* dispose at end of life cycle, releasing all resources.
*/
@@ -269,8 +263,7 @@
excludeCrawlingURL = null;
includeCrawlingURL = null;
}
-
-
+
/**
* recylcle this object, relasing resources
*/
@@ -280,8 +273,7 @@
urlsNextDepth = null;
depth = -1;
}
-
-
+
/**
* The same as calling crawl(url,-1);
*
@@ -290,7 +282,7 @@
public void crawl(URL url) {
crawl(url, -1);
}
-
+
/**
* Start crawling a URL.
*
@@ -324,15 +316,14 @@
urlsToProcess = new HashSet();
urlsNextDepth = new HashSet();
depth = maxDepth;
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("crawl URL " + url + " to depth " + maxDepth);
}
-
+
urlsToProcess.add(url);
}
-
-
+
/**
* Return iterator, iterating over all links of the currently crawled URL.
* <p>
@@ -346,8 +337,7 @@
public Iterator iterator() {
return new CocoonCrawlerIterator(this);
}
-
-
+
/**
* Default exclude patterns.
* <p>
@@ -371,7 +361,7 @@
".*\\.js(\\?.*)?$",
".*\\.css(\\?.*)?$"
};
-
+
for (int i = 0; i < EXCLUDE_FROM_CRAWLING_DEFAULT.length; i++) {
String pattern = EXCLUDE_FROM_CRAWLING_DEFAULT[i];
try {
@@ -382,8 +372,7 @@
}
}
}
-
-
+
/**
* Compute list of links from the url.
* <p>
@@ -402,15 +391,15 @@
if (!isIncludedURL(sURL) || isExcludedURL(sURL)) {
return null;
}
-
+
// don't try to get links for url which has been crawled already
if (crawled.contains(sURL)) {
return null;
}
-
+
// mark it as crawled
crawled.add(sURL);
-
+
// get links of url
if (getLogger().isDebugEnabled()) {
getLogger().debug("Getting links of URL " + sURL);
@@ -427,7 +416,7 @@
links_url_connection.connect();
InputStream is = links_url_connection.getInputStream();
br = new BufferedReader(new InputStreamReader(is));
-
+
String contentType = links_url_connection.getContentType();
if (contentType == null) {
if (getLogger().isDebugEnabled()) {
@@ -436,42 +425,42 @@
// there is a check on null in the calling method
return null;
}
-
+
int index = contentType.indexOf(';');
if (index != -1) {
contentType = contentType.substring(0, index);
}
-
+
if (getLogger().isDebugEnabled()) {
getLogger().debug("Content-type: " + contentType);
}
-
+
if (contentType.equals(linkContentType)) {
url_links = new ArrayList();
-
+
// content is supposed to be a list of links,
// relative to current URL
String line;
while ((line = br.readLine()) != null) {
final URL newUrl = new URL(url, line);
final String sNewUrl = newUrl.toString();
-
+
boolean add_url = true;
// don't add new_url twice
if (add_url) {
add_url &= !url_links.contains(sNewUrl);
}
-
+
// don't add new_url if it has been crawled already
if (add_url) {
add_url &= !crawled.contains(sNewUrl);
}
-
+
// don't add if is not matched by existing include definition
if (add_url) {
add_url &= isIncludedURL(sNewUrl);
}
-
+
// don't add if is matched by existing exclude definition
if (add_url) {
add_url &= !isExcludedURL(sNewUrl);
@@ -498,8 +487,7 @@
}
return url_links;
}
-
-
+
/**
* check if URL is a candidate for indexing
*
@@ -528,8 +516,7 @@
}
return false;
}
-
-
+
/**
* check if URL is a candidate for indexing
*
@@ -558,8 +545,7 @@
}
return false;
}
-
-
+
/**
* Helper class implementing an Iterator
* <p>
@@ -572,8 +558,7 @@
*/
public static class CocoonCrawlerIterator implements Iterator {
private SimpleCocoonCrawlerImpl cocoonCrawler;
-
-
+
/**
* Constructor for the CocoonCrawlerIterator object
*
@@ -582,8 +567,7 @@
CocoonCrawlerIterator(SimpleCocoonCrawlerImpl cocoonCrawler) {
this.cocoonCrawler = cocoonCrawler;
}
-
-
+
/**
* check if crawling is finished.
*
@@ -594,8 +578,7 @@
return cocoonCrawler.urlsToProcess.size() > 0
|| cocoonCrawler.urlsNextDepth.size() > 0;
}
-
-
+
/**
* @return the next URL
*/
@@ -637,8 +620,7 @@
// finally return url
return theNextUrl;
}
-
-
+
/**
* remove is not implemented
*/
@@ -647,4 +629,3 @@
}
}
}
-
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/LocationTrackingDebugger.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/LocationTrackingDebugger.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/LocationTrackingDebugger.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/LocationTrackingDebugger.java Sun Jan 8 15:26:58 2006
@@ -69,15 +69,14 @@
}
};
-
static {
// Register what's needed to analyze exceptions produced by Rhino
ExceptionUtils.addCauseMethodName("getWrappedException");
LocationUtils.addFinder(rhinoLocFinder);
}
-
- private List locations;
- private Throwable throwable;
+
+ protected List locations;
+ protected Throwable throwable;
/**
* Rhino+cont API
@@ -92,7 +91,7 @@
public DebugFrame enterFrame(Context cx, Scriptable scope, Scriptable thisObj, Object[] args, DebuggableScript fnOrScript) {
return new StackTrackingFrame(fnOrScript);
}
-
+
/**
* Rhino 1.6 API
*/
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/CompilingClassLoader.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/CompilingClassLoader.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/CompilingClassLoader.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/flow/javascript/fom/CompilingClassLoader.java Sun Jan 8 15:26:58 2006
@@ -205,7 +205,7 @@
}
}
- private String makeFileName(String className) {
+ protected String makeFileName(String className) {
Source src = getSource(className);
if (src != null) {
String result = src.getURI();
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/XModuleSource.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/XModuleSource.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/XModuleSource.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/XModuleSource.java Sun Jan 8 15:26:58 2006
@@ -78,7 +78,7 @@
private String attributeType;
private String attributeName;
private String xPath;
- private ServiceManager manager;
+ protected ServiceManager manager;
private Map objectModel;
private Logger logger;
@@ -342,7 +342,7 @@
XModuleSource.this.getContentHandler());
} catch (Exception e){
throw new IOException("Exception during processing of " +
- XModuleSource.super.getURI() +
+ XModuleSource.this.getURI() +
e.getMessage());
} finally {
if (parser != null) XModuleSource.this.manager.release( parser );
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java Sun Jan 8 15:26:58 2006
@@ -45,8 +45,8 @@
private ServiceManager manager;
private ServiceSelector selector;
- private List tokens;
- private boolean needsMapStack;
+ protected List tokens;
+ protected boolean needsMapStack;
private static final int OPEN = -2;
private static final int CLOSE = -3;
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/IncludeTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/IncludeTransformer.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/IncludeTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/IncludeTransformer.java Sun Jan 8 15:26:58 2006
@@ -208,7 +208,7 @@
//
/** The {@link ServiceManager} instance associated with this instance. */
- private ServiceManager manager;
+ protected ServiceManager manager;
/** Configuration option controlling recursive includes processing */
private boolean defaultRecursive;
@@ -220,7 +220,7 @@
private boolean defaultRecursiveParallel;
/** The name of the thread pool to use (for parallel processing). */
- private String threadPool;
+ protected String threadPool;
/** The default value to be appended to the caching key. */
private String defaultKey;
@@ -230,10 +230,10 @@
//
/** The {@link SourceResolver} used to resolve included URIs. */
- private SourceResolver resolver;
+ protected SourceResolver resolver;
/** The {@link Environment} used within parallel threads */
- private Environment environment;
+ protected Environment environment;
/** The {@link Processor} used within parallel threads */
private Processor processor;
@@ -246,7 +246,7 @@
//
/** The {@link SourceValidity} instance associated with this request. */
- private MultiSourceValidity validity;
+ protected MultiSourceValidity validity;
/** A {@link NamespacesTable} used to filter namespace declarations. */
private NamespacesTable namespaces;
@@ -473,25 +473,25 @@
private String base;
/** The source URI to be included declared in an src attribute of the include element. */
- private String source;
+ protected String source;
/** The flag indicating whether source content has to be parsed into XML or included as text. */
- private boolean parse;
+ protected boolean parse;
/** The mime type hint to the {@link org.apache.excalibur.xmlizer.XMLizer} when parsing the source content. */
- private String mimeType;
+ protected String mimeType;
/** The buffer collecting fallback content. */
- private SaxBuffer fallback;
+ protected SaxBuffer fallback;
/** A {@link Map} of the parameters to supply to the included source. */
- private Map parameters;
+ protected Map parameters;
/** The current parameter name captured. */
- private String parameter;
+ protected String parameter;
/** The current parameter value (as a {@link StringBuffer}). */
- private StringBuffer value;
+ protected StringBuffer value;
/** Create include element */
private IncludeElement(String base, boolean parallel, boolean recursive, boolean recursiveParallel, Logger logger) {
Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java?rev=367127&r1=367126&r2=367127&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java (original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java Sun Jan 8 15:26:58 2006
@@ -90,7 +90,7 @@
private static final String XINCLUDE_CACHE_KEY = "XInclude";
/** The {@link SourceValidity} instance associated with this request. */
- private MultiSourceValidity validity;
+ protected MultiSourceValidity validity;
public void setup(SourceResolver resolver, Map objectModel, String source, Parameters parameters)
throws ProcessingException, SAXException, IOException {