Search in sources :

Example 1 with Fixes

use of org.openntf.domino.ext.Session.Fixes in project org.openntf.domino by OpenNTF.

the class AbstractSessionFactory method wrapSession.

protected Session wrapSession(final lotus.domino.Session raw, final boolean selfCreated) {
    WrapperFactory wf = Factory.getWrapperFactory();
    org.openntf.domino.Session sess = wf.fromLotus(raw, Session.SCHEMA, wf);
    sess.setNoRecycle(!selfCreated);
    Fixes[] fixes = Factory.getThreadConfig().fixes;
    if (fixes != null) {
        for (Fixes fix : fixes) {
            if (fix.isKhan()) {
                sess.setFixEnable(fix, true);
            }
        }
    }
    sess.setAutoMime(Factory.getThreadConfig().autoMime);
    sess.setConvertMIME(false);
    if (selfCreated && currentApiPath_ != null) {
        Database db = sess.getCurrentDatabase();
        if (db == null) {
            db = sess.getDatabase(currentApiPath_);
            setCurrentDatabase(sess, db);
        }
    }
    return sess;
}
Also used : WrapperFactory(org.openntf.domino.WrapperFactory) Fixes(org.openntf.domino.ext.Session.Fixes) Database(org.openntf.domino.Database) Session(org.openntf.domino.Session)

Example 2 with Fixes

use of org.openntf.domino.ext.Session.Fixes in project org.openntf.domino by OpenNTF.

the class ODAGraphService method getDataServiceConfig.

protected ThreadConfig getDataServiceConfig() {
    Fixes[] fixes = Fixes.values();
    AutoMime autoMime = AutoMime.WRAP_32K;
    boolean bubbleExceptions = false;
    return new ThreadConfig(fixes, autoMime, bubbleExceptions);
}
Also used : ThreadConfig(org.openntf.domino.utils.Factory.ThreadConfig) Fixes(org.openntf.domino.ext.Session.Fixes) AutoMime(org.openntf.domino.AutoMime)

Example 3 with Fixes

use of org.openntf.domino.ext.Session.Fixes in project org.openntf.domino by OpenNTF.

the class AbstractXPageSessionFactory method wrapSession.

protected Session wrapSession(final lotus.domino.Session raw, final boolean selfCreated) {
    Session sess = Factory.getWrapperFactory().fromLotus(raw, Session.SCHEMA, null);
    sess.setNoRecycle(!selfCreated);
    boolean allFix = true;
    AutoMime autoMime = AutoMime.WRAP_32K;
    boolean mimeFriendly = true;
    boolean viewExactMatch = false;
    if (NotesContext.getCurrentUnchecked() != null) {
        allFix = ODAPlatform.isAppAllFix(null);
        autoMime = ODAPlatform.getAppAutoMime(null);
        mimeFriendly = ODAPlatform.isAppMimeFriendly(null);
        viewExactMatch = ODAPlatform.isAppViewExactMatch(null);
    }
    if (allFix) {
        for (Fixes fix : Fixes.values()) {
            if (fix.isKhan()) {
                sess.setFixEnable(fix, true);
            }
        }
    }
    sess.setAutoMime(autoMime);
    sess.setViewExactMatch(viewExactMatch);
    if (mimeFriendly) {
        sess.setConvertMIME(false);
    }
    if (selfCreated && currentApiPath_ != null) {
        Database db = sess.getCurrentDatabase();
        if (db == null) {
            db = sess.getDatabase(currentApiPath_);
            setCurrentDatabase(sess, db);
        }
    }
    return sess;
}
Also used : Fixes(org.openntf.domino.ext.Session.Fixes) Database(org.openntf.domino.Database) AutoMime(org.openntf.domino.AutoMime) Session(org.openntf.domino.Session)

Aggregations

Fixes (org.openntf.domino.ext.Session.Fixes)3 AutoMime (org.openntf.domino.AutoMime)2 Database (org.openntf.domino.Database)2 Session (org.openntf.domino.Session)2 WrapperFactory (org.openntf.domino.WrapperFactory)1 ThreadConfig (org.openntf.domino.utils.Factory.ThreadConfig)1