当前位置: 首页>>代码示例>>Java>>正文


Java Item.getType方法代码示例

本文整理汇总了Java中lotus.domino.Item.getType方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getType方法的具体用法?Java Item.getType怎么用?Java Item.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lotus.domino.Item的用法示例。


在下文中一共展示了Item.getType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDateField

import lotus.domino.Item; //导入方法依赖的package包/类
public static Calendar getDateField(Document doc, String fieldName) throws NotesException {
	
	Calendar result=null;
	
	Item someItem=null;
	DateTime someDate=null;
	
	try {
		someItem=doc.getFirstItem(fieldName);
		if(null != someItem && someItem.getType()==Item.DATETIMES) {
			someDate=someItem.getDateTimeValue();
			result=Calendar.getInstance();
			result.setTime(someDate.toJavaDate());
		}
		return result;
	} catch(NotesException ne) {
		throw ne;
	} finally {
		recycleObjects(someItem, someDate);
	}		
	
}
 
开发者ID:sbasegmez,项目名称:ic14demos,代码行数:23,代码来源:Utilities.java

示例2: updateMimePart

import lotus.domino.Item; //导入方法依赖的package包/类
private void updateMimePart(String itemName, JsonJavaObject jsonObject) throws NotesException, JsonException {
	
	if ( document.hasItem(itemName) ) {
		Item item = document.getFirstItem(itemName);
		if ( item.getType() == Item.MIME_PART ) {
			
			// SPR #JJVX8RGJZG:  When updating _existing_ MIME parts, we were
			// leaving old attachments around.  The fix is to explicitly remove
			// the parts first.
			
			MIMEEntity entity = item.getMIMEEntity();
			entity.remove();
			document.closeMIMEEntities(true, itemName);
		}
	}
	
    Object jsonMime =  jsonObject.get(ATTR_CONTENT);
	List<JsonJavaObject> parts = (List<JsonJavaObject>)jsonMime;
	ParserContext context = new ParserContext(document, itemName);
	for ( int i = 0; i < parts.size(); i++ ) {
		JsonJavaObject obj = parts.get(i);
		boolean lastEntity = false;
		if ( (i+1) == parts.size() ) {
			lastEntity = true;
		}
		
		JsonMimeEntityAdapter adapter = new JsonMimeEntityAdapter(context, obj);
		context.setCurrentEntityAdapter(adapter);
		adapter.flushJsonProperties(lastEntity);
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:32,代码来源:JsonDocumentContent.java

示例3: getDateValue

import lotus.domino.Item; //导入方法依赖的package包/类
@Override
public Date getDateValue(String strField) throws SQLConnectorException {
	m_LasField = strField;
	try {
		Date dtRC = null;
		Item itmCurrent = m_docTarget.getFirstItem(strField);
		if (itmCurrent.getType() == Item.TEXT) {
			String strDate = itmCurrent.getText();
			if (strDate.contains(".")) {
				dtRC = m_sdfTESTER_DE.parse(strDate);
			} else {
				dtRC = m_sdfTESTER_US.parse(strDate);
			}
		} else if (itmCurrent.getType() == Item.DATETIMES) {
			dtRC = itmCurrent.getDateTimeValue().toJavaDate();
		} else {
			throw new SQLConnectorException(
					Constants.E_NOTES_DOC_VALUE_ACCESS,
					"Error in accesing field: " + strField
							+ " is no date type", null);

		}
		return dtRC;
	} catch (Exception ex) {
		throw new SQLConnectorException(Constants.E_NOTES_DOC_VALUE_ACCESS,
				"Error in accesing field: " + strField, ex);
	}
}
 
开发者ID:OpenNTF,项目名称:SyncTool4DOTS,代码行数:29,代码来源:NotesDataImpl.java

示例4: writeItem

import lotus.domino.Item; //导入方法依赖的package包/类
protected void writeItem(JsonWriter jsonWriter, Item item, String propName) 
        throws NotesException, IOException, ServiceException {        
    String itemName = item.getName();
    int itemType = item.getType();
    
    if (itemType == Item.OTHEROBJECT) {
        // Skip Other Object Types
    }
    else if (itemType == Item.ATTACHMENT) {
        // Skip Attachment Types
    }
    else if (itemType == Item.NOTELINKS) {
        // Skip Note Links Types
    }
    else if (itemType == Item.SIGNATURE) {
        // Skip Signature Types
    }       
    else if (itemType == Item.RICHTEXT) {
        if (writtenRichTextItems == null) {
            writtenRichTextItems = new HashSet<String>();
        }
        if (!writtenRichTextItems.contains(itemName)) {
            writtenRichTextItems.add(itemName);
            writeRichTextItem(jsonWriter, item, propName);      
        }
    } 
    else if (itemType == Item.MIME_PART) {
        if (writtenMimeItems == null) {
            writtenMimeItems = new HashSet<String>();
        }
        if (!writtenMimeItems.contains(itemName)) {
            writtenMimeItems.add(itemName);
            writeRichTextItem(jsonWriter, item, propName);      
        }
    } 
    else {
        Vector<?> values = item.getValues();
        if (values != null && values.size() != 0) {
            if (values.size() == 1) {                           
                writeProperty(jsonWriter, propName, values.get(0));
            } else {
                writeProperty(jsonWriter, propName, values);
            }
        }
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:47,代码来源:JsonDocumentContent.java

示例5: getFirstMimeEntity

import lotus.domino.Item; //导入方法依赖的package包/类
public MIMEEntity getFirstMimeEntity(boolean ignoreForm) throws NotesException {
	
	if ( _mimeEntity == null ) {

		Database database = _document.getParentDatabase();
		Session session = database.getParent();
		boolean restoreConvertMime = false;
		
		if (session.isConvertMime()) {
			// Do not convert MIME to rich text.
			session.setConvertMIME(false);
			restoreConvertMime = true;
		}
		
		try {
			Item item = _document.getFirstItem(_itemName);
			if (item != null) {
				if (item.getType() == Item.RICHTEXT) {
					if ( ITEM_BODY.equalsIgnoreCase(_itemName) && !ignoreForm) {
						_document.removeItem("$KeepPrivate"); //$NON-NLS-1$
						_document.convertToMIME(lotus.domino.Document.CVT_RT_TO_PLAINTEXT_AND_HTML, 0);
						_mimeEntity = _document.getMIMEEntity(_itemName);
					}
					else {
						_tempDocument = database.createDocument();
						_tempDocument.copyItem(item, ITEM_BODY);	
						_tempDocument.convertToMIME(lotus.domino.Document.CVT_RT_TO_PLAINTEXT_AND_HTML, 0);
						_mimeEntity = _tempDocument.getMIMEEntity(ITEM_BODY);	
					}
				} 
				else if (item.getType() == Item.MIME_PART) {
					_mimeEntity = _document.getMIMEEntity(_itemName);
				}
			}
		}
		finally {
			if (restoreConvertMime) {
				session.setConvertMime(true);
			}
		}
	}

	return _mimeEntity;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:45,代码来源:MimeEntityHelper.java

示例6: checkLoad

import lotus.domino.Item; //导入方法依赖的package包/类
public void checkLoad() {
	if (m_Content != null) {
		return;
	}
	try {
		Database ndbCurrent = NotesContext.getCurrentUnchecked().getCurrentSession().getDatabase(m_Server, m_Database);
		if (ndbCurrent == null) {
			throw new XPTRuntimeException("Database "+ m_Server +"!!"+m_Database +" not accessable");
		}
		Document docCurrent = ndbCurrent.getDocumentByUNID(m_DocumentUNID);
		if (docCurrent == null) {
			throw new XPTRuntimeException("Document "+ m_Server +"!!"+m_Database +"/"+ m_DocumentUNID+" not accessable");
			
		}
		MIMEEntity mimeCurrent = docCurrent.getMIMEEntity(m_FieldName);
		if (mimeCurrent == null && !docCurrent.hasItem(m_FieldName)) {
			m_Content = MimeMultipart.fromHTML("");
			return;
		}
		if (mimeCurrent == null && docCurrent.hasItem(m_FieldName)) {
			if (docCurrent.getFirstItem(m_FieldName) != null) {
				Item itField = docCurrent.getFirstItem(m_FieldName);
				if (itField.getType() != 1) {
					m_Content = MimeMultipart.fromHTML(docCurrent.getItemValueString(m_FieldName));
				} else {
					RichTextItem rti = (RichTextItem) itField;
					if (rti != null) {
						DominoDocument dd = new DominoDocument();
						dd.setDocument(docCurrent);
						DominoRichTextItem drtCurrent = new DominoRichTextItem(dd, rti);
						m_Content = MimeMultipart.fromHTML(drtCurrent.getHTML());
					}
				}
				itField.recycle();
			}
			docCurrent.recycle();
			ndbCurrent.recycle();
		}
		processMime(mimeCurrent);
	} catch (Exception ex) {
		LoggerFactory.logError(this.getClass(), "Error druing checkLoad()", ex);
		throw new XPTRuntimeException("General Error with: Database "+ m_Server +"!!"+m_Database +" / Field: "+ m_FieldName +" / "+m_DocumentUNID);
	}
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:45,代码来源:MimeMultiPartExtended.java


注:本文中的lotus.domino.Item.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。