• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java View类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



View类属于lotus.domino包,在下文中一共展示了View类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
	}
}
 
开发者ID:sbasegmez,项目名称:Blogged,代码行数:22,代码来源:BoxService.java


示例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);

}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:30,代码来源:RestWebSocket.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:Nagios4DominoIntegration,代码行数:25,代码来源:NinjaStorageService.java


示例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;
		}
	});

}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:24,代码来源:TestViewMetaData.java


示例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;
		}
	});
}
 
开发者ID:klehmann,项目名称:domino-jna,代码行数:25,代码来源:TestViewMetaData.java


示例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);
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:21,代码来源:RestWebSocket.java


示例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;
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:29,代码来源:ApplyStatus.java


示例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();
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:22,代码来源:ApplyStatus.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:ViewListTreeNode.java


示例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$
    }

}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:26,代码来源:ViewEntryTreeNode.java


示例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);
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:25,代码来源:ViewEntryTreeNode.java


示例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);
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:UIListView.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:20,代码来源:DominoViewPickerData.java


示例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;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:17,代码来源:DominoNABNamePickerData.java


示例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$
    }
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:AbstractDominoViewPickerData.java


示例16: getCurrentView

import lotus.domino.View; //导入依赖的package包/类
public View getCurrentView(final String keyName, final String keyValue, final Database database) {

        View view = null;
        if ( UNID.equalsIgnoreCase(keyName) ) {
            // Find the view by UNID
            view = getCurrentViewByUnid(database, keyValue);
        }
        else if( NAME.equalsIgnoreCase(keyName)){
            // Find the view by name
            view = getCurrentViewByName(database, keyValue);
        }
        else {
            // This resource should always have a database context
            String msg = StringUtil.format("The query method {0} not supported", keyName); // $NLX-ViewBaseResource.Thequerymethod0notsupported-1$
            throw new WebApplicationException(ErrorHelper.createErrorResponse(msg, Response.Status.NOT_FOUND));
        }
        if ( view == null ) {
            // This resource should always have a database context
            throw new WebApplicationException(ErrorHelper.createErrorResponse("The URI must refer to an existing view.", Response.Status.NOT_FOUND)); // $NLX-ViewBaseResource.TheURImustrefertoanexistingview-1$
        }
        return view;
    }
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:23,代码来源:ViewBaseResource.java


示例17: getCurrentViewByName

import lotus.domino.View; //导入依赖的package包/类
/**
 * 
 * Get the current View object by its name or aliases with access control check
 * @return the view object for the specified name/alias
 */
protected View getCurrentViewByName(Database db, String name){
    try {
        View view = db.getView(name);
        if ( view == null ) {
            // This resource should always have a database context
            throw new WebApplicationException(ErrorHelper.createErrorResponse("The URI must refer to an existing view.", Response.Status.NOT_FOUND)); // $NLX-AbstractDasResource.TheURImustrefertoanexistingview-1$
        }           
        doViewAccessCheck(view);                    
        return view;
    } catch (NotesException e) {
        if(DasServlet.DAS_LOGGER.isTraceDebugEnabled()){
            DasServlet.DAS_LOGGER.traceDebug(e, "Error accessing the view by name: {0}",name); // $NON-NLS-1$
        }
        throw new WebApplicationException(ErrorHelper.createErrorResponse(e, Response.Status.INTERNAL_SERVER_ERROR));
    }        
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:22,代码来源:AbstractDasResource.java


示例18: getSettingsFromMyWebGate

import lotus.domino.View; //导入依赖的package包/类
private void getSettingsFromMyWebGate(Database ndbMyWebGate, ApplicationSettings apSettings) {
	try {
		View viwSetup = ndbMyWebGate.getView("vwLUPSetup");
		Document docSetup = viwSetup.getFirstDocument();
		if (docSetup != null) {
			apSettings.setExternalCertifier(docSetup.getItemValueString("ExternalCertifierT"));
			apSettings.setInternalCertifier(docSetup.getItemValueString("InternalCertifierT"));
			apSettings.setGlobalID(docSetup.getItemValueString("GlobalIDT"));
			apSettings.setSystemPrefix(docSetup.getItemValueString("SystemPrefixT"));
			apSettings.setFQDN(docSetup.getItemValueString("FQDNT"));
			apSettings.setSFN(docSetup.getItemValueString("SendFriendRequestT"));
			docSetup.recycle();
		}
		viwSetup.recycle();
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:19,代码来源:SettingStorageService.java


示例19: getMWGDbSettings

import lotus.domino.View; //导入依赖的package包/类
public MyWebGateTargetDB getMWGDbSettings() {
	MyWebGateTargetDB mwgTarget = new MyWebGateTargetDB();
	try {
		View viwSettings = ExtLibUtil.getCurrentDatabase().getView(VIEW_LUP_SETTINGS);
		Document docSettings = viwSettings.getDocumentByKey(KEY_MWGDB_SETTINGS, true);
		if (docSettings != null) {
			mwgTarget.setServer(docSettings.getItemValueString("ServerT"));
			mwgTarget.setPath(docSettings.getItemValueString("PathT"));
			Database ndbMyWebGate = ExtLibUtil.getCurrentSession().getDatabase(mwgTarget.getServer(), mwgTarget.getPath());
			if (ndbMyWebGate != null && ndbMyWebGate.isOpen()) {
				mwgTarget.setAvailable(true);
				ndbMyWebGate.recycle();
			}
			docSettings.recycle();
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return mwgTarget;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:21,代码来源:SettingStorageService.java


示例20: saveMWGDbSettings

import lotus.domino.View; //导入依赖的package包/类
public void saveMWGDbSettings(MyWebGateTargetDB mwgTarget) {
	try {
		View viwSettings = ExtLibUtil.getCurrentSessionAsSigner().getCurrentDatabase().getView(VIEW_LUP_SETTINGS);
		Document docSettings = viwSettings.getDocumentByKey(KEY_MWGDB_SETTINGS, true);
		if (docSettings == null) {
			docSettings = ExtLibUtil.getCurrentSessionAsSigner().getCurrentDatabase().createDocument();
			docSettings.replaceItemValue("Form", "frmSettings");
			docSettings.replaceItemValue("Type", KEY_MWGDB_SETTINGS);
		}

		docSettings.replaceItemValue("ServerT", mwgTarget.getServer());
		docSettings.replaceItemValue("PathT", mwgTarget.getPath());
		docSettings.save(true, false, true);
		docSettings.recycle();

	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:20,代码来源:SettingStorageService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XmlReader类代码示例发布时间:2022-05-21
下一篇:
Java ReflectiveCallable类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap