use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.
the class ViewEntryCollection method getNextEntry.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.ViewEntryCollection#getNextEntry(lotus.domino.ViewEntry)
*/
@Override
public ViewEntry getNextEntry(final lotus.domino.ViewEntry entry) {
try {
ViewEntry result = fromLotus(getDelegate().getNextEntry(toLotus(entry)), ViewEntry.SCHEMA, parent);
entry.recycle();
return result;
} catch (NotesException e) {
DominoUtils.handleException(e);
return null;
}
}
use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.
the class ViewNavigator method getNthDocument.
@Override
public ViewEntry getNthDocument(final int nth) {
// System.out.println("TEMP DEBUG getting document " + nth + " from a navigator with " + getCount() + " entries");
if (nth > getCount()) {
return null;
}
ViewEntry next = getFirstDocument();
int i = 1;
while (i < nth) {
next = getNextDocument();
if (next == null) {
return null;
}
i++;
}
return next;
}
use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.
the class ViewEntryIterator method next.
/*
* (non-Javadoc)
*
* @see java.util.Iterator#next()
*/
@Override
@SuppressWarnings("deprecation")
public ViewEntry next() {
ViewEntry result = null;
ViewEntry currentEntry = getCurrentEntry();
try {
result = ((currentEntry == null) ? collection_.getFirstEntry() : collection_.getNextEntry(currentEntry));
currentIndex_++;
} catch (Throwable t) {
DominoUtils.handleException(t);
} finally {
setCurrentEntry(result);
}
return result;
}
use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.
the class IndexDatabase method getTermStarts.
/* (non-Javadoc)
* @see org.openntf.domino.big.impl.IIndexDatabase#getTermStarts(java.lang.String, int)
*/
@Override
public List<String> getTermStarts(final String startsWith, final int count) {
List<String> result = new ArrayList<String>();
ViewEntry startEntry = getTermView().getFirstEntryByKey(startsWith, false);
if (startEntry == null) {
if (log_.isLoggable(Level.FINE)) {
log_.log(Level.FINE, "Unable to find ViewEntry for key " + startsWith);
}
// System.out.println("ViewEntryCollection strategy returned " + vec.getCount() + " entries.");
return result;
}
String val = startEntry.getColumnValue(IndexDatabase.TERM_KEY_NAME, String.class);
result.add(val);
ViewNavigator nav = getTermView().createViewNavFrom(startEntry, count);
for (int i = 1; i < count; i++) {
ViewEntry nextEntry = nav.getNextSibling();
val = nextEntry.getColumnValue(IndexDatabase.TERM_KEY_NAME, String.class);
result.add(val);
}
return result;
}
use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.
the class DEntryEdge method getVertexId.
@Override
public Object getVertexId(final Direction direction) {
if (Direction.OUT.equals(direction)) {
if (outKey_ == null) {
try {
ViewEntry entry = (org.openntf.domino.ViewEntry) getDelegate();
if (entry.isDocument()) {
String mid = entry.getDocument().getMetaversalID();
setOutId(NoteCoordinate.Utils.getNoteCoordinate(mid));
} else if (entry.isCategory()) {
String entryid = delegateKey_.toString();
String mid = "V" + entryid.substring(1);
setOutId(ViewEntryCoordinate.Utils.getViewEntryCoordinate(mid));
} else if (entry.isTotal()) {
setOutId("TOTAL");
// FIXME NTF Implement this please
} else {
Exception e = new UnimplementedException();
e.printStackTrace();
try {
throw e;
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
} catch (Throwable t) {
t.printStackTrace();
}
}
} else if (Direction.IN.equals(direction)) {
if (inKey_ == null) {
// NTF only occurs when EntryEdge is manifested by direct request from ID rather than iteration of EdgeEntryList
ViewEntryCoordinate vec = (ViewEntryCoordinate) delegateKey_;
String mid = vec.getViewDocument().getMetaversalID();
setInId(NoteCoordinate.Utils.getNoteCoordinate(mid));
}
}
return super.getVertexId(direction);
}
Aggregations