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


Java View.getFirstDocument方法代码示例

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


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

示例1: getAllCustomers

import lotus.domino.View; //导入方法依赖的package包/类
public List<Customer> getAllCustomers(Session sesCurrent) {
	List<Customer> lstCustomer = new ArrayList<Customer>();
	try {
		Database ndbCurrent = sesCurrent.getCurrentDatabase();
		View viwCustomer = ndbCurrent.getView("lupCustomersById");
		Document docNext = viwCustomer.getFirstDocument();
		while (docNext != null) {
			Document docProcess = docNext;
			docNext = viwCustomer.getNextDocument(docNext);
			Customer newCustomer = new Customer();
			if (DominoStorageService.getInstance().getObjectWithDocument(newCustomer, docProcess)) {
				lstCustomer.add(newCustomer);
			}
			docProcess.recycle();
		}
		viwCustomer.recycle();
		ndbCurrent.recycle();
	} catch (Exception e) {
		e.printStackTrace();
	}

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

示例2: getWelcomePage

import lotus.domino.View; //导入方法依赖的package包/类
public WelcomePage getWelcomePage(Session sesCurrent) {
	//boolean debug = false;
	WelcomePage wp = new WelcomePage();
	try {
		View viwSettings = ExtLibUtil.getCurrentSession().getCurrentDatabase().getView("vwWelcomePage");
		Document docSettings = viwSettings.getFirstDocument();
		if (docSettings == null) {
			docSettings = ExtLibUtil.getCurrentSession().getCurrentDatabase().createDocument();
			docSettings.replaceItemValue("Form", "frmWelcomePage");
			docSettings.replaceItemValue("InfoText", "Default Info Text");
			docSettings.save(true,false,true);
		}
		wp.setInfoText(docSettings.getItemValueString("InfoText"));
		return wp;
	} catch (Exception e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:20,代码来源:AdminStorageService.java

示例3: getAllUserstories

import lotus.domino.View; //导入方法依赖的package包/类
public List<Userstory> getAllUserstories(Session sesCurrent) {
	List<Userstory> lstUserstory = new ArrayList<Userstory>();
	try {
		Database ndbCurrent = sesCurrent.getCurrentDatabase();
		View viwUserstory = ndbCurrent.getView("lupUserstoriesById");
		Document docNext = viwUserstory.getFirstDocument();
		while (docNext != null) {
			Document docProcess = docNext;
			docNext = viwUserstory.getNextDocument(docNext);
			Userstory newUserstory = new Userstory();
			if (DominoStorageService.getInstance().getObjectWithDocument(
					newUserstory, docProcess)) {
				if (!newUserstory.getIsDeleted().equals("true")) {
					lstUserstory.add(newUserstory);
				}
			}
			docProcess.recycle();
		}
		viwUserstory.recycle();
		ndbCurrent.recycle();
	} catch (Exception e) {
		e.printStackTrace();
	}

	return lstUserstory;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:27,代码来源:UserstoryStorageService.java

示例4: loadConfig

import lotus.domino.View; //导入方法依赖的package包/类
private synchronized HashMap<String, TokenConfiguration> loadConfig() {
	Database ndbNames = null;
	View viwSSO = null;
	HashMap<String, TokenConfiguration> configurations = new HashMap<String, TokenConfiguration>();
	try {
		ndbNames = ExtLibUtil.getCurrentSessionAsSigner().getDatabase(ExtLibUtil.getCurrentSession().getServerName(), "names.nsf");
		if (ndbNames != null) {
			viwSSO = ndbNames.getView("($WebSSOConfigs)");
			Document docNext = viwSSO.getFirstDocument();
			while (docNext != null) {
				Document docConfig = docNext;
				docNext = viwSSO.getNextDocument(docNext);
				TokenConfiguration tokenConfig = buildConfig(docConfig);
				if (tokenConfig != null) {
					configurations.put(tokenConfig.getDomain().toLowerCase(), tokenConfig);
				}
				docConfig.recycle();
			}
		}
	} catch (Exception e) {
		e.printStackTrace();
	}
	return configurations;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:25,代码来源:TokenFactory.java

示例5: searchInViewFrom

import lotus.domino.View; //导入方法依赖的package包/类
/**
 * Search for documents containing the search term in the view of the
 * database db, using the fulltext search capability.
 * 
 * @param search
 * @param viewName
 * @param db
 * @return
 */
public List<T> searchInViewFrom(String search, String viewName, Database db) {
	List<T> result = new ArrayList<T>();
	try {
		View view = db.getView(viewName);
		int count = view.FTSearch(search);
		if (count == 0) {
			view.recycle();
			return result;
		}
		result = new ArrayList<T>(count);
		Document docNext = view.getFirstDocument();
		while (docNext != null) {
			Document docProcess = docNext;
			docNext = view.getNextDocument(docNext);
			convertDocument2ObjectAndAdd2List(result, docProcess);
			docProcess.recycle();
		}
		view.recycle();
	} catch (NullPointerException ex) {
		throw ex;
	} catch (Exception e) {
		throw new XPTRuntimeException("Error during search of " + search + " in view " + viewName, e);
	}
	return result;
}
 
开发者ID:OpenNTF,项目名称:XPagesToolkit,代码行数:35,代码来源:AbstractStorageService.java

示例6: getAllIterations

import lotus.domino.View; //导入方法依赖的package包/类
public List<Iteration> getAllIterations(Session sesCurrent) {
	List<Iteration> lstIteration = new ArrayList<Iteration>();
	try {
		Database ndbCurrent = sesCurrent.getCurrentDatabase();
		View viwIteration = ndbCurrent.getView("lupIterationsById");
		Document docNext = viwIteration.getFirstDocument();
		while (docNext != null) {
			Document docProcess = docNext;
			docNext = viwIteration.getNextDocument(docNext);
			Iteration newIteration = new Iteration();
			if (DominoStorageService.getInstance().getObjectWithDocument(
					newIteration, docProcess)) {
				lstIteration.add(newIteration);
			}
			docProcess.recycle();
		}
		viwIteration.recycle();
		ndbCurrent.recycle();
	} catch (Exception e) {
		e.printStackTrace();
	}

	return lstIteration;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:25,代码来源:IterationStorageService.java

示例7: 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,项目名称:Nagios4DominoIntegration,代码行数:19,代码来源:SettingStorageService.java

示例8: run

import lotus.domino.View; //导入方法依赖的package包/类
@Override
@Stopwatch
public void run() {

	if(TaskRunner.getInstance().isClosing()){
		return;
	}
	
	if(server.getWebSocketAndObserverCount() == 0)return;

	Session session = this.openSession();
	try {
		Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
		View view = db.getView(Const.VIEW_MSG_QUEUE);
		if(view.getAllEntries().getCount() > 0){
			view.setAutoUpdate(false);
			Document doc = view.getFirstDocument();
			Document temp = null;
			while(doc!=null){
				if(doc.isValid() && !doc.hasItem(StringCache.FIELD_CONFLICT)){
					this.processDoc(doc);

				}else if(doc.isValid() && doc.hasItem(StringCache.FIELD_CONFLICT)){
					this.processConflict(doc);
				}
				temp = view.getNextDocument(doc);
				doc.recycle();
				doc = temp;	
			}

			view.setAutoUpdate(true);
		}
	} catch (NotesException e) {
		LOG.log(Level.SEVERE,null,e);

	}finally{
		this.closeSession(session);
	}
}
 
开发者ID:mwambler,项目名称:xockets.io,代码行数:40,代码来源:QueueProcessor.java

示例9: setClustermateUsersOffline

import lotus.domino.View; //导入方法依赖的package包/类
/**
 * Sets the clustermate users offline.
 *
 * @param db the db
 * @param clustermate the clustermate
 */
@Stopwatch
private void setClustermateUsersOffline(Database db, String clustermate) {

	try {
		View view = db.getView(Const.VIEW_USERS);
		view.setAutoUpdate(false);
		Document doc = view.getFirstDocument();
		Document temp = null;
		while(doc!=null){

			if(doc.isValid()){
				String host = doc.getItemValueString(Const.FIELD_HOST);

				//if hosts are the same
				if(host!=null && host.equals(clustermate)){
					doc.replaceItemValue(Const.FIELD_STATUS, Const.STATUS_OFFLINE);
					doc.save();
				}
			}

			temp = view.getNextDocument(doc);
			doc.recycle();
			doc = temp;
		}
		view.setAutoUpdate(true);

	} catch (NotesException e) {
		LOG.log(Level.SEVERE,null,e);
	}

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

示例10: run

import lotus.domino.View; //导入方法依赖的package包/类
@Override
@Stopwatch
public void run() {

	if(TaskRunner.getInstance().isClosing()){
		return;
	}


	Session session =  this.openSession();
	try {	
		Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
		View view = db.getView(Const.VIEW_USERS);
		Document doc = view.getFirstDocument();
		Document temp = null;
		while(doc!=null){
			String host = doc.getItemValueString(Const.FIELD_HOST);
			if(ServerInfo.getInstance().isCurrentServer(host)){
				String currentStatus= doc.getItemValueString(Const.FIELD_STATUS);
				//only update if we need to.
				if(!this.getStatus().equals(currentStatus)){
					doc.replaceItemValue(Const.FIELD_STATUS, this.getStatus());
					doc.save();
				}
			}

			temp = view.getNextDocument(doc);
			doc.recycle();
			doc = temp;
		}

	} catch (NotesException e) {
		LOG.log(Level.SEVERE,null,e);

	}finally{
		SessionFactory.closeSession(session);
	}

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

示例11: getFirstContactID

import lotus.domino.View; //导入方法依赖的package包/类
public String getFirstContactID() throws NotesException {
	if(!firstContactIDRead) {
		Database db = ExtLibUtil.getCurrentDatabase();
		View view = db.getView("AllContacts");
		Document doc = view.getFirstDocument();
		if(doc!=null) {
			firstContactID = doc.getNoteID();
		}
	}
	return firstContactID;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:12,代码来源:DataAccessor.java

示例12: setClustermateUsersOffline

import lotus.domino.View; //导入方法依赖的package包/类
@Profiled
private void setClustermateUsersOffline(Database db, String clustermate) {

	try {
		View view = db.getView(Const.VIEW_USERS);
		view.setAutoUpdate(false);
		Document doc = view.getFirstDocument();
		Document temp = null;
		while(doc!=null){

			if(doc.isValid()){
				String host = doc.getItemValueString(Const.FIELD_HOST);

				//if hosts are the same
				if(host!=null && host.equals(clustermate)){
					doc.replaceItemValue(Const.FIELD_STATUS, Const.STATUS_OFFLINE);
					doc.save();
				}
			}

			temp = view.getNextDocument(doc);
			doc.recycle();
			doc = temp;
		}
		view.setAutoUpdate(true);

	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);
	}

}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:32,代码来源:ClustermateMonitor.java

示例13: getAllProjects

import lotus.domino.View; //导入方法依赖的package包/类
public List<Project> getAllProjects(Session sesCurrent) {
	List<Project> lstProject = new ArrayList<Project>();
	try {
		Database ndbCurrent = sesCurrent.getCurrentDatabase();
		View viwProject = ndbCurrent.getView("lupProjectsById");
		Document docNext = viwProject.getFirstDocument();
		while (docNext != null) {
			Document docProcess = docNext;
			docNext = viwProject.getNextDocument(docNext);
			Project newProject = new Project();
			if (DominoStorageService.getInstance().getObjectWithDocument(
					newProject, docProcess)) {
				if (newProject.getIsDeleted() == null) {
					lstProject.add(newProject);
				} else if (!newProject.getIsDeleted().equals("true")) {
					lstProject.add(newProject);
				}
			}
			docProcess.recycle();
		}
		viwProject.recycle();
		ndbCurrent.recycle();
	} catch (Exception e) {
		e.printStackTrace();
	}

	return lstProject;
}
 
开发者ID:OpenNTF,项目名称:myWebGate-Scrum,代码行数:29,代码来源:ProjectStorageService.java

示例14: run

import lotus.domino.View; //导入方法依赖的package包/类
@Profiled
public void run() {
	
	if(TaskRunner.getInstance().isClosing()){
		return;
	}
	

	Session session = SessionFactory.openSession();
	try {	
		Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
		View view = db.getView(Const.VIEW_USERS);
		Document doc = view.getFirstDocument();
		Document temp = null;
		while(doc!=null){
			String host = doc.getItemValueString(Const.FIELD_HOST);
			if(ServerInfo.getInstance().isCurrentServer(host)){
				String currentStatus= doc.getItemValueString(Const.FIELD_STATUS);
				//only update if we need to.
				if(!this.getStatus().equals(currentStatus)){
					doc.replaceItemValue(Const.FIELD_STATUS, this.getStatus());
					doc.save();
				}
			}

			temp = view.getNextDocument(doc);
			doc.recycle();
			doc = temp;
		}

	} catch (NotesException e) {
		logger.log(Level.SEVERE,null,e);

	}finally{
		SessionFactory.closeSession(session);
	}

}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:39,代码来源:StampAllUsers.java

示例15: getAllObjectsForFrom

import lotus.domino.View; //导入方法依赖的package包/类
/**
 * Loads all object where the user, group or role occurs in one of the
 * fields form the source database
 * 
 * @param userName
 * @param viewName
 * @param fieldsToCheck
 * @param sourceDatabase
 * @return
 */
public List<T> getAllObjectsForFrom(String userName, String viewName, List<String> fieldsToCheck, Database sourceDatabase) {
	List<T> ret = new ArrayList<T>();
	List<String> lstRolesGroups = RoleAndGroupProvider.getInstance().getGroupsAndRolesOf(userName, sourceDatabase);
	try {
		View view = sourceDatabase.getView(viewName);
		view.setAutoUpdate(false);
		Document docNext = view.getFirstDocument();
		while (docNext != null) {
			Document docCurrent = docNext;
			docNext = view.getNextDocument(docNext);
			if (isDocumentOfInterest(docCurrent, lstRolesGroups, fieldsToCheck)) {
				convertDocument2ObjectAndAdd2List(ret, docCurrent);
			}
			docCurrent.recycle();

		}
		view.recycle();
	} catch (NullPointerException ex) {
		throw ex;
	} catch (Exception e) {
		LoggerFactory.logError(getClass(), GENERAL_ERROR, e);
		throw new XPTRuntimeException(GENERAL_ERROR, e);
	}
	return ret;

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


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