com.ibm.notes.java.api.data
Class NotesViewData

java.lang.Object
  extended by com.ibm.notes.java.api.data.NotesData
      extended by com.ibm.notes.java.api.data.NotesViewData

public class NotesViewData
extends NotesData

Class that contains data that is associated with a Notes view.


Field Summary
 
Fields inherited from class com.ibm.notes.java.api.data.NotesData
baseUrl, ENCODE_ERR, NOTES_COMMAND_SEPARATOR, NOTES_PARAMETER_SEPARATOR, NOTES_PATH_SEPARATOR, NOTES_PROTOCOL, NULL_ERR
 
Constructor Summary
NotesViewData(NotesDatabaseData database, String view)
          Constructs a NotesViewData object from a NotesDatabaseData object and a view.
NotesViewData(NotesDatabaseData database, String name, String unid)
          Constructs a NotesViewData object from a NotesDatabaseData object, a view name, and an UNID.
NotesViewData(NotesDatabaseData database, String name, String unid, List<String> aliases)
          Constructs a NotesViewData object from a NotesDatabaseData object, a view name, an UNID, and the views aliases.
NotesViewData(String url)
          Constructs a NotesViewData object using a Notes URL.
NotesViewData(View view)
          Constructs a NotesViewData object from a lotus.domino.View object.
 
Method Summary
 boolean equals(Object obj)
          Determines whether two NotesViewData objects are equals to each other.
 List<String> getAliases()
          Gets the aliases of the view.
 NotesDatabaseData getDatabaseData()
           
 String getName()
          Gets the view name.
 String getOpenUrl()
          Gets the encoded Notes URL to open the NotesData object.
 String getSearchUrl(String searchFor)
          Gets the Notes URL to search this view.
 String getUnid()
          Gets the view unid.
 View open(Session session)
          Opens a lotus.domino.View object given a session.
 void setAliases(List<String> aliases)
          Sets the aliases for the view
protected  void setBaseUrl()
          Constructs the Notes URL of the data object from the given information.
 void setName(String name)
          Sets the name of the view.
 void setUnid(String unid)
          Sets the unid of the view data.
 
Methods inherited from class com.ibm.notes.java.api.data.NotesData
encode, getBaseUrl, getParser, removeCommandAndParams
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotesViewData

public NotesViewData(String url)
              throws NotesException 
Constructs a NotesViewData object using a Notes URL. The URL must contain a view and be UTF-8 encoded. This constructor can take a framset URL as long as it contains a view parameter.

Parameters:
url - an encoded Notes URL containing the view
Throws:
NotesException - thrown when the NotesViewData object cannot be constructed from the URL
Since:
1.5.1

NotesViewData

public NotesViewData(NotesDatabaseData database,
                     String view)
              throws NotesException 
Constructs a NotesViewData object from a NotesDatabaseData object and a view. The view should not be encoded and should not be null.

Parameters:
database - the database containing the view
view - the view contained in the database, this view can be an empty string if there isn't one but cannot be null
Throws:
NotesException - thrown when the NotesViewData object cannot be constructed from the parameters
Since:
1.5.1

NotesViewData

public NotesViewData(NotesDatabaseData database,
                     String name,
                     String unid)
              throws NotesException 
Constructs a NotesViewData object from a NotesDatabaseData object, a view name, and an UNID. The view name should not be encoded.

Parameters:
database - the database containing the view
name - the name of the view, should not be encoded
unid - the unid of the view
Throws:
NotesException - thrown when the NotesViewData object cannot be constructed
Since:
1.5.1

NotesViewData

public NotesViewData(NotesDatabaseData database,
                     String name,
                     String unid,
                     List<String> aliases)
              throws NotesException 
Constructs a NotesViewData object from a NotesDatabaseData object, a view name, an UNID, and the views aliases. The view name should not be encoded.

Parameters:
database - the database containing the view
name - the name of the view, should not be encoded
unid - the unid of the view
aliases - the aliases of the view
Throws:
NotesException - thrown when the NotesViewData object cannot be constructed
Since:
1.5.2

NotesViewData

public NotesViewData(View view)
              throws NotesException 
Constructs a NotesViewData object from a lotus.domino.View object.

Parameters:
view - the lotus.domino.View used to construct this data object
Throws:
NotesException - thrown when the NotesViewData object cannot be constructed from the parameters
Since:
1.5.1
Method Detail

setBaseUrl

protected void setBaseUrl()
                   throws UnsupportedEncodingException
Description copied from class: NotesData
Constructs the Notes URL of the data object from the given information. The URL constructed should only contain the parameters passed in, no commands, or parameters should be added to the URL in this method.

Specified by:
setBaseUrl in class NotesData
Throws:
UnsupportedEncodingException - thrown when the URL cannot be encoded

getName

public String getName()
Gets the view name. The returned String will not be encoded. The name may be null. It is not possible for the view unid and the view name to both be null.

Returns:
the view
Since:
1.5.1

setName

public void setName(String name)
             throws NotesException 
Sets the name of the view. The name should not be encoded.

Parameters:
name - the name of the view, should not be encoded
Throws:
NotesException - thrown when the name cannot be set
Since:
1.5.1

getUnid

public String getUnid()
Gets the view unid. The unid may be null. It is not possible for the view unid and the view name to both be null.

Returns:
UNID
Since:
1.5.1

setUnid

public void setUnid(String unid)
             throws NotesException 
Sets the unid of the view data.

Parameters:
unid - the unid of the view
Throws:
NotesException - thrown when the unid cannot be set
Since:
1.5.1

getAliases

public List<String> getAliases()
Gets the aliases of the view.

Returns:
the alias of the view
Since:
1.5.2

setAliases

public void setAliases(List<String> aliases)
Sets the aliases for the view

Parameters:
aliases - aliases to set
Since:
1.5.2

equals

public boolean equals(Object obj)
Determines whether two NotesViewData objects are equals to each other.

Overrides:
equals in class Object
Parameters:
obj - object to test for equality
Returns:
true if the two objects are equal, false otherwise
Since:
1.5.1

getOpenUrl

public String getOpenUrl()
Description copied from class: NotesData
Gets the encoded Notes URL to open the NotesData object. The URL is UTF-8 encoded.

Specified by:
getOpenUrl in class NotesData
Returns:
the encoded Notes URL to open the NotesData object

getSearchUrl

public String getSearchUrl(String searchFor)
Gets the Notes URL to search this view. The URL will be UTF-8 encoded.

Parameters:
searchFor - the term(s) to search the view for
Returns:
the Notes URL to search this view
Since:
1.5.1

open

public View  open(Session session)
                       throws NotesException 
Opens a lotus.domino.View object given a session. This method works best when this object has a view name. If not it tries to resolve the URL of this object.

Parameters:
session - the session to use to open the view
Returns:
a lotus.domino.View object based on this object
Throws:
NotesException - thrown when the View object cannot be opened using the given session
Since:
1.5.1

getDatabaseData

public NotesDatabaseData getDatabaseData()