Package de.innovationgate.wga.config

Examples of de.innovationgate.wga.config.ConfigBean


     */
    public static int retrievePriorityForDatabase(WGAConfiguration config, VirtualHost vHost, String dbkey) {

        // first try - check if default db is requested
        if (vHost.getDefaultDatabase() != null) {
            ConfigBean bean = (ConfigBean) config.getByUid(vHost.getDefaultDatabase());
            if (bean != null && bean instanceof ContentDatabase) {
                ContentDatabase database = (ContentDatabase) bean;
                if (dbkey.equalsIgnoreCase(database.getKey())) {
                    return 0;
                }
            }
        }
       
        // second try - check allowed db keys
        int i = 0;
        for (String uid : vHost.getAllowedDatabases()) {
            i++;
            if (uid.equals(VirtualHost.UID_ALL_DATABASES)) {
                return Integer.MAX_VALUE;
            }
            ConfigBean dbBean = (ConfigBean) config.getByUid(uid);
            if (dbBean != null && dbBean instanceof ContentDatabase) {
                ContentDatabase database = (ContentDatabase) dbBean;
                if (dbkey.equalsIgnoreCase(database.getKey())) {
                    return i;
                }      
View Full Code Here


    }
   
    public static String getDefaultDBKey(WGACore core, VirtualHost vHost) {
        String defaultDBKey = null;
        if (vHost.getDefaultDatabase() != null) {
            ConfigBean bean = (ConfigBean) core.getWgaConfiguration().getByUid(vHost.getDefaultDatabase());
            if (bean != null && bean instanceof ContentDatabase) {
                ContentDatabase database = (ContentDatabase) bean;
                defaultDBKey = database.getKey();
            }
        }
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.config.ConfigBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.