]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 605693: Make config.cgi?ctype=rdf faster
authorFrédéric Buclin <LpSolit@gmail.com>
Wed, 20 Oct 2010 12:09:02 +0000 (14:09 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Wed, 20 Oct 2010 12:09:02 +0000 (14:09 +0200)
r=timello a=LpSolit

template/en/default/config.rdf.tmpl
template/en/default/filterexceptions.pl

index ec80f7601063f1b78a1ea0d0999e372dbb7cbede..dd4065bdbd3c07e0513e0a31c4d949fe2dce03ca 100644 (file)
   #                 Frédéric Buclin <LpSolit@gmail.com>
   #%]
 
+[%# The url to the installation is going to be displayed many times.
+  # So we cache it here for better performance.
+ %]
+[% escaped_urlbase = BLOCK %][% urlbase FILTER xml %][% END %]
 <?xml version="1.0"[% IF Param('utf8') %] encoding="UTF-8"[% END %]?>
 <!-- Note: this interface is experimental and under development.
    - We may and probably will make breaking changes to it in the future. -->
@@ -27,7 +31,7 @@
      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:bz="http://www.bugzilla.org/rdf#">
 
-<bz:installation rdf:about="[% urlbase FILTER xml %]">
+<bz:installation rdf:about="[% escaped_urlbase %]">
   <bz:install_version>[% constants.BUGZILLA_VERSION FILTER html %]</bz:install_version>
   <bz:maintainer>[% Param('maintainer') FILTER html %]</bz:maintainer>
 
     <Seq>
       [% FOREACH product = products %]
         <li>
-          <bz:product rdf:about="[% urlbase FILTER xml %]product.cgi?name=[% product.name FILTER url_quote %]">
+          <bz:product rdf:about="[% escaped_urlbase %]product.cgi?name=[% product.name FILTER url_quote %]">
             <bz:name>[% product.name FILTER html %]</bz:name>
 
             <bz:components>
               <Seq>
                 [% FOREACH component = product.components %]
-                  <li resource="[% urlbase FILTER xml %]component.cgi?name=[% component.name FILTER url_quote 
+                  <li resource="[% escaped_urlbase %]component.cgi?name=[% component.name FILTER url_quote
                       %]&amp;product=[% product.name FILTER url_quote %]"/>
                 [% END %]
               </Seq>
             <bz:versions>
               <Seq>
                 [% FOREACH version = product.versions %]
-                  <li resource="[% urlbase FILTER xml %]version.cgi?name=[% version.name FILTER url_quote %]"/>
+                  <li resource="[% escaped_urlbase %]version.cgi?name=[% version.name FILTER url_quote %]"/>
                 [% END %]
               </Seq>
             </bz:versions>
               <bz:target_milestones>
                 <Seq>
                   [% FOREACH milestone = product.milestones %]
-                    <li resource="[% urlbase FILTER xml %]milestone.cgi?name=[% milestone.name FILTER url_quote %]"/>
+                    <li resource="[% escaped_urlbase %]milestone.cgi?name=[% milestone.name FILTER url_quote %]"/>
                   [% END %]
                 </Seq>
               </bz:target_milestones>
       [% FOREACH product = products %]
         [% FOREACH component = product.components %]
           <li>
-            <bz:component rdf:about="[% urlbase FILTER xml %]component.cgi?name=[% component.name FILTER url_quote 
+            <bz:component rdf:about="[% escaped_urlbase %]component.cgi?name=[% component.name FILTER url_quote
                           %]&amp;product=[% product.name FILTER url_quote %]">
               <bz:name>[% component.name FILTER html %]</bz:name>
               [% IF show_flags %]
                     [% FOREACH flag_type = flag_types %]
                       [% NEXT UNLESS flag_type.is_active %]
                       [% all_visible_flag_types.${flag_type.id} = flag_type %]
-                      <li resource="[% urlbase FILTER xml %]flag.cgi?id=[% flag_type.id FILTER url_quote
+                      <li resource="[% escaped_urlbase %]flag.cgi?id=[% flag_type.id FILTER url_quote
                           %]&amp;name=[% flag_type.name FILTER url_quote %]" />
                     [% END %]
                   </Seq>
       [% FOREACH product = products %]
         [% FOREACH version = product.versions %]
           <li>
-            <bz:version rdf:about="[% urlbase FILTER xml %]version.cgi?name=[% version.name FILTER url_quote %]">
+            <bz:version rdf:about="[% escaped_urlbase %]version.cgi?name=[% version.name FILTER url_quote %]">
               <bz:name>[% version.name FILTER html %]</bz:name>
             </bz:version>
           </li>
         [% FOREACH product = products %]
           [% FOREACH milestone = product.milestones %]
             <li>
-              <bz:target_milestone rdf:about="[% urlbase FILTER xml %]milestone.cgi?name=[% milestone.name FILTER url_quote %]">
+              <bz:target_milestone rdf:about="[% escaped_urlbase %]milestone.cgi?name=[% milestone.name FILTER url_quote %]">
                 <bz:name>[% milestone.name FILTER html %]</bz:name>
               </bz:target_milestone>
             </li>
       <Seq>
         [% FOREACH flag_type = all_visible_flag_types.values.sort('name') %]
           <li>
-            <bz:flag_type rdf:about="[% urlbase FILTER xml %]flag.cgi?id=[% flag_type.id FILTER url_quote
+            <bz:flag_type rdf:about="[% escaped_urlbase %]flag.cgi?id=[% flag_type.id FILTER url_quote
                           %]&amp;name=[% flag_type.name FILTER url_quote %]">
               <bz:id>[% flag_type.id FILTER html %]</bz:id>
               <bz:name>[% flag_type.name FILTER html %]</bz:name>
       [% PROCESS "global/field-descs.none.tmpl" %]
       [% FOREACH item = field %]
         <li>
-          <bz:field rdf:about="[% urlbase FILTER xml %]field.cgi?name=[% item.name FILTER url_quote %]">
+          <bz:field rdf:about="[% escaped_urlbase %]field.cgi?name=[% item.name FILTER url_quote %]">
             <bz:name>[% item.name FILTER html %]</bz:name>
             <bz:description>[% (field_descs.${item.name} OR item.description) FILTER html %]</bz:description>
             [%-# These values are meaningful for custom fields only. %]
index 2c096df73a5d4d197388e745633bac4181d63239..cc4d09d3e5a6071e49d08e45b9039ea9eb703d03 100644 (file)
   'group.id',
 ],
 
+'config.rdf.tmpl' => [
+  'escaped_urlbase',
+],
+
 );