Session s = NotesFactory.createSession( bdtest1:8000 );
Database db = s.getDatabase( Redbooks );
View view = db.getView( platform sorted );
ViewNavigator viewnav = view.createViewNavMaxLevel(0);
Access the fields of a document
After we get all entries in Navigator, we can perform some methods to access
the document from navigator:
ViewNavigator nav = view.createViewNavFromCategory( AS/400 );
ViewEntry entry = nav.getFirst();
while (entry!=0) {
Document doc = entry.getDocument();
}
This code will return documents associated with the view entry.
If the view entry is not a document, it returns null and also returns null if the
document is deleted after the ViewEntry object is created.
The getDocument() method returns a document object. The document object
has several methods that we can use to retrieve the fields value:
  getItemValueString(String)
This method returns the value of an item with a single text value. If the
item has no value, or the value is numeric or date time, this method
returns an empty string.
out.println(entry.getDocument().getItemValueString( FormNumber );
This code will return the text from column FormNumber.
  getItemValue(String)
This method returns the value of the appropriate field from the document.
The data type of the result is always java.util.Vector; however, the element
of the Vector is dependent to the actual field type as shown in Table 6.
Table 6. Data type of Item from getItemValue()
Item type
Value return type
Rich text
java.util.Vector with a String element as
plain text
Text (includes Names, Authors, and
java.util.Vector with String elements
Readers item types) or text list
Number or number list
java.util.Vector with Double elements
Date time or range of date time values
java.util.Vector with DateTime elements
Chapter 3. Building the Web server
97




  

Home

About Services Network Support FAQ Order Contact
 

Linux Web Hosting

Our partners:Jsp Web Hosting Unlimited Web Hosting Cheapest Web Hosting  Java Web Hosting Web Templates Best Web Templates PHP Mysql Web Hosting Interland Web Hosting Cheap Web Hosting PHP Web Hosting Tomcat Web Hosting Quality Web Hosting Best Web Hosting  Mac Web Hosting 

Lunarwebhost.net  Business web hosting division of Vision Web Hosting Inc. All rights reserved