You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by ju...@apache.org on 2006/10/09 19:11:44 UTC
svn commit: r454430 [2/2] - in /jackrabbit/trunk/contrib/jackrabbit-ntdoc:
./ src/ src/main/ src/main/java/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/jackrabbit/
src/main/java/org/apache/jackrabbit/ntdoc/ src/main/java/org/a...
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/parser/XMLNodeTypeParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/parser/XMLNodeTypeParser.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/parser/XMLNodeTypeParser.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/parser/XMLNodeTypeParser.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,234 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.parser;
+
+import java.io.*;
+import java.util.*;
+import javax.xml.parsers.*;
+
+import org.w3c.dom.*;
+import org.apache.jackrabbit.ntdoc.model.*;
+
+/**
+ * This class implements the XML parser.
+ */
+public final class XMLNodeTypeParser
+ extends NodeTypeParser {
+ /**
+ * Static factory for creating stream to DOM transformers.
+ */
+ private final static DocumentBuilderFactory BUILDER_FACTORY =
+ DocumentBuilderFactory.newInstance();
+
+ /**
+ * Parse the file.
+ */
+ public void parse()
+ throws IOException {
+ Document doc = parseDocument();
+ Element root = doc.getDocumentElement();
+
+ if (root.getNodeName().equals("nodeTypes")) {
+ parseNamespaces(root);
+ parseNodeTypes(root);
+ }
+ }
+
+ /**
+ * Parse the xml file.
+ */
+ private Document parseDocument()
+ throws IOException {
+ try {
+ DocumentBuilder builder = BUILDER_FACTORY.newDocumentBuilder();
+ return builder.parse(getInputStream(), getSystemId());
+ } catch (IOException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
+ /**
+ * Parse all namespaces.
+ */
+ private void parseNamespaces(Element root)
+ throws IOException {
+ NamedNodeMap attributes = root.getAttributes();
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attr = (Attr) attributes.item(i);
+ if (attr.getName().startsWith("xmlns:")) {
+ addNamespace(attr.getName().substring(6), attr.getValue());
+ }
+ }
+ }
+
+ /**
+ * Parse all node types.
+ */
+ private void parseNodeTypes(Element root)
+ throws IOException {
+ NodeList list = root.getElementsByTagName("nodeType");
+ for (int i = 0; i < list.getLength(); i++) {
+ parseNodeType((Element) list.item(i));
+ }
+ }
+
+ /**
+ * Parse single node type.
+ */
+ private void parseNodeType(Element root)
+ throws IOException {
+ NodeType nt = addNodeType(root.getAttribute("name"));
+ nt.setMixin(Boolean.valueOf(root.getAttribute("isMixin")).booleanValue());
+ nt.setOrderable(Boolean.valueOf(root.getAttribute("hasOrderableChildNodes")).booleanValue());
+ String primaryItemName = root.getAttribute("primaryItemName");
+ nt.setSuperTypes(parseValueList(root, "supertypes", "supertype"));
+
+ NodeList list = root.getElementsByTagName("propertyDefinition");
+ for (int i = 0; i < list.getLength(); i++) {
+ PropertyDef def = parsePropertyDef((Element) list.item(i));
+ nt.addItemDef(def);
+
+ if (def.getName().equals(primaryItemName)) {
+ def.setPrimary(true);
+ }
+ }
+
+ list = root.getElementsByTagName("childNodeDefinition");
+ for (int i = 0; i < list.getLength(); i++) {
+ NodeDef def = parseChildNodeDef((Element) list.item(i));
+ nt.addItemDef(def);
+
+ if (def.getName().equals(primaryItemName)) {
+ def.setPrimary(true);
+ }
+ }
+ }
+
+ /**
+ * Parse property definition.
+ */
+ private PropertyDef parsePropertyDef(Element root)
+ throws IOException {
+ PropertyDef def = new PropertyDef(root.getAttribute("name"));
+ def.setAutoCreated(Boolean.valueOf(root.getAttribute("autoCreated")).booleanValue());
+ def.setMandatory(Boolean.valueOf(root.getAttribute("mandatory")).booleanValue());
+ def.setProtected(Boolean.valueOf(root.getAttribute("protected")).booleanValue());
+ def.setMultiple(Boolean.valueOf(root.getAttribute("multiple")).booleanValue());
+ def.setOnParentVersion(parseOnParentVersion(root));
+ def.setRequiredType(parseRequiredType(root));
+ def.setConstraints(parseValueList(root, "valueConstraints", "valueConstraints"));
+ def.setDefaultValues(parseValueList(root, "defaultValues", "defaultValue"));
+ return def;
+ }
+
+ /**
+ * Parse property definition.
+ */
+ private NodeDef parseChildNodeDef(Element root)
+ throws IOException {
+ NodeDef def = new NodeDef(root.getAttribute("name"));
+ def.setAutoCreated(Boolean.valueOf(root.getAttribute("autoCreated")).booleanValue());
+ def.setMandatory(Boolean.valueOf(root.getAttribute("mandatory")).booleanValue());
+ def.setProtected(Boolean.valueOf(root.getAttribute("protected")).booleanValue());
+ def.setMultiple(Boolean.valueOf(root.getAttribute("sameNameSiblings")).booleanValue());
+ def.setOnParentVersion(parseOnParentVersion(root));
+ def.setDefaultPrimaryType(parseElementValue(root, "defaultPrimaryType"));
+ def.setRequiredPrimaryTypes(parseValueList(root, "requiredPrimaryTypes", "requiredPrimaryType"));
+ return def;
+ }
+
+ /**
+ * Parse on parent version.
+ */
+ private int parseOnParentVersion(Element root)
+ throws IOException {
+ String opv = root.getAttribute("onParentVersion");
+ if ("version".equalsIgnoreCase(opv)) {
+ return ItemDef.OPV_VERSION;
+ } else if ("initialize".equalsIgnoreCase(opv)) {
+ return ItemDef.OPV_INITIALIZE;
+ } else if ("compute".equalsIgnoreCase(opv)) {
+ return ItemDef.OPV_COMPUTE;
+ } else if ("ignore".equalsIgnoreCase(opv)) {
+ return ItemDef.OPV_IGNORE;
+ } else if ("abort".equalsIgnoreCase(opv)) {
+ return ItemDef.OPV_ABORT;
+ } else {
+ return ItemDef.OPV_COPY;
+ }
+ }
+
+ /**
+ * Parse required type.
+ */
+ private int parseRequiredType(Element root)
+ throws IOException {
+ String type = root.getAttribute("requiredType");
+ if ("binary".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_BINARY;
+ } else if ("long".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_LONG;
+ } else if ("double".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_DOUBLE;
+ } else if ("boolean".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_BOOLEAN;
+ } else if ("date".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_DATE;
+ } else if ("name".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_NAME;
+ } else if ("path".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_PATH;
+ } else if ("reference".equalsIgnoreCase(type)) {
+ return PropertyDef.TYPE_REFERENCE;
+ } else if ("undefined".equalsIgnoreCase(type) || "*".equals(type)) {
+ return PropertyDef.TYPE_UNDEFINED;
+ } else {
+ return PropertyDef.TYPE_STRING;
+ }
+ }
+
+ /**
+ * Return a value list.
+ */
+ private List parseValueList(Element root, String listName, String elemName)
+ throws IOException {
+ ArrayList list = new ArrayList();
+ NodeList nodes = root.getElementsByTagName(listName);
+ Element listElem = nodes.getLength() > 0 ? (Element) nodes.item(0) : null;
+
+ if (listElem != null) {
+ nodes = listElem.getElementsByTagName("elemName");
+ for (int i = 0; i < nodes.getLength(); i++) {
+ list.add(nodes.item(i).getTextContent());
+ }
+ }
+
+ return list;
+ }
+
+ /**
+ * Return value for an element.
+ */
+ private String parseElementValue(Element root, String elemName)
+ throws IOException {
+ NodeList nodes = root.getElementsByTagName(elemName);
+ Element listElem = nodes.getLength() > 0 ? (Element) nodes.item(0) : null;
+ return listElem != null ? listElem.getTextContent() : null;
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/parser/XMLNodeTypeParser.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/HtmlProducer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/HtmlProducer.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/HtmlProducer.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/HtmlProducer.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.producer;
+
+import java.io.*;
+
+import org.apache.jackrabbit.ntdoc.util.*;
+
+/**
+ * This class implements the base html producer.
+ */
+public abstract class HtmlProducer
+ extends Producer {
+ /**
+ * Create a new css writer.
+ */
+ protected CssWriter createCssWriter(String name)
+ throws IOException {
+ return new CssWriter(createFileWriter(name));
+ }
+
+ /**
+ * Create a new html writer.
+ */
+ protected HtmlWriter createHtmlWriter(String name)
+ throws IOException {
+ return new HtmlWriter(createFileWriter(name));
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/HtmlProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/Producer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/Producer.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/Producer.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/Producer.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.producer;
+
+import java.io.*;
+
+import org.apache.jackrabbit.ntdoc.model.*;
+import org.apache.jackrabbit.ntdoc.reporter.*;
+
+/**
+ * This class defines the abstract doc producer.
+ */
+public abstract class Producer
+ extends ReporterDelegator {
+ /**
+ * Title.
+ */
+ private String title;
+
+ /**
+ * Output directory.
+ */
+ private File outputDir;
+
+ /**
+ * Node types.
+ */
+ private NodeTypeSet nodeTypes;
+
+ /**
+ * Return the title.
+ */
+ public String getTitle() {
+ return this.title;
+ }
+
+ /**
+ * Set the title.
+ */
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * Return the output dir.
+ */
+ public File getOutputDir() {
+ return this.outputDir;
+ }
+
+ /**
+ * Set the output directory.
+ */
+ public void setOutputDir(File outputDir) {
+ this.outputDir = outputDir;
+ }
+
+ /**
+ * Return the node types.
+ */
+ public NodeTypeSet getNodeTypes() {
+ return this.nodeTypes;
+ }
+
+ /**
+ * Set the node types.
+ */
+ public void setNodeTypes(NodeTypeSet nodeTypes) {
+ this.nodeTypes = nodeTypes;
+ }
+
+ /**
+ * Open a relative file.
+ */
+ protected File createFile(String name) {
+ File file = new File(this.outputDir, name);
+ file.getParentFile().mkdirs();
+ return file;
+ }
+
+ /**
+ * Open a relative file.
+ */
+ protected FileWriter createFileWriter(String name)
+ throws IOException {
+ return new FileWriter(createFile(name));
+ }
+
+ /**
+ * Produce the documentation.
+ */
+ public abstract void produce()
+ throws IOException;
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/Producer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/StandardProducer.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/StandardProducer.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/StandardProducer.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/StandardProducer.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,551 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.producer;
+
+import java.io.*;
+
+import org.apache.jackrabbit.ntdoc.util.*;
+import org.apache.jackrabbit.ntdoc.model.*;
+
+/**
+ * This class implements a standard producer.
+ */
+public final class StandardProducer
+ extends HtmlProducer {
+ /**
+ * Produce the documentation.
+ */
+ public void produce()
+ throws IOException {
+ produceCss();
+ produceFrameSet();
+ produceToc();
+ produceNodeTypes();
+ }
+
+ /**
+ * Produce the css.
+ */
+ private void produceCss()
+ throws IOException {
+ CssWriter out = createCssWriter("default.css");
+ produceCss(out);
+ out.close();
+ }
+
+ /**
+ * Produce the css.
+ */
+ private void produceCss(CssWriter out)
+ throws IOException {
+ out.enter("body, th, td");
+ out.attrib("font-family", "Arial, Helvetica, sans-serif");
+ out.attrib("font-size", "12px");
+ out.attrib("color", "#000000");
+ out.leave();
+
+ out.enter("th, td");
+ out.attrib("padding-left", "4px");
+ out.leave();
+
+ out.enter("td");
+ out.attrib("vertical-align", "top");
+ out.attrib("white-space", "nowrap");
+ out.attrib("border-right", "1px solid #999999");
+ out.leave();
+
+ out.enter("th");
+ out.attrib("text-align", "left");
+ out.attrib("font-weight", "normal");
+ out.attrib("border-right", "1px solid #999999");
+ out.attrib("border-bottom", "1px solid #999999");
+ out.attrib("border-top", "1px solid #999999");
+ out.attrib("background-color", "#DDDDDD");
+ out.leave();
+
+ out.enter("th.first-col");
+ out.attrib("border-left", "1px solid #999999");
+ out.leave();
+
+ out.enter("td.first-col");
+ out.attrib("border-left", "1px solid #999999");
+ out.leave();
+
+ out.enter("td.block-header");
+ out.attrib("border-style", "none");
+ out.attrib("font-weight", "bold");
+ out.leave();
+
+ out.enter("td.block-footer");
+ out.attrib("border-right", "1px none #999999");
+ out.attrib("border-top", "1px solid #999999");
+ out.leave();
+
+ out.enter("a, a:visited, a:active");
+ out.attrib("color", "#000080");
+ out.attrib("text-decoration", "none");
+ out.leave();
+
+ out.enter("a:hover");
+ out.attrib("color", "#FFFFFF");
+ out.attrib("background", "#000080");
+ out.attrib("text-decoration", "none");
+ out.leave();
+
+ out.enter("tr.attr-first-row td");
+ out.attrib("border-right", "1px solid #999999");
+ out.attrib("border-top", "1px solid #999999");
+ out.leave();
+
+ out.enter("td.attr-first-col");
+ out.attrib("text-align", "left");
+ out.attrib("font-weight", "normal");
+ out.attrib("border-left", "1px solid #999999");
+ out.attrib("background-color", "#DDDDDD");
+ out.leave();
+ }
+
+ /**
+ * Produce the frame set.
+ */
+ private void produceFrameSet()
+ throws IOException {
+ HtmlWriter out = createHtmlWriter("index.html");
+ produceFrameSet(out);
+ out.close();
+ }
+
+ /**
+ * Produce the frame set.
+ */
+ private void produceFrameSet(HtmlWriter out)
+ throws IOException {
+ NodeType firstNode = getNodeTypes().getNodeType(0);
+ String firstName = firstNode != null ? getFileName("types", firstNode.getName()) : "";
+
+ htmlBegin(out, getTitle(), "default.css", false);
+ out.enter("frameset").attrib("cols", "20%,80%");
+ out.enter("frame").attrib("src", "toc.html").attrib("name", "toc").leave();
+ out.enter("frame").attrib("src", firstName).attrib("name", "body").leave();
+ out.leave();
+ htmlEnd(out, false);
+ }
+
+ /**
+ * Produce the toc.
+ */
+ private void produceToc()
+ throws IOException {
+ HtmlWriter out = createHtmlWriter("toc.html");
+ produceToc(out);
+ out.close();
+ }
+
+ /**
+ * Produce the toc.
+ */
+ private void produceToc(HtmlWriter out)
+ throws IOException {
+ htmlBegin(out, getTitle(), "default.css", true);
+ produceNodeTypeToc(out, "Mixin Types", getNodeTypes().getMixinNodeTypes());
+ produceNodeTypeToc(out, "Node Types", getNodeTypes().getConcreteNodeTypes());
+ htmlEnd(out, true);
+ }
+
+ /**
+ * Produce the toc.
+ */
+ private void produceNodeTypeToc(HtmlWriter out, String title, NodeType[] nodeTypes)
+ throws IOException {
+ if (nodeTypes.length > 0) {
+ htmlHeading(out, 3, title);
+ for (int i = 0; i < nodeTypes.length; i++) {
+ produceNodeTypeTocLink(out, nodeTypes[i]);
+ }
+ }
+ }
+
+ /**
+ * Produce toc link.
+ */
+ private void produceNodeTypeTocLink(HtmlWriter out, NodeType nt)
+ throws IOException {
+ String name = getFileName("types", nt.getName());
+ out.enter("a").attrib("href", name).attrib("target", "body");
+ out.text(nt.getName()).leave();
+ out.enter("br").leave();
+ }
+
+ /**
+ * Produce node type doc.
+ */
+ private void produceNodeTypes()
+ throws IOException {
+ NodeType[] list = getNodeTypes().getNodeTypes();
+ for (int i = 0; i < list.length; i++) {
+ produceNodeType(list[i]);
+ }
+ }
+
+ /**
+ * Produce node type doc.
+ */
+ private void produceNodeType(NodeType nt)
+ throws IOException {
+ HtmlWriter out = createHtmlWriter(getFileName("types", nt.getName()));
+ produceNodeType(out, nt);
+ out.close();
+ }
+
+ /**
+ * Produce node type doc.
+ */
+ private void produceNodeType(HtmlWriter out, NodeType nt)
+ throws IOException {
+ htmlBegin(out, nt.getName(), "../default.css", true);
+ htmlHeading(out, 2, nt.getName());
+ out.enter("table").attrib("width", "100%").attrib("cellpadding", "1");
+ out.attrib("cellspacing", "0").attrib("border", "0");
+
+ produceAttribBlock(out, nt);
+ produceNodeDefsBlock(out, nt);
+ producePropertyDefsBlock(out, nt);
+
+ out.leave();
+ htmlEnd(out, true);
+ }
+
+ /**
+ * Produce child node defs block.
+ */
+ private void produceNodeDefsBlock(HtmlWriter out, NodeType type)
+ throws IOException {
+ // Add normal definitions
+ NodeDef[] defs = type.getNodeDefs();
+ if (defs.length > 0) {
+ produceBlockHeader(out, "Child Node Definitions");
+ produceNodeDefHeader(out, false);
+
+ for (int i = 0; i < defs.length; i++) {
+ produceNodeDefData(out, defs[i], false);
+ }
+
+ produceBlockFooter(out);
+ }
+
+ // Add inherited definitions
+ defs = type.getInheritedNodeDefs();
+ if (defs.length > 0) {
+ produceBlockHeader(out, "Inherited Child Node Definitions");
+ produceNodeDefHeader(out, true);
+
+ for (int i = 0; i < defs.length; i++) {
+ produceNodeDefData(out, defs[i], true);
+ }
+
+ produceBlockFooter(out);
+ }
+ }
+
+ /**
+ * Produce property defs block.
+ */
+ private void producePropertyDefsBlock(HtmlWriter out, NodeType type)
+ throws IOException {
+ // Add normal definitions
+ PropertyDef[] defs = type.getPropertyDefs();
+ if (defs.length > 0) {
+ produceBlockHeader(out, "Property Definitions");
+ producePropertyDefHeader(out, false);
+
+ for (int i = 0; i < defs.length; i++) {
+ producePropertyDefData(out, defs[i], false);
+ }
+
+ produceBlockFooter(out);
+ }
+
+ // Add inherited definitions
+ defs = type.getInheritedPropertyDefs();
+ if (defs.length > 0) {
+ produceBlockHeader(out, "Inherited Property Definitions");
+ producePropertyDefHeader(out, true);
+
+ for (int i = 0; i < defs.length; i++) {
+ producePropertyDefData(out, defs[i], true);
+ }
+
+ produceBlockFooter(out);
+ }
+ }
+
+ /**
+ * Produce child def row.
+ */
+ private void produceNodeDefHeader(HtmlWriter out, boolean inherited)
+ throws IOException {
+ out.enter("tr");
+ out.enter("th").attrib("class", "first-col").text("Name").leave();
+ out.enter("th").attrib("title", "Declaring Node Type").text("Decl. Type").leave();
+ out.enter("th").attrib("title", "Required Node Types").text("Req. Types").leave();
+ out.enter("th").attrib("title", "Defining Node Type").attrib("colspan", "2").text("Def. Type").leave();
+ out.enter("th").attrib("title", "On Parent Version").text("OPV").leave();
+ out.enter("th").attrib("title", "Auto Created").text("AC").leave();
+ out.enter("th").attrib("title", "Mandatory").text("Man").leave();
+ out.enter("th").attrib("title", "Protected").text("Prot").leave();
+ out.enter("th").attrib("title", "Same Name Siblings").text("SNS").leave();
+ out.leave();
+ }
+
+ /**
+ * Produce child def row.
+ */
+ private void produceNodeDefData(HtmlWriter out, NodeDef def, boolean inherited)
+ throws IOException {
+ out.enter("tr");
+ out.enter("td").attrib("class", "first-col").text(def.getName()).leave();
+
+ out.enter("td");
+ produceValue(out, def.getDeclaringNodeType().getName(), true);
+ out.leave();
+
+ out.enter("td");
+ produceValueList(out, def.getRequiredPrimaryTypes(), true);
+ out.leave();
+
+ out.enter("td").attrib("colspan", "2");
+ produceValue(out, def.getDefaultPrimaryType(), true);
+ out.leave();
+
+ out.enter("td").text(def.getOnParentVersionString()).leave();
+ produceBooleanFlag(out, def.isAutoCreated());
+ produceBooleanFlag(out, def.isMandatory());
+ produceBooleanFlag(out, def.isProtected());
+ produceBooleanFlag(out, def.isMultiple());
+ }
+
+ /**
+ * Produce property def row.
+ */
+ private void producePropertyDefHeader(HtmlWriter out, boolean inherited)
+ throws IOException {
+ out.enter("tr");
+ out.enter("th").attrib("class", "first-col").text("Name").leave();
+ out.enter("th").attrib("title", "Declaring Node Type").text("Decl. Type").leave();
+ out.enter("th").attrib("title", "Required Type").text("Req. Type").leave();
+ out.enter("th").attrib("title", "Default Value").text("Default").leave();
+ out.enter("th").attrib("title", "Constraint").text("Constraint").leave();
+ out.enter("th").attrib("title", "On Parent Version").text("OPV").leave();
+ out.enter("th").attrib("title", "Auto Created").text("AC").leave();
+ out.enter("th").attrib("title", "Mandatory").text("Man").leave();
+ out.enter("th").attrib("title", "Protected").text("Prot").leave();
+ out.enter("th").attrib("title", "Multiple Values").text("Mul").leave();
+ out.leave();
+ }
+
+ /**
+ * Produce property def row.
+ */
+ private void producePropertyDefData(HtmlWriter out, PropertyDef def, boolean inherited)
+ throws IOException {
+ out.enter("tr");
+ out.enter("td").attrib("class", "first-col").text(def.getName()).leave();
+
+ out.enter("td");
+ produceValue(out, def.getDeclaringNodeType().getName(), true);
+ out.leave();
+
+ out.enter("td");
+ produceValue(out, def.getRequiredTypeString(), false);
+ out.leave();
+
+ out.enter("td");
+ produceValueList(out, def.getDefaultValues(), false);
+ out.leave();
+
+ out.enter("td");
+ produceValueList(out, def.getConstraints(), false);
+ out.leave();
+
+ out.enter("td").text(def.getOnParentVersionString()).leave();
+ produceBooleanFlag(out, def.isAutoCreated());
+ produceBooleanFlag(out, def.isMandatory());
+ produceBooleanFlag(out, def.isProtected());
+ produceBooleanFlag(out, def.isMultiple());
+ }
+
+ /**
+ * Produce attribute block.
+ */
+ private void produceAttribBlock(HtmlWriter out, NodeType nt)
+ throws IOException {
+ produceBlockHeader(out, "Node Type Attributes");
+ // produceAttribHeader(out);
+ produceAttribData(out, "Node Type Name", nt.getName(), true, false);
+ produceAttribData(out, "Node Type Namespace", nt.getNamespace(), false, false);
+ produceAttribData(out, "Mixin Node Type", String.valueOf(nt.isMixin()), false, false);
+ produceAttribData(out, "Orderable child nodes", String.valueOf(nt.isOrderable()), false, false);
+ produceAttribData(out, "Primary Item Name", nt.getPrimaryItemName(), false, false);
+ produceAttribData(out, "Supertypes", nt.getSuperTypes(), false, true);
+ produceBlockFooter(out);
+ }
+
+ /**
+ * Block header.
+ */
+ private void produceBlockHeader(HtmlWriter out, String name)
+ throws IOException {
+ out.enter("tr");
+ out.enter("td").attrib("class", "block-header").text(name).leave();
+ out.leave();
+ }
+
+ /**
+ * Block footer.
+ */
+ private void produceBlockFooter(HtmlWriter out)
+ throws IOException {
+ out.enter("tr");
+ out.enter("td").attrib("class", "block-footer").attrib("colspan", "10");
+ out.spacer().leave();
+ out.leave();
+ }
+
+ /**
+ * Produce attrib row.
+ */
+ private void produceAttribData(HtmlWriter out, String name, Object value, boolean first, boolean link)
+ throws IOException {
+ out.enter("tr");
+
+ if (first) {
+ out.attrib("class", "attr-first-row");
+ }
+
+ out.enter("td").attrib("class", "attr-first-col").text(name).leave();
+ out.enter("td").attrib("colspan", "9");
+
+ if (value instanceof String[]) {
+ produceValueList(out, (String[]) value, link);
+ } else if (value != null) {
+ produceValue(out, value.toString(), link);
+ }
+
+ out.spacer();
+ out.leave();
+ out.leave();
+ }
+
+ /**
+ * Produce name link.
+ */
+ private void produceValue(HtmlWriter out, String name, boolean link)
+ throws IOException {
+ if (link) {
+ link = getNodeTypes().getNodeType(name) != null;
+ }
+
+ if (link) {
+ out.enter("a").attrib("href", getFileName(null, name)).text(name.trim()).leave();
+ } else {
+ out.text(name);
+ }
+
+ out.spacer();
+ }
+
+ /**
+ * Produce name link.
+ */
+ private void produceValueList(HtmlWriter out, String[] names, boolean link)
+ throws IOException {
+ if (names != null) {
+ for (int i = 0; i < names.length; i++) {
+ if (i > 0) {
+ out.enter("br").leave();
+ }
+
+ produceValue(out, names[i], link);
+ }
+ }
+
+ out.spacer();
+ }
+
+ /**
+ * Produce boolean flag.
+ */
+ private void produceBooleanFlag(HtmlWriter out, boolean value)
+ throws IOException {
+ out.enter("td");
+ if (value) {
+ out.enter("li").attrib("type", "disc").leave();
+ }
+
+ out.spacer();
+ out.leave();
+ }
+
+ /**
+ * Title tag.
+ */
+ private void htmlHeading(HtmlWriter out, int level, String title)
+ throws IOException {
+ out.enter("h" + level).text(title).leave();
+ }
+
+ /**
+ * Html begin.
+ */
+ private void htmlBegin(HtmlWriter out, String title, String css, boolean body)
+ throws IOException {
+ out.enter("html");
+ out.enter("head");
+ out.enter("title").text(title).leave();
+ out.enter("link").attrib("href", css).attrib("rel", "stylesheet").
+ attrib("type", "text/css").leave();
+ out.leave();
+
+ if (body) {
+ out.enter("body");
+ }
+ }
+
+ /**
+ * Html end.
+ */
+ private void htmlEnd(HtmlWriter out, boolean body)
+ throws IOException {
+ if (body) {
+ out.leave();
+ }
+
+ out.leave();
+ }
+
+ /**
+ * Return name of file.
+ */
+ private String getFileName(String prefix, String name) {
+ String tmp = name.replace(':', '-') + ".html";
+ if ((prefix != null) && (prefix.length() > 0)) {
+ return prefix + "/" + tmp;
+ } else {
+ return tmp;
+ }
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/producer/StandardProducer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/Reporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/Reporter.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/Reporter.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/Reporter.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.reporter;
+
+/**
+ * This interface defines the logging reporter.
+ */
+public interface Reporter {
+ /**
+ * Report info.
+ */
+ public void info(String msg);
+
+ /**
+ * Report warning.
+ */
+ public void warning(String msg);
+
+ /**
+ * Report error.
+ */
+ public void error(String msg);
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/Reporter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/ReporterDelegator.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/ReporterDelegator.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/ReporterDelegator.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/ReporterDelegator.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.reporter;
+
+/**
+ * This class implements the reporter delegator.
+ */
+public class ReporterDelegator
+ implements Reporter {
+ /**
+ * Reporter.
+ */
+ private Reporter reporter;
+
+ /**
+ * Return the reporter.
+ */
+ public Reporter getReporter() {
+ return this.reporter;
+ }
+
+ /**
+ * Set the reporter.
+ */
+ public void setReporter(Reporter reporter) {
+ this.reporter = reporter;
+ }
+
+ /**
+ * Report info.
+ */
+ public void info(String msg) {
+ if (this.reporter != null) {
+ this.reporter.info(msg);
+ }
+ }
+
+ /**
+ * Report warning.
+ */
+ public void warning(String msg) {
+ if (this.reporter != null) {
+ this.reporter.warning(msg);
+ }
+ }
+
+ /**
+ * Report error.
+ */
+ public void error(String msg) {
+ if (this.reporter != null) {
+ this.reporter.error(msg);
+ }
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/ReporterDelegator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/SimpleReporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/SimpleReporter.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/SimpleReporter.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/SimpleReporter.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.reporter;
+
+import java.io.*;
+
+/**
+ * This class implements the simple reporter.
+ */
+public final class SimpleReporter
+ implements Reporter {
+ /**
+ * Print stream.
+ */
+ private final PrintStream out;
+
+ /**
+ * Construct the reporter.
+ */
+ public SimpleReporter(PrintStream out) {
+ this.out = out;
+ }
+
+ /**
+ * Write line.
+ */
+ private void report(String level, String msg) {
+ if (this.out != null) {
+ this.out.println("[" + level + "] " + msg);
+ }
+ }
+
+ /**
+ * Report info.
+ */
+ public void info(String msg) {
+ report("INFO", msg);
+ }
+
+ /**
+ * Report warning.
+ */
+ public void warning(String msg) {
+ report("WARNING", msg);
+ }
+
+ /**
+ * Report error.
+ */
+ public void error(String msg) {
+ report("ERROR", msg);
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/reporter/SimpleReporter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/CssWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/CssWriter.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/CssWriter.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/CssWriter.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.util;
+
+import java.io.*;
+
+/**
+ * This class implements the CSS writer.
+ */
+public final class CssWriter {
+ /**
+ * Print writer.
+ */
+ private final PrintWriter out;
+
+ /**
+ * Construct the document.
+ */
+ public CssWriter(Writer out) {
+ this.out = new PrintWriter(out);
+ }
+
+ /**
+ * Start class.
+ */
+ public CssWriter enter(String name) {
+ this.out.println(name + " {");
+ return this;
+ }
+
+ /**
+ * Add attribute.
+ */
+ public CssWriter attrib(String name, String value) {
+ this.out.println(name + ": " + value + ";");
+ return this;
+ }
+
+ /**
+ * End class.
+ */
+ public CssWriter leave() {
+ this.out.println("}");
+ return this;
+ }
+
+ /**
+ * Flush the document.
+ */
+ public void flush() {
+ this.out.flush();
+ }
+
+ /**
+ * Close the document.
+ */
+ public void close() {
+ this.out.close();
+ }
+}
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/CssWriter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/HtmlWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/HtmlWriter.java?view=auto&rev=454430
==============================================================================
--- jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/HtmlWriter.java (added)
+++ jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/HtmlWriter.java Mon Oct 9 10:11:42 2006
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.ntdoc.util;
+
+import java.io.*;
+import java.util.*;
+
+/**
+ * This class implements the html writer.
+ */
+public final class HtmlWriter {
+ /**
+ * Print writer.
+ */
+ private final PrintWriter out;
+
+ /**
+ * Element open.
+ */
+ private boolean elementOpen;
+
+ /**
+ * Element stack.
+ */
+ private final Stack elementStack;
+
+ /**
+ * Construct the document.
+ */
+ public HtmlWriter(Writer out) {
+ this.out = new PrintWriter(out);
+ this.elementStack = new Stack();
+ this.elementOpen = false;
+ }
+
+ /**
+ * Push element.
+ */
+ private void pushElement(String name) {
+ closeElement(false);
+ this.elementOpen = true;
+ this.elementStack.push(name);
+ }
+
+ /**
+ * Pop element.
+ */
+ private String popElement() {
+ if (!this.elementStack.isEmpty()) {
+ return (String) this.elementStack.pop();
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Close element. Return true if closed.
+ */
+ private boolean closeElement(boolean leave) {
+ if (this.elementOpen) {
+ if (leave) {
+ this.out.print("/>");
+ popElement();
+ } else {
+ this.out.print(">");
+ }
+
+ this.elementOpen = false;
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Start element.
+ */
+ public HtmlWriter enter(String name) {
+ pushElement(name);
+ this.out.print("<" + name);
+ return this;
+ }
+
+ /**
+ * Add attribute.
+ */
+ public HtmlWriter attrib(String name, String value) {
+ if (this.elementOpen) {
+ this.out.print(" " + name + "=\"" + value + "\"");
+ }
+
+ return this;
+ }
+
+ /**
+ * Add text.
+ */
+ public HtmlWriter text(String value) {
+ closeElement(false);
+ this.out.print(value);
+ return this;
+ }
+
+ /**
+ * Add text.
+ */
+ public HtmlWriter spacer() {
+ return text(" ");
+ }
+
+ /**
+ * End element.
+ */
+ public HtmlWriter leave() {
+ if (!closeElement(true)) {
+ String name = popElement();
+ if (name != null) {
+ this.out.print("</" + name + ">");
+ }
+ }
+
+ return this;
+ }
+
+ /**
+ * Flush the document.
+ */
+ public void flush() {
+ this.out.flush();
+ }
+
+ /**
+ * Close the document.
+ */
+ public void close() {
+ this.out.close();
+ }
+}
+
Propchange: jackrabbit/trunk/contrib/jackrabbit-ntdoc/src/main/java/org/apache/jackrabbit/ntdoc/util/HtmlWriter.java
------------------------------------------------------------------------------
svn:eol-style = native