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


Java Item类代码示例

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


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

示例1: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
public String[][] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	String[][] strRC = new String[2][];
	try {
		String[] strOldValues = getRawValueFromStore(docCurrent, def.getNotesField());
		String[] strValues = getValue(objCurrent, def.getJavaField());
		strRC[0] = strOldValues;
		strRC[1] = strValues;
		Vector<String> vecValues = new Vector<String>(strValues.length);

		boolean isNamesValue = false;
		if (def.isAuthor() || def.isReader() || def.isNames()) {
			Item iNotesField = docCurrent.replaceItemValue(def.getNotesField(), "");
			isNamesValue = NamesProcessor.getInstance().setNamesField(def, iNotesField);
			iNotesField.recycle();
		}

		for (String strVal : strValues) {
			vecValues.addElement(NamesProcessor.getInstance().setPerson(strVal, isNamesValue, docCurrent.getParentDatabase().getParent()));
		}
		strRC[1] = vecValues.toArray(new String[vecValues.size()]);
		Item notesItem =docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return strRC;

}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:31,代码来源:StringArrayBinder.java

示例2: readDocument

import lotus.domino.Item; //导入依赖的package包/类
public void readDocument (Document doc){
	Vector<Item> items;
	try {
		items = doc.getItems();
		Form form = doc.getParentDatabase().getForm(doc.getItemValueString("Form"));
		Vector<String> fields = form.getFields();

		for(Item item : items){
			String fieldName = this.resolveFieldName(item.getName(), fields);
			this.processItem(item, fieldName);
		}

		//make sure we add the UNID
		this.put("unid", doc.getUniversalID());
		

	} catch (Exception e) {
		logger.log(Level.SEVERE,null, e);
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:21,代码来源:DocumentWrapper.java

示例3: 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

示例4: writeItemAsHtml

import lotus.domino.Item; //导入依赖的package包/类
protected void writeItemAsHtml(JsonWriter jsonWriter, Item item, String propName) throws IOException, NotesException  {
	DominoUtils.HtmlConverterWrapper converter = null;
	String itemName = item.getName();
    jsonWriter.startProperty(propName); 
    jsonWriter.startObject();
    try {
        converter = new DominoUtils.HtmlConverterWrapper();
        writeProperty(jsonWriter, ATTR_TYPE, TYPE_RICHTEXT);
        writeProperty(jsonWriter, ATTR_CONTENTTYPE, CONTENTTYPE_TEXT_HTML); 
        // Convert item to HTML.
        converter.convertItem(item.getParent(), itemName);          
        String htmlContent = converter.getConverterText();      
        Vector<String> attachments = converter.getReferneceUrls();
        writeHtmlAttachmentReference(jsonWriter, htmlContent, attachments);
    }  finally {
        jsonWriter.endObject();
        jsonWriter.endProperty();
    	if (converter != null) {
    		converter.recycle();
    	}
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:JsonDocumentContent.java

示例5: getContent

import lotus.domino.Item; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<String> getContent() {
	Database db = null;
	Document doc = null;
	Item item = null;

	try {
		db = NotesObjects.getDatabaseAsSigner(filename);
		doc = NotesObjects.getDocumentById(db, noteid);

		if (doc != null) {
			item = doc.getFirstItem("EventList");
			return new ArrayList<String>(item.getValues());
		}
		return null;

	} catch (NotesException e) {
		log.error(e);
		return null;
	} finally {
		NotesObjects.incinerate(item, doc, db);
	}

}
 
开发者ID:majkilde,项目名称:LogFileReader,代码行数:25,代码来源:LognsfDoc.java

示例6: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
public void processJava2Domino(Document docCurrent, Object objCurrent,
		String strNotesField, String strJavaField, HashMap<String, Object> addValues) {
	try {
		String[] strValues = getValue(objCurrent, strJavaField);
		Vector<String> vecValues = new Vector<String>(strValues.length);
		
		boolean isNamesValue = false;
		if(addValues != null && addValues.size() > 0){
			docCurrent.replaceItemValue(strNotesField,"");
			Item iNotesField = docCurrent.getFirstItem(strNotesField);
			isNamesValue = NamesProcessor.getInstance().setNamesField(addValues, iNotesField);
		}
		
		for (String strVal : strValues) {
			vecValues.addElement(NamesProcessor.getInstance().setPerson(strVal, isNamesValue));	
		}
		
		docCurrent.replaceItemValue(strNotesField, vecValues);
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:24,代码来源:StringArrayBinder.java

示例7: setNamesField

import lotus.domino.Item; //导入依赖的package包/类
public boolean setNamesField(HashMap<String, Object> addValues, Item iNotesField) {
	boolean isNamesValue = false;
	try {
		if (addValues != null && addValues.size() > 0) {
			if (iNotesField != null) {
				if (addValues.containsKey("isReader")) {
					isNamesValue = true;
					iNotesField.setReaders(true);
				} else if (addValues.containsKey("isAuthor")) {
					isNamesValue = true;
					iNotesField.setAuthors(true);
				} else if (addValues.containsKey("isNames")) {
					isNamesValue = true;
					iNotesField.setNames(true);
				}
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return isNamesValue;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:23,代码来源:NamesProcessor.java

示例8: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
public void processJava2Domino(Document docCurrent, Object objCurrent,
		String strNotesField, String strJavaField, HashMap<String, Object> addValues) {
	try {
		boolean isNamesValue = false;
		String strValue = getValue(objCurrent,strJavaField);
		
		if(addValues != null && addValues.size() > 0){
			docCurrent.replaceItemValue(strNotesField,"");
			Item iNotesField = docCurrent.getFirstItem(strNotesField);
			isNamesValue = NamesProcessor.getInstance().setNamesField(addValues, iNotesField);
			strValue = NamesProcessor.getInstance().setPerson(strValue, isNamesValue);	
		}
		docCurrent.replaceItemValue(strNotesField, strValue);
					
	} catch (Exception e) {
		e.printStackTrace();
	}

}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:20,代码来源:StringBinder.java

示例9: testDoubleBinder2Domino

import lotus.domino.Item; //导入依赖的package包/类
@Test
public void testDoubleBinder2Domino() throws DSSException, NotesException {
	BinderContainer container = new BinderContainer("");
	Domino2JavaBinder d2jBinder = container.getLoader(ListDoubleIntTestMock.class);
	assertNotNull(d2jBinder);
	assertEquals(2, d2jBinder.getDefinitions().size());
	List<Definition> definitions = d2jBinder.getDefinitions();
	Definition defDouble = getTheDoubleDefinition(definitions);
	assertNotNull(defDouble);
	assertTrue(defDouble.getBinder() instanceof ListDoubleBinder);
	ListDoubleIntTestMock mock = new ListDoubleIntTestMock();
	Item item = EasyMock.createNiceMock(Item.class);
	mock.setDoubleList(DOUBLE_VALUES);
	Document docTest = EasyMock.createNiceMock(Document.class);
	expect(docTest.getItemValue(defDouble.getNotesField())).andReturn(NUMBERS_DOUBLES);
	expect(docTest.replaceItemValue(defDouble.getNotesField(), DOUBLE_VALUES)).andReturn(item);
	replay(docTest);
	defDouble.getBinder().processJava2Domino(docTest, mock, defDouble);
	verify(docTest);
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:21,代码来源:ListDoubleBinderTest.java

示例10: testIntegerBinder2Domino

import lotus.domino.Item; //导入依赖的package包/类
@Test
public void testIntegerBinder2Domino() throws DSSException, NotesException {
	BinderContainer container = new BinderContainer("");
	Domino2JavaBinder d2jBinder = container.getLoader(ListDoubleIntTestMock.class);
	assertNotNull(d2jBinder);
	assertEquals(2, d2jBinder.getDefinitions().size());
	List<Definition> definitions = d2jBinder.getDefinitions();
	Definition defInteger = getTheIntegerDefinition(definitions);
	assertNotNull(defInteger);
	assertTrue(defInteger.getBinder() instanceof ListIntegerBinder);
	ListDoubleIntTestMock mock = new ListDoubleIntTestMock();
	mock.setIntegerList(INT_VALUES);
	Document docTest = EasyMock.createNiceMock(Document.class);
	Item item = EasyMock.createNiceMock(Item.class);
	expect(docTest.getItemValue(defInteger.getNotesField())).andReturn(NUMBERS_INTEGERS);
	expect(docTest.replaceItemValue(defInteger.getNotesField(), INT_VALUES)).andReturn(item);
	replay(docTest);
	defInteger.getBinder().processJava2Domino(docTest, mock, defInteger);
	verify(docTest);
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:21,代码来源:ListDoubleBinderTest.java

示例11: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
@Override
public List<Integer>[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	@SuppressWarnings("unchecked")
	List<Integer>[] lstRC = new List[2];
	try {
		List<Integer> lstOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		List<Integer> lstValues = getValue(objCurrent, def.getJavaField());

		lstRC[0] = lstOldValues;
		lstRC[1] = lstValues;
		Vector<Integer> vecValues = new Vector<Integer>();
		vecValues.addAll(lstValues);
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:22,代码来源:ListIntegerBinder.java

示例12: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
public Double[][] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	Double[][] dblRC = new Double[2][];
	try {
		Double[] nOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		Double[] nValues = getValue(objCurrent, def.getJavaField());
		dblRC[0] = nOldValues;
		dblRC[1] = nValues;
		Vector<Double> vecValues = new Vector<Double>(nValues.length);
		for (Double nVal : nValues) {
			vecValues.addElement(nVal);
		}
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return dblRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:21,代码来源:DoubleArrayBinder.java

示例13: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
public String[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	String[] arrRC = new String[2];
	try {
		boolean isNamesValue = false;
		String strOldValue = docCurrent.getItemValueString(def.getNotesField());
		String strValue = getValue(objCurrent, def.getJavaField());
		if (strValue == null) {
			strValue = "";
		}
		if (def.isAuthor() || def.isReader() || def.isNames()) {
			Item iNotesField = docCurrent.replaceItemValue(def.getNotesField(), "");
			isNamesValue = NamesProcessor.getInstance().setNamesField(def, iNotesField);
			strValue = NamesProcessor.getInstance().setPerson(strValue, isNamesValue, docCurrent.getParentDatabase().getParent());
			iNotesField.recycle();
		}
		arrRC[0] = strOldValue;
		arrRC[1] = strValue;
		Item notesItem = docCurrent.replaceItemValue(def.getNotesField(), strValue);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return arrRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:27,代码来源:StringBinder.java

示例14: processJava2Domino

import lotus.domino.Item; //导入依赖的package包/类
@Override
public List<Double>[] processJava2Domino(Document docCurrent, Object objCurrent, Definition def) {
	@SuppressWarnings("unchecked")
	List<Double>[] lstRC = new List[2];
	try {
		List<Double> lstOldValues = getValueFromStore(docCurrent, docCurrent.getItemValue(def.getNotesField()), def);
		List<Double> lstValues = getValue(objCurrent, def.getJavaField());

		lstRC[0] = lstOldValues;
		lstRC[1] = lstValues;
		Vector<Double> vecValues = new Vector<Double>();
		vecValues.addAll(lstValues);
		Item notesItem =docCurrent.replaceItemValue(def.getNotesField(), vecValues);
		notesItem.setSummary(def.isNotesSummary());
		notesItem.recycle();

	} catch (Exception e) {
		LoggerFactory.logWarning(getClass(), "Error during processJava2Domino", e);
	}
	return lstRC;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:22,代码来源:ListDoubleBinder.java

示例15: setNamesField

import lotus.domino.Item; //导入依赖的package包/类
public boolean setNamesField(Definition def, Item iNotesField) {
	boolean isNamesValue = false;
	try {
		if (iNotesField != null) {
			if (def.isReader()) {
				isNamesValue = true;
				iNotesField.setReaders(true);
			} else if (def.isAuthor()) {
				isNamesValue = true;
				iNotesField.setAuthors(true);
			} else if (def.isNames()) {
				isNamesValue = true;
				iNotesField.setNames(true);
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return isNamesValue;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:21,代码来源:NamesProcessor.java


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