Search in sources :

Example 6 with ViewNavigator

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

the class View method createViewNavFromDescendants.

/*
	 * (non-Javadoc)
	 *
	 * @see org.openntf.domino.View#createViewNavFromDescendants(java.lang.Object, int)
	 */
@Override
public ViewNavigator createViewNavFromDescendants(final Object entry, final int cacheSize) {
    try {
        getDelegate().setAutoUpdate(false);
        getDelegate().setEnableNoteIDsForCategories(true);
        ViewNavigator result = fromLotus(getDelegate().createViewNavFromDescendants(toLotus(entry), cacheSize), ViewNavigator.SCHEMA, this);
        result.setCacheSize(cacheSize);
        ((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.DESCENDANTS);
        return result;
    } catch (NotesException e) {
        DominoUtils.handleException(e);
    }
    return null;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) NotesException(lotus.domino.NotesException)

Example 7 with ViewNavigator

use of org.openntf.domino.ViewNavigator 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;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry) ArrayList(java.util.ArrayList) CaseInsensitiveString(org.openntf.domino.types.CaseInsensitiveString)

Example 8 with ViewNavigator

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

the class DCategoryVertex method getSubNavigator.

public ViewNavigator getSubNavigator() {
    View view = getView();
    // $NON-NLS-1$
    ViewEntry entry = view.getEntryAtPosition(getProperty("position", String.class));
    ViewNavigator result = view.createViewNavFromDescendants(entry, 100);
    if (getParent().getConfiguration().isSuppressSingleValueCategories()) {
        while (checkSkipCategory(result)) {
            // System.out.println("TEMP DEBUG SubNavigator skipping category level...");
            result = dropSingleValueCategory(view, result);
        }
    }
    return result;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry) View(org.openntf.domino.View)

Example 9 with ViewNavigator

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

the class DCategoryVertex method dropSingleValueCategory.

public static ViewNavigator dropSingleValueCategory(final View view, final ViewNavigator nav) {
    ViewEntry first = nav.getFirst();
    ViewNavigator result = view.createViewNavFromDescendants(first);
    return result;
}
Also used : ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry)

Example 10 with ViewNavigator

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

the class DEdgeEntryList method initEntryList.

public void initEntryList(final List<CharSequence> list) {
    ViewNavigator nav = null;
    if (org.openntf.domino.View.class.equals(source_.getDelegateType())) {
        View view = source_.getView();
        Vector<Object> repeatKeys = new Vector<Object>();
        repeatKeys.addAll(list);
        ViewEntry entry = view.getFirstEntryByKey(repeatKeys, false);
        if (entry != null) {
            nav = view.createViewNavFrom(entry);
            entryList_ = new ViewEntryList(nav);
        } else {
            throw new KeyNotFoundException(list);
        }
    } else {
        throw new IllegalArgumentException("Cannot use start keys on anything except a view root.");
    }
}
Also used : ViewEntryList(org.openntf.domino.big.impl.ViewEntryList) ViewNavigator(org.openntf.domino.ViewNavigator) ViewEntry(org.openntf.domino.ViewEntry) View(org.openntf.domino.View) Vector(java.util.Vector)

Aggregations

ViewNavigator (org.openntf.domino.ViewNavigator)22 NotesException (lotus.domino.NotesException)14 ViewEntry (org.openntf.domino.ViewEntry)7 View (org.openntf.domino.View)5 Session (org.openntf.domino.Session)3 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 Database (org.openntf.domino.Database)2 ViewEntryList (org.openntf.domino.big.impl.ViewEntryList)2 IOException (java.io.IOException)1 InvalidClassException (java.io.InvalidClassException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 Vector (java.util.Vector)1 BackendBridgeSanityCheckException (org.openntf.domino.exceptions.BackendBridgeSanityCheckException)1 CaseInsensitiveString (org.openntf.domino.types.CaseInsensitiveString)1