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


Java View.setAutoUpdate方法代码示例

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


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

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

示例2: getAllFrom

import lotus.domino.View; //导入方法依赖的package包/类
/**
 * Loads all objects form a view from the source database
 * 
 * @param viewName
 * @param sourceDatabase
 * @return
 */
public List<T> getAllFrom(String viewName, Database sourceDatabase) {
	List<T> ret = new ArrayList<T>();
	try {
		View viwDabases = sourceDatabase.getView(viewName);
		viwDabases.setAutoUpdate(false);
		Document docNext = viwDabases.getFirstDocument();
		while (docNext != null) {
			Document docCurrent = docNext;
			docNext = viwDabases.getNextDocument(docNext);
			convertDocument2ObjectAndAdd2List(ret, docCurrent);
			docCurrent.recycle();

		}
		viwDabases.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,代码行数:30,代码来源:AbstractStorageService.java

示例3: getObjectsByForeignIdFrom

import lotus.domino.View; //导入方法依赖的package包/类
/**
 * Load all objects by a foreign id form a view from the source database
 * 
 * @param foreignId
 * @param viewName
 * @param sourceDatabase
 * @return
 */
public List<T> getObjectsByForeignIdFrom(String foreignId, String viewName, Database sourceDatabase) {
	List<T> ret = new ArrayList<T>();
	try {
		View view = sourceDatabase.getView(viewName);
		view.setAutoUpdate(false);
		DocumentCollection documents = view.getAllDocumentsByKey(foreignId, true);
		Document docNext = documents.getFirstDocument();
		while (docNext != null) {
			Document docCurrent = docNext;
			docNext = documents.getNextDocument(docNext);

			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,代码行数:33,代码来源:AbstractStorageService.java

示例4: run

import lotus.domino.View; //导入方法依赖的package包/类
@Override
@Stopwatch
public void run() {
	
	if(TaskRunner.getInstance().isClosing()){
		return;
	}
	
	//exit if nobody on.
	if(server.getWebSocketCount() == 0) return;
	
	Session session = this.openSession();
	try {
		Database db = session.getDatabase(StringCache.EMPTY, Const.WEBSOCKET_PATH);
		View view = db.getView(this.getEventQueue());
		view.setAutoUpdate(false);
		DocumentCollection col = view.getAllDocumentsByKey(target, true);
		Document doc = col.getFirstDocument();
		Document temp = null;
		while(doc!=null){
			if(doc.isValid()){
				this.processDoc(doc);
			}
			temp = col.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,代码行数:37,代码来源:EventQueueProcessor.java

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

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

示例7: getView

import lotus.domino.View; //导入方法依赖的package包/类
protected View getView() throws NotesException {
	Database db = DominoUtils.getCurrentDatabase();
	View view = db.getView(_viewName);
	view.setAutoUpdate(false);
	view.refresh();
	return view;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:8,代码来源:MemberDataProvider.java

示例8: getAllMyObjectsFrom

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

		}
		viwDabases.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,代码行数:36,代码来源:AbstractStorageService.java

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

示例10: calculateExactCount

import lotus.domino.View; //导入方法依赖的package包/类
@Override
public int calculateExactCount(final View paramView) throws NotesException {
	//if (paramView instanceof org.openntf.domino.impl.View) {
	//paramView = org.openntf.domino.impl.Base.toLotus(paramView);
	try {
		paramView.setAutoUpdate(false);
	} catch (NotesException ne) {
		handleException(ne);
	}
	//}
	return super.calculateExactCount(paramView);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:OpenntfViewNavigatorEx.java

示例11: hasMoreRows

import lotus.domino.View; //导入方法依赖的package包/类
@Override
public int hasMoreRows(final View paramView, final int paramInt) {
	//if (paramView instanceof org.openntf.domino.View) {
	//	paramView = org.openntf.domino.impl.Base.toLotus(paramView);
	try {
		paramView.setAutoUpdate(false);
	} catch (NotesException ne) {
		handleException(ne);
	}
	//}
	return super.hasMoreRows(paramView, paramInt);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:13,代码来源:OpenntfViewNavigatorEx.java

示例12: run

import lotus.domino.View; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void run() {
	org.openntf.domino.Session sess = Factory.getSession(SessionType.NATIVE);
	try {
		TreeSet<String> names = new TreeSet<String>();
		Session session = TypeUtils.toLotus(sess);
		// Point to ExtLib demo, create a view called AllContactsByState
		// Copy AllContacts but adding a categorised column for State
		Database extLib = session.getDatabase(session.getServerName(), "odademo/oda_1.nsf");
		View states = extLib.getView("AllStates");
		states.setAutoUpdate(false);
		ViewEntry entState = states.getAllEntries().getFirstEntry();
		View byState = extLib.getView("AllContactsByState");
		byState.setAutoUpdate(false);
		Vector<String> key = new Vector<String>();
		Vector<String> stateVals = entState.getColumnValues();
		key.add(stateVals.get(0));
		ViewEntryCollection ec = byState.getAllEntriesByKey(key, true);
		ViewEntry ent = ec.getFirstEntry();
		while (null != ent) {
			Vector<Object> vals = ent.getColumnValues();
			names.add((String) vals.get(7));

			ViewEntry tmpEnt = ec.getNextEntry();
			ent.recycle(vals);
			ent.recycle();
			ent = tmpEnt;
		}
		System.out.println(names.toString());
	} catch (NotesException e) {
		e.printStackTrace();
	}
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:35,代码来源:Connect17Standard.java

示例13: 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(this.getEventQueue());
		view.setAutoUpdate(false);
		DocumentCollection col = view.getAllDocumentsByKey(target, true);
		Document doc = col.getFirstDocument();
		Document temp = null;
		while(doc!=null){
			if(doc.isValid()){
				this.processDoc(doc);
			}
			temp = col.getNextDocument(doc);
			doc.recycle();
			doc = temp;
		}

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

	}finally{
		SessionFactory.closeSession(session);
	}
}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:33,代码来源:EventQueueProcessor.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_MSG_QUEUE);
		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) {
		logger.log(Level.SEVERE,null,e);

	}finally{
		SessionFactory.closeSession(session);
	}
}
 
开发者ID:mwambler,项目名称:webshell-xpages-ext-lib,代码行数:37,代码来源:QueueProcessor.java

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


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