From ff495b698e0e047594fcd3ea5f407e6d5bccc378 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Fri, 11 Nov 2011 09:00:53 -0500 Subject: [PATCH] SEC-1858: Removed methods for generating docbook for xsd Not squashing so this is around if needed again --- .../security/config/doc/Attribute.groovy | 16 ---- .../security/config/doc/Element.groovy | 74 ------------------- .../config/doc/SpringSecurityXsdParser.groovy | 2 - 3 files changed, 92 deletions(-) diff --git a/config/src/test/groovy/org/springframework/security/config/doc/Attribute.groovy b/config/src/test/groovy/org/springframework/security/config/doc/Attribute.groovy index 398e543d69..6ec02e4011 100644 --- a/config/src/test/groovy/org/springframework/security/config/doc/Attribute.groovy +++ b/config/src/test/groovy/org/springframework/security/config/doc/Attribute.groovy @@ -23,27 +23,11 @@ package org.springframework.security.config.doc * @see XsdDocumentedSpec */ class Attribute { - def prefix = "" def name def desc def elmt - def indent() { - prefix += " " - } - - def toDocbook(prefix) { - def indent = " "+prefix - """ -${prefix}
-${indent}<literal>${name}</literal> -${indent}${desc} -${prefix}
""" - } def getId() { return "${elmt.id}-${name}".toString() } - public String toString() { - prefix + '@' + name + " - " + desc - } } diff --git a/config/src/test/groovy/org/springframework/security/config/doc/Element.groovy b/config/src/test/groovy/org/springframework/security/config/doc/Element.groovy index 95120da58c..225eff05a9 100644 --- a/config/src/test/groovy/org/springframework/security/config/doc/Element.groovy +++ b/config/src/test/groovy/org/springframework/security/config/doc/Element.groovy @@ -23,7 +23,6 @@ package org.springframework.security.config.doc * @see XsdDocumentedSpec */ class Element { - def prefix = "" def name def desc def attrs @@ -34,12 +33,6 @@ class Element { def childElmts = [:] def parentElmts = [:] - def indent() { - prefix += " " - attrs*.indent() - childElmts.values()*.indent() - } - def getId() { return "nsa-${name}".toString() } @@ -83,73 +76,6 @@ class Element { ids } - def getFullName() { - parentElmt ? parentElmt.fullName+"-"+name : name - } - - def docbookParentElmts(prefix) { - if(parentElmts.empty) { - return '' - } - def indent = prefix+' ' - def parents = """ -${prefix}
-${indent}Parent Elements of <literal><${name}></literal> -${indent}""" - parentElmts.sort {l,r -> l.name.compareTo(r.name)}.each { - parents += """\n${indent} ${it.name}""" - } - parents += "\n${indent}\n${prefix}
" - parents - } - - def docbookChildElmts(prefix) { - if(!childElmts) { - return '' - } - def indent = prefix+' ' - def children = """ -${prefix}
-${indent}Child Elements of <literal><${name}></literal> -${indent}""" - childElmts.values().sort {l,r -> l.name.compareTo(r.name)}.each { - children += """\n${indent} ${it.name}""" - } - children += "\n${indent}\n${prefix}
" - children - } - def toDocbook(prefix) { - def indent = prefix+' ' - def parentElmt = docbookParentElmts(indent) - def attributes = "" - attrs.sort {l,r -> l.name.compareTo(r.name)}.each { - attributes += it.toDocbook(indent+' ') - } - if(attributes) { - attributes = """ -${indent}
-${indent} <literal><${name}></literal> Attributes${attributes} -${indent}
""" - } - def childElmts = docbookChildElmts(indent) - def elements = "" - childElmts.values().sort {l,r -> l.name.compareTo(r.name)}.each { - elements += it.toDocbook(prefix) - } - """ -${prefix}
-${indent}<literal><${name}></literal> -${indent}${desc}${parentElmt}${attributes}${childElmts} -${prefix}
${elements}""" - } - - public String toString() { - def result = prefix + name + " - " + desc+"\n" - attrs.sort {l,r -> l.name.compareTo(r.name)}.each { result+= it.toString()} - childElmts.values().sort {l,r -> l.name.compareTo(r.name)}.each { result+= it.toString() } - result - } - def getAllChildElmts() { def result = [:] childElmts.values()*.subGrps*.each { elmt -> result.put(elmt.name,elmt) } diff --git a/config/src/test/groovy/org/springframework/security/config/doc/SpringSecurityXsdParser.groovy b/config/src/test/groovy/org/springframework/security/config/doc/SpringSecurityXsdParser.groovy index 6c5a081a44..e978588281 100644 --- a/config/src/test/groovy/org/springframework/security/config/doc/SpringSecurityXsdParser.groovy +++ b/config/src/test/groovy/org/springframework/security/config/doc/SpringSecurityXsdParser.groovy @@ -162,8 +162,6 @@ class SpringSecurityXsdParser { e.childElmts = elements(n) e.attrs = attrs(n) e.attrs.addAll(attrgrps(n)) - e.childElmts.values()*.indent() - e.attrs*.indent() e.attrs*.elmt = e e.childElmts.values()*.each { it.parentElmts.put(e.name,e) }