Search in sources :

Example 11 with ViewEntry

use of org.openntf.domino.ViewEntry 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 12 with ViewEntry

use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.

the class MassViewNavigatorTest method run.

@Test
public void run() {
    Session s = Factory.getSession(SessionType.CURRENT);
    Database source = s.getDatabase("", TARGET, true);
    View view = source.getView(VIEW);
    System.out.println("-- START --");
    long start = System.nanoTime();
    if (null != view) {
        view.setAutoUpdate(false);
        System.out.println(view.getEntryCount());
        ViewNavigator nav = view.createViewNav();
        nav.setCacheSize(400);
        System.out.println("CacheSize: " + nav.getCacheSize());
        view.setAutoUpdate(true);
        ViewEntry entry = null;
        entry = nav.getFirst();
        while (null != entry) {
            entry = nav.getNext(entry);
        }
    }
    long elapsed = System.nanoTime() - start;
    System.out.println("-- STOP --");
    System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry) Database(org.openntf.domino.Database) View(org.openntf.domino.View) Session(org.openntf.domino.Session) Test(org.junit.Test)

Example 13 with ViewEntry

use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.

the class DCategoryVertex method checkSkipCategory.

public static boolean checkSkipCategory(final ViewNavigator nav) {
    // System.out.println("TEMP DEBUG Checking Skip Category...");
    boolean result = false;
    ViewEntry first = nav.getFirst();
    if (first == null) {
        return false;
    }
    if (first.isCategory()) {
        ViewEntry second = nav.getNextSibling(first);
        if (second == null) {
            result = true;
        }
    }
    nav.gotoFirst();
    return result;
}
Also used : ViewEntry(org.openntf.domino.ViewEntry)

Example 14 with ViewEntry

use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.

the class RawMessageProviderDBImpl method buildMsgCache.

/*----------------------------------------------------------------------------*/
private void buildMsgCache() {
    iMsgCache = new TreeMap<String, Map<String, Map<String, String>>>();
    /*
		 * To avoid PANIC-s from WrapperFactory.recacheLotusObject (when buildMsgCache is called again),
		 * this was partly modified 
		 */
    try {
        if (iDB == null) {
            if (iDBPath == null)
                return;
            Session s = Factory.getSession_unchecked(SessionType.CURRENT);
            if (s == null || (iDB = s.getDatabase(iDBServer, iDBPath)) == null) {
                System.err.println("RawMessageProviderDBImpl: Can't open DB " + iDBServer + "!!" + iDBPath);
                return;
            }
        }
        View v = iDB.getView(iLookupView);
        if (v == null)
            return;
        v.setAutoUpdate(false);
        ViewNavigator nav = v.createViewNav();
        for (ViewEntry ve = nav.getFirst(); ve != null; ve = nav.getNext()) oneDBMsgText(ve);
    } catch (Throwable t) {
        t.printStackTrace();
    } finally {
        iDB = null;
    }
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry) TreeMap(java.util.TreeMap) Map(java.util.Map) View(org.openntf.domino.View) Session(org.openntf.domino.Session)

Example 15 with ViewEntry

use of org.openntf.domino.ViewEntry in project org.openntf.domino by OpenNTF.

the class MassViewEntryCollectionTest method run.

@Test
public void run() {
    Session s = Factory.getSession(SessionType.CURRENT);
    Database source = s.getDatabase("", TARGET, true);
    View view = source.getView(VIEW);
    System.out.println("-- START --");
    long start = System.nanoTime();
    int i = 0;
    if (null != view) {
        view.setAutoUpdate(false);
        System.out.println(view.getEntryCount());
        for (ViewEntry entry : view.getAllEntries()) {
            i++;
        }
        /* */
        view.setAutoUpdate(true);
    }
    System.out.println(i);
    long elapsed = System.nanoTime() - start;
    System.out.println("-- STOP --");
    System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
}
Also used : ViewEntry(org.openntf.domino.ViewEntry) Database(org.openntf.domino.Database) View(org.openntf.domino.View) Session(org.openntf.domino.Session) Test(org.junit.Test)

Aggregations

ViewEntry (org.openntf.domino.ViewEntry)21 View (org.openntf.domino.View)7 ViewNavigator (org.openntf.domino.ViewNavigator)7 Database (org.openntf.domino.Database)5 Session (org.openntf.domino.Session)5 Test (org.junit.Test)3 ViewEntryCollection (org.openntf.domino.ViewEntryCollection)3 ViewEntryCoordinate (org.openntf.domino.big.ViewEntryCoordinate)3 ArrayList (java.util.ArrayList)2 FastSet (javolution.util.FastSet)2 NotesException (lotus.domino.NotesException)2 Edge (com.tinkerpop.blueprints.Edge)1 Vertex (com.tinkerpop.blueprints.Vertex)1 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 TreeSet (java.util.TreeSet)1 Vector (java.util.Vector)1 Document (org.openntf.domino.Document)1 DocumentCollection (org.openntf.domino.DocumentCollection)1