Class nwcCollection

Class nwcCollection

Object
   |
   +----nwcCollection

public class nwcCollection
extends Object
This class defines an nwcCollection object which represents a set of nwcItem objects grouped together into a common context. Eventually, this object will most likely come from an .Xml file but that is supposed to be transparent to the object represented by this class. In fact, for now I will most likely just build-in a single collection because I'm only going to develop one collection as my "prototype" for this notion.

Further info about this is centralized in the data model description for the translator as a whole.

Version:
"Initial version: July 16, 2001."

Author:
Kevin G. Pammett, Pammett Family Enterprises.
Copyright © Kevin G. Pammett, Inc. All rights reserved.
See Also:
outputTheNwcSelectionLines(java.io.FileOutputStream,java.lang.String), process_Xml_SongDescriptionFile()

Variable Index

 o beginBIO_para_tag
This tag is used to identify important points within nwcItem data.
 o beginJobTitle_tag
This tag is used to identify important points within nwcItem data.
 o endBIO_para_tag
This tag is used to identify important points within nwcItem data.
 o endJobTitle_tag
This tag is used to identify important points within nwcItem data.
 o ix_Author
 o ix_BIO_email
 o ix_BIO_para
 o ix_BIO_update
 o ix_FullName
 o ix_Html_1LineComment
 o ix_LB
 o ix_NwcPlayerHeight
 o ix_Nwc_Score
 o ix_Nwc_ScoreFile
 o ix_PubDateTime
 o ix_RSid
 o ix_Title
 o ix_UB
 o ix_Unknown
 o ix_db_name
 o m_Attr_ix
 o m_BIO_FullName
 o m_BIO_email
 o m_BIO_para
 o m_BIO_picture
This Attribute comes directly from the nwc Item that we parse to create this object.
 o m_BIO_update
 o m_CollectionSeed
For now, this is how we know the "seed" that corresponds to the Xml object that the NwcItem is for.
 o m_DbCategorization
This Attribute is foreign to the datasource per se but is used by TBS-kgp to distinguish between the sets of information objects that it manipulates.
 o m_Label
 o m_NwcPlayerHeight
 o m_PubDateTime
 o m_RS_Id
These are the "attributes" that we get directly from the SongSet initializer.
 o m_ScoreFile
 o m_Title
 o m_db_ID
 o m_db_name
This Attribute comes directly from the nwc Item that we parse to create this object.
 o m_nwc_Publish_Root
The "nwc Publish Root" [directory] may later be an argument that can be given on the command line, but for now it's simply a property of the collection.
 o nwc_Songs
This container is used to hold the set of Songs (called "Xml_to_nwcItem" objects) that are managed by this object.
 o nwc_Xml_Songs
This container is used to hold the set of Songs (called "Xml_to_nwcItem" objects) that are managed by this object.
 o showExtraInfo
This boolean is intended for use only for debugging.

Constructor Index

 o nwcCollection(String)
This constructor is the expected way to create an nwcItem object because the whole mechanism will only work if you give the required 'seed'.

Method Index

 o addSong(Xml_to_nwcItem)
A big part of the raison d'etre for this object is that it manages a collection of Songs (called "Xml_to_nwcItem" objects) so that it can do things like "make a navigation menu [of the Songs]", etc.
 o cardinality()
This property tells you how many Songs (called "Xml_to_nwcItem" objects) there are in the collection that is managed by this object.
 o dbInsert(String)
This method is the only way, from the outside view, to add data regarding this item to the underlying database.
 o doTranslateCollection(String)
This primitive simply calls "translate .Xml to .html" for each Song in the collection of Songs (called "Xml_to_nwcItem" objects) that is being managed by this object.
 o dumpToLog()
This method simply dumps the current object in a way that is intended only for debugging purposes.
 o getVersion()
The usual fixed-string Version ID.
 o htmlNavBarLink(int, String)
This method lets us encapsulate exactly how one Song refers to another (as in NavBar references).
 o outOneItem(String)
This method produces a one-line "announcement" about the current object.
 o outputAsHtml(String)
This method is the only way, from the outside view, to get the object to "translate" its internal values into the std "output" format that is, really, the only reason (for now!) for processing the .Xml in the first place.
 o outputNwcItemHtmlHead(FileOutputStream, String)
This method lets us encapsulate exactly how we do the 'std' beginning part of each separate .html file that we generate.
 o outputNwcItemHtmlTail(FileOutputStream)
This method lets us encapsulate exactly how we do the 'std' trailing part of each separate .html file that we generate.
 o outputNwcPlugIn(FileOutputStream)
