lotus.domino.NotesException Java Examples

The following examples show how to use lotus.domino.NotesException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OpenntfNABNamePickerData.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
@Override
public Object readLabel(final ViewEntry ve, final Vector<Object> columnValues) throws NotesException {
	String first = (String) columnValues.get(1);
	String mid = (String) columnValues.get(2);
	String last = (String) columnValues.get(3);
	StringBuilder b = new StringBuilder();
	if (StringUtil.isNotEmpty(first)) {
		b.append(first);
	}
	if (StringUtil.isNotEmpty(mid)) {
		if (b.length() > 0) {
			b.append(" ");
		}
		b.append(mid);
	}
	if (StringUtil.isNotEmpty(last)) {
		if (b.length() > 0) {
			b.append(" ");
		}
		b.append(last);
	}

	return b.toString();
}
 
Example #2
Source File: ViewNavigator.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
@Override
public boolean gotoLast() {
	try {
		boolean result = getDelegate().gotoLast();
		if (result) {
			lotus.domino.ViewEntry newEntry = getDelegate().getCurrent();
			if (newEntry != null) {
				curPosition_ = newEntry.getPosition(DEFAULT_SEPARATOR);
				if (forceJavaDates_) {
					newEntry.setPreferJavaDates(true);
				}
			}
		}
		return result;
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return false;
	}
}
 
Example #3
Source File: DominoNABNamePickerData.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example #4
Source File: ViewNavigator.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
@Override
public boolean gotoPrev(final lotus.domino.ViewEntry entry) {
	try {
		boolean result = getDelegate().gotoPrev(toLotus(entry));
		if (result) {
			lotus.domino.ViewEntry newEntry = getDelegate().getCurrent();
			if (newEntry != null) {
				curPosition_ = newEntry.getPosition(DEFAULT_SEPARATOR);
				if (forceJavaDates_) {
					newEntry.setPreferJavaDates(true);
				}
			}
		}
		return result;
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return false;
	}
}
 
Example #5
Source File: DominoViewPickerData.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example #6
Source File: JsonMimeEntityAdapter.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
/**
 * Recursively adds entity adapters to a flat list (depth first)
 * 
 * @param adapters
 * @param entity
 * @throws NotesException
 */
public static void addEntityAdapter(List<JsonMimeEntityAdapter> adapters, MIMEEntity entity) throws NotesException {
	
	// Add this entity
	
	JsonMimeEntityAdapter adapter = new JsonMimeEntityAdapter(entity);
	adapters.add(adapter);
	
	// Add children
	
	MIMEEntity child = entity.getFirstChildEntity();
	if ( child != null ) {
		addEntityAdapter(adapters, child);

		// Add siblings
		
		MIMEEntity sibling = child.getNextSibling();
		while ( sibling != null ) {
			addEntityAdapter(adapters, sibling);
			sibling = sibling.getNextSibling();
		}
	}
}
 
Example #7
Source File: ViewNavigator.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
@Override
public ViewEntry getPrev(final lotus.domino.ViewEntry entry) {
	try {
		lotus.domino.ViewEntry newEntry = getDelegate().getPrev(toLotus(entry));
		if (newEntry != null) {
			curPosition_ = newEntry.getPosition(DEFAULT_SEPARATOR);
			if (forceJavaDates_) {
				newEntry.setPreferJavaDates(true);
			}
		}
		return fromLotus(newEntry, ViewEntry.SCHEMA, getParentView());
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return null;
	}
}
 
Example #8
Source File: DbDirectory.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
/**
 * Removes all databases from this collection that are not contained in the specified collection.
 *
 * @param objs
 *            collection containing databases to be retained in this directory
 * @return true if this directory changed as a result of the call
 */
@Override
public boolean retainAll(final Collection<?> objs) {
	Collection<DatabaseMetaData> holders = new ArrayList<DatabaseMetaData>(objs.size());

	for (Object obj : objs) {
		if (obj instanceof Database) {
			try {
				holders.add(new DatabaseMetaData((Database) obj));
			} catch (NotesException ne) {

				DominoUtils.handleException(ne);
				return false;
			}
		}
	}
	return getMetaDataSet().retainAll(holders);
}
 
Example #9
Source File: MIMEHeader.java    From org.openntf.domino with Apache License 2.0 6 votes vote down vote up
@Override
protected void resurrect() {
	if (headerName_ != null) {
		try {
			lotus.domino.MIMEEntity entity = toLotus(parent);
			lotus.domino.MIMEHeader header = entity.getNthHeader(headerName_);
			this.setDelegate(header, true);
		} catch (NotesException ne) {
			DominoUtils.handleException(ne);
		}
	} else {
		if (log_.isLoggable(Level.SEVERE)) {
			log_.log(Level.SEVERE,
					"MIMEHeader doesn't have headerName value. Something went terribly wrong. Nothing good can come of this...");
		}
	}
}
 
Example #10
Source File: Agent.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean lockProvisional() {
	try {
		return getDelegate().lockProvisional();
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return false;
	}
}
 
