本文整理汇总了Java中lotus.domino.View类的典型用法代码示例。如果您正苦于以下问题:Java View类的具体用法?Java View怎么用?Java View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
View类属于lotus.domino包,在下文中一共展示了View类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadAppstore
import lotus.domino.View; //导入依赖的package包/类
private void loadAppstore() {
Database db=ExtLibUtil.getCurrentDatabase();
View view=null;
Document appstore=null;
try {
view=db.getView("apps");
appstore=view.getDocumentByKey(DEFAULT_ENDPOINT_NAME, true);
if(appstore==null) {
System.out.println("No Application found for "+DEFAULT_ENDPOINT_NAME);
} else {
consumerKey=appstore.getItemValueString("ConsumerKey");
consumerSecret=appstore.getItemValueString("ConsumerSecret");
}
} catch(NotesException ne) {
ne.printStackTrace();
} finally {
DevelopiUtils.recycleObjects(appstore, view);
}
}
示例2: getLatestMessage
import lotus.domino.View; //导入依赖的package包/类
@Override
public Response getLatestMessage() throws NotesException {
if(this.hasWebSocketConnection()){
throw new RuntimeException("This RESTful API can only be used when no websocket connection is open.");
}
SocketMessage msg = null;
Database db = XSPUtils.session().getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
View view = db.getView(Const.VIEW_MESSAGES_BY_USER);
ViewEntry entry = view.getEntryByKey(XSPUtils.session().getEffectiveUserName(),true);
if(entry!=null){
Document doc = entry.getDocument();
if(doc.isValid()){
msg = msgFactory.buildMessage(entry.getDocument());
//mark as sent.
doc.replaceItemValue(Const.FIELD_SENTFLAG, Const.FIELD_SENTFLAG_VALUE_SENT);
doc.save();
}
}
//cleanup db should cleanup view, entry, and doc.
db.recycle();
return this.buildResponse(msg);
}
示例3: getAllNinjas
import lotus.domino.View; //导入依赖的package包/类
public List<Ninja> getAllNinjas(Session sesCurrent) {
List<Ninja> lstNinja = new ArrayList<Ninja>();
try {
Database ndbCurrent = sesCurrent.getCurrentDatabase();
View viwNinjas = ndbCurrent.getView("lupNinjasById");
Document docNext = viwNinjas.getFirstDocument();
while (docNext != null) {
Document docProcess = docNext;
docNext = viwNinjas.getNextDocument(docNext);
Ninja ninNew = new Ninja();
if (DominoStorageService.getInstance().getObjectWithDocument(
ninNew, docProcess)) {
lstNinja.add(ninNew);
}
docProcess.recycle();
}
viwNinjas.recycle();
ndbCurrent.recycle();
} catch (Exception e) {
e.printStackTrace();
}
return lstNinja;
}
示例4: testViewMetaData_nameAndAlias
import lotus.domino.View; //导入依赖的package包/类
@Test
public void testViewMetaData_nameAndAlias() {
runWithSession(new IDominoCallable<Object>() {
@Override
public Object call(Session session) throws Exception {
NotesDatabase dbData = getFakeNamesDb();
Database dbDataLegacy = getFakeNamesDbLegacy();
//CompaniesHierarchical
NotesCollection colFromDbData = dbData.openCollectionByName("AnotherAlias");
View viewCompanies = dbDataLegacy.getView("AnotherAlias");
Assert.assertEquals("Name correct", viewCompanies.getName(), colFromDbData.getName());
Assert.assertEquals("Aliases correct", viewCompanies.getAliases(), colFromDbData.getAliases());
Assert.assertEquals("Selection formula correct", viewCompanies.getSelectionFormula(), colFromDbData.getSelectionFormula());
return null;
}
});
}
示例5: testViewMetaData_columnTitleLookup
import lotus.domino.View; //导入依赖的package包/类
@Test
public void testViewMetaData_columnTitleLookup() {
runWithSession(new IDominoCallable<Object>() {
@Override
public Object call(Session session) throws Exception {
NotesDatabase dbData = getFakeNamesDb();
Database dbDataLegacy = getFakeNamesDbLegacy();
NotesCollection colFromDbData = dbData.openCollectionByName("People");
colFromDbData.update();
View viewPeople = dbDataLegacy.getView("People");
int topLevelEntriesLegacy = viewPeople.getTopLevelEntryCount();
int topLevelEntries = colFromDbData.getTopLevelEntries();
System.out.println("Top level entries: "+topLevelEntries);
Assert.assertEquals("Top level entries of JNA call is equal to legacy call", topLevelEntriesLegacy, topLevelEntries);
return null;
}
});
}
示例6: getMessages
import lotus.domino.View; //导入依赖的package包/类
@Override
public Response getMessages() throws NotesException {
if(this.hasWebSocketConnection()){
throw new RuntimeException("This RESTful API can only be used when no websocket connection is open.");
}
Database db = XSPUtils.session().getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
View view = db.getView(Const.VIEW_MESSAGES_BY_USER);
ViewEntryCollection col = view.getAllEntriesByKey(XSPUtils.session().getEffectiveUserName(),true);
List<SocketMessage> list = msgFactory.buildMessages(col);
//mark the collection as sent
col.stampAll(Const.FIELD_SENTFLAG, Const.FIELD_SENTFLAG_VALUE_SENT);
//cleanup db should cleanup view, and col
db.recycle();
return this.buildResponse(list);
}
示例7: getUserDoc
import lotus.domino.View; //导入依赖的package包/类
/**
* Gets the user doc.
*
* @param session the session
* @param create the create
* @return the user doc
* @throws NotesException the notes exception
*/
private Document getUserDoc(Session session, boolean create) throws NotesException{
Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
Document doc = null;
View users = db.getView(Const.VIEW_USERS);
View sessions = db.getView(Const.VIEW_SESSIONS);
doc = users.getDocumentByKey(user.getUserId().trim(),true);
if(doc == null){
doc = sessions.getDocumentByKey(user.getSessionId(),true);
}
//if we get here... create the doc.
if(doc==null && create){
doc = db.createDocument();
}
//cleanup
users.recycle();
sessions.recycle();
return doc;
}
示例8: deleteAnonymousDoc
import lotus.domino.View; //导入依赖的package包/类
/**
* Delete anonymous doc.
*
* @param session the session
* @throws NotesException the notes exception
*/
//if the user moved from anonymous to person to anonymous to person
private void deleteAnonymousDoc(Session session) throws NotesException{
Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
View view = db.getView(Const.VIEW_USERS);
Vector<String> keys = new Vector<String>(3);
keys.add(this.getSessionId().trim());
keys.add(this.getSessionId().trim());
DocumentCollection col = view.getAllDocumentsByKey(keys,true);
if(col!=null && col.getCount() > 0){
col.stampAll(Const.FIELD_FORM, Const.FIELD_VALUE_DELETE);
col.recycle();
}
}
示例9: accept
import lotus.domino.View; //导入依赖的package包/类
boolean accept(View view) {
try {
// Try on the view type
if (!acceptFolders && view.isFolder()) {
return false;
}
if (!acceptViews && !view.isFolder()) {
return false;
}
// Else, use the selection
if (StringUtil.isNotEmpty(filter)) {
if (!view.getName().matches(filter)) {
return false;
}
}
} catch (NotesException ex) {
}
return true;
}
示例10: iterateChildren
import lotus.domino.View; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked") // $NON-NLS-1$
public ITreeNode.NodeIterator iterateChildren(int start, int count) {
try {
View view = getView();
ViewEntryCollection col;
Object keys = getKeys();
if(keys!=null) {
if(keys instanceof Vector) {
col = view.getAllEntriesByKey((Vector)keys,isKeysExactMatch());
} else {
col = view.getAllEntriesByKey(keys,isKeysExactMatch());
}
} else {
col = view.getAllEntries();
}
return new ListIterator(view,col,start,count);
}catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while reading the list or views/folders"); // $NLX-ViewEntryTreeNode.Errorwhilereadingthelistorviewsfo-1$
}
}
示例11: ListIterator
import lotus.domino.View; //导入依赖的package包/类
ListIterator(View view, ViewEntryCollection entries, int start, int count) {
this.entries = entries;
this.count = count;
// Compute the cached data
try {
String labelColumn = getLabelColumn();
if(StringUtil.isNotEmpty(labelColumn)) {
Vector<ViewColumn> vc = (Vector<ViewColumn>)view.getColumns();
for(int i=0; i<vc.size(); i++) {
if(StringUtil.equals(vc.get(i).getItemName(), labelColumn)) {
labelIndex = vc.get(i).getColumnValuesIndex();
break;
}
}
}
} catch(NotesException ex) {}
// Skip the first...
if(start>0) {
// todo...
}
moveToNext(true);
}
示例12: createColumns
import lotus.domino.View; //导入依赖的package包/类
protected void createColumns(FacesContext context, Customizer bean, ViewFactory f, View view) {
if(bean==null || !bean.createColumns(context, this, f)) {
ViewDef viewDef = f.getViewDef(view);
if(viewDef!=null) {
// The view control already exists, it is simply wrapped into a ControlImpl
// We then create the columns and ask the control builder to actually
// add the columns to the view panel and call the FacesComponent methods
ControlImpl<UIListView> viewControl = new ControlImpl<UIListView>(this);
int index = 0;
for(Iterator<ColumnDef> it=viewDef.iterateColumns(); it.hasNext(); index++) {
ColumnDef colDef = it.next();
IControl viewCol = createColumn(context,bean,index,colDef);
viewControl.addChild(viewCol);
}
ControlBuilder.buildControl(context, viewControl,true);
}
}
if(bean!=null) {
bean.afterCreateColumns(context, this);
}
}
示例13: openView
import lotus.domino.View; //导入依赖的package包/类
@Override
protected View openView() throws NotesException {
Database db = DominoUtils.openDatabaseByName(getDatabaseName());
View view = db.getView(getViewName());
String labelName = getLabelColumn();
if(StringUtil.isNotEmpty(labelName)) {
try {
view.resortView(labelName, true);
} catch(NotesException ex) {
// We can't resort the view so we silently fail
// We just report it to the console
if( ExtlibDominoLogger.DOMINO.isWarnEnabled() ){
ExtlibDominoLogger.DOMINO.warnp(this, "openView", ex, //$NON-NLS-1$
StringUtil.format("The view {0} needs the column {1} to be sortable for the value picker to be searchable",getViewName(),labelName)); // $NLW-DominoViewPickerData_ValuePickerNotSearchable_UnsortableColumn-1$
}
}
}
return view;
}
示例14: openView
import lotus.domino.View; //导入依赖的package包/类
@Override
protected View openView() throws NotesException {
// Find the database
Database nabDb = findNAB();
if(nabDb==null) {
throw new FacesExceptionEx(null,"Not able to find a valid address book for the name picker"); // $NLX-DominoNABNamePickerData.Notabletofindavalidaddressbookfor-1$
}
// Find the view
String viewName = getViewName();
if(StringUtil.isEmpty(viewName)) {
throw new FacesExceptionEx(null,"Not able to find a view in the address book that matches the selection criterias"); // $NLX-DominoNABNamePickerData.Notabletofindaviewintheaddressboo-1$
}
View view = nabDb.getView(viewName);
return view;
}
示例15: loadEntries
import lotus.domino.View; //导入依赖的package包/类
public List<IPickerEntry> loadEntries(Object[] ids, String[] attributeNames) {
try {
EntryMetaData meta = createEntryMetaData(null);
View view = meta.getView();
view.setAutoUpdate(false);
try {
// TODO: use the options here?
ArrayList<IPickerEntry> entries = new ArrayList<IPickerEntry>(ids.length);
for(int i=0; i<ids.length; i++) {
ViewEntry ve = view.getEntryByKey(ids[i],true);
if(ve!=null) {
Entry e = meta.createEntry(ve);
entries.add(e);
} else {
entries.add(null);
}
//ve.recycle();
}
return entries;
} finally {
// Recycle the view?
}
} catch(NotesException ex) {
throw new FacesExceptionEx(ex,"Error while loading entry"); // $NLX-AbstractDominoViewPickerData.Errorwhileloadingentry-1$
}
}