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()
-
beginBIO_para_tag
- This tag is used to identify important points within nwcItem data.
-
beginJobTitle_tag
- This tag is used to identify important points within nwcItem data.
-
endBIO_para_tag
- This tag is used to identify important points within nwcItem data.
-
endJobTitle_tag
- This tag is used to identify important points within nwcItem data.
-
ix_Author
-
-
ix_BIO_email
-
-
ix_BIO_para
-
-
ix_BIO_update
-
-
ix_FullName
-
-
ix_Html_1LineComment
-
-
ix_LB
-
-
ix_NwcPlayerHeight
-
-
ix_Nwc_Score
-
-
ix_Nwc_ScoreFile
-
-
ix_PubDateTime
-
-
ix_RSid
-
-
ix_Title
-
-
ix_UB
-
-
ix_Unknown
-
-
ix_db_name
-
-
m_Attr_ix
-
-
m_BIO_FullName
-
-
m_BIO_email
-
-
m_BIO_para
-
-
m_BIO_picture
- This Attribute comes directly from the
nwc Item
that we parse to create this object.
-
m_BIO_update
-
-
m_CollectionSeed
- For now, this is how we know the "seed" that corresponds to the
Xml object that the NwcItem is for.
-
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.
-
m_Label
-
-
m_NwcPlayerHeight
-
-
m_PubDateTime
-
-
m_RS_Id
- These are the "attributes" that we get directly from the SongSet initializer.
-
m_ScoreFile
-
-
m_Title
-
-
m_db_ID
-
-
m_db_name
- This Attribute comes directly from the
nwc Item
that we parse to create this object.
-
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.
-
nwc_Songs
- This container is used to hold the set of Songs
(called "Xml_to_nwcItem" objects) that are managed
by this object.
-
nwc_Xml_Songs
- This container is used to hold the set of Songs
(called "Xml_to_nwcItem" objects) that are managed
by this object.
-
showExtraInfo
- This boolean is intended for use only for debugging.
-
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'.
-
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.
-
cardinality()
- This property tells you how many
Songs (called "Xml_to_nwcItem" objects)
there are in the collection that is managed by this object.
-
dbInsert(String)
- This method is the only way, from the outside view, to add
data regarding this item to the underlying database.
-
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.
-
dumpToLog()
- This method simply dumps the current object in a way that is intended
only for debugging purposes.
-
getVersion()
- The usual fixed-string Version ID.
-
htmlNavBarLink(int, String)
- This method lets us encapsulate exactly how one Song refers to another
(as in NavBar references).
-
outOneItem(String)
- This method produces a one-line "announcement" about the current object.
-
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.
-
outputNwcItemHtmlHead(FileOutputStream, String)
- This method lets us encapsulate exactly how we do the 'std' beginning
part of each separate .html file that we generate.
-
outputNwcItemHtmlTail(FileOutputStream)
- This method lets us encapsulate exactly how we do the 'std' trailing
part of each separate .html file that we generate.
-
outputNwcPlugIn(FileOutputStream)
- This method lets us encapsulate exactly how the Nwc Plug-In
is invoked.
-
outputOneHtmlLine(FileOutputStream, String)
- This method is part of the Xml translator...
-
outputTheNwcSelectionLines(FileOutputStream, String, String)
- This method is part of the Xml translator...
-
outputTrailingTable(FileOutputStream)
- This method lets us encapsulate exactly how the Nwc Plug-In
is invoked.
-
setCollectionSeed(String)
- For now, this is how we know the "seed" that corresponds to the
Xml object that the SongSet is for.
-
setNwc_Publish_Root(String)
- This is needed to generate links within Song menus...
-
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.
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
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
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
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
ix_Author
static final int ix_Author
ix_BIO_email
static final int ix_BIO_email
-
- See Also:
- m_db_name, consumeAttribute(java.lang.String, java.lang.String)
ix_BIO_para
static final int ix_BIO_para
ix_BIO_update
static final int ix_BIO_update
ix_FullName
static final int ix_FullName
-
- See Also:
- consumeAttribute(java.lang.String, java.lang.String)
ix_Html_1LineComment
static final int ix_Html_1LineComment
-
- See Also:
- consumeAttribute(java.lang.String, java.lang.String)
ix_LB
static final int ix_LB
ix_NwcPlayerHeight
static final int ix_NwcPlayerHeight
ix_Nwc_Score
static final int ix_Nwc_Score
-
- See Also:
- m_BIO_picture, consumeAttribute(java.lang.String, java.lang.String)
ix_Nwc_ScoreFile
static final int ix_Nwc_ScoreFile
ix_PubDateTime
static final int ix_PubDateTime
ix_RSid
static final int ix_RSid
ix_Title
static final int ix_Title
ix_UB
static final int ix_UB
ix_Unknown
static final int ix_Unknown
ix_db_name
static final int ix_db_name
-
- See Also:
- m_db_name, consumeAttribute(java.lang.String, java.lang.String)
m_Attr_ix
int m_Attr_ix
m_BIO_FullName
java.lang.String m_BIO_FullName
m_BIO_email
java.lang.String m_BIO_email
m_BIO_para
java.lang.String m_BIO_para
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()
m_BIO_update
java.lang.String m_BIO_update
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.
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()
m_Label
java.lang.String m_Label
m_NwcPlayerHeight
java.lang.String m_NwcPlayerHeight
m_PubDateTime
java.lang.String m_PubDateTime
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.
m_ScoreFile
java.lang.String m_ScoreFile
m_Title
java.lang.String m_Title
m_db_ID
int m_db_ID
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()
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()
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)
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)
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()
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()
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()
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)
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)
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()
dumpToLog
void dumpToLog()
- This method simply dumps the current object in a way that is intended
only for debugging purposes.
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).
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)
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.
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()
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()
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()
outputNwcPlugIn
int outputNwcPlugIn(FileOutputStream rsOutFile) throws IOException
- This method lets us encapsulate exactly how the Nwc Plug-In
is invoked.
- See Also:
- outputItems()
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)
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)
outputTrailingTable
int outputTrailingTable(FileOutputStream rsOutFile) throws IOException
- This method lets us encapsulate exactly how the Nwc Plug-In
is invoked.
- See Also:
- outputItems()
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.
setNwc_Publish_Root
void setNwc_Publish_Root(String wrtDirectorySpec)
- This is needed to generate links within Song menus... wwww
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()