Package de.innovationgate.wga.common.beans.csconfig.v1

Examples of de.innovationgate.wga.common.beans.csconfig.v1.MediaKey


            _initACL = initACL;
           
            _initDisabled = false;
            if (_db.getDbReference().startsWith(PluginConfig.PLUGIN_DBKEY_PREFIX)) {
                if (_info != null && _info.getCsConfig() != null && _info.getCsConfig().getPluginConfig() != null) {
                    PluginConfig pc = _info.getCsConfig().getPluginConfig();
                    if (pc instanceof de.innovationgate.wga.common.beans.csconfig.v3.PluginConfig) {
                        _initDisabled = ((de.innovationgate.wga.common.beans.csconfig.v3.PluginConfig) pc).isDisablePluginInit();
                    }
                }
            }
View Full Code Here


        getRuntimeContext().setReconnect(reconnectDatabase);
    }
   
    public String getPluginHomepage() {
       
        PluginConfig pc = getCsConfig().getPluginConfig();
       
        if (!pc.isUsageAsContentStore()) {
            return null;
        }
       
        String ph = pc.getPluginHomepage();
        if (ph != null && !ph.trim().equals("")) {
            return ph;
        }
       
        PublisherOption option = getCsConfig().findPublisherOption(WGACore.DBATTRIB_HOME_PAGE);
View Full Code Here

                db.getSessionContext().setTask("Initializing database in WGA");
               
                // Plugin dbs are always CS5 since they are automatically migrated
                //getLog().info("Database of plugin " + plugin.getPluginID().getUniqueName() + " is content store version " + db.getContentStoreVersion());
               
                PluginConfig pc = plugin.getCsConfig().getPluginConfig();
                String auth = pc.getAuthentication();
                db.setTitle(pc.getTitle());
               
               
                // Set mandatory database attributes
                initializeDBAttributes(db, dbKey, dbKey, new HashSet());
               
                // Create authentication
                if (auth != null) {
                    String authImplClass = null;
                    Map<String,String> authOptions = new HashMap<String, String>();
                   
                    // Delegate authentication to the default domain
                    if (auth.equals(PluginConfig.AUTHSOURCE_DEFAULT_DOMAIN)) {
                        authImplClass = WGAAuthModuleFactory.AUTHMODULE_DELEGATE;
                        authOptions.put(DelegatingAuthModule.COPTION_DOMAIN, "default");
                    }
                    // Use some plugin for authentication
                    else {
                        WGAPlugin authPlugin = plugin.getParent().getPluginByUniqueName(auth);
                    if (authPlugin != null) {
                        authImplClass = CSAuthModule.class.getName();
                        authOptions.put(CSAuthModule.COPTION_DBKEY, authPlugin.buildDatabaseKey());
                    }
                    else {
                            getLog().error("Unable to find authentication plugin " + auth);
                        }
                    }
                   
                    if (authImplClass != null) {
                        AuthenticationModule authModule = WGFactory.getAuthModuleFactory().getAuthModule(authImplClass, authOptions, db);
                        db.setAuthenticationModule(authModule);
                    }
                   
                }
               
                // Enforce some plugin settings via db attributes
                db.setAttribute(DBATTRIB_PERSMODE, String.valueOf(pc.getPersonalisationMode()));
                db.setAttribute(DBATTRIB_PERSSTATMODE, String.valueOf(Constants.PERSSTATMODE_SESSION));
                db.setAttribute(DBATTRIB_PLUGIN_FILETIME, new Long(plugin.getFileLastModified()));
                db.setAttribute(DBATTRIB_PLUGIN_ID, plugin.getPluginID());
                db.setAttribute(DBATTRIB_PLUGIN_VERSION, plugin.getPluginID().getVersion());
               
                if (!pc.isUsageAsContentStore()) {
                    db.setAttribute(DBATTRIB_ALLOW_PUBLISHING, "false");
                }
               
                if (!pc.isShowOnStartPage()) {
                    db.setAttribute(DBATTRIB_STARTPAGE, "false");
                }
   
                // Configure design provider
                DesignReference ref = new DesignReference(Constants.DESIGNCOL_PLUGIN, plugin.getInstallationKey(), null);
View Full Code Here

    public boolean hasPluginConfig() {
        return _csConfig.getPluginConfig() != null;
    }

    public void createPluginConfig() {
        PluginConfig config =  PluginConfig.instantiatePluginConfigForCompliance(_csConfig.getVersionCompliance());
        config.getId().getVersion().setBuildVersion(1);
        if (getVersionCompliance() != null) {
            Version minWGAVersion = VERSIONCOMPLIANCE_TO_WGA_VERSION.get(getVersionCompliance().getKey());
            if (minWGAVersion != null) {
                config.setMinimumWGAVersion(minWGAVersion);
            }
           
            // OpenWGA 5.0 requires java 1.5
            if (minWGAVersion.isAtLeast(5, 0)) {
                config.setMinimumJavaVersion(new Version("1.5.0"));
            }
        }
       
        config.setPersonalisationMode(Constants.PERSMODE_AUTO);
       
        _csConfig.setPluginConfig(config);

        loadPluginVersionProperties();
View Full Code Here

            }
        }

        if (hasPluginConfig()) {
            // Validate plugin id
            PluginConfig pc = _csConfig.getPluginConfig();
            PluginID id = pc.getId();

            errors.addAll(validatePluginUniqueName(getPluginUniqueName()));

            // Validate plugin dependencies
            Iterator<PluginID> dependencies = pc.getDependencies().iterator();
            while (dependencies.hasNext()) {
                PluginID did = (PluginID) dependencies.next();
                if (did.getUniqueName() == null || did.getUniqueName().trim().equals("")) {
                    errors.add(new ValidationError("Unique name of plugin dependency should not be empty.", new String[] { "pluginDependencies" }));
                }
                else if (did.getUniqueName().contains(" ")) {
                    errors.add(new ValidationError("Unique name of plugin dependency should not contain white spaces.", new String[] { "pluginDependencies" }));
                }
            }

            // Validate relation between minimum WGA version and WGA
            // compatibility version
            float minimumWGAVersion = Float.valueOf(pc.getMinimumWGAVersion().getMajorVersion() + "." + pc.getMinimumWGAVersion().getMinorVersion());
            float compatibilityWGAVersion = Float.valueOf(_csConfig.getVersionCompliance().substring(3));
            if (minimumWGAVersion < compatibilityWGAVersion) {
                errors.add(new ValidationError("The minimum WGA version in plugin configuration is lower than the version chosen in 'Developed for WGA version'", new String[] { "pluginWGAVersion",
                        "versionCompliance" }));
            }
View Full Code Here

           
            CSConfig correctVersionCSConfig = CSConfig.instantiateCSConfigForCompliance(_csConfig.getVersionCompliance());
            BeanUtils.copyProperties(correctVersionCSConfig, _csConfig);
           
            if (_csConfig.getPluginConfig() != null) {
                PluginConfig correctVersionPluginConfig = PluginConfig.instantiatePluginConfigForCompliance(_csConfig.getVersionCompliance());
                BeanUtils.copyProperties(correctVersionPluginConfig, _csConfig.getPluginConfig());
                correctVersionCSConfig.setPluginConfig(correctVersionPluginConfig);
            }
                       
            _csConfig = correctVersionCSConfig;
View Full Code Here

    }
  }
 

  private void handleAddDependency() {
    PluginID id = new PluginID();
    id.setUniqueName(EMPTY_PLUGIN_UNAME);
    id.setVersion(new Version(EMPTY_PLUGIN_VERSION));
    _pluginDependenciesModel.add(id);
  }
