You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Bastian Hofmann (JIRA)" <ji...@apache.org> on 2010/07/10 15:44:51 UTC

[jira] Updated: (SHINDIG-1379) Moved ServletMap out of index.php into config

     [ https://issues.apache.org/jira/browse/SHINDIG-1379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bastian Hofmann updated SHINDIG-1379:
-------------------------------------

    Summary: Moved ServletMap out of index.php into config  (was: Moved ServletMap out of index.php unit config)

> Moved ServletMap out of index.php into config
> ---------------------------------------------
>
>                 Key: SHINDIG-1379
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1379
>             Project: Shindig
>          Issue Type: Improvement
>          Components: PHP
>            Reporter: Bastian Hofmann
>
> Index: php/config/container.php
> ===================================================================
> --- php/config/container.php    (Revision 962830)
> +++ php/config/container.php    (Arbeitskopie)
> @@ -77,6 +77,23 @@
>    'default_js_prefix' => '/gadgets/js/',
>    'default_iframe_prefix' => '/gadgets/ifr?',
>  
> +  'servlet_map' => array(
> +    '/container' => 'FilesServlet',
> +    '/samplecontainer' => 'FilesServlet',
> +    '/gadgets/js' => 'JsServlet',
> +    '/gadgets/proxy' => 'ProxyServlet',
> +    '/gadgets/makeRequest' => 'MakeRequestServlet',
> +    '/gadgets/ifr' => 'GadgetRenderingServlet',
> +    '/gadgets/metadata' => 'MetadataServlet',
> +    '/gadgets/oauthcallback' => 'OAuthCallbackServlet',
> +    '/gadgets/api/rpc' => 'JsonRpcServlet',
> +    '/gadgets/api/rest' => 'DataServiceServlet',
> +    '/social/rest' => 'DataServiceServlet',
> +    '/rpc' => 'JsonRpcServlet',
> +    '/public.crt' => 'CertServlet',
> +    '/public.cer' => 'CertServlet',
> +  ),
> +
>    // The X-XRDS-Location value for your implementing container, see http://code.google.com/p/partuza/source/browse/trunk/Library/XRDS.php for an example
>    'xrds_location' => '',
>  
> Index: php/index.php
> ===================================================================
> --- php/index.php       (Revision 962830)
> +++ php/index.php       (Arbeitskopie)
> @@ -76,20 +76,13 @@
>    }
>  }
>  
> -$servletMap = array(Config::get('web_prefix') . '/container' => 'FilesServlet', 
> -    Config::get('web_prefix') . '/samplecontainer' => 'FilesServlet', 
> -    Config::get('web_prefix') . '/gadgets/js' => 'JsServlet', 
> -    Config::get('web_prefix') . '/gadgets/proxy' => 'ProxyServlet', 
> -    Config::get('web_prefix') . '/gadgets/makeRequest' => 'MakeRequestServlet', 
> -    Config::get('web_prefix') . '/gadgets/ifr' => 'GadgetRenderingServlet', 
> -    Config::get('web_prefix') . '/gadgets/metadata' => 'MetadataServlet', 
> -    Config::get('web_prefix') . '/gadgets/oauthcallback' => 'OAuthCallbackServlet', 
> -    Config::get('web_prefix') . '/gadgets/api/rpc' => 'JsonRpcServlet', 
> -    Config::get('web_prefix') . '/gadgets/api/rest' => 'DataServiceServlet', 
> -    Config::get('web_prefix') . '/social/rest' => 'DataServiceServlet', 
> -    Config::get('web_prefix') . '/rpc' => 'JsonRpcServlet', 
> -    Config::get('web_prefix') . '/public.crt' => 'CertServlet', 
> -    Config::get('web_prefix') . '/public.cer' => 'CertServlet');
> +//get servlet map and prefix the servlet paths
> +$configServletMap = Config::get('servlet_map');
> +$webPrefix   = Config::get('web_prefix');
> +$servletMap  = array();
> +foreach ($configServletMap as $path => $servlet) {
> +    $servletMap[$webPrefix . $path] = $servlet;
> +}
>  
>  // Try to match the request url to our servlet mapping
>  $servlet = false;
> @@ -98,7 +91,7 @@
>    if (substr($uri, 0, strlen($url)) == $url) {
>      //FIXME temporary hack to support both /proxy and /makeRequest with the same event handler
>      // /makeRequest == /proxy?output=js
> -    if ($url == Config::get('web_prefix') . '/gadgets/makeRequest') {
> +    if ($url == $webPrefix . '/gadgets/makeRequest') {
>        $_GET['output'] = 'js';
>      }
>      $servlet = $class;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.