Java Code Examples for lotus.domino.NotesException#getMessage()

The following examples show how to use lotus.domino.NotesException#getMessage() . 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: BluemixContext.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
public boolean isHybridApplication() {
    checkOnBluemix();
    
    try{
        Session session = ExtLibUtil.getCurrentSession();
        String serverName = session.getServerName();
        
        String defaultServerNameFull  = "CN=vcap/O=Bluemix"; // $NON-NLS-1$
        String defaultServerNameShort = "vcap/Bluemix"; // $NON-NLS-1$
        if(serverName != null && !serverName.equals(defaultServerNameFull) && !serverName.equals(defaultServerNameShort)) {
            return true;
        }
    }catch(NotesException ne) {
        throw new FacesException(ne.getMessage());
    }
    return false;
}
 
Example 2
Source File: NotesDatabaseStoreRenderer.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
public String getDbUrlInName(FacesContext context, UINotesDatabaseStoreComponent component) throws IOException{
    String dbName = component.getDatabaseName();
    StringBuilder b = new StringBuilder();
    try {
        Database database = null;
        if (StringUtil.isEmpty(dbName)) {
            database = NotesContext.getCurrent().getCurrentDatabase();
        } else {
            Session session = NotesContext.getCurrent().getCurrentSession();
            database = DominoUtils.openDatabaseByName(session, dbName);
        }
        String url = database.getHttpURL();
        String[] paths = url.split("/");
        for (int i = 0; i < 3 && i < paths.length; i++) {
            b.append(paths[i] + "/");
        }
        b.append(database.getFilePath().replaceAll("\\\\", "/"));
    } catch (NotesException e) {
        IOException ioe = new IOException(e.getMessage());
        ioe.initCause(e);
        throw ioe;
    }
    return b.toString();
}
 
Example 3
Source File: NotesDatabaseStoreRenderer.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
public String getDbUrl(FacesContext context, UINotesDatabaseStoreComponent component) throws IOException{
    String dbName = component.getDatabaseName();
    StringBuilder b = new StringBuilder();
    try {
        Database database = null;
        if (StringUtil.isEmpty(dbName)) {
            database = NotesContext.getCurrent().getCurrentDatabase();
        }else{
            Session session = NotesContext.getCurrent().getCurrentSession();
            database = DominoUtils.openDatabaseByName(session, dbName);             
        }
        String url = database.getHttpURL();
        int idx = url.indexOf("?OpenDatabase"); // $NON-NLS-1$

        b.append(idx == -1 ? url : url.substring(0, idx));
    } catch (NotesException e) {
        IOException ioe = new IOException(e.getMessage());
        ioe.initCause(e);
        throw ioe;
    }
    
    return b.toString();
}