本文整理汇总了Java中org.openntf.domino.Document.hasItem方法的典型用法代码示例。如果您正苦于以下问题:Java Document.hasItem方法的具体用法?Java Document.hasItem怎么用?Java Document.hasItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.openntf.domino.Document
的用法示例。
在下文中一共展示了Document.hasItem方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTermUnidInDbids
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Set<String> getTermUnidInDbids(final CharSequence term, final Collection<String> dbids) {
Set<String> unids = new HashSet<String>();
Document doc = getTermDocument(term);
for (String dbid : dbids) {
String itemName = TERM_MAP_PREFIX + dbid;
if (doc.hasItem(itemName)) {
Map termMap = doc.getItemValue(itemName, Map.class);
for (Object key : termMap.keySet()) {
Object termObj = termMap.get(key);
if (termObj != null) {
if (termObj instanceof Collection) {
unids.addAll((Collection) termObj);
} else if (termObj instanceof CharSequence) {
unids.add(((CharSequence) termObj).toString());
} else {
unids.add(String.valueOf(termObj));
}
}
}
}
}
return unids;
}
示例2: getView
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public View getView(final Document viewDocument) {
View result = null;
if (viewDocument.hasItem("$Index") || viewDocument.hasItem("$Collection") || viewDocument.hasItem("$Collation")
|| viewDocument.hasItem("$VIEWFORMAT")) {
String unid = viewDocument.getUniversalID();
String rawtitles = viewDocument.getItemValue("$Title", String.class);
String[] titles = PIPE_SPLIT.split(rawtitles);
for (String title : titles) {
View chk = getView(title);
if (chk.getUniversalID().equalsIgnoreCase(unid)) {
result = chk;
break;
}
}
}
return result;
}
示例3: scanDatabase
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unused")
public DocumentScanner scanDatabase(final Database db) {
Document dbDoc = getDbDocument(db.getReplicaID());
DocumentScanner scanner = new DocumentScanner();
scanner.setTrackFieldTokens(false);
scanner.setTrackFieldTypes(false);
scanner.setTrackFieldValues(false);
scanner.setTrackTokenFreq(false);
scanner.setTrackTokenLocation(true);
scanner.setTrackNameLocation(true);
scanner.setStopTokenList(getStopList());
scanner.setIgnoreDollar(true);
scanner.setStateManager(this, db.getReplicaID());
scanner.setCaseSensitive(getCaseSensitive());
dbDoc.replaceItemValue(IndexDatabase.DB_TITLE_NAME, db.getTitle());
if (dbDoc.hasItem(DB_LAST_INDEX_NAME)) {
scanner.setLastScanDate(dbDoc.getItemValue(DB_LAST_INDEX_NAME, Date.class));
// scanner.setStopTokenList(getStopList());
// scanner.setIgnoreDollar(true);
// Object tokenLocationObject = dbDoc.getItemValue(DB_TOKEN_LOCATION_NAME, Map.class);
// if (tokenLocationObject != null && !((Map) tokenLocationObject).isEmpty()) {
// scanner.setTokenLocationMap(tokenLocationObject);
// }
}
if (dbDoc.hasItem(IndexDatabase.DB_DOC_LIST_NAME)) {
scanner.setCollection(dbDoc.getItemValue(IndexDatabase.DB_DOC_LIST_NAME, org.openntf.domino.DocumentCollection.class));
}
Date scanDate = new Date();
scanDatabase(db, scanner);
String dbid = db.getReplicaID();
// writeResults(dbid, scanner);
dbDoc.replaceItemValue(DB_LAST_INDEX_NAME, scanDate);
// dbDoc.replaceItemValue(DB_FIELD_TOKEN_NAME, scanner.getFieldTokenMap());
// dbDoc.replaceItemValue(DB_TOKEN_LOCATION_NAME, scanner.getTokenLocationMap());
dbDoc.save();
return scanner;
}
示例4: getTermDbidHitCount
import org.openntf.domino.Document; //导入方法依赖的package包/类
protected int getTermDbidHitCount(final Document doc, final CharSequence dbid) {
int result = 0;
String itemName = TERM_MAP_PREFIX + dbid;
if (doc.hasItem(itemName)) {
Map termMap = doc.getItemValue(itemName, Map.class);
for (Object key : termMap.keySet()) {
Object val = termMap.get(key);
if (val instanceof Collection) {
result += ((Collection) val).size();
}
}
}
return result;
}
示例5: getTermItemsInDbids
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Set<CharSequence> getTermItemsInDbids(final String term, final Collection<String> dbids) {
Set<CharSequence> result = new HashSet<CharSequence>();
Document doc = getTermDocument(term);
for (String dbid : dbids) {
String itemName = TERM_MAP_PREFIX + dbid;
if (doc.hasItem(itemName)) {
Map termMap = doc.getItemValue(itemName, Map.class);
result.addAll(termMap.keySet());
}
}
return result;
}
示例6: getTermUnidInDbsItems
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Set<CharSequence> getTermUnidInDbsItems(final String term, final Collection<String> dbids, final Collection<?> itemNames) {
Set<CharSequence> unids = new HashSet<CharSequence>();
Document doc = getTermDocument(term);
for (String dbid : dbids) {
String itemName = TERM_MAP_PREFIX + dbid;
if (doc.hasItem(itemName)) {
Map termMap = doc.getItemValue(itemName, Map.class);
for (Object key : itemNames) {
CaseInsensitiveString ciskey = null;
if (key instanceof CaseInsensitiveString) {
ciskey = (CaseInsensitiveString) key;
} else if (key instanceof String) {
ciskey = new CaseInsensitiveString((String) key);
} else {
ciskey = new CaseInsensitiveString(String.valueOf(key));
}
Object termObj = termMap.get(ciskey);
if (termObj != null) {
if (termObj instanceof Collection) {
unids.addAll((Collection) termObj);
} else if (termObj instanceof CharSequence) {
unids.add(((CharSequence) termObj).toString());
} else {
unids.add(String.valueOf(termObj));
}
}
}
}
}
return unids;
}
示例7: restoreTokenLocationMap
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Map<CharSequence, Set<CharSequence>> restoreTokenLocationMap(final CharSequence token, final Object mapKey) {
Map result = null;
Document doc = getTermDocument(token.toString());
String itemName = TERM_MAP_PREFIX + String.valueOf(mapKey);
if (doc.hasItem(itemName)) {
result = doc.getItemValue(itemName, Map.class);
// System.out.println("Found existing term match for: " + token.toString() + " with " + result.size() + " items");
} else {
result = new ConcurrentHashMap<CaseInsensitiveString, Set<String>>(8, 0.9f, 1);
}
return result;
}
示例8: restoreValueLocationMap
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Map<CharSequence, Set<CharSequence>> restoreValueLocationMap(final CharSequence token, final Object mapKey) {
Map result = null;
Document doc = getValueDocument(token.toString());
String itemName = VALUE_MAP_PREFIX + String.valueOf(mapKey);
if (doc.hasItem(itemName)) {
result = doc.getItemValue(itemName, Map.class);
} else {
result = new ConcurrentHashMap<CaseInsensitiveString, Set<String>>(8, 0.9f, 1);
}
return result;
}
示例9: restoreNameLocationMap
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Map<CharSequence, Set<CharSequence>> restoreNameLocationMap(final CharSequence name, final Object mapKey) {
Map result = null;
Document doc = getNameDocument(name.toString());
String itemName = TERM_MAP_PREFIX + String.valueOf(mapKey);
if (doc.hasItem(itemName)) {
result = doc.getItemValue(itemName, Map.class);
} else {
result = new ConcurrentHashMap<CaseInsensitiveString, Set<String>>(8, 0.9f, 1);
}
return result;
}
示例10: getXotsClassNames
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public String[] getXotsClassNames() {
Document iconDoc = getDocument();
if (iconDoc != null && iconDoc.hasItem("$Xots")) {
String[] xotsClassNames = iconDoc.getItemValue("$Xots", String[].class);
if (xotsClassNames != null) {
return xotsClassNames;
}
}
return new String[] {};
}
示例11: getTermLinksInDbsItems
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public Set<String> getTermLinksInDbsItems(final Session session, final String serverName, final String term,
final Collection<CharSequence> dbids, final Collection<?> itemNames) {
Set<String> unids = new HashSet<String>();
Document doc = getTermDocument(term);
for (CharSequence dbid : dbids) {
String itemName = TERM_MAP_PREFIX + dbid;
if (doc.hasItem(itemName)) {
Map termMap = doc.getItemValue(itemName, Map.class);
// Database db = session.getDatabaseByReplicaID(serverName, dbid);
// if (db != null) {
for (Object key : itemNames) {
CaseInsensitiveString ciskey = null;
if (key instanceof CaseInsensitiveString) {
ciskey = (CaseInsensitiveString) key;
} else if (key instanceof String) {
ciskey = new CaseInsensitiveString((String) key);
} else {
ciskey = new CaseInsensitiveString(String.valueOf(key));
}
Object termObj = termMap.get(ciskey);
if (termObj != null) {
if (termObj instanceof Collection) {
for (Object unid : (Collection) termObj) {
// Document curDoc = db.getDocumentByUNID((String) unid);
unids.add("http://localhost/__" + dbid + ".nsf/0/" + unid);
}
// unids.addAll((Collection) termObj);
} else if (termObj instanceof CharSequence) {
// Document curDoc = db.getDocumentByUNID((String) ((CharSequence) termObj).toString());
unids.add("http://localhost/__" + dbid + ".nsf/0/" + ((CharSequence) termObj).toString());
// unids.add(((CharSequence) termObj).toString());
} else {
unids.add(String.valueOf(termObj));
}
}
}
// }
}
}
return unids;
}
示例12: isTimeSensitive
import org.openntf.domino.Document; //导入方法依赖的package包/类
@Override
public boolean isTimeSensitive() {
Document doc = getDocument();
return doc.hasItem("$FormulaTV");
}
示例13: getListStrings
import org.openntf.domino.Document; //导入方法依赖的package包/类
/**
* Gets or generates an List of Strings from an Item on a Document
*
* @param source
* Document from which to get or generate the result.
*
* @param itemname
* Name of item from which to get the content
*
* @return List of Strings retrieved or generated from the input. Returns null if the document does not contain the item.
*
* @throws IllegalArgumentException
* if source document is null or itemname is blank or null.
*/
public static List<String> getListStrings(final Document source, final String itemname) {
if (null == source) {
throw new IllegalArgumentException("Source document is null");
}
if (Strings.isBlankString(itemname)) {
throw new IllegalArgumentException("ItemName is blank or null");
}
return (source.hasItem(itemname)) ? CollectionUtils.getListStrings(source.getItemValue(itemname)) : null;
}