Beispiel #1
0
 def __init__(self, context_config_files):
     """ """
     self.logger = logging.getLogger("seminode.core.runtime.wsgi.WSGIRuntime")
     context_config = []
     if not isinstance(context_config_files, list):
         context_config_files = [context_config_files]
     for cfg in context_config_files:
         file_ext = path.splitext(cfg)[1]
         file_ext = file_ext.strip(".")
         self.logger.debug(file_ext)
         reader = self.config_reader_map.get(file_ext, None)
         if not reader:
             raise SeminodeConfigurationError("No reader found for: %s" % cfg)
         context_config.append(reader(cfg))
     application_context = ApplicationContext(context_config)
     SecurityContextHolder.setStrategy(SecurityContextHolder.MODE_THREADLOCAL)
     SecurityContextHolder.getContext()
     self.wsgi_app = application_context.get_object("filterchain.proxy")
    # while executing the sample application.

    logger = logging.getLogger("springpython")
    loggingLevel = logging.DEBUG
    logger.setLevel(loggingLevel)
    ch = logging.StreamHandler()
    ch.setLevel(loggingLevel)
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    ch.setFormatter(formatter)
    logger.addHandler(ch)

    applicationContext = ApplicationContext(noxml.PetClinicClientOnly())
    applicationContext.get_object("filterChainProxy")

    SecurityContextHolder.setStrategy(SecurityContextHolder.MODE_GLOBAL)
    SecurityContextHolder.getContext()

    conf = {
        '/': {
            "tools.staticdir.root": os.getcwd(),
            "tools.sessions.on": True,
            "tools.filterChainProxy.on": True
        },
        "/images": {
            "tools.staticdir.on": True,
            "tools.staticdir.dir": "images"
        },
        "/html": {
            "tools.staticdir.on": True,
            "tools.staticdir.dir": "html"
Beispiel #3
0
    logger = logging.getLogger("springpython")
    loggingLevel = logging.DEBUG
    logger.setLevel(loggingLevel)
    ch = logging.StreamHandler()
    ch.setLevel(loggingLevel)
    formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") 
    ch.setFormatter(formatter)
    logger.addHandler(ch)
    
    # This sample loads the IoC container from an XML file. The XML-based application context
    # automatically resolves all dependencies and order of instantiation for you. 

    applicationContext = ApplicationContext(XMLConfig(config_location = "applicationContext.xml"))
    applicationContext.get_object("filterChainProxy")

    SecurityContextHolder.setStrategy(SecurityContextHolder.MODE_GLOBAL)
    SecurityContextHolder.getContext()
    
    conf = {'/': 	{"tools.staticdir.root": os.getcwd(),
                         "tools.sessions.on": True,
                         "tools.filterChainProxy.on": True},
            "/images": 	{"tools.staticdir.on": True,
                         "tools.staticdir.dir": "images"},
            "/html": 	{"tools.staticdir.on": True,
                      	 "tools.staticdir.dir": "html"}
            }

    form = applicationContext.get_object(name = "root")
    form.filter = applicationContext.get_object(name = "authenticationProcessingFilter")
    form.hashedUserDetailsServiceList = [applicationContext.get_object(name = "md5UserDetailsService"),
                                         applicationContext.get_object(name = "shaUserDetailsService")]