Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1379

Moved ServletMap out of index.php into config

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-RC2
    • Component/s: PHP
    • Labels:
      None

      Description

      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;

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bhofmann Bastian Hofmann
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: