SEC-1858: Removed methods for generating docbook for xsd

Not squashing so this is around if needed again
This commit is contained in:
Rob Winch 2011-11-11 09:00:53 -05:00
parent c8b847f1ed
commit ff495b698e
3 changed files with 0 additions and 92 deletions

View File

@ -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}<section xml:id="${id}">
${indent}<title><literal>${name}</literal></title>
${indent}<para>${desc}</para>
${prefix}</section>"""
}
def getId() {
return "${elmt.id}-${name}".toString()
}
public String toString() {
prefix + '@' + name + " - " + desc
}
}

View File

@ -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}<section xml:id="${id}-parents">
${indent}<title>Parent Elements of <literal>&lt;${name}&gt;</literal></title>
${indent}<orderedlist>"""
parentElmts.sort {l,r -> l.name.compareTo(r.name)}.each {
parents += """\n${indent} <listitem><link xlink:href="#${it.id}">${it.name}</link></listitem>"""
}
parents += "\n${indent}</orderedlist>\n${prefix}</section>"
parents
}
def docbookChildElmts(prefix) {
if(!childElmts) {
return ''
}
def indent = prefix+' '
def children = """
${prefix}<section xml:id="${id}-children">
${indent}<title>Child Elements of <literal>&lt;${name}&gt;</literal></title>
${indent}<orderedlist>"""
childElmts.values().sort {l,r -> l.name.compareTo(r.name)}.each {
children += """\n${indent} <listitem><link xlink:href="#${it.id}">${it.name}</link></listitem>"""
}
children += "\n${indent}</orderedlist>\n${prefix}</section>"
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}<section xml:id="${id}-attributes">
${indent} <title><literal>&lt;${name}&gt;</literal> Attributes</title>${attributes}
${indent}</section>"""
}
def childElmts = docbookChildElmts(indent)
def elements = ""
childElmts.values().sort {l,r -> l.name.compareTo(r.name)}.each {
elements += it.toDocbook(prefix)
}
"""
${prefix}<section xml:id="${id}">
${indent}<title><literal>&lt;${name}&gt;</literal></title>
${indent}<para>${desc}</para>${parentElmt}${attributes}${childElmts}
${prefix}</section>${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) }

View File

@ -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) }