Permalink
Browse files

Merge branch 'develop' into feature/lucence-range-index

  • Loading branch information...
2 parents 2f815e1 + 977cbbf commit 41c094d98c244446199a9516b367a7ed0df1a5ff @wolfgangmm wolfgangmm committed Sep 14, 2013
Showing with 1,900 additions and 1,065 deletions.
  1. +1 −1 extensions/debuggee/src/org/exist/debuggee/ScriptRunner.java
  2. +27 −2 extensions/modules/src/org/exist/xquery/modules/jfreechart/Configuration.java
  3. +16 −2 extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeChartFactory.java
  4. +22 −8 schema/conf.xsd
  5. +4 −1 src/org/exist/memtree/DocumentImpl.java
  6. +11 −6 src/org/exist/memtree/MemTreeBuilder.java
  7. +10 −1 src/org/exist/memtree/NamespaceNode.java
  8. +1 −0 src/org/exist/xquery/DynamicFunctionCall.java
  9. +1 −1 src/org/exist/xquery/EnclosedExpr.java
  10. +6 −0 src/org/exist/xquery/ErrorCodes.java
  11. +84 −38 src/org/exist/xquery/NamespaceConstructor.java
  12. +4 −1 src/org/exist/xquery/PartialFunctionApplication.java
  13. +8 −10 src/org/exist/xquery/functions/securitymanager/AccountManagementFunction.java
  14. +15 −22 src/org/exist/xquery/parser/XQuery.g
  15. +131 −131 src/org/exist/xquery/parser/XQueryLexer.java
  16. +803 −563 src/org/exist/xquery/parser/XQueryParser.java
  17. +17 −5 src/org/exist/xquery/parser/XQueryTree.g
  18. +240 −188 src/org/exist/xquery/parser/XQueryTreeParser.java
  19. +1 −1 src/template_java.txt
  20. +2 −2 test/src/org/exist/xquery/XQueryTest.java
  21. +235 −0 test/src/xquery/namespaces.xql
  22. +4 −3 test/src/xquery/suite.xql
  23. +18 −0 test/src/xquery/xquery3/higher-order.xml
  24. +44 −22 tools/wrapper/bin/exist.bat
  25. +9 −9 tools/wrapper/bin/exist.sh.in
  26. +43 −21 tools/wrapper/bin/install.bat
  27. +51 −18 tools/wrapper/bin/uninstall.bat
  28. BIN tools/wrapper/bin/wrapper-linux-ia-64
  29. BIN tools/wrapper/bin/wrapper-linux-x86-32
  30. BIN tools/wrapper/bin/wrapper-linux-x86-64
  31. BIN tools/wrapper/bin/wrapper-macosx-universal-32
  32. BIN tools/wrapper/bin/wrapper-macosx-universal-64
  33. BIN tools/wrapper/bin/wrapper-solaris-sparc-32
  34. BIN tools/wrapper/bin/wrapper-solaris-sparc-64
  35. BIN tools/wrapper/bin/wrapper-solaris-x86-32
  36. BIN tools/wrapper/bin/wrapper-solaris-x86-64
  37. BIN tools/wrapper/bin/wrapper-windows-x86-32.exe
  38. BIN tools/wrapper/bin/wrapper-windows-x86-64.exe
  39. +92 −9 tools/wrapper/conf/wrapper.conf.in
  40. BIN tools/wrapper/lib/libwrapper-linux-ia-64.so
  41. BIN tools/wrapper/lib/libwrapper-linux-x86-32.so
  42. BIN tools/wrapper/lib/libwrapper-linux-x86-64.so
  43. BIN tools/wrapper/lib/libwrapper-macosx-universal-32.jnilib
  44. BIN tools/wrapper/lib/libwrapper-macosx-universal-64.jnilib
  45. BIN tools/wrapper/lib/libwrapper-solaris-sparc-32.so
  46. BIN tools/wrapper/lib/libwrapper-solaris-sparc-64.so
  47. BIN tools/wrapper/lib/libwrapper-solaris-x86-32.so
  48. BIN tools/wrapper/lib/libwrapper-solaris-x86-64.so
  49. BIN tools/wrapper/lib/wrapper-windows-x86-32.dll
  50. BIN tools/wrapper/lib/wrapper-windows-x86-64.dll
  51. BIN tools/wrapper/lib/wrapper.jar
