Package de.innovationgate.wga.modules

Examples of de.innovationgate.wga.modules.ModuleDefinition


    public List<ModuleDefinition> getContentDatabaseTypesForServer(WGDatabaseServer server) {
       
        List<ModuleDefinition> dbTypes = new ArrayList<ModuleDefinition>();
        Iterator<ModuleDefinition> allDbTypes = getModulesForType(ContentDatabaseModuleType.class).values().iterator();
        while (allDbTypes.hasNext()) {
            ModuleDefinition moduleDefinition = (ModuleDefinition) allDbTypes.next();
            DatabaseProperties props = (DatabaseProperties) moduleDefinition.getProperties();
            Iterator<ServerDatabaseRetriever> retrievers = props.getServerDatabaseRetrievers().iterator();
            while (retrievers.hasNext()) {
                ServerDatabaseRetriever serverDatabaseRetriever = (ServerDatabaseRetriever) retrievers.next();
                if (server.getClass().isAssignableFrom(serverDatabaseRetriever.getDatabaseServerType())) {
                    dbTypes.add(moduleDefinition);
View Full Code Here


        return server;
    }

    public Connection createJDBCConnection(DatabaseInformation db, Properties props) throws WGBackendException {
      try {
      ModuleDefinition serverDef = WGFactory.getModuleRegistry().getModuleDefinition(DatabaseServerModuleType.class, MySqlDatabaseServer.class);
      OptionReader serverOptionReader = OptionReader.create(getOptions(), serverDef);
     
      String hostName = buildHostName();
     
            String masterUser = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_USER);
View Full Code Here

        if (!_csOnly) {
            throw new WGNotSupportedException("Creating custom databases is not supported");
        }
       
        try {
            ModuleDefinition serverDef = WGFactory.getModuleRegistry().getModuleDefinition(DatabaseServerModuleType.class, MySqlDatabaseServer.class);
            OptionReader serverOptionReader = OptionReader.create(dbServer.getOptions(), serverDef);
           
            String hostName = buildHostName(dbServer);
           
            String masterUser = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_USER);
View Full Code Here

    public List<DatabaseInformation> getAvailableDatabases(WGDatabaseServer dbServer) throws WGAPIException {
       
        try {
            List<DatabaseInformation> dbs = new ArrayList<DatabaseInformation>();
           
            ModuleDefinition serverDef = WGFactory.getModuleRegistry().getModuleDefinition(DatabaseServerModuleType.class, MySqlDatabaseServer.class);
            OptionReader serverOptionReader = OptionReader.create(dbServer.getOptions(), serverDef);
           
            String hostName = buildHostName(dbServer);
           
            String masterUser = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_USER);
View Full Code Here

    }

    public WGDatabase openDatabase(Class<? extends WGDatabaseCore> implClass, WGDatabaseServer dbServer, Map<String, String> options, boolean prepareOnly) throws WGAPIException {

        try {
            ModuleDefinition serverDef = WGFactory.getModuleRegistry().getModuleDefinition(DatabaseServerModuleType.class, MySqlDatabaseServer.class);
            OptionReader serverOptionReader = OptionReader.create(dbServer.getOptions(), serverDef);
           
            String hostName = buildHostName(dbServer);
           
            String masterUser = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_USER);
View Full Code Here

        return false;
    }

    public WGDatabase openDatabase(Class<? extends WGDatabaseCore> implClass, WGDatabaseServer dbServer, Map<String, String> options, boolean prepareOnly) throws WGAPIException {
        try {
            ModuleDefinition serverDef = WGFactory.getModuleRegistry().getModuleDefinition(DatabaseServerModuleType.class, getDatabaseServerType());
            OptionReader serverOptionReader = OptionReader.create(dbServer.getOptions(), serverDef);
           
            String masterUser = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_USER);
            String masterPassword = (String) serverOptionReader.readOptionValueOrDefault(DatabaseServer.OPTION_MASTERLOGIN_PASSWORD);
           
View Full Code Here

  private void createWGAServicesSOAPFilter(WGACore core) {
     
        try {
            // Determine the protocol implementation to use
            String implClass = core.getWgaConfiguration().getWebServiceProtocolImplementation();
            ModuleDefinition protocolDefinition = null;
            if (implClass != null) {
                protocolDefinition = core.getModuleRegistry().getModuleDefinition(WGAServicesSoapProtocolModuleType.class, implClass);
                if (protocolDefinition == null) {
                    core.getLog().error("Unable to use WGAServices protocol implementation " + implClass + " because it is not registered");
                }
            }
           
            // If not configured or configured not found, try to take the "first best"
            if (protocolDefinition == null) {
                Iterator<ModuleDefinition> impls = core.getModuleRegistry().getModulesForType(WGAServicesSoapProtocolModuleType.class).values().iterator();
                if (impls.hasNext()) {
                    protocolDefinition = impls.next();
                }
            }
           
            // Create and init the filter (which we do anyway, even if there are no protocol implementation)
            FilterMapping filterMapping = new FilterMapping();
            filterMapping.setName("WGAServices SOAP Request Filter");
            filterMapping.setEnabled(true);
            filterMapping.setImplClassName(WGAServicesSOAPFilter.class.getName());
           
            List<String> patterns = new ArrayList<String>();
            patterns.add("/services/*");
            patterns.add("//services/*");
            filterMapping.setUrlPatterns(patterns);
           
            Map<String, String> parameters = new HashMap<String, String>();
           
            // If we have a definition we pass on the servlet class to the filter, otherwise we used the "SOAP disabled" servlet
            if (protocolDefinition != null) {
                parameters.put(WGAServicesSOAPFilter.PARAM_PROTOCOL_SERVLET, protocolDefinition.getImplementationClass().getName());
            }
            else {
                parameters.put(WGAServicesSOAPFilter.PARAM_PROTOCOL_SERVLET, WGAServicesSOAPDisabledServlet.class.getName());
            }
           
           
            filterMapping.setInitParameters(parameters);
           
            WGAServicesSOAPFilter filter = new WGAServicesSOAPFilter();
            WGAFilterConfig filterConfig = WGAFilterConfig.createFromMapping(filterMapping);
            filterConfig.setServletContext(core.getServletContext());
            filter.init(filterConfig);
            _filters.add(filter);
            _filterToURLPatterns.put(filter, filterMapping.getUrlPatterns());
           
            if (protocolDefinition != null) {
                core.getLog().info("WGAServices enabled using protocol implementation " + protocolDefinition.getTitle(Locale.getDefault()));
            }
            else {
                core.getLog().info("No WGAServices SOAP protocol implementation available. SOAP Web Service is disabled.");
            }
        }
View Full Code Here

       
    }

    public String getValueTitle(String value, Locale locale) {
       
        ModuleDefinition def = _reg.getModuleDefinitionByKey(PasswordEncodingType.class, value);
        if (def != null) {
            return def.getTitle(locale);
        }
        return value;
       
    }
View Full Code Here

    }
   
    public String getTitle(Locale locale) {
       
        ModuleRegistry reg = job.getScheduler().getCore().getModuleRegistry();
        ModuleDefinition def = reg.getModuleDefinition(SchedulerTaskModuleType.class, getClass().getName());
        if (def == null) {
            return "Task " + getClass().getName();
        }
       
        SchedulerTaskProperties props = (SchedulerTaskProperties) def.getProperties();
        if (props == null || definition == null) {
            return def.getTitle(locale);
        }
       
        return props.createTitle(definition, locale);
       
    }
View Full Code Here

                        info.setUid(server.getUid());
                        info.setTitle(server.getTitle(Locale.ENGLISH));
                        infos.add(info);
                       
                        while (csTypes.hasNext()) {
                            ModuleDefinition csType = csTypes.next();                       
                            if (server.isDatabaseTypeCreatable((Class<? extends WGDatabaseCore>)csType.getImplementationClass())) {
                                info.getCreateableContentStoreImplemenations().add(csType.getImplementationClass().getName());                           
                            }
                        }
                    }                   
                }
            }
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.modules.ModuleDefinition

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.