Show
Ignore:
Timestamp:
02/04/07 00:36:48 (2 years ago)
Author:
david
Message:

finally: caching. one config file per action, definitions can be specific to one or more request-method, each definition can contain settings specific to one or more output types, groups (like in smarty, multiple sources like string, locale, request param etc), cache TTL ('2 days 4 hours'), caching can be controlled on a per layer level, slots can be included in the cache, action attribs, template vars and request attribs (yes, with namespace) can be restored, restrictable to certain views, closes #78. also did some minor fixes here and there, added slots to sample app.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/src/config/xsd/caching.xsd

    r908 r1635  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> 
     3 
     4  <xs:include schemaLocation="default_tags.xsd"/>   
     5 
    36  <xs:element name="configurations" type="configurations" /> 
    47  <xs:complexType name="configurations"> 
    58    <xs:sequence> 
     9      <xs:element name="sandbox" type="sandbox" minOccurs="0" /> 
    610      <xs:element name="configuration" minOccurs="0" maxOccurs="unbounded"> 
    711        <xs:complexType> 
    812          <xs:sequence> 
    9             <xs:element name="cachings" type="cachings" /> 
     13            <xs:group ref="cachings" /> 
    1014          </xs:sequence> 
    1115          <xs:attribute name="environment" type="xs:string" /> 
     
    1620    <xs:attribute name="parent" type="xs:string" /> 
    1721  </xs:complexType> 
     22 
     23  <xs:group name="cachings"> 
     24    <xs:choice> 
     25      <xs:element name="cachings" type="cachings" minOccurs="0" /> 
     26      <xs:element name="caching" type="caching" minOccurs="0" maxOccurs="unbounded"/> 
     27    </xs:choice> 
     28  </xs:group> 
    1829  <xs:complexType name="cachings"> 
    1930    <xs:sequence> 
     
    2233  </xs:complexType> 
    2334  <xs:complexType name="caching"> 
     35    <xs:sequence maxOccurs="unbounded"> 
     36      <xs:group ref="groups" /> 
     37      <xs:group ref="views" /> 
     38      <xs:group ref="action_attributes" /> 
     39      <xs:group ref="output_types" /> 
     40    </xs:sequence> 
     41    <xs:attribute name="method" type="php_label" /> 
     42    <xs:attribute name="enabled" type="xs:boolean" /> 
     43    <xs:attribute name="lifetime" type="xs:string" /> 
     44  </xs:complexType> 
     45   
     46  <xs:group name="groups"> 
     47    <xs:choice> 
     48      <xs:element name="groups" type="groups" minOccurs="0" /> 
     49      <xs:element name="group" type="group" minOccurs="0" maxOccurs="unbounded"/> 
     50    </xs:choice> 
     51  </xs:group> 
     52  <xs:complexType name="groups"> 
    2453    <xs:sequence> 
    25       <xs:element name="groups"> 
    26         <xs:complexType> 
    27           <xs:sequence> 
    28             <xs:element name="group" maxOccurs="unbounded"> 
    29               <xs:complexType> 
    30                 <xs:sequence> 
    31                 </xs:sequence> 
    32                 <xs:attribute name="name" type="xs:string" use="required" /> 
    33                 <xs:attribute name="source" type="xs:string" /> 
    34               </xs:complexType> 
    35             </xs:element> 
    36           </xs:sequence> 
    37         </xs:complexType> 
    38       </xs:element> 
    39       <xs:element name="decorator"> 
    40         <xs:complexType> 
    41           <xs:sequence> 
    42             <xs:element name="slots"> 
    43               <xs:complexType> 
    44                 <xs:sequence> 
    45                   <xs:element name="slot" type="xs:string" maxOccurs="unbounded" /> 
    46                 </xs:sequence> 
    47               </xs:complexType> 
    48             </xs:element> 
    49             <xs:element name="variables"> 
    50               <xs:complexType> 
    51                 <xs:sequence> 
    52                   <xs:element name="variable" type="xs:string" maxOccurs="unbounded" /> 
    53                 </xs:sequence> 
    54               </xs:complexType> 
    55             </xs:element> 
    56           </xs:sequence> 
    57           <xs:attribute name="include" type="xs:string" /> 
    58         </xs:complexType> 
    59       </xs:element> 
    60       <xs:element name="views"> 
    61         <xs:complexType> 
    62           <xs:sequence> 
    63             <xs:element name="whitelists"> 
    64               <xs:complexType> 
    65                 <xs:sequence> 
    66                   <xs:element name="whitelist" type="xs:string" maxOccurs="unbounded" /> 
    67                 </xs:sequence> 
    68               </xs:complexType> 
    69             </xs:element> 
    70           </xs:sequence> 
    71         </xs:complexType> 
    72       </xs:element> 
    73       <xs:element name="variables"> 
    74         <xs:complexType> 
    75           <xs:sequence> 
    76             <xs:element name="variable" maxOccurs="unbounded"> 
    77               <xs:complexType> 
    78                 <xs:sequence> 
    79                 </xs:sequence> 
    80                 <xs:attribute name="source" type="xs:string" /> 
    81                 <xs:attribute name="name" type="xs:string" /> 
    82               </xs:complexType> 
    83             </xs:element> 
    84           </xs:sequence> 
    85         </xs:complexType> 
    86       </xs:element> 
     54      <xs:element name="group" type="group" maxOccurs="unbounded" /> 
     55    </xs:sequence> 
     56  </xs:complexType> 
     57  <xs:complexType name="group"> 
     58    <xs:simpleContent> 
     59      <xs:extension base="xs:string"> 
     60        <xs:attribute name="source" type="xs:string" /> 
     61        <xs:attribute name="namespace" type="xs:string" /> 
     62      </xs:extension> 
     63    </xs:simpleContent> 
     64  </xs:complexType> 
     65 
     66  <xs:group name="action_attributes"> 
     67    <xs:choice> 
     68      <xs:element name="action_attributes" type="action_attributes" minOccurs="0" /> 
     69      <xs:element name="action_attribute" type="action_attribute" minOccurs="0" maxOccurs="unbounded"/> 
     70    </xs:choice> 
     71  </xs:group> 
     72  <xs:complexType name="action_attributes"> 
     73    <xs:sequence> 
     74      <xs:element name="action_attribute" type="action_attribute" minOccurs="0" maxOccurs="unbounded" /> 
     75    </xs:sequence> 
     76  </xs:complexType> 
     77  <xs:complexType name="action_attribute"> 
     78    <xs:sequence> 
     79      <xs:element name="action_attribute" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 
     80    </xs:sequence> 
     81  </xs:complexType> 
     82 
     83  <xs:group name="views"> 
     84    <xs:choice> 
     85      <xs:element name="views" type="views" minOccurs="0" /> 
     86      <xs:element name="view" type="view" minOccurs="0" maxOccurs="unbounded"/> 
     87    </xs:choice> 
     88  </xs:group> 
     89  <xs:complexType name="views"> 
     90    <xs:sequence> 
     91      <xs:element name="view" type="view" minOccurs="0" maxOccurs="unbounded" /> 
     92    </xs:sequence> 
     93  </xs:complexType> 
     94  <xs:complexType name="view"> 
     95    <xs:simpleContent> 
     96      <xs:extension base="xs:string"> 
     97        <xs:attribute name="module" type="php_label" /> 
     98      </xs:extension> 
     99    </xs:simpleContent> 
     100  </xs:complexType> 
     101 
     102  <xs:group name="output_types"> 
     103    <xs:choice> 
     104      <xs:element name="output_types" type="output_types" minOccurs="0" /> 
     105      <xs:element name="output_type" type="output_type" minOccurs="0" maxOccurs="unbounded"/> 
     106    </xs:choice> 
     107  </xs:group> 
     108  <xs:complexType name="output_types"> 
     109    <xs:sequence> 
     110      <xs:element name="output_type" type="output_type" maxOccurs="unbounded" /> 
     111    </xs:sequence> 
     112  </xs:complexType> 
     113  <xs:complexType name="output_type"> 
     114    <xs:sequence maxOccurs="unbounded"> 
     115      <xs:group ref="request_attributes" /> 
     116      <xs:group ref="template_variables" /> 
     117      <xs:group ref="layers" /> 
     118    </xs:sequence> 
     119    <xs:attribute name="name" type="php_label" /> 
     120  </xs:complexType> 
     121 
     122  <xs:group name="request_attributes"> 
     123    <xs:choice> 
     124      <xs:element name="request_attributes" type="request_attributes" minOccurs="0" /> 
     125      <xs:element name="request_attribute" type="request_attribute" minOccurs="0" maxOccurs="unbounded"/> 
     126    </xs:choice> 
     127  </xs:group> 
     128  <xs:complexType name="request_attributes"> 
     129    <xs:sequence> 
     130      <xs:element name="request_attribute" type="request_attribute" maxOccurs="unbounded" /> 
     131    </xs:sequence> 
     132  </xs:complexType> 
     133  <xs:complexType name="request_attribute"> 
     134    <xs:simpleContent> 
     135      <xs:extension base="xs:string"> 
     136        <xs:attribute name="namespace" type="xs:string" /> 
     137      </xs:extension> 
     138    </xs:simpleContent> 
     139  </xs:complexType> 
     140 
     141  <xs:group name="template_variables"> 
     142    <xs:choice> 
     143      <xs:element name="template_variables" type="template_variables" minOccurs="0" /> 
     144      <xs:element name="template_variable" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> 
     145    </xs:choice> 
     146  </xs:group> 
     147  <xs:complexType name="template_variables"> 
     148    <xs:sequence> 
     149      <xs:element name="template_variable" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 
     150    </xs:sequence> 
     151  </xs:complexType> 
     152 
     153  <xs:group name="layers"> 
     154    <xs:choice> 
     155      <xs:element name="layers" type="layers" minOccurs="0" /> 
     156      <xs:element name="layer" type="layer" minOccurs="0" maxOccurs="unbounded"/> 
     157    </xs:choice> 
     158  </xs:group> 
     159  <xs:complexType name="layers"> 
     160    <xs:sequence> 
     161      <xs:element name="layer" type="layer" maxOccurs="unbounded" /> 
     162    </xs:sequence> 
     163  </xs:complexType> 
     164  <xs:complexType name="layer"> 
     165    <xs:sequence maxOccurs="unbounded"> 
     166      <xs:group ref="slots" /> 
    87167    </xs:sequence> 
    88168    <xs:attribute name="name" type="xs:string" use="required" /> 
    89     <xs:attribute name="enabled" type="xs:string" /> 
     169    <xs:attribute name="include" type="xs:string" /> 
    90170  </xs:complexType> 
     171 
     172  <xs:group name="slots"> 
     173    <xs:choice> 
     174      <xs:element name="slots" type="slots" minOccurs="0" /> 
     175      <xs:element name="slot" type="xs:string" minOccurs="0" maxOccurs="unbounded"/> 
     176    </xs:choice> 
     177  </xs:group> 
     178  <xs:complexType name="slots"> 
     179    <xs:sequence> 
     180      <xs:element name="slot" type="xs:string" minOccurs="0" maxOccurs="unbounded" /> 
     181    </xs:sequence> 
     182  </xs:complexType> 
     183 
    91184</xs:schema>