本文整理汇总了Java中lotus.domino.Document.computeWithForm方法的典型用法代码示例。如果您正苦于以下问题:Java Document.computeWithForm方法的具体用法?Java Document.computeWithForm怎么用?Java Document.computeWithForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lotus.domino.Document
的用法示例。
在下文中一共展示了Document.computeWithForm方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveToDb
import lotus.domino.Document; //导入方法依赖的package包/类
public void saveToDb(Database db) throws NotesException {
Document pDoc=null;
if(isNew()) {
pDoc=db.createDocument();
pDoc.replaceItemValue("Form", "Participant");
} else {
pDoc=db.getDocumentByID(getNoteId());
}
if(isDeleted()) {
// Might not be able to delete it. So change the form.
pDoc.replaceItemValue("Form", "Participant_DELETED");
} else {
pDoc.replaceItemValue("MainDocId", getMainDocId());
pDoc.replaceItemValue("Name", getName());
pDoc.replaceItemValue("LCVFlag", isLcvProvided()?"1":"");
}
pDoc.computeWithForm(false, false);
pDoc.save();
noteId=pDoc.getNoteID();
}
示例2: createSampleDbDirProfile
import lotus.domino.Document; //导入方法依赖的package包/类
private void createSampleDbDirProfile(Database db) throws NotesException {
Document docProfile = db.getProfileDocument("DirectoryProfile", null);
docProfile.replaceItemValue("Form", "DirectoryProfile");
docProfile.replaceItemValue("Domain", db.getParent().evaluate("@Domain", docProfile));
docProfile.replaceItemValue("GroupSortDefault", "1");
docProfile.replaceItemValue("AutoPopulateMembersInterval", "30");
docProfile.replaceItemValue("SecureInetPasswords", "1");
docProfile.replaceItemValue("AltLanguageInfoAllowed", "1");
docProfile.computeWithForm(false, false);
docProfile.save(true, false);
docProfile.recycle();
}
示例3: getStoreDoc
import lotus.domino.Document; //导入方法依赖的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;
}
示例4: createDiscussionDocument
import lotus.domino.Document; //导入方法依赖的package包/类
void createDiscussionDocument(Database db, Document parent, ArrayList<String> users, int[] pos, int nDoc) throws NotesException, IOException {
DateTime date = db.getParent().createDateTime(new Date());
String[] loremIpsum = SampleDataUtil.readLoremIpsum();
for(int j=0; j<nDoc; j++) {
pos[pos.length-1] = j+1;
Document doc = db.createDocument();
try {
doc.replaceItemValue("Form","Discussion");
StringBuilder b = new StringBuilder();
for(int i=0; i<pos.length; i++) {
if(i>0) {
b.append("/");
}
b.append(pos[i]);
}
int idx = (int)(Math.random()*(loremIpsum.length-1));
String body = loremIpsum[idx];
int dot = body.indexOf('.');
if(dot<0) {dot=body.length()-1;}
int coma = body.indexOf(',');
if(coma<0) {coma=body.length()-1;}
String title = body.substring(0,Math.min(dot,coma));
// Get a random author
int x = Math.min((int)(Math.random()*((double)users.size())),users.size());
String author = users.get(x);
doc.replaceItemValue("Title",title);
doc.replaceItemValue("Body",body);
doc.replaceItemValue("Author",author);
doc.replaceItemValue("Date",date);
if(parent!=null) {
doc.makeResponse(parent);
}
doc.computeWithForm(false, false);
doc.save();
if(pos.length<disc_maxDepth) {
double r = Math.random();
if(r<=(1.0/(double)pos.length)) {
int[] newPos = new int[pos.length+1];
System.arraycopy(pos, 0, newPos, 0, pos.length);
int n = (int)(Math.random()*5);
createDiscussionDocument(db, doc, users, newPos, n);
}
}
// Move the date to the day before if requested
boolean mvd = Math.random()<=0.40;
if(mvd) {
// Previous day...
date.adjustDay(-1);
}
} finally {
doc.recycle();
}
}
}