You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/11/27 09:10:16 UTC

[sling-org-apache-sling-jcr-webconsole] branch feature/latest-parent created (now bc39996)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch feature/latest-parent
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-webconsole.git.


      at bc39996  SLING-9946 switch to latest parent

This branch includes the following new commits:

     new bc39996  SLING-9946 switch to latest parent

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-jcr-webconsole] 01/01: SLING-9946 switch to latest parent

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/latest-parent
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-webconsole.git

commit bc39996f2400d9aee008be33ec2c28e97a9ce241
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Nov 27 10:10:01 2020 +0100

    SLING-9946 switch to latest parent
---
 pom.xml                                            |  56 ++---
 .../internal/DescriptorsConfigurationPrinter.java  |  74 ------
 .../webconsole/internal/DescriptorsPrinter.java    |  51 ++++
 .../internal/NamespaceConfigurationPrinter.java    | 100 --------
 .../jcr/webconsole/internal/NamespacesPrinter.java |  79 +++++++
 .../internal/NodeTypeConfigurationPrinter.java     | 257 ++++++++-------------
 6 files changed, 239 insertions(+), 378 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9d6999c..2bb4899 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,34 +1,34 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
     Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
+    or more contributor license agreements. See the NOTICE file
     distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
+    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
+    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
+    KIND, either express or implied. See the License for the
     specific language governing permissions and limitations
     under the License.
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.sling</groupId>
-        <artifactId>sling</artifactId>
-        <version>26</version>
+        <artifactId>sling-bundle-parent</artifactId>
+        <version>40</version>
         <relativePath/>
     </parent>
 
     <artifactId>org.apache.sling.jcr.webconsole</artifactId>
-    <packaging>bundle</packaging>
     <version>1.0.3-SNAPSHOT</version>
 
     <name>Apache Sling JCR WebConsole Bundle</name>
@@ -42,30 +42,6 @@
         <url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-jcr-webconsole.git</url>
     </scm>
 
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <version>1.26.4</version>        
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Bundle-Category>
-                            sling,jcr
-                        </Bundle-Category>
-                        <Private-Package>
-                            org.apache.sling.jcr.webconsole.internal.*
-                        </Private-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
     <reporting>
         <plugins>
             <plugin>
@@ -88,24 +64,24 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.api</artifactId>
-            <version>2.0.6</version>
+            <version>2.2.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.webconsole</artifactId>
-            <version>3.0.0</version>
+            <groupId>javax.servlet</groupId>
+            <artifactId>javax.servlet-api</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.4</version>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <artifactId>org.apache.felix.inventory</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 
diff --git a/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsConfigurationPrinter.java b/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsConfigurationPrinter.java
deleted file mode 100644
index cbc2695..0000000
--- a/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsConfigurationPrinter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * 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.sling.jcr.webconsole.internal;
-
-import java.io.PrintWriter;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.webconsole.ConfigurationPrinter;
-import org.apache.sling.jcr.api.SlingRepository;
-
-/**
- * A Felix WebConsole ConfigurationPrinter which outputs the current JCR
- * repository descriptors.
- */
-@Component
-@Service(ConfigurationPrinter.class)
-@Properties({
-    @Property(name = "service.description", value = "JCR Descriptors Configuration Printer"),
-    @Property(name = "service.vendor", value = "The Apache Software Foundation")
-})
-public class DescriptorsConfigurationPrinter implements ConfigurationPrinter {
-
-
-    @Reference(policy=ReferencePolicy.DYNAMIC)
-    private volatile SlingRepository slingRepository;
-
-    /**
-     * Get the title of the configuration status page.
-     *
-     * @return the title
-     */
-    public String getTitle() {
-        return "JCR Descriptors";
-    }
-
-    /**
-     * Output a list of repository descriptors.
-     *
-     * @param pw a PrintWriter
-     */
-    public void printConfiguration(PrintWriter pw) {
-        if (slingRepository != null) {
-            final String[] descriptorKeys = slingRepository.getDescriptorKeys();
-            for (final String key : descriptorKeys) {
-                pw.printf("%s = %s\n", key, slingRepository.getDescriptor(key));
-            }
-        } else {
-            pw.println("SlingRepository is not available.");
-        }
-
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsPrinter.java b/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsPrinter.java
new file mode 100644
index 0000000..dfb2ef6
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/webconsole/internal/DescriptorsPrinter.java
@@ -0,0 +1,51 @@
+/**
+ * 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.sling.jcr.webconsole.internal;
+
+import java.io.PrintWriter;
+
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+/**
+ * A Felix WebConsole ConfigurationPrinter which outputs the current JCR
+ * repository descriptors.
+ */
+@Component(property = { InventoryPrinter.NAME + "=JCR Descriptors", InventoryPrinter.FORMAT  + "=TEXT"})
+public class DescriptorsPrinter implements InventoryPrinter {
+
+
+    @Reference
+    private SlingRepository slingRepository;
+
+    /**
+     * Output a list of repository descriptors.
+     */
+    @Override
+    public void print(PrintWriter printWriter, Format format, boolean isZip) {
+        final String[] descriptorKeys = slingRepository.getDescriptorKeys();
+        for (final String key : descriptorKeys) {
+            printWriter.printf("%s = %s%n", key, slingRepository.getDescriptor(key));
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespaceConfigurationPrinter.java b/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespaceConfigurationPrinter.java
deleted file mode 100644
index 30a1302..0000000
--- a/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespaceConfigurationPrinter.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * 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.sling.jcr.webconsole.internal;
-
-import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.jcr.NamespaceRegistry;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.webconsole.ConfigurationPrinter;
-import org.apache.sling.jcr.api.SlingRepository;
-
-/**
- * A Felix WebConsole ConfigurationPrinter which outputs the current JCR
- * namespace mappings.
- */
-@Component
-@Service(ConfigurationPrinter.class)
-@Properties({
-    @Property(name = "service.description", value = "JCR Namespace Configuration Printer"),
-    @Property(name = "service.vendor", value = "The Apache Software Foundation")
-})
-public class NamespaceConfigurationPrinter implements ConfigurationPrinter {
-
-
-    @Reference(policy=ReferencePolicy.DYNAMIC)
-    private volatile SlingRepository slingRepository;
-
-    /**
-     * Get the title of the configuration status page.
-     *
-     * @return the title
-     */
-    public String getTitle() {
-        return "JCR Namespaces";
-    }
-
-    /**
-     * Output a list of namespace prefixes and URIs from the NamespaceRegistry.
-     *
-     * @param pw a PrintWriter
-     */
-    public void printConfiguration(PrintWriter pw) {
-        if (slingRepository != null) {
-            Session session = null;
-            try {
-                session = slingRepository.loginAdministrative(null);
-                NamespaceRegistry reg = session.getWorkspace().getNamespaceRegistry();
-                List<String> globalPrefixes = Arrays.asList(reg.getPrefixes());
-                for (String prefix : session.getNamespacePrefixes()) {
-                    if (prefix.length() > 0) {
-                        pw.printf("%10s = %s", prefix, session.getNamespaceURI(prefix));
-                        if (globalPrefixes.contains(prefix)) {
-                            pw.print(" [global]");
-                        } else {
-                            pw.print(" [local]");
-                        }
-                        pw.println();
-                    }
-                }
-            } catch (RepositoryException e) {
-                pw.println("Unable to output namespace mappings.");
-                e.printStackTrace(pw);
-            } finally {
-                if (session != null) {
-                    session.logout();
-                }
-            }
-        } else {
-            pw.println("SlingRepository is not available.");
-        }
-
-    }
-
-}
diff --git a/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespacesPrinter.java b/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespacesPrinter.java
new file mode 100644
index 0000000..647ccf6
--- /dev/null
+++ b/src/main/java/org/apache/sling/jcr/webconsole/internal/NamespacesPrinter.java
@@ -0,0 +1,79 @@
+/**
+ * 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.sling.jcr.webconsole.internal;
+
+import java.io.PrintWriter;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import javax.jcr.NamespaceRegistry;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+
+/**
+ * A Felix WebConsole ConfigurationPrinter which outputs the current JCR
+ * namespace mappings.
+ */
+@Component(property = { InventoryPrinter.NAME + "=JCR Namespaces", InventoryPrinter.FORMAT  + "=TEXT"})
+public class NamespacesPrinter implements InventoryPrinter {
+
+    @Reference
+    private SlingRepository slingRepository;
+
+    /**
+     * Output a list of namespace prefixes and URIs from the NamespaceRegistry.
+     */
+    @Override
+    public void print(PrintWriter printWriter, Format format, boolean isZip) {
+        Session session = null;
+        try {
+            session = slingRepository.loginAdministrative(null);
+            NamespaceRegistry reg = session.getWorkspace().getNamespaceRegistry();
+            List<String> globalPrefixes = Arrays.asList(reg.getPrefixes());
+            List<String> localPrefixes = Arrays.asList(session.getNamespacePrefixes());
+            Collections.sort(localPrefixes);
+            for (String prefix : localPrefixes) {
+                if (prefix.length() > 0) {
+                    printWriter.printf("%10s = %s", prefix, session.getNamespaceURI(prefix));
+                    if (globalPrefixes.contains(prefix)) {
+                        printWriter.print(" [global]");
+                    } else {
+                        printWriter.print(" [local]");
+                    }
+                    printWriter.println();
+                }
+            }
+        } catch (RepositoryException e) {
+            printWriter.println("Unable to output namespace mappings.");
+            e.printStackTrace(printWriter);
+        } finally {
+            if (session != null) {
+                session.logout();
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/jcr/webconsole/internal/NodeTypeConfigurationPrinter.java b/src/main/java/org/apache/sling/jcr/webconsole/internal/NodeTypeConfigurationPrinter.java
index d31f4c0..c58fe1a 100644
--- a/src/main/java/org/apache/sling/jcr/webconsole/internal/NodeTypeConfigurationPrinter.java
+++ b/src/main/java/org/apache/sling/jcr/webconsole/internal/NodeTypeConfigurationPrinter.java
@@ -32,156 +32,21 @@ import javax.jcr.nodetype.NodeTypeManager;
 import javax.jcr.nodetype.PropertyDefinition;
 import javax.jcr.version.OnParentVersionAction;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
-import org.apache.felix.webconsole.ConfigurationPrinter;
-import org.apache.felix.webconsole.ModeAwareConfigurationPrinter;
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
 import org.apache.sling.jcr.api.SlingRepository;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
 
 /**
  * A Felix WebConsole ConfigurationPrinter which outputs the current JCR
  * nodetypes.
  */
-@Component
-@Service(ConfigurationPrinter.class)
-@Properties({
-    @Property(name = "service.description", value = "JCR Nodetype Configuration Printer"),
-    @Property(name = "service.vendor", value = "The Apache Software Foundation"),
-    @Property(name = "felix.webconsole.configprinter.web.unescaped", boolValue = true)
-})
-public class NodeTypeConfigurationPrinter implements ModeAwareConfigurationPrinter {
+@Component(property = { InventoryPrinter.NAME + "=JCR Node Types", InventoryPrinter.FORMAT  + "=TEXT"})
+public class NodeTypeConfigurationPrinter implements InventoryPrinter {
 
-    @Reference(policy = ReferencePolicy.DYNAMIC)
-    private volatile SlingRepository slingRepository;
-
-    /**
-     * Get the title of the configuration status page.
-     *
-     * @return the title
-     */
-    public String getTitle() {
-        return "JCR NodeTypes";
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    public void printConfiguration(PrintWriter pw, String mode) {
-        if (slingRepository != null) {
-            Session session = null;
-            try {
-                session = slingRepository.loginAdministrative(null);
-                NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
-                NodeTypeIterator it = ntm.getAllNodeTypes();
-                List<NodeType> sortedTypes = sortTypes(it);
-
-                for (NodeType nt : sortedTypes) {
-                    pw.printf("[%s]", nt.getName());
-
-                    printSuperTypes(pw, nt);
-
-                    if (nt.hasOrderableChildNodes()) {
-                        pw.print(" orderable");
-                    }
-                    if (nt.isMixin()) {
-                        pw.print(" mixin");
-                    }
-                    linebreak(pw, mode);
-
-                    for (PropertyDefinition prop : nt.getPropertyDefinitions()) {
-                        if (prop.getDeclaringNodeType() == nt) {
-                            startBold(pw, mode);
-                        }
-
-                        pw.printf("- %s", prop.getName());
-                        printDefaultValues(pw, prop);
-                        if (prop.getName().equals(nt.getPrimaryItemName())) {
-                            pw.print(" primary");
-                        }
-                        if (prop.isMandatory()) {
-                            pw.print(" mandatory");
-                        }
-                        if (prop.isAutoCreated()) {
-                            pw.print(" autocreated");
-                        }
-                        if (prop.isProtected()) {
-                            pw.print(" protected");
-                        }
-                        if (prop.isMultiple()) {
-                            pw.print(" multiple");
-                        }
-                        pw.printf(" %s", OnParentVersionAction.nameFromValue(prop.getOnParentVersion()));
-                        printConstraints(pw, prop);
-
-                        if (prop.getDeclaringNodeType() == nt) {
-                            stopBold(pw, mode);
-                        }
-
-                        linebreak(pw, mode);
-                    }
-                    for (NodeDefinition child : nt.getChildNodeDefinitions()) {
-                        if (child.getDeclaringNodeType() == nt) {
-                            startBold(pw, mode);
-                        }
-
-                        pw.printf("+ %s", child.getName());
-
-                        printRequiredChildTypes(pw, child);
-
-                        if (child.getDefaultPrimaryType() != null) {
-                            pw.printf(" = %s", child.getDefaultPrimaryType().getName());
-                        }
-
-                        if (child.isMandatory()) {
-                            pw.print(" mandatory");
-                        }
-                        if (child.isAutoCreated()) {
-                            pw.print(" autocreated");
-                        }
-                        if (child.isProtected()) {
-                            pw.print(" protected");
-                        }
-                        if (child.allowsSameNameSiblings()) {
-                            pw.print(" multiple");
-                        }
-                        pw.printf(" %s", OnParentVersionAction.nameFromValue(child.getOnParentVersion()));
-
-                        if (child.getDeclaringNodeType() == nt) {
-                            stopBold(pw, mode);
-                        }
-
-                        linebreak(pw, mode);
-                    }
-
-                    linebreak(pw, mode);
-
-                }
-            } catch (RepositoryException e) {
-                pw.println("Unable to output namespace mappings.");
-                e.printStackTrace(pw);
-            } finally {
-                if (session != null) {
-                    session.logout();
-                }
-            }
-        } else {
-            pw.println("SlingRepository is not available.");
-        }
-    }
-
-    /**
-     * Output a list of node types from the NamespaceRegistry.
-     *
-     * @param pw a PrintWriter
-     */
-    public void printConfiguration(PrintWriter pw) {
-        printConfiguration(pw, ConfigurationPrinter.MODE_TXT);
-
-    }
+    @Reference
+    private SlingRepository slingRepository;
 
     private List<NodeType> sortTypes(NodeTypeIterator it) {
         List<NodeType> types = new ArrayList<NodeType>();
@@ -197,26 +62,6 @@ public class NodeTypeConfigurationPrinter implements ModeAwareConfigurationPrint
         return types;
     }
 
-    private void linebreak(PrintWriter pw, String mode) {
-        if (ConfigurationPrinter.MODE_WEB.equals(mode)) {
-            pw.println("<br/>");
-        } else {
-            pw.println();
-        }
-    }
-
-    private void stopBold(PrintWriter pw, String mode) {
-        if (ConfigurationPrinter.MODE_WEB.equals(mode)) {
-            pw.print("</b>");
-        }
-    }
-
-    private void startBold(PrintWriter pw, String mode) {
-        if (ConfigurationPrinter.MODE_WEB.equals(mode)) {
-            pw.print("<b>");
-        }
-    }
-
     private void printRequiredChildTypes(PrintWriter pw, NodeDefinition child) {
         if (child.getRequiredPrimaryTypes() != null && child.getRequiredPrimaryTypes().length > 0) {
             pw.print(" (");
@@ -231,7 +76,6 @@ public class NodeTypeConfigurationPrinter implements ModeAwareConfigurationPrint
             }
             pw.print(")");
         }
-
     }
 
     private void printDefaultValues(PrintWriter pw, PropertyDefinition prop) throws RepositoryException {
@@ -274,4 +118,89 @@ public class NodeTypeConfigurationPrinter implements ModeAwareConfigurationPrint
             first = false;
         }
     }
+
+    @Override
+    public void print(PrintWriter pw, Format format, boolean isZip) {
+        Session session = null;
+        try {
+            session = slingRepository.loginAdministrative(null);
+            NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
+            NodeTypeIterator it = ntm.getAllNodeTypes();
+            List<NodeType> sortedTypes = sortTypes(it);
+
+            for (NodeType nt : sortedTypes) {
+                pw.printf("[%s]", nt.getName());
+
+                printSuperTypes(pw, nt);
+
+                if (nt.hasOrderableChildNodes()) {
+                    pw.print(" orderable");
+                }
+                if (nt.isMixin()) {
+                    pw.print(" mixin");
+                }
+                pw.println();
+
+                for (PropertyDefinition prop : nt.getPropertyDefinitions()) {
+
+                    pw.printf("- %s", prop.getName());
+                    printDefaultValues(pw, prop);
+                    if (prop.getName().equals(nt.getPrimaryItemName())) {
+                        pw.print(" primary");
+                    }
+                    if (prop.isMandatory()) {
+                        pw.print(" mandatory");
+                    }
+                    if (prop.isAutoCreated()) {
+                        pw.print(" autocreated");
+                    }
+                    if (prop.isProtected()) {
+                        pw.print(" protected");
+                    }
+                    if (prop.isMultiple()) {
+                        pw.print(" multiple");
+                    }
+                    pw.printf(" %s", OnParentVersionAction.nameFromValue(prop.getOnParentVersion()));
+                    printConstraints(pw, prop);
+
+
+                    pw.println();
+                }
+                for (NodeDefinition child : nt.getChildNodeDefinitions()) {
+
+                    pw.printf("+ %s", child.getName());
+
+                    printRequiredChildTypes(pw, child);
+
+                    if (child.getDefaultPrimaryType() != null) {
+                        pw.printf(" = %s", child.getDefaultPrimaryType().getName());
+                    }
+
+                    if (child.isMandatory()) {
+                        pw.print(" mandatory");
+                    }
+                    if (child.isAutoCreated()) {
+                        pw.print(" autocreated");
+                    }
+                    if (child.isProtected()) {
+                        pw.print(" protected");
+                    }
+                    if (child.allowsSameNameSiblings()) {
+                        pw.print(" multiple");
+                    }
+                    pw.printf(" %s", OnParentVersionAction.nameFromValue(child.getOnParentVersion()));
+
+                    pw.println();
+                }
+                pw.println();
+            }
+        } catch (RepositoryException e) {
+            pw.println("Unable to output node type definitions.");
+            e.printStackTrace(pw);
+        } finally {
+            if (session != null) {
+                session.logout();
+            }
+        }
+    }
 }
\ No newline at end of file