use of org.openntf.domino.ViewNavigator in project org.openntf.domino by OpenNTF.
the class DEdgeEntryList method initEntryList.
// public DEdgeEntryList(final DVertex source, final DElementStore store, final List<CharSequence> startkeys) {
// source_ = source;
// store_ = store;
// initEntryList(startkeys);
// }
protected void initEntryList() {
ViewNavigator nav = null;
if (org.openntf.domino.View.class.equals(source_.getDelegateType())) {
nav = source_.getView().createViewNav();
if (source_.getParent().getConfiguration().isSuppressSingleValueCategories()) {
while (DCategoryVertex.checkSkipCategory(nav)) {
// System.out.println("TEMP DEBUG SubNavigator skipping category level...");
nav = DCategoryVertex.dropSingleValueCategory(source_.getView(), nav);
}
}
} else if (source_ instanceof DCategoryVertex) {
nav = ((DCategoryVertex) source_).getSubNavigator();
} else {
throw new IllegalStateException("Cannot create a DEdgeEntryList from a Vertex backed by a " + source_.getClass().getName());
}
entryList_ = new ViewEntryList(nav, isFlat_);
}
use of org.openntf.domino.ViewNavigator 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");
}
use of org.openntf.domino.ViewNavigator 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;
}
}
use of org.openntf.domino.ViewNavigator in project org.openntf.domino by OpenNTF.
the class MassViewNavigatorSkipTest 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);
nav.skip(1000000);
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");
}
use of org.openntf.domino.ViewNavigator in project org.openntf.domino by OpenNTF.
the class View method createViewNavFromKey.
@SuppressWarnings("rawtypes")
@Override
public ViewNavigator createViewNavFromKey(final Vector arg0, final boolean arg1) {
try {
getDelegate().setAutoUpdate(false);
getDelegate().setEnableNoteIDsForCategories(true);
ViewNavigator result = fromLotus(getDelegate().createViewNavFromKey(arg0, arg1), ViewNavigator.SCHEMA, this);
((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.KEYS);
return result;
} catch (Exception e) {
DominoUtils.handleException(e);
}
return null;
}
Aggregations