Search in sources :

Example 1 with ViewEntryCollection

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");
    }
}
Also used : ViewColumn(org.openntf.domino.ViewColumn) Database(org.openntf.domino.Database) ViewEntryCollection(org.openntf.domino.ViewEntryCollection) View(org.openntf.domino.View) Session(org.openntf.domino.Session)

Example 2 with ViewEntryCollection

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);
    }
}
Also used : ViewEntry(org.openntf.domino.ViewEntry) TreeSet(java.util.TreeSet) Database(org.openntf.domino.Database) ArrayList(java.util.ArrayList) ViewEntryCollection(org.openntf.domino.ViewEntryCollection) View(org.openntf.domino.View) Session(org.openntf.domino.Session)

Example 3 with ViewEntryCollection

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();
}
Also used : FastSet(javolution.util.FastSet) ViewEntry(org.openntf.domino.ViewEntry) ViewEntryCollection(org.openntf.domino.ViewEntryCollection) Edge(com.tinkerpop.blueprints.Edge)

Example 4 with ViewEntryCollection

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.");
    }
}
Also used : ViewEntryList(org.openntf.domino.big.impl.ViewEntryList) ViewEntryCollection(org.openntf.domino.ViewEntryCollection) View(org.openntf.domino.View) Vector(java.util.Vector)

Example 5 with ViewEntryCollection

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();
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) FastSet(javolution.util.FastSet) ViewEntry(org.openntf.domino.ViewEntry) ViewEntryCollection(org.openntf.domino.ViewEntryCollection)

Aggregations

ViewEntryCollection (org.openntf.domino.ViewEntryCollection)5 View (org.openntf.domino.View)3 ViewEntry (org.openntf.domino.ViewEntry)3 FastSet (javolution.util.FastSet)2 Database (org.openntf.domino.Database)2 Session (org.openntf.domino.Session)2 Edge (com.tinkerpop.blueprints.Edge)1 Vertex (com.tinkerpop.blueprints.Vertex)1 ArrayList (java.util.ArrayList)1 TreeSet (java.util.TreeSet)1 Vector (java.util.Vector)1 ViewColumn (org.openntf.domino.ViewColumn)1 ViewEntryList (org.openntf.domino.big.impl.ViewEntryList)1