com.sonoma
Class SiteMenu

java.lang.Object
  |
  +--com.sonoma.SiteMenu

public class SiteMenu
extends java.lang.Object

SiteMenu manages Chapters and Sections. Allowing users to add/edit/move/ and remove sections or chapters


Constructor Summary
SiteMenu()
          Creates new dbContent
 
Method Summary
 void addChapter(org.w3c.dom.Document doc, java.lang.String CurrentChapterID, java.lang.String Title, java.lang.String NewID)
          Creates a new Chapter in the DocBook
 org.w3c.dom.Node addSect1(org.w3c.dom.Document doc, java.lang.String Label, java.lang.String NewID, java.lang.String SectionID, java.lang.String ChapterID)
          adds a new section to a selected chapter before the chapter with the selectedID value
 org.w3c.dom.Node addSect1(org.w3c.dom.Node ndChapter, java.lang.String Label, java.lang.String NewID, XMLUtility myXML)
          adds a new section to the end of a chapter node
 java.lang.String createMenuXPath(java.lang.String ChapterID)
          Creates a valid XPath with a ChapterID
 java.lang.String createMenuXPath(java.lang.String ChapterID, java.lang.String SectionID)
          Creates a valid XPath with a Chapter and SectionID
 org.w3c.dom.Node moveChapter(org.w3c.dom.Document doc, java.lang.String OldID, java.lang.String NewID)
          Removes a chapter and adds it back in a new location (before the new location)
 org.w3c.dom.Node moveSect1(org.w3c.dom.Document doc, java.lang.String CurrentSectionID, java.lang.String CurrentChapterID, java.lang.String NewSectionID, java.lang.String NewChapterID)
          Moves a section from one place to another within the DocBook file
 org.w3c.dom.Node removeChapter(org.w3c.dom.Document doc, java.lang.String OldID)
          Removes a chapter
 org.w3c.dom.Node removeSect1(org.w3c.dom.Document doc, java.lang.String SectionID, java.lang.String ChapterID)
          Removes a section from a chapter in the DocBook file
 void updateChapter(org.w3c.dom.Document doc, java.lang.String OldID, java.lang.String NewID, java.lang.String NewTitle)
          Updates a new Chapter in the DocBook
 void updateSect1(org.w3c.dom.Document doc, java.lang.String Label, java.lang.String NewID, java.lang.String SectionID, java.lang.String ChapterID)
          Updates a Section
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiteMenu

public SiteMenu()
Creates new dbContent
Method Detail

createMenuXPath

public java.lang.String createMenuXPath(java.lang.String ChapterID,
                                        java.lang.String SectionID)
Creates a valid XPath with a Chapter and SectionID
Parameters:
doc - is the current DocBook
ChapterID - is the Chapter's @id attribute value
SectionID - is the sections @id attribute Value

createMenuXPath

public java.lang.String createMenuXPath(java.lang.String ChapterID)
Creates a valid XPath with a ChapterID
Parameters:
doc - is the current DocBook
ChapterID - is the Chapter's @id attribute value

addChapter

public final void addChapter(org.w3c.dom.Document doc,
                             java.lang.String CurrentChapterID,
                             java.lang.String Title,
                             java.lang.String NewID)
Creates a new Chapter in the DocBook
Parameters:
doc - is the current DocBook
CurrentChapterID - is where the new chapter will be inserted (before the current)
Title - a text title for the chapter
NewID - is the @id attribute for the new chapter.

updateChapter

public void updateChapter(org.w3c.dom.Document doc,
                          java.lang.String OldID,
                          java.lang.String NewID,
                          java.lang.String NewTitle)
Updates a new Chapter in the DocBook
Parameters:
doc - is the current DocBook
OldID - the current DocBook chapter @id attribute value
NewTitle - is the new text title for the chapter
NewID - is the new @id attribute for the chapter.

moveChapter

public org.w3c.dom.Node moveChapter(org.w3c.dom.Document doc,
                                    java.lang.String OldID,
                                    java.lang.String NewID)
Removes a chapter and adds it back in a new location (before the new location)
Parameters:
doc - is the current DocBook
OldID - the current DocBook chapter @id attribute value
NewID - the current chapter will be pasted before the chapter with this @id attribute.

removeChapter

public org.w3c.dom.Node removeChapter(org.w3c.dom.Document doc,
                                      java.lang.String OldID)
Removes a chapter
Parameters:
doc - is the current DocBook
OldID - the current DocBook chapter @id attribute value

addSect1

public org.w3c.dom.Node addSect1(org.w3c.dom.Node ndChapter,
                                 java.lang.String Label,
                                 java.lang.String NewID,
                                 XMLUtility myXML)
adds a new section to the end of a chapter node
Parameters:
ndChapter - the current chapter
Label - is the value for the chapter's @label attribute
NewID - is the value for the chapter's @id attribute

addSect1

public org.w3c.dom.Node addSect1(org.w3c.dom.Document doc,
                                 java.lang.String Label,
                                 java.lang.String NewID,
                                 java.lang.String SectionID,
                                 java.lang.String ChapterID)
adds a new section to a selected chapter before the chapter with the selectedID value
Parameters:
doc - the current DocBook XML file
Label - the label attribute for the new section
NewID - the id of the new section
SectionID - the new section will be inserted before this section
ChapterID - used to select the correct section in the correct Chapter

updateSect1

public void updateSect1(org.w3c.dom.Document doc,
                        java.lang.String Label,
                        java.lang.String NewID,
                        java.lang.String SectionID,
                        java.lang.String ChapterID)
Updates a Section
Parameters:
doc - the current DocBook XML file
Label - the label attribute for the new section
NewID - the new id of the section
SectionID - the current id of the section
ChapterID - used to select the correct section in the correct Chapter

moveSect1

public org.w3c.dom.Node moveSect1(org.w3c.dom.Document doc,
                                  java.lang.String CurrentSectionID,
                                  java.lang.String CurrentChapterID,
                                  java.lang.String NewSectionID,
                                  java.lang.String NewChapterID)
Moves a section from one place to another within the DocBook file
Parameters:
doc - the current DocBook XML file
CurrentSectionID - is the @id value of the section to be moved
CurrentChapterID - the @id value of the chapter of the current section to be moved
NewSectionID - is the section will be pasted before the section with this @id value and the @id value of the chapter.
NewChapterID - see above

removeSect1

public org.w3c.dom.Node removeSect1(org.w3c.dom.Document doc,
                                    java.lang.String SectionID,
                                    java.lang.String ChapterID)
Removes a section from a chapter in the DocBook file
Parameters:
SectionID - the current id of the section
ChapterID - used to select the correct section in the correct Chapter