Search in sources :

Example 1 with ViewEntryList

use of org.openntf.domino.big.impl.ViewEntryList 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)

Example 2 with ViewEntryList

use of org.openntf.domino.big.impl.ViewEntryList 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_);
}
Also used : ViewEntryList(org.openntf.domino.big.impl.ViewEntryList) ViewNavigator(org.openntf.domino.ViewNavigator)

Example 3 with ViewEntryList

use of org.openntf.domino.big.impl.ViewEntryList 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)

Aggregations

ViewEntryList (org.openntf.domino.big.impl.ViewEntryList)3 Vector (java.util.Vector)2 View (org.openntf.domino.View)2 ViewNavigator (org.openntf.domino.ViewNavigator)2 ViewEntry (org.openntf.domino.ViewEntry)1 ViewEntryCollection (org.openntf.domino.ViewEntryCollection)1