本文整理汇总了Java中com.ibm.xsp.extlib.util.ExtLibUtil.getCurrentDatabase方法的典型用法代码示例。如果您正苦于以下问题:Java ExtLibUtil.getCurrentDatabase方法的具体用法?Java ExtLibUtil.getCurrentDatabase怎么用?Java ExtLibUtil.getCurrentDatabase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.xsp.extlib.util.ExtLibUtil
的用法示例。
在下文中一共展示了ExtLibUtil.getCurrentDatabase方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadAppstore
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private void loadAppstore() {
Database db=ExtLibUtil.getCurrentDatabase();
View view=null;
Document appstore=null;
try {
view=db.getView("apps");
appstore=view.getDocumentByKey(DEFAULT_ENDPOINT_NAME, true);
if(appstore==null) {
System.out.println("No Application found for "+DEFAULT_ENDPOINT_NAME);
} else {
consumerKey=appstore.getItemValueString("ConsumerKey");
consumerSecret=appstore.getItemValueString("ConsumerSecret");
}
} catch(NotesException ne) {
ne.printStackTrace();
} finally {
DevelopiUtils.recycleObjects(appstore, view);
}
}
示例2: get
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public DominoDocument get(Object key) {
if(!(key instanceof String)) {
throw new IllegalArgumentException("key must be a String.");
}
try {
Database database = ExtLibUtil.getCurrentDatabase();
Document doc = database.getDocumentByUNID((String)key);
return DominoDocument.wrap(
database.getFilePath(), // databaseName
doc, // Document
null, // computeWithForm
null, // concurrencyMode
false, // allowDeletedDocs
null, // saveLinksAs
null // webQuerySaveAgent
);
} catch(NotesException ne) {
ne.printStackTrace();
}
return null;
}
示例3: run
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public void run() throws NotesException, IOException {
Database db = ExtLibUtil.getCurrentDatabase();
if(deleteAllDoc) {
deleteAllDocuments();
}
if(createUsers) {
createUsers(db);
}
if(createStates) {
createStates(db);
}
if(createDiscussionDocuments) {
createDiscussionDocuments(db);
}
if(createAllTypes) {
createAllTypes(db);
}
}
示例4: getNoteCount
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public int getNoteCount() throws NotesException {
Database database = ExtLibUtil.getCurrentDatabase();
View notes = database.getView("Notes by Parent");
ViewNavigator nav = notes.createViewNavFromCategory(this.getDocumentId());
int count = nav.getCount();
nav.recycle();
notes.recycle();
return count;
}
示例5: getStoreDoc
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private Document getStoreDoc() {
Database database=ExtLibUtil.getCurrentDatabase();
Document doc=null;
View view=null;
try {
view=database.getView("tokenstores");
String serverName=database.getServer();
doc=view.getDocumentByKey(serverName, true);
if(doc==null) {
doc=database.createDocument();
doc.replaceItemValue("Form", "tokenstore");
doc.replaceItemValue("ServerName", serverName);
doc.computeWithForm(false, false);
doc.save();
}
} catch (NotesException e) {
e.printStackTrace();
} finally {
DevelopiUtils.recycleObject(view);
}
return doc;
}
示例6: getFirstContactID
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public String getFirstContactID() throws NotesException {
if(!firstContactIDRead) {
Database db = ExtLibUtil.getCurrentDatabase();
View view = db.getView("AllContacts");
Document doc = view.getFirstDocument();
if(doc!=null) {
firstContactID = doc.getNoteID();
}
}
return firstContactID;
}
示例7: loadList
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private void loadList(String eventCode) {
Database db=ExtLibUtil.getCurrentDatabase();
View view=null;
ViewEntryCollection entries=null;
try {
view=db.getView("ParticipantsByEventCode");
entries=view.getAllEntriesByKey(eventCode, true);
ViewEntry ve=entries.getFirstEntry();
while(ve!=null) {
Document pDoc=null;
try {
pDoc=ve.getDocument();
_list.add(new Participant(pDoc));
} finally {
Utils.recycleObject(pDoc);
}
ViewEntry tmpEntry=ve;
ve=entries.getNextEntry(tmpEntry);
Utils.recycleObject(tmpEntry);
}
} catch (NotesException e) {
// Use OpenNTF Domino API to get rid of this.
e.printStackTrace();
} finally {
Utils.recycleObjects(view, entries);
}
}
示例8: getCurrentDatabase
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
private static Database getCurrentDatabase() {
return ExtLibUtil.getCurrentDatabase();
}
示例9: deleteAllDocuments
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
void deleteAllDocuments() throws NotesException {
Database db = ExtLibUtil.getCurrentDatabase();
db.getAllDocuments().removeAll(true);
}
示例10: getCommonServerName
import com.ibm.xsp.extlib.util.ExtLibUtil; //导入方法依赖的package包/类
public static String getCommonServerName() {
Session session=ExtLibUtil.getCurrentSession();
Database db=ExtLibUtil.getCurrentDatabase();
String serverName="";
try {
serverName = db.getServer();
} catch (NotesException e) { }
return toCommon(session, serverName);
}