|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is the public API for data navigation. It provides methods to navigate and manipulate a single row of a dataset at a time.
Navigation does not guarantee that all data is pre-fetched from the server; consequently, navigation operations can fail. For SilverStream-provided objects that implement AgiRowCursor, however, changes to the data, are guaranteed to be buffered until a call to AgiRowSetManager.updateRows(). For this reason, data change operations cannot fail and do not throw exceptions.
Third-party controls that implement this interface can be data bound
using the AgoBindingManager
class.
Field Summary | |
static String |
BANDNAME
This distinguished property contains the name of the band in hierarchical AgiRowCursors retrieved from views. |
static String |
ORDINAL
This distinguished property contains the row number of the current row in the currently retrieved set of rows |
Method Summary | |
void |
addAgiRowCursorListener(AgiRowCursorListener rcl)
Add an event listener to this row cursor |
boolean |
allowsChildren()
Check whether the current row allows children. |
void |
appendChild()
Append a new row as the last child of the current row. |
AgiRowCursor |
copy()
Make an identical copy of this AgiRowCursor. |
void |
delete()
Marks a record as deleted in the client's image of the data. |
Object |
getProperty(int colnum)
Get the value of the property at the specified column index of the current row. |
Object |
getProperty(String name)
Get the value of the named property of the current row. |
int |
getPropertyCount()
Get the number of properties supported by the current row. |
int |
getPropertyIndex(String name)
Get the index of the named property. |
String |
getPropertyName(int colnum)
Get the name of the property at the specified index |
AgiRowSetEventProducer |
getRowSetEventProducer()
Get a reference to this cursor's associated AgiRowSetEventProducer |
boolean |
gotoChild()
Navigate to the first child of the current row. |
boolean |
gotoFirst()
Navigate to the first peer of the current row. |
boolean |
gotoLast()
Navigate to the last peer of the current row. |
boolean |
gotoNext()
Navigate to the next peer of the current row. |
boolean |
gotoParent()
Navigate to the parent of the current row. |
boolean |
gotoPrevious()
Navigate to the previous peer of the current row. |
boolean |
gotoRoot()
Navigate to the top-most parent of the current row. |
boolean |
hasChildren()
Check whether the current row has children. |
void |
insertAfter()
Insert a new row immediately after the current row. |
void |
insertBefore()
Insert a new row immediately before the current row. |
void |
makePrimaryVersion()
If the current row is part of a versioning table, copy the data from the current row to the corresponding row in the source (primary) table. |
void |
removeAgiRowCursorListener(AgiRowCursorListener rcl)
Remove an event listener from this row cursor |
boolean |
setProperty(int colnum,
Object value)
Set the value of the property at the specified index of the current row. |
boolean |
setProperty(String name,
Object value)
Set the value of the named property of the current row. |
Field Detail |
public static final String BANDNAME
AgiRowCursor.getProperty(String)
.
The BANDNAME property can be used for row cursors retrieved from multi-band views created using the SilverStream Designer. It allows the application to tell what kind of row the row cursor is pointing to. For example:
String bn = (String) rc.getProperty(AgiRowCursor.BANDNAME);
This tells the application the name of the band to which the current row belongs. Views can have multiple sub-bands at the same level. When navigating using a row cursor, the rows from the first sub-band can flow uninterrupted into the rows of the second sub-band. That is, the row cursor could point to a row from one sub-band, and after a call to rc.gotoNext(), the row cursor might point to a row from another sub-band.
public static final String ORDINAL
The ORDINAL property can be used for row cursors retrieved from multi-band views created using the SilverStream Designer. It allows the application to tell the ordinal number of the current row that cursor is pointing to. For example:
Integer ord = (Integer) agcData1.getProperty(AgiRowCursor.ORDINAL);
This tells the application the ordinal number of the current row. That is, this is the first row, the second row, the 39th row, etc. This allows you, for example, to display "row 3 of 57", and the like.
Method Detail |
public boolean gotoFirst() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
boolean successful; try { successful = rc.gotoFirst(); } catch (AgoApiException e) { agDialog.displayError(e); }
AgoSecurityException
,
AgoTransientSystemException
,
AgoUnrecoverableSystemException
public boolean gotoLast() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
boolean successful; try { successful = rc.gotoLast(); } catch (AgoApiException e) { agDialog.displayError(e); }
public boolean gotoNext() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
boolean successful; try { successful = rc.gotoNext(); } catch (AgoApiException e) { agDialog.displayError(e); }
AgoSecurityException
,
AgoTransientSystemException
,
AgoUnrecoverableSystemException
public boolean gotoPrevious() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
boolean successful; try { successful = rc.gotoPrevious(); } catch (AgoApiException e) { agDialog.displayError(e); }
public boolean allowsChildren()
AgiRowCursor.appendChild()
,
AgiRowCursor.hasChildren()
public boolean hasChildren()
if (rc.hasChildren()) { // Do something with the child rows... }
AgiRowCursor.allowsChildren()
,
AgiRowCursor.appendChild()
public boolean gotoChild() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
try { if (rc.gotoChild()) { // Do something with the child row } } catch (AgoException e) { // Handle the exception here }
public boolean gotoParent() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
try { if (!rc.gotoParent()) { // No parent row... } } catch (AgoException e) { // Handle the exception... }
public boolean gotoRoot() throws AgoSecurityException, AgoTransientSystemException, AgoUnrecoverableSystemException
boolean successful; try { successful = rc.gotoRoot(); } catch (AgoApiException e) { agDialog.displayError(e); }
public Object getProperty(String name)
name
- the name of the column to obtainString name = (String) rc.getProperty("customername");
AgiRowCursor.BANDNAME
,
AgiRowCursor.ORDINAL
,
AgiRowCursor.setProperty(String, Object)
public boolean setProperty(String name, Object value)
name
- the name of the property whose value is setvalue
- the value to which the property is set. For a list of mappings
between Java and SQL Object types, see Java and SQL Object Conversions in
on-line help under General Reference.rc.setProperty("Customers.CustomerName", "Bob Smith");
public Object getProperty(int colnum)
colnum
- the index of the column to obtain.
The column indices are zero-based.String lastName; lastName = (String) rc.getProperty(3);
AgiRowCursor.setProperty(int, Object)
public boolean setProperty(int colnum, Object value)
colnum
- the index of the property whose value is setvalue
- the value to which the property is set. For a list of mappings
between Java and SQL Object types, see Java and SQL Object Conversions in
on-line help under General Reference.rc.setProperty(3, "Bob Smith");
public int getPropertyCount()
int numberOfProperties; numberOfProperties = rc.getPropertyCount();
public String getPropertyName(int colnum)
colnum
- specifies the index of the column.
Property indices are zero-based.String propertyName; propertyName = rc.getPropertyName(3);
AgiRowCursor.setProperty(int, Object)
,
AgiRowCursor.getProperty(int)
,
AgiRowCursor.getPropertyIndex(String)
public int getPropertyIndex(String name)
name
- specifies the name of the column.
Property indices are zero-based.int index; index = rc.getPropertyIndex();
AgiRowCursor.setProperty(int, Object)
,
AgiRowCursor.getProperty(int)
,
AgiRowCursor.getPropertyName(int)
public void delete()
After this operation, the current row is automatically changed to
the next or previous record. The cursor no longer navigates to
a record marked as deleted.
The record is not actually deleted from the database until the
AgiRowSetManager.updateRows()
method is called.
rc.delete();
public void insertBefore()
rc.insertBefore();
public void insertAfter()
rc.insertAfter();
public void appendChild()
AgiRowCursor.allowsChildren()
is true.public void makePrimaryVersion()
Like other changes to data made through a SilverStream row cursor, this
change is bufferred until a call to AgiRowSetManager.updateRows()
.
rc.makePrimaryVersion();
public void addAgiRowCursorListener(AgiRowCursorListener rcl)
rcl
- the event listener to addUse this method to provide an object to receive AgiRowCursorListener events. This is an alternative to coding directly on these events in the Programming Editor.
agcData1.addAgiRowCursorListener(myObject);
public void removeAgiRowCursorListener(AgiRowCursorListener rcl)
rcl
- the event listener to removeagcData1.removeAgiRowCursorListener(myObject);
public AgiRowCursor copy()
The following code fragment illustrates how to make a copy of an AgiRowCursor.
AgiRowCursor newRC; newRC = oldRC.copy();
public AgiRowSetEventProducer getRowSetEventProducer()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |