|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.greenstone.gs3client.data.NodeData org.greenstone.gs3client.data.DocumentNodeData
public class DocumentNodeData
Represents the data stored in the <documentNode> Elements of Greenstone 3's XML response messages. A DocumentNodeData may have descendants of type DocumentNodeData. Some DocumentNodeData objects are the root of a structure, others are internal nodes or leaves. See p.47 to p.49 in the manual.
Field Summary | |
---|---|
protected DocumentNodeData[] |
childnodes
children of this node: part of <nodeStructure> Element |
java.lang.String |
docType
DocType can be Hierarchical for instance |
protected java.lang.String |
nodeContent
The text content of the document |
protected java.util.HashMap |
nodeStructureInfo_map
A Hashmap to store <nodeStructureInfo> of a DocumentNodeData (if it has any) |
java.lang.String |
nodeType
NodeType of this DocumentNodeData: root, internal or leaf |
double |
rank
Rank of this DocumentNodeData if the <documentNode> Element was returned in a search result |
protected DocumentNodeData |
rootDoc
Reference to this doc's root |
Fields inherited from class org.greenstone.gs3client.data.NodeData |
---|
hasChildren, nodeID, nodeMetadata, nodeTag |
Constructor Summary | |
---|---|
DocumentNodeData(org.w3c.dom.Element docNodeTag)
Given tags of the form <documentNode nodeID="HASHac0a04dd14571c60d7fbfd.4.2" nodeType="x" docType="y"> <nodeContent>Text</nodeContent> <nodeStructureInfo><info name="i" value="1" /> <info name = "ii" value = "2" /></nodeStructureInfo> <metadataList><metadata name="a">Value </metadata></metadataList> <nodeStructure> <documentNode ....></documentNode> <documentNode ....></documentNode> </nodeStructure> </documentNode> this constructor extracts the nodeId out of it and any other fields that might be set in the docNodeTag <documentNode> element. |
Method Summary | |
---|---|
boolean |
canBeImage()
|
protected static void |
descNodeIDsAsList(java.util.Vector v,
DocumentNodeData parent,
boolean onlyTheUntitled)
Recursive method that adds all the nodeIDs of the descendents of DocumentNodeData parent into the Vector v. |
java.lang.String |
getAssocFilePath()
|
java.util.Vector |
getAssociatedFileNames()
|
NodeData[] |
getChildren()
|
java.lang.String |
getContent()
|
DocumentNodeData[] |
getDescendents()
|
java.lang.String[] |
getDescNodeIDsAsList(boolean onlyTheUntitled)
When called on a rootNode, returns an array of all the descendents' nodeIDs. |
java.lang.String |
getDocType()
|
java.lang.String |
getImgName()
|
java.lang.String |
getImgURL()
|
java.lang.String |
getNodeType()
|
DocumentNodeData |
getRoot()
|
boolean |
hasNoText()
|
boolean |
isLeaf()
|
protected void |
setDescendents(DocumentNodeData root,
org.w3c.dom.Element docNodeTag,
java.util.Map nodeIDsToDocNodes_map)
Recursive method. |
DocumentNodeData |
setDescendentsOfRootNode(org.w3c.dom.Element nodeStructure,
java.util.Map nodeIDsToDocNodes_map)
Given a <nodeStructure></nodeStructure> element returned from a request for the *ENTIRE* nodeStructure, this method will find the <documentNode> that is the Root (nodeType=ROOT) and from there on proceed to set all descendent <documentNode>s. |
void |
setNodeContent(org.w3c.dom.Element docNodeTag)
Sets member variable nodeContent with the text (if any) inside any <nodeContent></nodeContent> child element of <documentNode>, else the value of nodeContent is set to empty string (""). |
void |
setNodeStructInfo(org.w3c.dom.Element docNodeTag)
Sets structureInfo member variable <nodeStructureInfo> element is present as child of <documentNode>, else value of structureInfo remains unchanged. |
java.lang.String |
show()
|
Methods inherited from class org.greenstone.gs3client.data.NodeData |
---|
getMetadataList, getTitle, setChildren, setMetadataList, showMeta, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String nodeType
public final java.lang.String docType
public final double rank
protected DocumentNodeData rootDoc
protected DocumentNodeData[] childnodes
protected java.util.HashMap nodeStructureInfo_map
protected java.lang.String nodeContent
Constructor Detail |
---|
public DocumentNodeData(org.w3c.dom.Element docNodeTag)
docNodeTag
- is an <documentNode> XML element to construct
this DocumentNodeData object fromMethod Detail |
---|
public DocumentNodeData setDescendentsOfRootNode(org.w3c.dom.Element nodeStructure, java.util.Map nodeIDsToDocNodes_map)
nodeStructure
- is the <nodeStructure></nodeStructure>
element returned from a request for the *ENTIRE* nodeStructurenodeIDsToDocNodes_map
- is the Map of node IDs to DocumentNodeData
objects being maintained
protected void setDescendents(DocumentNodeData root, org.w3c.dom.Element docNodeTag, java.util.Map nodeIDsToDocNodes_map)
root
- - the root element of this documentNodeDatadocNodeTag
- - the <documentNode> XML Element of the Root
nested within a <nodeStructure> elementnodeIDsToDocNodes_map
- is the Map of node IDs to DocumentNodeData
objects being maintainedpublic void setNodeStructInfo(org.w3c.dom.Element docNodeTag)
docNodeTag
- is the <documentNode> XML element containing
the <nodeStructureInfo> Element that is to be processedpublic void setNodeContent(org.w3c.dom.Element docNodeTag)
docNodeTag
- is the <documentNode> XML element containing
the content information for this DocumentNodeData objectpublic java.lang.String show()
show
in class NodeData
public boolean isLeaf()
public java.lang.String getNodeType()
public java.lang.String getDocType()
public DocumentNodeData getRoot()
public java.lang.String getContent()
public DocumentNodeData[] getDescendents()
public NodeData[] getChildren()
getChildren
in class NodeData
public java.lang.String[] getDescNodeIDsAsList(boolean onlyTheUntitled)
onlyTheUntitled
- - if true this method is only to return those
descendants' IDs whose titles have not yet been set. If false,
all descendants' nodeIDs are returned.
protected static void descNodeIDsAsList(java.util.Vector v, DocumentNodeData parent, boolean onlyTheUntitled)
v
- is the Vector being populated with descendant documentNodeData's
IDs.parent
- is the parent DocumentNodeData node currently being
considered in this recursion step.onlyTheUntitled
- should be true if only those descendant
DocumentNodeData objects that don't yet have a title need to be returned.
If false, it returns all descendants' nodeIDs in the Vector v.public boolean canBeImage()
public boolean hasNoText()
public java.lang.String getImgURL()
public java.lang.String getImgName()
public java.util.Vector getAssociatedFileNames()
public java.lang.String getAssocFilePath()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |