use of org.openntf.domino.design.DesignForm in project org.openntf.domino by OpenNTF.
the class FormTest method getFormInfo.
private void getFormInfo(final Database db, final StringBuilder sb) {
DesignForm form = db.getDesign().getForm("testForm");
FormField field = form.addField();
field.setName("EclipseTest");
field.setKind(Kind.COMPUTED);
field.setDefaultValueFormula("@Today");
field.setFieldType(Type.DATETIME);
FormField field2 = form.addField();
field2.setName("EclipseTest2");
field2.setKind(Kind.EDITABLE);
field2.setDefaultValueFormula("Hello");
field2.setAllowMultiValues(true);
sb.append("Outputting explicit subforms for testForm");
addNewLine(sb);
List<String> subforms = form.getExplicitSubforms();
for (String subformName : subforms) {
sb.append(subformName);
addNewLine(sb);
}
sb.append("Outputting computed subforms for testForm");
addNewLine(sb);
subforms = form.getComputedSubforms();
for (String subformName : subforms) {
sb.append(subformName);
addNewLine(sb);
}
}
use of org.openntf.domino.design.DesignForm in project org.openntf.domino by OpenNTF.
the class FormCRUDTest method run.
@SuppressWarnings("unchecked")
@Override
public void run() {
try {
Session sess = Factory.getSession(SessionType.NATIVE);
Database db = sess.getDatabase("PrivateTest.nsf");
DesignForm form = db.getDesign().createForm();
form.setName("EclipseTest");
FormField field = form.addField();
field.setName("EclipseTest");
field.setKind(Kind.COMPUTED);
field.setDefaultValueFormula("@Today");
field.setFieldType(Type.DATETIME);
FormField field2 = form.addField();
field2.setName("EclipseTest2");
field2.setKind(Kind.EDITABLE);
field2.setDefaultValueFormula("Hello");
field2.setAllowMultiValues(true);
form.save();
} catch (Exception e) {
e.printStackTrace();
}
}
use of org.openntf.domino.design.DesignForm in project org.openntf.domino by OpenNTF.
the class FormCRUDTest method getFormInfo.
private void getFormInfo(final Database db, final StringBuilder sb) {
DesignForm form = db.getDesign().getForm("testForm");
sb.append("Outputting explicit subforms for testForm");
addNewLine(sb);
List<String> subforms = form.getExplicitSubforms();
for (String subformName : subforms) {
sb.append(subformName);
addNewLine(sb);
}
sb.append("Outputting computed subforms for testForm");
addNewLine(sb);
subforms = form.getComputedSubforms();
for (String subformName : subforms) {
sb.append(subformName);
addNewLine(sb);
}
}
Aggregations