本文整理汇总了Java中lotus.domino.Document.getUniversalID方法的典型用法代码示例。如果您正苦于以下问题:Java Document.getUniversalID方法的具体用法?Java Document.getUniversalID怎么用?Java Document.getUniversalID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lotus.domino.Document
的用法示例。
在下文中一共展示了Document.getUniversalID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeEntry
import lotus.domino.Document; //导入方法依赖的package包/类
protected void writeEntry(JsonWriter jwriter, Document document
) throws IOException, ServiceException, NotesException {
String unid = document.getUniversalID();
if (!StringUtil.isNotEmpty(unid)) {
return;
}
jwriter.startArrayItem();
jwriter.startObject();
try {
DateTime lastModified = document.getLastModified();
if (lastModified != null)
writeDominoProperty(jwriter, RestServiceConstants.ATTR_MODIFIED, lastModified);
writeProperty(jwriter, RestServiceConstants.ATTR_UNID, unid);
String link = _uri + unid;
writeProperty(jwriter, RestServiceConstants.ATTR_HREF, link);
} finally {
jwriter.endArrayItem();
jwriter.endObject();
}
}
示例2: getEventCode
import lotus.domino.Document; //导入方法依赖的package包/类
/**
* This example uses DocumentUniqueId as the event code.
*
* @return the event code we will use for Participant docs
*/
private String getEventCode() {
if(StringUtil.isEmpty(eventCode)) {
Document eventDoc=getDoc();
try {
eventCode = eventDoc.getUniversalID();
} catch (NotesException e) {
// Use OpenNTF Domino API to get rid of this.
e.printStackTrace();
}
}
return eventCode;
}
示例3: faultyMethod
import lotus.domino.Document; //导入方法依赖的package包/类
@SuppressWarnings("null")
public void faultyMethod() {
Document doc = null;
try {
@SuppressWarnings("unused")
String id = doc.getUniversalID(); //will throw a NullPointerException
} catch (Exception e) {
//if you're only using the toolbar in a class to log errors,
//you might want to call ik like this, so no object is created
//if no error occur
DebugToolbar.get().error(e, "DemoClass.faultyMethod");
}
}
示例4: profileGet
import lotus.domino.Document; //导入方法依赖的package包/类
/**
* Gets an up-to-date copy of the profile document.
*
* @param database
* @return
* @throws NotesException
*/
private Document profileGet(Database database) throws NotesException {
// Open the calendar profile. This returns a cached copy (may not be up to date).
Document profile = database.getProfileDocument("CalendarProfile", null); // $NON-NLS-1$
String unid = profile.getUniversalID();
profile.recycle();
// Open the same document by UNID. This ensures we get the latest copy.
profile = database.getDocumentByUNID(unid);
return profile;
}