Search in sources :

Example 96 with Database

use of org.openntf.domino.Database 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 97 with Database

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

the class ViewCheckUniqueTest method main.

public static void main(final String[] args) {
    Session s = null;
    Database d = null;
    NotesThread.sinitThread();
    try {
        s = Factory.getSession(SessionType.CURRENT);
        d = s.getDatabase("heracles/intec-pw", "OpenNTF\\OpenNTFDomino.nsf");
        ViewCheckUniqueTest a = new ViewCheckUniqueTest(s, d);
        a.NotesMain();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        NotesThread.stermThread();
    }
}
Also used : Database(org.openntf.domino.Database) Session(org.openntf.domino.Session)

Example 98 with Database

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

the class DesignClassTest method testCreation.

// @Test
public void testCreation() {
    DbDirectory dbdir = Factory.getSession(SessionType.CURRENT).getDbDirectory("");
    Database db = dbdir.createDatabase("D:/Daten/notesdaten_9/localdb/pw" + System.currentTimeMillis() + ".nsf", true);
    AboutDocument abd = new org.openntf.domino.design.impl.AboutDocument(db);
    abd.save();
}
Also used : DbDirectory(org.openntf.domino.DbDirectory) AboutDocument(org.openntf.domino.design.AboutDocument) Database(org.openntf.domino.Database)

Example 99 with Database

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

the class DesignClassTest method testDBClassLoader.

// @Test
public void testDBClassLoader() throws ClassNotFoundException {
    Session sess = Factory.getSession(SessionType.CURRENT);
    Database db = sess.getDatabase("D:/Daten/notesdaten_9/localdb/proglib4work2.nsf");
    ClassLoader cl = new DatabaseClassLoader(db.getDesign(), Factory.getClassLoader(), true, true);
    // XPage - java
    Class<?> cls = cl.loadClass("de.foconis.core.util.LSStringUtil");
    System.out.println(cls);
    // JAR
    cls = cl.loadClass("org.junit.Assert");
    System.out.println(cls);
    // Class<?> cls = cl.loadClass("com.googlecode.htmlcompressor.compressor.Compressor");
    // Script-Lib
    cls = cl.loadClass("FocMessageDigestFactory");
    System.out.println(cls);
}
Also used : DatabaseClassLoader(org.openntf.domino.design.impl.DatabaseClassLoader) Database(org.openntf.domino.Database) DatabaseClassLoader(org.openntf.domino.design.impl.DatabaseClassLoader) Session(org.openntf.domino.Session)

Example 100 with Database

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

the class TestWrapperFactory method testWrapSession.

@Test
public void testWrapSession() throws Exception {
    AllTests.session = Factory.getWrapperFactory().fromLotus(AllTests.lotusSession, Session.SCHEMA, null);
    assertNotEquals("Wrapped session should not be null", null, AllTests.session);
    System.out.println("Path is " + AllTests.EMPTY_DB);
    Database db = AllTests.session.getDatabase(AllTests.EMPTY_DB);
    assertNotNull(db);
    Factory.setSessionFactory(() -> AllTests.session, SessionType.CURRENT);
}
Also used : Database(org.openntf.domino.Database) Test(org.junit.Test)

Aggregations

Database (org.openntf.domino.Database)131 Session (org.openntf.domino.Session)73 Document (org.openntf.domino.Document)49 Test (org.junit.Test)19 View (org.openntf.domino.View)19 DbDirectory (org.openntf.domino.DbDirectory)17 NotesException (lotus.domino.NotesException)12 ArrayList (java.util.ArrayList)11 NoteCollection (org.openntf.domino.NoteCollection)11 OpenNTFNotesException (org.openntf.domino.exceptions.OpenNTFNotesException)10 DocumentCollection (org.openntf.domino.DocumentCollection)8 NoteCoordinate (org.openntf.domino.big.NoteCoordinate)8 Date (java.util.Date)6 UserAccessException (org.openntf.domino.exceptions.UserAccessException)6 IOException (java.io.IOException)5 HashMap (java.util.HashMap)5 ViewEntry (org.openntf.domino.ViewEntry)5 FastTable (javolution.util.FastTable)4 Item (org.openntf.domino.Item)4 RichTextItem (org.openntf.domino.RichTextItem)4