View Full Code Here

        }
       
        ContainerInfo info = _containerInfos.remove(db.getDbReference());
        if (info != null) {
            WGAPlugin plugin = null;
            PluginID pluginID = (PluginID) db.getAttribute(WGACore.DBATTRIB_PLUGIN_ID);
            if (pluginID != null) {
                plugin = _core.getPluginSet().getPluginByID(pluginID);
            }
           
            SystemContainerContext scContext = new SystemContainerContext(db, info, plugin, false);
View Full Code Here

    public void checkDependencies() {
       
        Iterator depsIt = _config.getCsConfig().getPluginConfig().getDependencies().iterator();
        while (depsIt.hasNext()) {
            PluginID depId = (PluginID) depsIt.next();
            WGAPlugin depPlugin = (WGAPlugin) _parent.getActivePluginsByUniqueName().get(depId.getUniqueName());
            if (depPlugin == null) {
                addInstallationFault(new DependencyFault(depId, DependencyFault.ERROR_DEPENDENCY_NOT_AVAILABLE));
                continue;
            }
           
            int versionCompare = depId.getVersion().compareTo(depPlugin.getPluginID().getVersion());
            if (versionCompare > 0) {
                addInstallationFault(new DependencyFault(depId, DependencyFault.ERROR_DEPENDENCY_WRONG_VERSION));
                continue;
            }
           
View Full Code Here

            return true;
        }
       
        Iterator dependencies = depPlugin.getCsConfig().getPluginConfig().getDependencies().iterator();
        while (dependencies.hasNext()) {
            PluginID id = (PluginID) dependencies.next();
            WGAPlugin plugin = getParent().getPluginByID(id);
            if (plugin != null && detectCircularReference(plugin)) {
                return true;
            }
        }
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.common.beans.csconfig.v1.MediaKey

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.