This method lets us encapsulate exactly how the Nwc Plug-In is invoked.
 o outputOneHtmlLine(FileOutputStream, String)
This method is part of the Xml translator...
 o outputTheNwcSelectionLines(FileOutputStream, String, String)
This method is part of the Xml translator...
 o outputTrailingTable(FileOutputStream)
This method lets us encapsulate exactly how the Nwc Plug-In is invoked.
 o setCollectionSeed(String)
For now, this is how we know the "seed" that corresponds to the Xml object that the SongSet is for.
 o setNwc_Publish_Root(String)
This is needed to generate links within Song menus...
 o showTruncatedValue(String, int)
When we want to display a String, for debugging purposes only, it's simpler to show the beginning and ending parts but not necessarily the whole thing.

Variables

 o beginBIO_para_tag
static final java.lang.String beginBIO_para_tag
This tag is used to identify important points within nwcItem data. In particular, text between the beginning "<nwcItem_para>" tag and its corresponding Xml ending tag defines the Article's dkdk "Abstract".

See Also:
endBIO_para_tag, myHgQ_Items
 o beginJobTitle_tag
static final java.lang.String beginJobTitle_tag
This tag is used to identify important points within nwcItem data. In particular, text between the beginning "<nwcItem_jobTitle>" tag and its corresponding Xml ending tag defines the Article's dkdk "Abstract".

See Also:
endJobTitle_tag, ix_Title, myHgQ_Items
 o endBIO_para_tag
static final java.lang.String endBIO_para_tag
This tag is used to identify important points within nwcItem data. In particular, text between the beginning "<nwcItem_para>" tag and its corresponding Xml ending tag defines the Article's dkdk "Abstract".

See Also:
beginBIO_para_tag, myHgQ_Items
 o endJobTitle_tag
static final java.lang.String endJobTitle_tag
This tag is used to identify important points within nwcItem data. In particular, text between the beginning "<nwcItem_jobTitle>" tag and its corresponding Xml ending tag defines the Article's dkdk "Abstract".

See Also:
beginJobTitle_tag, myHgQ_Items
 o ix_Author
static final int ix_Author
 o ix_BIO_email
static final int ix_BIO_email

See Also:
m_db_name, consumeAttribute(java.lang.String, java.lang.String)
 o ix_BIO_para
static final int ix_BIO_para
 o ix_BIO_update
static final int ix_BIO_update
 o ix_FullName
static final int ix_FullName

See Also:
consumeAttribute(java.lang.String, java.lang.String)
 o ix_Html_1LineComment
static final int ix_Html_1LineComment

See Also:
consumeAttribute(java.lang.String, java.lang.String)
 o ix_LB
static final int ix_LB
 o ix_NwcPlayerHeight
static final int ix_NwcPlayerHeight
 o ix_Nwc_Score
static final int ix_Nwc_Score

See Also:
m_BIO_picture, consumeAttribute(java.lang.String, java.lang.String)
 o ix_Nwc_ScoreFile
static final int ix_Nwc_ScoreFile
 o ix_PubDateTime
static final int ix_PubDateTime
 o ix_RSid
static final int ix_RSid
 o ix_Title
static final int ix_Title
 o ix_UB
static final int ix_UB
 o ix_Unknown
static final int ix_Unknown
 o ix_db_name
static final int ix_db_name

See Also:
m_db_name, consumeAttribute(java.lang.String, java.lang.String)
 o m_Attr_ix
 int m_Attr_ix
 o m_BIO_FullName
 java.lang.String m_BIO_FullName
 o m_BIO_email
 java.lang.String m_BIO_email
 o m_BIO_para
 java.lang.String m_BIO_para
 o m_BIO_picture
 java.lang.String m_BIO_picture
This Attribute comes directly from the nwc Item that we parse to create this object. In particular, this "ID" is used when we go back to the external database in order to pick up further information about this Article.

The correspondence between this datum and which Xml attribute it is associated with is made by the "ix_" (just an int) referenced below.

See Also:
ArticleURL(), ix_Nwc_Score, process_Xml_SongDescriptionFile()
 o m_BIO_update
 java.lang.String m_BIO_update
 o m_CollectionSeed
 java.lang.String m_CollectionSeed
For now, this is how we know the "seed" that corresponds to the Xml object that the NwcItem is for.

 o m_DbCategorization
 java.lang.String m_DbCategorization
This Attribute is foreign to the datasource per se but is used by TBS-kgp to distinguish between the sets of information objects that it manipulates.