Example #11
Source File: OutlineEntry.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setImagesText(final String imagesText) {
	try {
		getDelegate().setImagesText(imagesText);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #12
Source File: ACLEntry.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void enableRole(final String role) {
	try {
		getDelegate().enableRole(role);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #13
Source File: JsonViewCollectionContent.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
private String getViewName(Document viewDoc) throws NotesException {
	String name = "";
	String[] aliases = null;		
	Vector<?> names = viewDoc.getItemValue(FIELD_TITLE);
	if ( names != null && names.size() > 0 ){
		String title = (String)names.get( 0 );
		//Compute the aliases
		ArrayList<String> aliasesList = new ArrayList<String>();
		StringTokenizer st = new StringTokenizer( title, "|");
		while ( st.hasMoreTokens() ){
			if ( name == null ){
				name = st.nextToken().trim();
			}else{
				aliasesList.add( st.nextToken().trim() );
			}
		}
		for ( int i = 1; i < names.size(); i++ ){
			aliasesList.add( (String)names.get( i ) );
		}
		aliases = aliasesList.toArray( new String[0] );
	}else if ( viewDoc.hasItem( FIELD_TITLE ) ) {
		name="";	//Empty name
	}
	if (name.length() == 0)
		if (aliases != null)
			name = aliases[0];
	return name;
}
 
Example #14
Source File: RichTextItem.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public EmbeddedObject embedObject(final int type, final String className, final String source, final String name) {
	markDirty();
	try {
		return fromLotus(getDelegate().embedObject(type, className, source, name), EmbeddedObject.SCHEMA, parent);
	} catch (NotesException e) {
		DominoUtils.handleException(e, this);
		return null;
	}
}
 
Example #15
Source File: Session.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setAllowLoopBack(final boolean flag) {
	try {
		getDelegate().setAllowLoopBack(flag);
	} catch (NotesException e) {
		DominoUtils.handleException(e, this);

	}
}
 
Example #16
Source File: Outline.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public OutlineEntry createEntry(final String entryName, final lotus.domino.OutlineEntry referenceEntry, final boolean after) {
	try {
		return fromLotus(getDelegate().createEntry(entryName, toLotus(referenceEntry), after), OutlineEntry.SCHEMA, this);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return null;
	}
}
 
Example #17
Source File: MIMEEntity.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public org.openntf.domino.MIMEEntity getPrevEntity(final int search) {
	try {
		return fromLotusMimeEntity(getDelegate().getPrevEntity(search));
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return null;
	}
}
 
Example #18
Source File: ViewColumn.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setTitle(final String title) {
	try {
		getDelegate().setTitle(title);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #19
Source File: ViewColumn.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setSecondaryResort(final boolean flag) {
	try {
		getDelegate().setSecondaryResort(flag);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #20
Source File: DxlExporter.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean getOmitRichtextAttachments() {
	try {
		return getDelegate().getOmitRichtextAttachments();
	} catch (NotesException e) {
		DominoUtils.handleException(e, getLog());
		return false;
	}
}
 
Example #21
Source File: Agent.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setServerName(final String server) {
	try {
		getDelegate().setServerName(server);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #22
Source File: OutlineEntry.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setFrameText(final String frameText) {
	try {
		getDelegate().setFrameText(frameText);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #23
Source File: RichTextTable.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void addRow(final int count) {
	try {
		getDelegate().addRow(count);
		markDirty();
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
}
 
Example #24
Source File: Agent.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
@Override
public boolean lock(final Vector names) {
	try {
		return getDelegate().lock(names);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return false;
	}
}
 
Example #25
Source File: View.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public ViewNavigator createViewNavFromAllUnread(final String userName) {
	try {
		getDelegate().setAutoUpdate(false);
		getDelegate().setEnableNoteIDsForCategories(true);
		ViewNavigator result = fromLotus(getDelegate().createViewNavFromAllUnread(userName), ViewNavigator.SCHEMA, this);
		((org.openntf.domino.impl.ViewNavigator) result).setType(ViewNavigator.Types.UNREAD);
		((org.openntf.domino.impl.ViewNavigator) result).setUnreadUser(userName);
		return result;
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
	return null;
}
 
Example #26
Source File: Log.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isLogErrors() {
	try {
		return getDelegate().isLogErrors();
	} catch (NotesException ne) {
		DominoUtils.handleException(ne);
		return false;
	}
}
 
Example #27
Source File: ACLEntry.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isCanCreateLSOrJavaAgent() {
	try {
		return getDelegate().isCanCreateLSOrJavaAgent();
	} catch (NotesException e) {
		DominoUtils.handleException(e);
	}
	return false;
}
 
Example #28
Source File: DxlImporter.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public void setInputValidationOption(final int option) {
	try {
		getDelegate().setInputValidationOption(option);
	} catch (NotesException e) {
		DominoUtils.handleException(e, getLog());
	}
}
 
Example #29
Source File: Registration.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public int getMailOwnerAccess() {
	try {
		return getDelegate().getMailOwnerAccess();
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return 0;
	}
}
 
Example #30
Source File: Outline.java    From org.openntf.domino with Apache License 2.0 5 votes vote down vote up
@Override
public OutlineEntry getLast() {
	try {
		return fromLotus(getDelegate().getLast(), OutlineEntry.SCHEMA, this);
	} catch (NotesException e) {
		DominoUtils.handleException(e);
		return null;
	}
}