Search in sources :

Example 1 with DesignColumn

use of org.openntf.domino.design.DesignColumn in project org.openntf.domino by OpenNTF.

the class Engage17DesignView method run.

@Override
public void run() {
    Session sess = Factory.getSession(SessionType.NATIVE);
    Database extLib = sess.getDatabase("oda_1.nsf");
    View contacts = extLib.getView("AllContactsProgrammatic");
    if (null != contacts) {
        contacts.remove();
    }
    DatabaseDesign dbDesign = extLib.getDesign();
    DesignView newView = dbDesign.createView();
    newView.setSelectionFormula("SELECT Form=\"Contact\"");
    newView.setName("AllContactsProgrammatic");
    DesignColumn col = newView.addColumn();
    col.setItemName("State");
    col.setSortOrder(SortOrder.ASCENDING);
    col.setTitle("STATE");
    col.setCategorized(true);
    DesignColumn name = newView.addColumn();
    name.setFormula("FirstName+\" \"+LastName");
    name.setSortOrder(SortOrder.ASCENDING);
    name.setTitle("NAME");
    DesignColumn name2 = newView.addColumn();
    name2.setFormula("LastName");
    name2.setSortOrder(SortOrder.ASCENDING);
    name2.setTitle("NAME");
    DesignColumn city = newView.addColumn();
    city.setItemName("City");
    city.setTitle("CITY");
    city.setResortOrder(ResortOrder.ASCENDING);
    city.setSecondarySortColumn(2);
    newView.save();
}
Also used : DesignColumn(org.openntf.domino.design.DesignColumn) DesignView(org.openntf.domino.design.DesignView) DatabaseDesign(org.openntf.domino.design.DatabaseDesign) Database(org.openntf.domino.Database) View(org.openntf.domino.View) DesignView(org.openntf.domino.design.DesignView) Session(org.openntf.domino.Session)

Aggregations

Database (org.openntf.domino.Database)1 Session (org.openntf.domino.Session)1 View (org.openntf.domino.View)1 DatabaseDesign (org.openntf.domino.design.DatabaseDesign)1 DesignColumn (org.openntf.domino.design.DesignColumn)1 DesignView (org.openntf.domino.design.DesignView)1