Java Code Examples for lotus.domino.Session#getEnvironmentString()

The following examples show how to use lotus.domino.Session#getEnvironmentString() . 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: DataService.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
public static boolean isUseRelativeUrls() {        
    boolean useRelativeUrls = true;
    
    try {
        Session session = ContextInfo.getUserSession();
        if ( s_useRelativeUrls == null && session != null ) {
            // One time intialization
            String value = session.getEnvironmentString("DataServiceAbsoluteUrls", true); // $NON-NLS-1$
            if ( "1".equals(value) ) {
                useRelativeUrls = false;
            }                
            s_useRelativeUrls = new Boolean(useRelativeUrls);
        } 
    }
    catch (NotesException e) {
        // Ignore this
    }
    
    if ( s_useRelativeUrls != null ) {
        useRelativeUrls = s_useRelativeUrls;
    }
    
    return useRelativeUrls;
}
 
Example 2
Source File: CalendarService.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
public static boolean isUseRelativeUrls() {
    
    boolean useRelativeUrls = true;
    
    try {
        Session session = ContextInfo.getUserSession();
        if ( s_useRelativeUrls == null && session != null ) {
            // One time intialization
            String value = session.getEnvironmentString("CalendarServiceAbsoluteUrls", true); // $NON-NLS-1$
            if ( "1".equals(value) ) {
                useRelativeUrls = false;
            }
            
            s_useRelativeUrls = new Boolean(useRelativeUrls);
        } 
    }
    catch (NotesException e) {
        // Ignore this
    }
    
    if ( s_useRelativeUrls != null ) {
        useRelativeUrls = s_useRelativeUrls;
    }
    
    return useRelativeUrls;
}
 
Example 3
Source File: DataService.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static int getMaxViewEntries() {        
    
    if ( s_maxViewEntries == -1 ) {

        // One time intialization from notes.ini
        
        try {
            Session session = ContextInfo.getUserSession();
            if ( session != null ) {
                String value = session.getEnvironmentString("DataServiceMaxViewEntries", true); // $NON-NLS-1$
                if ( StringUtil.isNotEmpty(value) ) {
                    int maxCount = Integer.valueOf(value);
                    if ( maxCount > DEFAULT_VIEW_COUNT ) {
                        s_maxViewEntries = maxCount;
                    }
                }
            } 
        }
        catch (Throwable e) {
            // Ignore all exceptions (including unchecked)
        }
        
        if ( s_maxViewEntries == -1 ) {
            // Static value is still not initialized.  Use the default value.
            s_maxViewEntries = MAX_VIEW_COUNT;
        }
    }
    
    return s_maxViewEntries;
}
 
Example 4
Source File: ProviderFactory.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static IDelegateProvider getDelegateProvider(Session session) {
    if ( s_delegateProvider == null ) {
        s_delegateProvider = (IDelegateProvider)loadFromFragment(IDelegateProvider.class);

        if ( s_delegateProvider == null ) {
            boolean useOldProvider = false;
            
            try {
                String var = session.getEnvironmentString("MailServiceDelegateWithACL", true); // $NON-NLS-1$
                if ( "1".equals(var) ) {
                    useOldProvider = true;
                }
            }
            catch (NotesException e) {
                // Ignore
            }
            
            if ( useOldProvider ) {
                s_delegateProvider = new DelegateProvider();
            }
            else {
                s_delegateProvider = new Delegate901Provider();
            }
        }
    }
    
    return s_delegateProvider;
}
 
Example 5
Source File: ProviderFactory.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public static IFreeRoomsProvider getFreeRoomsProvider(Session session) {
    if ( s_freeRoomsProvider == null ) {
        s_freeRoomsProvider = (IFreeRoomsProvider)loadFromFragment(IFreeRoomsProvider.class);
        
        if ( s_freeRoomsProvider == null ) {
            boolean useOldProvider = false;
            
            try {
                String var = session.getEnvironmentString("FbUseOldRoomsAPI", true); // $NON-NLS-1$
                if ( "1".equals(var) ) {
                    useOldProvider = true;
                }
            }
            catch (NotesException e) {
                // Ignore
            }
            
            if ( useOldProvider ) {
                s_freeRoomsProvider = new FreeRoomsProvider();
            }
            else {
                s_freeRoomsProvider = new FreeRooms901Provider();
            }
        }
    }
    
    return s_freeRoomsProvider;
}