use of org.openntf.domino.ViewEntryCollection in project org.openntf.domino by OpenNTF.
the class NoteListTest method run2.
public void run2() {
long testStartTime = System.nanoTime();
Session session = this.getSession();
try {
Database db = session.getDatabase("", "imdb/movies.nsf");
// db.setDelayUpdates(true);
marktime = System.nanoTime();
timelog("Beginning view build...");
View byLength = db.getView("byLength");
View btitles = db.createView("BTitles", "@Begins(Title; \"B\")", byLength);
// View btitles = db.createView("BTitles", "@Begins(Title; \"B\")");
ViewColumn length = btitles.createColumn(1, "Title", "Title");
length.setSorted(true);
timelog("View defined.");
btitles.refresh();
timelog("Completed view build.");
ViewEntryCollection vec = btitles.getAllEntries();
int count = vec.getCount();
timelog("Found " + count + " documents in the view");
btitles.remove();
timelog("Removed view.");
btitles.recycle();
db.recycle();
} catch (Throwable t) {
t.printStackTrace();
} finally {
long testEndTime = System.nanoTime();
System.out.println("Completed " + getClass().getSimpleName() + " run in " + ((testEndTime - testStartTime) / 1000000) + " ms");
}
}
use of org.openntf.domino.ViewEntryCollection in project org.openntf.domino by OpenNTF.
the class Connect17ODA method run.
@SuppressWarnings("unchecked")
@Override
public void run() {
try {
Session sess = Factory.getSession(SessionType.NATIVE);
TreeSet<String> names = new TreeSet<String>();
Database extLib = sess.getDatabase("odademo/oda_1.nsf");
View states = extLib.getView("AllStates");
ViewEntry entState = states.getAllEntries().getFirstEntry();
View byState = extLib.getView("AllContactsByState");
ArrayList<Object> stateVals = new ArrayList(entState.getColumnValuesEx());
ViewEntryCollection ec = byState.getAllEntriesByKey(stateVals.get(0));
for (ViewEntry ent : ec) {
names.add((String) ent.getColumnValues().get(8));
}
System.out.println(names.toString());
} catch (Exception e) {
XspOpenLogUtil.logError(e);
}
}
use of org.openntf.domino.ViewEntryCollection in project org.openntf.domino by OpenNTF.
the class DominoGraph method getEdges.
@Override
public Iterable<Edge> getEdges() {
FastSet<Edge> result = new FastSet<Edge>();
ViewEntryCollection vec = getEdgeView().getAllEntries();
for (ViewEntry entry : vec) {
result.add(getEdge(entry.getUniversalID()));
}
return result.unmodifiable();
}
use of org.openntf.domino.ViewEntryCollection in project org.openntf.domino by OpenNTF.
the class DEdgeEntryList method filterEntryList.
@SuppressWarnings("deprecation")
public void filterEntryList(final List<CharSequence> list) {
ViewEntryCollection coll = null;
if (org.openntf.domino.View.class.equals(source_.getDelegateType())) {
View view = source_.getView();
Vector<Object> repeatKeys = new Vector<Object>();
repeatKeys.addAll(list);
coll = view.getAllEntriesByKey(repeatKeys, false);
if (coll.getCount() == 0) {
throw new KeyNotFoundException(list);
}
entryList_ = new ViewEntryList(coll);
} else {
throw new IllegalArgumentException("Cannot use filter keys on anything except a view root.");
}
}
use of org.openntf.domino.ViewEntryCollection in project org.openntf.domino by OpenNTF.
the class DominoGraph method getVertices.
@Override
public Iterable<Vertex> getVertices() {
FastSet<Vertex> result = new FastSet<Vertex>();
ViewEntryCollection vec = getVertexView().getAllEntries();
for (ViewEntry entry : vec) {
result.add(getVertex(entry.getUniversalID()));
}
return result.unmodifiable();
}
Aggregations