@@ -72,7 +72,7 @@ public void run() {
try {
db = BrokerPool.getInstance();
- db.addObserver(this);
+ BrokerPool.registerStatusObserver(this);
broker = db.get(null);
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2009 The eXist Project
+ * Copyright (C) 2009-2013 The eXist-db Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
import org.apache.log4j.Logger;
import org.exist.xquery.XPathException;
+import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.util.TableOrder;
import org.w3c.dom.Node;
@@ -34,6 +35,7 @@
*
* @author Dannes Wessels (dizzzz@exist-db.org)
* @author Andrzej Taramina (andrzej@chaeron.com)
+ * @author Leif-Jöran Olsson (ljo@exist-db.org)
*/
public class Configuration {
@@ -63,6 +65,7 @@
private String categoryItemLabelGeneratorClass;
private String categoryItemLabelGeneratorParameter = "{2}";
private String categoryItemLabelGeneratorNumberFormat = "0";
+ private CategoryLabelPositions categoryLabelPositions = CategoryLabelPositions.STANDARD;
// Orientation and Order
private TableOrder order = TableOrder.BY_COLUMN;
@@ -207,6 +210,10 @@ public String getCategoryItemLabelGeneratorParameter() {
public String getCategoryItemLabelGeneratorNumberFormat() {
return categoryItemLabelGeneratorNumberFormat;
}
+
+ public CategoryLabelPositions getCategoryLabelPositions() {
+ return categoryLabelPositions;
+ }
public String getSeriesColors() {
return seriesColors;
@@ -489,7 +496,25 @@ public void parse(Node configuration) throws XPathException {
} else {
categoryItemLabelGeneratorNumberFormat = value;
}
-
+
+ } else if (child.getLocalName().equals("categoryLabelPositions")) {
+ String value = getValue(child);
+ if (value == null) {
+ throw new XPathException("Value for 'categoryLabelPostions' cannot be parsed");
+ } else if ("UP_45".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.UP_45;
+ } else if ("UP_90".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.UP_90;
+ } else if ("DOWN_45".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.DOWN_45;
+
+ } else if ("DOWN_90".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.DOWN_90;
+
+ } else {
+ throw new XPathException("Wrong value for 'categoryLabelPositions'");
+ }
+
} else if (child.getLocalName().equals("imageType")) {
String value = getValue(child);
if (value == null) {
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2009 The eXist Project
+ * Copyright (C) 2009-2013 The eXist-db Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -33,11 +33,13 @@
import org.exist.xquery.XPathException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.labels.CategoryItemLabelGenerator;
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PiePlot;
+import org.jfree.chart.plot.MultiplePiePlot;
import org.jfree.chart.plot.SpiderWebPlot;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.chart.title.LegendTitle;
@@ -237,8 +239,9 @@ private static void setCategoryChartParameters( JFreeChart chart, Configuration
{
setCategoryRange( chart, config );
setCategoryItemLabelGenerator( chart, config );
+ setCategoryLabelPositions( chart, config );
setSeriesColors( chart, config );
- setAxisColors( chart, config );
+ setAxisColors( chart, config );
}
@@ -295,6 +298,13 @@ private static void setCategoryItemLabelGenerator( JFreeChart chart, Configurati
}
}
+ private static void setCategoryLabelPositions( JFreeChart chart, Configuration config )
+ {
+ CategoryLabelPositions positions = config.getCategoryLabelPositions();
+ if (chart.getPlot() instanceof CategoryPlot) {
+ ((CategoryPlot)chart.getPlot()).getDomainAxis().setCategoryLabelPositions(positions);
+ }
+ }
private static void setSeriesColors( JFreeChart chart, Configuration config )
{
@@ -373,7 +383,11 @@ private static void setPieSectionLabel( JFreeChart chart, Configuration config )
String pieSectionPercentFormat = config.getPieSectionPercentFormat();
if( pieSectionLabel != null ) {
+ if (chart.getPlot() instanceof MultiplePiePlot) {
+ ((PiePlot) ((MultiplePiePlot)chart.getPlot()).getPieChart().getPlot()).setLabelGenerator( new StandardPieSectionLabelGenerator( pieSectionLabel, new DecimalFormat( pieSectionNumberFormat ), new DecimalFormat( pieSectionPercentFormat ) ) );
+ } else {
((PiePlot)chart.getPlot()).setLabelGenerator( new StandardPieSectionLabelGenerator( pieSectionLabel, new DecimalFormat( pieSectionNumberFormat ), new DecimalFormat( pieSectionPercentFormat ) ) );
+ }
}
}
View
@@ -7,12 +7,21 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
+
+ <!-- Shared types -->
<xs:simpleType name="yes_no">
<xs:restriction base="xs:string">
<xs:enumeration value="yes"/>
<xs:enumeration value="no"/>
</xs:restriction>
</xs:simpleType>
+
+ <xs:complexType name="parameterType">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="value" type="xs:string"/>
+ </xs:complexType>
+
+ <!-- Root element -->
<xs:element name="exist">
<xs:complexType>
<xs:sequence>
@@ -28,12 +37,14 @@
<xs:element name="startup" minOccurs="0">
<xs:complexType>
<xs:sequence>
- <!-- TODO commonise with collection.xconf.xsd -->
<xs:element name="triggers" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="trigger" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="parameter" type="parameterType"/>
+ </xs:sequence>
<xs:attribute name="class" type="xs:string"/>
</xs:complexType>
</xs:element>
@@ -150,7 +161,8 @@
<xs:attribute name="flushAfter" type="xs:integer"
default="300"/>
<xs:attribute name="n" type="xs:integer" default="3"/>
- <xs:attribute name="buffer" type="xs:integer" default="32"/>
+ <xs:attribute name="buffer" type="xs:integer"
+ default="32"/>
</xs:complexType>
</xs:element>
</xs:sequence>
@@ -343,12 +355,13 @@
<xs:element name="module" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string"/>
- <xs:attribute name="value" type="xs:string"/>
- </xs:complexType>
- </xs:element>
+ <xs:element name="parameter" minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="value" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
<xs:attribute name="class" type="xs:string"/>
<xs:attribute name="uri" type="xs:anyURI"/>
@@ -385,4 +398,5 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+
</xs:schema>
@@ -325,7 +325,7 @@ public int addAttribute(int nodeNum, QName qname, String value, int type) throws
if (nodeKind == null) {
init();
}
- if ((nodeNum > 0 ) && (nodeKind[nodeNum] != Node.ELEMENT_NODE)) {
+ if ((nodeNum > 0 ) && !(nodeKind[nodeNum] == Node.ELEMENT_NODE || nodeKind[nodeNum] == NodeImpl.NAMESPACE_NODE)) {
throw( new DOMException( DOMException.INUSE_ATTRIBUTE_ERR,
"err:XQTY0024: An attribute node cannot follow a node that is not an attribute node."));
}
@@ -1104,6 +1104,9 @@ private void copyStartNode(NodeImpl node, DocumentBuilderReceiver receiver, bool
final String data = new String(document.characters, document.alpha[nr], document.alphaLen[nr]);
receiver.processingInstruction(qn.getLocalName(), data);
break;
+ case NodeImpl.NAMESPACE_NODE:
+ receiver.addNamespaceNode(document.namespaceCode[nr]);
+ break;
case NodeImpl.REFERENCE_NODE:
if (expandRefs) {
DBBroker broker = null;
@@ -446,13 +446,18 @@ public int namespaceNode( String prefix, String uri )
public int namespaceNode( QName qn )
{
final int lastNode = doc.getLastNode();
- final QName elemQN = doc.nodeName[lastNode];
- final String elemPrefix = ( elemQN.getPrefix() == null ) ? "" : elemQN.getPrefix();
-
- if( elemPrefix.equals( qn.getLocalName() ) && ( elemQN.getNamespaceURI() != null ) && !elemQN.getNamespaceURI().equals( qn.getNamespaceURI() ) ) {
- return( -1 );
+ boolean addNode = true;
+ if (doc.nodeName != null) {
+ final QName elemQN = doc.nodeName[lastNode];
+ if (elemQN != null) {
+ final String elemPrefix = ( elemQN.getPrefix() == null ) ? "" : elemQN.getPrefix();
+
+ if( elemPrefix.equals( qn.getLocalName() ) && ( elemQN.getNamespaceURI() != null ) ) {
+ addNode = false;
+ }
+ }
}
- return( doc.addNamespace( lastNode, qn ) );
+ return( addNode ? doc.addNamespace( lastNode, qn ) : -1 );
}
@@ -65,7 +65,7 @@ public short getNodeType()
//XQuery doesn't support namespace nodes
//so, mapping as an attribute at *serialization tile* makes sense
//however, the Query parser should not accept them in constructors !
- return( Node.ATTRIBUTE_NODE );
+ return( NodeImpl.NAMESPACE_NODE);
}
@@ -142,6 +142,15 @@ public void setValue( String value ) throws DOMException
{
}
+ @Override
+ public Node getFirstChild() {
+ return null;
+ }
+
+ @Override
+ public Node getLastChild() {
+ return null;
+ }
public String getNodeValue() throws DOMException
{
@@ -59,6 +59,7 @@ public Sequence eval(Sequence contextSequence, Item contextItem)
final FunctionCall call = ref.getCall();
call.setArguments(arguments);
final PartialFunctionApplication partialApp = new PartialFunctionApplication(context, call);
+ partialApp.analyze(new AnalyzeContextInfo(cachedContextInfo));
return partialApp.eval(contextSequence, contextItem);
} catch (final XPathException e) {
e.setLocation(line, column, getSource());
@@ -121,7 +121,7 @@ else if (buf.length() > 0)
{throw new XPathException(this, ErrorCodes.XQTY0024,
"An attribute may not appear after another child node.");}
next.copyTo(context.getBroker(), receiver);
- allowAttribs = next.getType() == Type.ATTRIBUTE;
+ allowAttribs = next.getType() == Type.ATTRIBUTE || next.getType() == Type.NAMESPACE;
next = i.nextItem();
}
}
@@ -125,6 +125,12 @@
public static ErrorCode XQDY0091 = new W3CErrorCode("XQDY0091", "An implementation MAY raise a dynamic error if an xml:id error, as defined in [XML ID], is encountered during construction of an attribute named xml:id.");
public static ErrorCode XQDY0092 = new W3CErrorCode("XQDY0092", "An implementation MAY raise a dynamic error if a constructed attribute named xml:space has a value other than preserve or default.");
public static ErrorCode XQST0093 = new W3CErrorCode("XQST0093", "It is a static error to import a module M1 if there exists a sequence of modules M1 ... Mi ... M1 such that each module directly depends on the next module in the sequence (informally, if M1 depends on itself through some chain of module dependencies.)");
+ public static ErrorCode XQDY0101 = new W3CErrorCode("XQDY0101", "An error is raised if a computed namespace constructor attempts to do any of the following:\n" +
+ "Bind the prefix xml to some namespace URI other than http://www.w3.org/XML/1998/namespace.\n" +
+ "Bind a prefix other than xml to the namespace URI http://www.w3.org/XML/1998/namespace.\n" +
+ "Bind the prefix xmlns to any namespace URI.\n" +
+ "Bind a prefix to the namespace URI http://www.w3.org/2000/xmlns/.\n" +
+ "Bind any prefix (including the empty prefix) to a zero-length namespace URI.");
/* XQuery 1.0 and XPath 2.0 Functions and Operators http://www.w3.org/TR/xpath-functions/#error-summary */
public static ErrorCode FOER0000 = new W3CErrorCode("FOER0000", "Unidentified error.");
Oops, something went wrong.

0 comments on commit 41c094d

Please sign in to comment.