use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class DominoGraph method getVertexView.
private View getVertexView() {
View result = getRawDatabase().getView(DominoGraph.VERTEX_VIEW_NAME);
if (result == null) {
result = getRawDatabase().createView(DominoGraph.VERTEX_VIEW_NAME, "SELECT " + DominoElement.TYPE_FIELD + "=\"" + DominoVertex.GRAPH_TYPE_VALUE + "\"", null, false);
org.openntf.domino.ViewColumn column1 = result.createColumn();
column1.setTitle("Created");
column1.setFormula("@Created");
column1.setSortDescending(true);
}
return result;
}
use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class DominoGraph method getEdgeView.
private View getEdgeView() {
View result = getRawDatabase().getView(DominoGraph.EDGE_VIEW_NAME);
if (result == null) {
result = getRawDatabase().createView(DominoGraph.EDGE_VIEW_NAME, "SELECT " + DominoElement.TYPE_FIELD + "=\"" + DominoEdge.GRAPH_TYPE_VALUE + "\"", null, false);
org.openntf.domino.ViewColumn column1 = result.createColumn();
column1.setTitle("Created");
column1.setFormula("@Created");
column1.setSortDescending(true);
}
return result;
}
use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class Connect17Transaction method run.
@Override
public void run() {
Session sess = Factory.getSession(SessionType.NATIVE);
Database extLib = sess.getDatabase("odademo/oda_1.nsf");
Database extLib2 = sess.getDatabase("odademo/oda_2.nsf");
View states = extLib.getView("AllStates");
Document stateDoc = states.getFirstDocument();
DatabaseTransaction txn = extLib.startTransaction();
extLib2.setTransaction(txn);
boolean successOrFail = false;
String state = stateDoc.getItemValueString("Key");
System.out.println("Processing state " + state);
// Update some documents
queueTransaction(extLib, state);
// Update some documents
queueTransaction(extLib2, state);
if (successOrFail) {
txn.commit();
System.out.println("...Committed");
} else {
txn.rollback();
System.out.println("rolled back");
}
}
use of org.openntf.domino.View 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();
}
use of org.openntf.domino.View in project org.openntf.domino by OpenNTF.
the class MassViewNavigatorTest method run.
@Test
public void run() {
Session s = Factory.getSession(SessionType.CURRENT);
Database source = s.getDatabase("", TARGET, true);
View view = source.getView(VIEW);
System.out.println("-- START --");
long start = System.nanoTime();
if (null != view) {
view.setAutoUpdate(false);
System.out.println(view.getEntryCount());
ViewNavigator nav = view.createViewNav();
nav.setCacheSize(400);
System.out.println("CacheSize: " + nav.getCacheSize());
view.setAutoUpdate(true);
ViewEntry entry = null;
entry = nav.getFirst();
while (null != entry) {
entry = nav.getNext(entry);
}
}
long elapsed = System.nanoTime() - start;
System.out.println("-- STOP --");
System.out.println("Thread " + Thread.currentThread().getName() + " elapsed time: " + elapsed / 1000000 + "ms");
}
Aggregations