Search in sources :

Example 6 with ViewEntry

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

the class DEntryEdge method getVertex.

@Override
public Vertex getVertex(final Direction direction) throws IllegalArgumentException {
    ViewEntry entry = (org.openntf.domino.ViewEntry) getDelegate();
    if (Direction.OUT.equals(direction) && entry.isCategory()) {
        Map<String, Object> delegateMap = new LinkedHashMap<String, Object>();
        delegateMap.put("value", entry.getCategoryValue());
        delegateMap.put("position", entry.getPosition());
        delegateMap.put("noteid", entry.getNoteID());
        delegateMap.put("childcount", entry.getChildCount());
        DCategoryVertex result = new DCategoryVertex(getParent(), delegateMap, entry.getParentView());
        result.delegateKey_ = getVertexId(Direction.OUT);
        result.setView(entry.getParentView());
        return result;
    }
    return super.getVertex(direction);
}
Also used : ViewEntry(org.openntf.domino.ViewEntry) LinkedHashMap(java.util.LinkedHashMap)

Example 7 with ViewEntry

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

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

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

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

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