|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jdom.Document | +--org.thdl.tib.bibl.XMLDoc | +--org.thdl.tib.bibl.TibDoc
This class extends XMLDoc
and adds methods specific to the TiblEdit
program, primarily by creating a TitleFactory
and an IDFactory
that allow
easy access and manipulation of those marked up items. It also contains methods for creating
new apparatus or variant reading mark up and entering in translations within Foreign elements
contained inside the associated Title element that contains as its text the transliteration
of the Tibetan title.
Field Summary |
Fields inherited from class org.jdom.Document |
content, docType |
Constructor Summary | |
TibDoc(Element rootElement)
TibDoc has a single constructor that takes a root element for the document. |
Method Summary | |
void |
addEditor(String initials,
String fullName,
String today)
This method sets the information for the current user (=editor) of the program who is entering in translations and adding critical titles to the text. |
Element |
addTitle(Element elem,
String sigla,
String pagination)
This method takes a Title element, a sigla, and a pagination and creates a new edition title within a particular TitleDecl. |
void |
addTranslation(String text,
Element el)
This method takes a text string and a title element and uses it to insert an English translation for a title, by adding a Foreign element to the title element, setting its Lang=eng, and putting the text in its content. |
static String |
cleanString(String text)
This static method is used to clean up an string derrived from XML content that may have paragraph returns in the middle of it and preceding or trailing spaces, etc. |
Element |
createCriticalTitle(Element el,
String initials)
This creates a critical version of any title within a TitleDecl by adding a title element as its first child with a Corresp=Ng. |
String |
findTitleListEd(Element tdecl)
This method takes a titledecl from a title list and finds the edition listed in the first titleitem element. |
Element |
getHead()
This returns the text's main head element that contains the text header. |
String[] |
getHeadStrings()
This method returns an array of strings. |
org.thdl.tib.bibl.IDFactory |
getIDFactory()
Returns the IDFactory created for this document that allows easy access to and
manipulation of ID information, that is the Tibids contained within the text's TibidDecl. |
String |
getNormalizedTitle()
This method returns the normalized title of the text using the tibbibl's TitleFactory . |
String[] |
getSources()
This method returns a string array of the sources used in creating this master document. |
org.thdl.tib.bibl.TitleFactory |
getTitleFactory()
Returns the TitleFactory created for this document that allows easy access to and
manipulation of titles. |
String |
getTitleText(Element title)
This returns the text of a title element as it is displayed in the TextPane . |
Element |
insertApp(Element title,
String selText,
int offset)
This method takes a title element, a string of selected text, and an integer indicating the offset from the start of the text's title where the apparatus element is to be inserted. |
static Element |
makeDiscussion(org.thdl.tib.bibl.DiscDialog dd,
String inits)
|
Element |
makeHI(String rend)
|
static Element |
newApp(String mainWit,
String lemma)
This generic static method simply creates an unattached version of an app element with the main reading set. |
void |
removeApp(Element appToRemove)
This method removes an existing App element, replacing it with the text of its lemma or main reading child. |
void |
setDoxography(String tibDox,
String engDox)
This method sets the master doxogrpahy elements within the IntellDecl section of the Tibbibl. |
void |
setFactories()
This method sets the IDFactory variable and the TitleFactory variable
for this Tibbibl XML document. |
protected void |
setHead()
This method sets the first head element or the text header by searching for the first head element. |
void |
setMasterID(String idString)
This method takes a string ID where the subcategories are delimited by a period (".") and invokes the Tibbibl's IDFactory.setMasterID(String) method to parse the ID and create
the nested Tibid mark-up. |
static Element[] |
toElementArray(List childs)
This static method is used to convert standard lists, such as Vectors, into arrays of org.jdom.Elements. |
void |
updateTextHeader()
This method is called when the Normalized title and/or translation is changed. |
Methods inherited from class org.thdl.tib.bibl.XMLDoc |
findElement, findElement, findElements, findElements, findID, getAncestor, getEditorID, getEditorName, getID, getRoot, getSysid, getTagList, processDoc, refreshTagList, setEditorInfo, setID, setRoot, setSysid |
Methods inherited from class org.jdom.Document |
addContent, addContent, clone, detachRootElement, equals, getContent, getContent, getDocType, getRootElement, hashCode, hasRootElement, removeContent, removeContent, setContent, setDocType, setRootElement, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TibDoc(Element rootElement)
TibDoc has a single constructor that takes a root element for the document.
Method Detail |
protected void setHead()
This method sets the first head element or the text header by searching for the first head element.
public Element getHead()
This returns the text's main head element that contains the text header.
public void setFactories()
This method sets the IDFactory variable
and the TitleFactory variable
for this Tibbibl XML document.
public org.thdl.tib.bibl.TitleFactory getTitleFactory()
Returns the TitleFactory
created for this document that allows easy access to and
manipulation of titles.
public org.thdl.tib.bibl.IDFactory getIDFactory()
Returns the IDFactory
created for this document that allows easy access to and
manipulation of ID information, that is the Tibids contained within the text's TibidDecl.
public void addEditor(String initials, String fullName, String today)
This method sets the information for the current user (=editor) of the program who is entering in translations and adding critical titles to the text. This information is added in the ControlInfo metadata section of the Tibbibl document. A Resp/Name pair is added with the Name element containing the full name and having an ID of the initials, and a Name element is added to the Source list, that has an ID of "Ng" and whose corresp attribute is set to the initials. Thus, all uses of the corresp="Ng" are linked to the tag under the list of sources with corresp = to the editor's initials and content of the full name. This in turn is linked to the Resp that contains the editor's full name and his/her responsibility regarding the document.
public String[] getHeadStrings()
This method returns an array of strings. The array contains 1. the opening string of the header, such as
"Bibliographic Record for", and 2. the text contain within each of its children elements, usually
there are two of these a lang="tib" and a lang="eng", each one entered separately. The strings
are stripped of extraneous paragraph markers and spaces using the cleanString(java.lang.String)
method.
If it's an English title then it is enclosed in parentheses.
String[]
an array containing the different strings that are the parts
of this header element. They are kept separate so that different styles can be
applied to the opening text (bold) and the title contents (bold-italic).public String[] getSources()
This method returns a string array of the sources used in creating this master document. These sources (for now -- this may change) are included within the controlInfo metadata for the text in a respStmt with n="source". It contains a Resp element with Source Records as the label and then a series of Name elements with their ID attribute set to their sigla and their content set to the full name of the source xml document (no path name). In the case of the master editor, the ID is set to Ng and the corresp attribute is set to the editor's initials. This serves to connect all the various pieces of information to a particular source by using their corresp attribute. The corresp attribute is an IDREF, which means its value must match the value for another element's ID. Thus, all uses of the corresp="Tk" not only identify the piece of information as belonging to the gTing skyes edition but also link each use with the name of the actual source file or the Tk Tibbibl record. In the case of the editor, their is a double IDREF occuring. Each use of the Ng sigla refers to the Name element in the sources that has the ID "Ng" and the corresp = to the editor's initials. This refers to the Resp element above that has an ID of the editor's intials and contains his or her full name.
public Element createCriticalTitle(Element el, String initials)
This creates a critical version of any title within a TitleDecl by adding a title element as its first child with a Corresp=Ng. It does this by cloning one of the existing title elements to get one with identical attribute values but changes the corresp attribute to Ng. It adds a Foreign element with Lang = "eng as part of this title's content for the translation. It also "cleans" the title of an Expan element, which were used to add editor's interpretations of standard abbreviations such as thaMd for thams cad. These are replaced with the original abbreviated form. Finally, it adds a Num element within the pagination that has an ID = Ng and contains the initals of the editor who is the source of this critical title.
initials
- - the initials of the editor creating the critical title.public void setDoxography(String tibDox, String engDox)
This method sets the master doxogrpahy elements within the IntellDecl section of the Tibbibl.
It takes two strings the Tibetan doxographical statement the English version of that. These
list the categories separated by colons and are supplied by the DoxWindow
. The master
doxography element with type = "category" and n = "0" is located or else inserted and its
text is set to the Tibetan doxographical statement and a Foreign element is included within that
containing the English translation of it.
public void setMasterID(String idString)
This method takes a string ID where the subcategories are delimited by a period (".") and
invokes the Tibbibl's IDFactory.setMasterID(String)
method to parse the ID and create
the nested Tibid mark-up.
public String getNormalizedTitle()
This method returns the normalized title of the text using the tibbibl's TitleFactory
.
public String findTitleListEd(Element tdecl)
This method takes a titledecl from a title list and finds the edition listed in the first titleitem element. Because the same version of a title could span many chapters in different editions, the Corresp attribute is not set for the title itself in a title list but is set on the individual titleItems. This method finds the first title item and returns the sigla contained in its corresp element so this can be assigned as the type attribute of the critical version of the title. (The type attribute of a critical title indicates its original source title.)
public void addTranslation(String text, Element el)
This method takes a text string and a title element and uses it to insert an English translation for a title, by adding a Foreign element to the title element, setting its Lang=eng, and putting the text in its content.
public Element addTitle(Element elem, String sigla, String pagination)
This method takes a Title element, a sigla, and a pagination and creates a new edition title within a particular TitleDecl. The element is one of the future siblings of the new edition title and is cloned to create one with identical attributes. The corresp value of the clone is then changed to the new sigla, children and text are removed, and the element is added to the active list of the TitleDecl's children. The pagination is located and a corresponding Num element is added with the corresp=sigla set and the text set to the given pagination. The resulting title element is then returned. THIS IS A TEMPORARY ADHOC FIX SO EDITORS CAN DEAL WITH EOC TITLES JUST LIKE OTHER TITLES One exception is if the new edition title is an EOC title to be added to a title list. In this case, the title is added to the titledecl as usual, but the pagination is included in a separate titleItem with a blank designation. This is a questionable practice because the notion of critically editing EOC titles is a contradition. The way we mark up EOC titles they are by nature variants, differences between them are catalogued by creating a new TitleList. But some of the title lists could be collapsed by considering them as variants on a critical title... The approach for this needs to be contemplated and fixed. Until then, they are treated like all other titles, and new edition titles added record their pagination in a separate title item element.
public String getTitleText(Element title)
This returns the text of a title element as it is displayed in the TextPane
. It gets this in the
same way the text pane does by using a TitleParser
that finds the constituent parts of a title and
determines which are to be displayed. For instance, if there is an app element, it displays only the text of
the Lem child (i.e., the main reading).
public Element insertApp(Element title, String selText, int offset)
This method takes a title element, a string of selected text, and an integer indicating the offset from
the start of the text's title where the apparatus element is to be inserted. It then uses a
TitleParser
to figure out the display text of the title, and with the offset integer determines
where in the title the apparatus element is to be inserted. It receives that part from the TitleParser, splits it,
and adds the app element. If all succeeds, the app element is then returned.
public void removeApp(Element appToRemove)
This method removes an existing App element, replacing it with the text of its lemma or main reading child.
public void updateTextHeader()
This method is called when the Normalized title and/or translation is changed. It locates the text's main Head element, which contains the text's header with its title, and changes the content of the two title elements (tib and eng) in the header to accurately reflect the modified normalized title and translation.
public static String cleanString(String text)
This static method is used to clean up an string derrived from XML content that may have paragraph returns in the middle of it and preceding or trailing spaces, etc. It replaces all the "\n" with spaces and then reduces all double spaces to single spaces as well as trimming the string of preceding or following spaces. If null, is sent to this method, it returns an empty String.
public static Element[] toElementArray(List childs)
This static method is used to convert standard lists, such as Vectors, into arrays of org.jdom.Elements. This is useful because the getContent method of Element returns a List and in iteration each item must be cast back to an Element. This method returns a fixed array of Elements that do not require such casting.
public static Element newApp(String mainWit, String lemma)
This generic static method simply creates an unattached version of an app element with the main reading set. It takes to parameters: the sigla of the main reading (lemma), and the text of the lemma. It returns an app element with the first child being this lem element and one empty rdg (reading) element for non-main-readings.
public static Element makeDiscussion(org.thdl.tib.bibl.DiscDialog dd, String inits)
public Element makeHI(String rend)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |