use of org.openntf.domino.Database in project org.openntf.domino by OpenNTF.
the class RichTextDoclink method getView.
/* (non-Javadoc)
* @see org.openntf.domino.ext.RichTextDoclink#getView()
*/
@Override
public View getView() {
String viewId = getViewUnID();
if (viewId != null && !viewId.isEmpty()) {
// Use session.resolve to not run afoul of same-named views
Database database = getDatabase();
Session session = getAncestorSession();
String databaseUrl = database.getURL();
// $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String url = databaseUrl.substring(0, databaseUrl.length() - "?OpenDatabase".length()) + "/" + viewId + "?OpenView";
return (View) session.resolve(url);
}
return null;
}
use of org.openntf.domino.Database in project org.openntf.domino by OpenNTF.
the class BigNoteCollection method getAddress.
public static String getAddress(final Document doc) {
final Database db = doc.getAncestorDatabase();
String result = getAddress(db);
result += doc.getNoteID();
return result;
}
use of org.openntf.domino.Database in project org.openntf.domino by OpenNTF.
the class BigNoteCollection method getDocument.
public static Document getDocument(final Session session, final String server, final String replid, final String noteid) {
final Database db = session.getDatabase("", "");
db.openByReplicaID(server, replid);
if (db.isOpen()) {
final Document result = db.getDocumentByID(noteid);
return result;
} else {
// TODO handle exception properly
return null;
}
}
use of org.openntf.domino.Database in project org.openntf.domino by OpenNTF.
the class DbCache method getDatabase.
public Database getDatabase(final long dbid, final String server, final Session session) {
Database result = dbMap_.get(dbid);
if (result == null) {
String replid = getReplidFromLong(dbid);
DbDirectory dir = session.getDbDirectory(server);
result = dir.openDatabaseByReplicaID(replid);
dbMap_.put(dbid, result);
}
return result;
}
use of org.openntf.domino.Database in project org.openntf.domino by OpenNTF.
the class DbCache method getDocument.
public Document getDocument(final NoteCoordinate nc) {
Document result = null;
long id = nc.getDbid();
Database db = getDatabase(id);
if (db == null) {
System.out.println("DEBUG: Unable to find database with id " + id + " (" + org.openntf.domino.big.NoteCoordinate.Utils.getReplidFromLong(id) + ")");
}
result = db.getDocumentByUNID(nc.getUNID(), true);
return result;
}
Aggregations