When a Query is issued to an external database (for now, only TBS-kgp), part of the Query metadata contains a categorization - such as "MR" for Magnetic Resonance - which is used throughout the system to facilitate the identification of 'all' objects resulting (directly) from a particular Query so that they can be treated alike. This "MR" is completely artificial in the sense that it is not deduced from the actual data in any sense other than its arbitrary association with the Query itself. In practice, this association is directly tied to the choice of MeSH keywords that we are given for the query, but using simple strings such as "MR" - independently - in this way allows us to have any number of Query objects which share a common Categorization. So, the Categorization string becomes a simple name for a set of MeSH keywords.

These same Categorization strings are also used in the TBS-kgp web site for the same purpose: when a user clicks on the "MR" Technology, the objects are fetched from the database by virture of the association that is set up using that datum. So, the "name" for a set of MeSH keywords is arbitrary but the mechanism relies on 'knowing' these names both at the feed level and within the web site and database logic.

Moreover, these values are used to provide exactly the same mechanism that we describe in the other classes where there is a datum by this same name.

Further info about this is centralized in the data model description for the translator as a whole.

See Also:
m_DbCategorization, dbInsert(Connection, java.lang.String), nwcItem(java.lang.String), myHgQ_Items, process_Xml_SongDescriptionFile()
 o m_Label
 java.lang.String m_Label
 o m_NwcPlayerHeight
 java.lang.String m_NwcPlayerHeight
 o m_PubDateTime
 java.lang.String m_PubDateTime
 o m_RS_Id
 java.lang.String m_RS_Id
These are the "attributes" that we get directly from the SongSet initializer.

I'm not sure when/if I'm really going to extend this to a full Xml object.

 o m_ScoreFile
 java.lang.String m_ScoreFile
 o m_Title
 java.lang.String m_Title
 o m_db_ID
 int m_db_ID
 o m_db_name
 java.lang.String m_db_name
This Attribute comes directly from the nwc Item that we parse to create this object. In particular, this "ID" is used to identify which external database we need to use when we go back to MEDLINE in order to pick up further information about this Article.

The correspondence between this datum and which Xml attribute it is associated with is made by the "ix_" (just an int) referenced below.

See Also:
ArticleURL(), ix_db_name, process_Xml_SongDescriptionFile()
 o m_nwc_Publish_Root
 java.lang.String m_nwc_Publish_Root
The "nwc Publish Root" [directory] may later be an argument that can be given on the command line, but for now it's simply a property of the collection. I'll parameterize this later; it probably comes from the "SongSet" .Xml file.

See Also:
myHgQryObjs, process_Xml_SongDescriptionFile()
 o nwc_Songs
 java.util.Vector nwc_Songs
This container is used to hold the set of Songs (called "Xml_to_nwcItem" objects) that are managed by this object. On purpose, we have no need to build-in any knowledge of how many there are or how they are constructed.

See Also:
addSong(Xml_to_nwcItem), cardinality(), myHgQ_Items, nwcItem(java.lang.String)
 o nwc_Xml_Songs
 java.util.Vector nwc_Xml_Songs
This container is used to hold the set of Songs (called "Xml_to_nwcItem" objects) that are managed by this object. On purpose, we have no need to build-in any knowledge of how many there are or how they are constructed.

See Also:
addSong(Xml_to_nwcItem), cardinality(), nwcItem(java.lang.String)
 o showExtraInfo
 boolean showExtraInfo
This boolean is intended for use only for debugging. When true it causes extra information to be generated into the TBS field so that (a) we can see when the record was inserted into the database and (b) we can see what category it belongs to.

The default for this is set up in the object's constructor.

See Also:
dumpToLog()

Constructors

 o nwcCollection
 nwcCollection(String wrtTitle)
This constructor is the expected way to create an nwcItem object because the whole mechanism will only work if you give the required 'seed'.

See Also:
m_DbCategorization, process_Xml_SongDescriptionFile()

Methods

 o addSong
 void addSong(Xml_to_nwcItem wrtSong)
A big part of the raison d'etre for this object is that it manages a collection of Songs (called "Xml_to_nwcItem" objects) so that it can do things like "make a navigation menu [of the Songs]", etc. As such, this method is fundamental because it is the way that an Xml_to_nwcItem object gets to belong to the collection. Without invoking this method, a collection has no Songs.

See Also:
nwc_Xml_Songs, cardinality()
 o cardinality
 int cardinality()
This property tells you how many Songs (called "Xml_to_nwcItem" objects) there are in the collection that is managed by this object. In default, the collection has no Songs.

See Also:
nwc_Xml_Songs, addSong(Xml_to_nwcItem)
 o dbInsert
 boolean dbInsert(String wrtTag)
