Search in sources :

Example 1 with DbProperties

use of org.openntf.domino.design.DatabaseDesign.DbProperties in project org.openntf.domino by OpenNTF.

the class DbPropTest method setDbInfo.

private void setDbInfo(final Database db) throws IOException {
    DatabaseDesign dbDesign = (DatabaseDesign) db.getDesign();
    HashMap<DbProperties, Boolean> props = new HashMap<>();
    props.put(DbProperties.USE_JS, false);
    props.put(DbProperties.REQUIRE_SSL, true);
    props.put(DbProperties.NO_URL_OPEN, false);
    props.put(DbProperties.ENHANCED_HTML, true);
    dbDesign.setReplicateUnreadSetting(UnreadReplicationSetting.CLUSTER);
    dbDesign.setDatabaseProperties(props);
    dbDesign.setMaxRevisions(30);
    dbDesign.save();
}
Also used : DatabaseDesign(org.openntf.domino.design.impl.DatabaseDesign) HashMap(java.util.HashMap) DbProperties(org.openntf.domino.design.DatabaseDesign.DbProperties)

Example 2 with DbProperties

use of org.openntf.domino.design.DatabaseDesign.DbProperties in project org.openntf.domino by OpenNTF.

the class DbPropTest method getDbInfo.

private void getDbInfo(final Database db, final StringBuilder sb) {
    DatabaseDesign dbDesign = (DatabaseDesign) db.getDesign();
    List<DbProperties> props = dbDesign.getDatabaseProperties();
    for (DbProperties prop : props) {
        sb.append(prop);
        addNewLine(sb);
    }
    sb.append(dbDesign.getTemplateName());
    addNewLine(sb);
    sb.append(dbDesign.getNameIfTemplate());
    addNewLine(sb);
    sb.append("DAS Setting = " + dbDesign.getDasMode().name());
    addNewLine(sb);
    sb.append("Replicate Unread = " + dbDesign.getReplicateUnreadSetting().name());
    addNewLine(sb);
    sb.append("Max Updated = " + dbDesign.getMaxUpdatedBy());
    addNewLine(sb);
    sb.append("Max Revisions = " + dbDesign.getMaxRevisions());
    addNewLine(sb);
    sb.append("Soft Deletes = " + dbDesign.getSoftDeletionsExpireIn());
}
Also used : DatabaseDesign(org.openntf.domino.design.impl.DatabaseDesign) DbProperties(org.openntf.domino.design.DatabaseDesign.DbProperties)

Example 3 with DbProperties

use of org.openntf.domino.design.DatabaseDesign.DbProperties in project org.openntf.domino by OpenNTF.

the class FormTest method getDbInfo.

private void getDbInfo(final Database db, final StringBuilder sb) {
    DatabaseDesign dbDesign = (DatabaseDesign) db.getDesign();
    List<DbProperties> props = dbDesign.getDatabaseProperties();
    for (DbProperties prop : props) {
        sb.append(prop);
        addNewLine(sb);
    }
    sb.append(dbDesign.getTemplateName());
    addNewLine(sb);
    sb.append(dbDesign.getNameIfTemplate());
    addNewLine(sb);
    sb.append("DAS Setting = " + dbDesign.getDasMode().name());
    addNewLine(sb);
    sb.append("Replicate Unread = " + dbDesign.getReplicateUnreadSetting().name());
    addNewLine(sb);
    sb.append("Max Updated = " + dbDesign.getMaxUpdatedBy());
    addNewLine(sb);
    sb.append("Max Revisions = " + dbDesign.getMaxRevisions());
    addNewLine(sb);
    sb.append("Soft Deletes = " + dbDesign.getSoftDeletionsExpireIn());
// dbDesign.setMaxRevisions(30);
// dbDesign.save();
}
Also used : DatabaseDesign(org.openntf.domino.design.impl.DatabaseDesign) DbProperties(org.openntf.domino.design.DatabaseDesign.DbProperties)

Example 4 with DbProperties

use of org.openntf.domino.design.DatabaseDesign.DbProperties in project org.openntf.domino by OpenNTF.

the class TestDatabasePropertyWrapper method testProperty.

public void testProperty(DbProperties prop) {
    HashMap<DbProperties, Boolean> props = new HashMap<DbProperties, Boolean>();
    props.put(prop, true);
    DatabaseDesign design = getNewSessionDesign();
    design.setDatabaseProperties(props);
    design.save();
    design = getNewSessionDesign();
    ArrayList<DbProperties> retProps = (ArrayList<DbProperties>) design.getDatabaseProperties();
    assertTrue(retProps.contains(prop));
    design = getNewSessionDesign();
    props.put(prop, false);
    design.setDatabaseProperties(props);
    design.save();
    design = getNewSessionDesign();
    retProps = (ArrayList<DbProperties>) design.getDatabaseProperties();
    assertFalse(retProps.contains(prop));
}
Also used : HashMap(java.util.HashMap) DatabaseDesign(org.openntf.domino.design.DatabaseDesign) ArrayList(java.util.ArrayList) DbProperties(org.openntf.domino.design.DatabaseDesign.DbProperties)

Aggregations

DbProperties (org.openntf.domino.design.DatabaseDesign.DbProperties)4 DatabaseDesign (org.openntf.domino.design.impl.DatabaseDesign)3 HashMap (java.util.HashMap)2 ArrayList (java.util.ArrayList)1 DatabaseDesign (org.openntf.domino.design.DatabaseDesign)1