本文整理汇总了Java中lotus.domino.Item.setAuthors方法的典型用法代码示例。如果您正苦于以下问题:Java Item.setAuthors方法的具体用法?Java Item.setAuthors怎么用?Java Item.setAuthors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lotus.domino.Item
的用法示例。
在下文中一共展示了Item.setAuthors方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: run2
import lotus.domino.Item; //导入方法依赖的package包/类
public void run2(final Session session) throws NotesException {
Database db = session.getDatabase("", "log.nsf");
Document doc = db.createDocument();
Item names = doc.replaceItemValue("Names", "CN=Nathan T Freeman/O=REDPILL");
names.setAuthors(true);
doc.replaceItemValue("form", "test");
doc.save(true);
String nid = doc.getNoteID();
doc.recycle();
doc = db.getDocumentByID(nid);
Vector<Double> numbers = new Vector<Double>();
numbers.add(new Double(1));
numbers.add(new Double(2));
doc.replaceItemValue("Names", numbers);
doc.save(true);
doc.recycle();
doc = db.getDocumentByID(nid);
names = doc.getFirstItem("Names");
System.out.println("Names is " + names.getType() + " with " + names.isNames() + " and " + names.isAuthors() + " and value "
+ names.getText());
doc.recycle();
db.recycle();
}
示例4: setAuthors
import lotus.domino.Item; //导入方法依赖的package包/类
protected void setAuthors(String name, Object value) throws WorkflowException {
try {
getDominoDocument().replaceItemValue(name, value);
Item item = getDominoDocument().getDocument(true).getFirstItem(name);//.replaceItemValue(name,value);
item.setAuthors(true);
} catch(NotesException ex) {
throw new WorkflowException(ex,"Error while setting item {0}",name);
}
}
示例5: online
import lotus.domino.Item; //导入方法依赖的package包/类
@Profiled
private void online(){
Session session = null;
try {
if(user!=null && !StrUtils.isEmpty(this.getUserId())){
session = SessionFactory.openSession();
this.user.setStatus(Const.STATUS_ONLINE);
logger.log(Level.FINE,this.getUserId());
Document doc = this.getUserDoc(session, true);
doc.replaceItemValue("Form", "fmUser");
Item userId = doc.replaceItemValue(Const.FIELD_USERID, this.getUserId());
userId.setAuthors(true);
doc.replaceItemValue(Const.FIELD_SESSIONID, this.getSessionId());
doc.replaceItemValue(Const.FIELD_STATUS, this.getStatus());
doc.replaceItemValue(Const.FIELD_HOST, user.getHost());
doc.replaceItemValue(Const.FIELD_URI, user.getUri());
doc.save();
if(!user.isAnonymous()){
deleteAnonymousDoc(session);
}
}
} catch (NotesException e) {
logger.log(Level.SEVERE,null, e);
}finally{
SessionFactory.closeSession(session);
}
}
示例6: online
import lotus.domino.Item; //导入方法依赖的package包/类
/**
* Online.
*/
@Stopwatch
private void online(){
Session session = null;
try {
if(user!=null && !StrUtils.isEmpty(this.getUserId())){
session = this.openSession();
this.user.setStatus(Const.STATUS_ONLINE);
LOG.log(Level.FINE,this.getUserId());
Document doc = this.getUserDoc(session, true);
doc.replaceItemValue(Const.FIELD_FORM, Const.FIELD_VALUE_USER);
Item userId = doc.replaceItemValue(Const.FIELD_USERID, this.getUserId());
userId.setAuthors(true);
doc.replaceItemValue(Const.FIELD_SESSIONID, this.getSessionId());
doc.replaceItemValue(Const.FIELD_STATUS, this.getStatus());
doc.replaceItemValue(Const.FIELD_HOST, user.getHost());
doc.replaceItemValue(Const.FIELD_URI, ColUtils.toVector(user.getUris()));
doc.save();
user.setDocId(doc.getUniversalID());
if(!user.isAnonymous()){
deleteAnonymousDoc(session);
}
doc.recycle();
}
} catch (NotesException e) {
LOG.log(Level.SEVERE,null, e);
}finally{
this.closeSession(session);
}
}