This method is the only way, from the outside view, to add data regarding this item to the underlying database. It generates the Article "Lable" on-the-fly because we don't really need it until this point.

See Also:
ArticleURL(), reworkSingleQuotes(java.lang.String)
 o doTranslateCollection
 int doTranslateCollection(String wrtCmdLine_Arg)
This primitive simply calls "translate .Xml to .html" for each Song in the collection of Songs (called "Xml_to_nwcItem" objects) that is being managed by this object.

See Also:
nwc_Xml_Songs, cardinality()
 o dumpToLog
 void dumpToLog()
This method simply dumps the current object in a way that is intended only for debugging purposes.

 o getVersion
static java.lang.String getVersion()
The usual fixed-string Version ID. This is used to keep track of which source goes with which executable. Since this class is NOT the driver, the log file generated by the translator does NOT include this version string (so its use is purely - for now - internal).

 o htmlNavBarLink
 java.lang.String htmlNavBarLink(int toIX,
                                 String useLabel)
This method lets us encapsulate exactly how one Song refers to another (as in NavBar references).

See Also:
outputAsHtml(java.lang.String), outputTheNwcSelectionLines(java.io.FileOutputStream,java.lang.String), outputNwcItem_TopNavBar(java.io.FileOutputStream,java.lang.String)
 o outOneItem
 void outOneItem(String wrtTag)
This method produces a one-line "announcement" about the current object. It is intended to be the "Summary" line that gets written to the feed log each time a successful Insert has been done, but the method does not really know that much about its context.

 o outputAsHtml
 boolean outputAsHtml(String wrtOutputFile)
This method is the only way, from the outside view, to get the object to "translate" its internal values into the std "output" format that is, really, the only reason (for now!) for processing the .Xml in the first place. Just now we only know how to produce .html but later that may change...

It is the caller of this routine that determines what output file will be written to.

See Also:
outputItems()
 o outputNwcItemHtmlHead
 int outputNwcItemHtmlHead(FileOutputStream rsOutFile,
                           String wrtKgpClaim) throws IOException
This method lets us encapsulate exactly how we do the 'std' beginning part of each separate .html file that we generate.

See Also:
outputAsHtml(java.lang.String), outputItems()
 o outputNwcItemHtmlTail
 int outputNwcItemHtmlTail(FileOutputStream rsOutFile) throws IOException
This method lets us encapsulate exactly how we do the 'std' trailing part of each separate .html file that we generate.

See Also:
outputAsHtml(java.lang.String), outputItems()
 o outputNwcPlugIn
 int outputNwcPlugIn(FileOutputStream rsOutFile) throws IOException
This method lets us encapsulate exactly how the Nwc Plug-In is invoked.

See Also:
outputItems()
 o outputOneHtmlLine
 int outputOneHtmlLine(FileOutputStream wrtFile,
                       String wrtLine) throws IOException
This method is part of the Xml translator... but I haven't decided how well to document that, yet.

See Also:
outputTheNwcSelectionLines(java.io.FileOutputStream,java.lang.String), outputAsHtml(java.lang.String)
 o outputTheNwcSelectionLines
 int outputTheNwcSelectionLines(FileOutputStream wrtFile,
                                String wrtTag,
                                String useWidth) throws IOException
This method is part of the Xml translator... but I haven't finished working on that yet. My plan, however, is that THIS routine should be used when we generate the .html FOR EACH Song object to create the "Song Nagivation" structure on each page. I'm actually using a different version of this method to do that, for now, but I'd like to switch to THIS one because this guy has visibility wrt the whole collection and that's what I really need in order to generate the Nav pannel, etc.

See Also:
getXmlObjs(), outputAsHtml(java.lang.String)
 o outputTrailingTable
 int outputTrailingTable(FileOutputStream rsOutFile) throws IOException
This method lets us encapsulate exactly how the Nwc Plug-In is invoked.

See Also:
outputItems()
 o setCollectionSeed
 void setCollectionSeed(String wrtSeed)
For now, this is how we know the "seed" that corresponds to the Xml object that the SongSet is for. For now, I'll leave out the getter cause I'm only partly committed to this notion.

 o setNwc_Publish_Root
 void setNwc_Publish_Root(String wrtDirectorySpec)
This is needed to generate links within Song menus... wwww

 o showTruncatedValue
public static java.lang.String showTruncatedValue(String wrtValue,
                                                  int maxSize)
When we want to display a String, for debugging purposes only, it's simpler to show the beginning and ending parts but not necessarily the whole thing.

See Also:
dumpToLog()