Search in sources :

Example 26 with View

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

Example 27 with View

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

the class DocumentSyncHelper method process.

/**
 * Process a specific document
 *
 * WARNING: Does not currently check that all properties of the SyncHelper have been set up
 *
 * @param doc
 *            Document to process
 * @since ODA 3.2.0
 */
public void process(final Document doc) {
    // TODO Check to make sure properties are all set up before running
    Session session = doc.getAncestorSession();
    Database targetDb = session.getDatabase(getTargetServer(), getTargetFilepath());
    View targetView = targetDb.getView(getTargetLookupView());
    Strategy strategy = getStrategy();
    setTransactionRule(TransactionRule.NO_TRANSACTION);
    processDocument(targetDb, targetView, strategy, null, doc);
}
Also used : Database(org.openntf.domino.Database) View(org.openntf.domino.View) Session(org.openntf.domino.Session)

Example 28 with View

use of org.openntf.domino.View 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 29 with View

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

the class TimeSensitive method run.

@Override
public void run() {
    Session s = Factory.getSession(SessionType.NATIVE);
    DbDirectory dir = s.getDbDirectory(s.getServerName());
    for (Database db : dir) {
        if (null == db) {
        // System.out.println("Database " + db.getFilePath() + " is null");
        } else {
            try {
                for (View vw : db.getViews()) {
                    if (vw.isTimeSensitive()) {
                        System.out.println("TIME SENSITIVE: View " + vw.getName() + " in db " + db.getFilePath());
                    }
                }
            } catch (Exception e) {
                System.out.println("Database " + db.getFilePath() + " cannot be opened");
            }
        }
    }
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) Database(org.openntf.domino.Database) View(org.openntf.domino.View) Session(org.openntf.domino.Session)

Example 30 with View

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

the class SerializeTest method testViewReboot.

@Test
public void testViewReboot() throws IOException, ClassNotFoundException {
    Session sess = Factory.getSession(SessionType.CURRENT);
    View vw = sess.getDatabase("log.nsf").getViews().get(0);
    View ret = test(vw, true);
    assertFalse(vw == ret);
}
Also used : View(org.openntf.domino.View) Session(org.openntf.domino.Session) Test(org.junit.Test)

Aggregations

View (org.openntf.domino.View)33 Session (org.openntf.domino.Session)20 Database (org.openntf.domino.Database)19 Document (org.openntf.domino.Document)9 ViewEntry (org.openntf.domino.ViewEntry)7 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)5 Date (java.util.Date)5 ViewNavigator (org.openntf.domino.ViewNavigator)5 HashMap (java.util.HashMap)4 ViewColumn (org.openntf.domino.ViewColumn)4 Map (java.util.Map)3 Vector (java.util.Vector)3 DocumentCollection (org.openntf.domino.DocumentCollection)3 ViewEntryCollection (org.openntf.domino.ViewEntryCollection)3 JsonJavaObject (com.ibm.commons.util.io.json.JsonJavaObject)2 JsonObject (com.ibm.commons.util.io.json.JsonObject)2 Edge (com.tinkerpop.blueprints.Edge)2 Vertex (com.tinkerpop.blueprints.Vertex)2 EdgeFrame (com.tinkerpop.frames.EdgeFrame)2