| 1 |
lars |
1 |
<com:TContent ID="body" >
|
|
|
2 |
|
|
|
3 |
<h1 id="1901">Page Configurations</h1>
|
|
|
4 |
<p id="220217" class="block-content">
|
|
|
5 |
Page configurations are mainly used by <tt>TPageService</tt> to modify or append the application configuration. As the name indicates, a page configuration is associated with a directory storing some page files. It is stored as an XML file named <tt>config.xml</tt>.
|
|
|
6 |
</p>
|
|
|
7 |
<p id="220218" class="block-content">
|
|
|
8 |
When a user requests a page stored under <tt><BasePath>/dir1/dir2</tt>, the <tt>TPageService</tt> will try to parse and load <tt>config.xml</tt> files under <tt><BasePath></tt>, <tt><BasePath>/dir1</tt> and <tt><BasePath>/dir1/dir2</tt>. Paths, modules, and parameters specified in these configuration files will be appended or merged into the existing application configuration. Here <tt><BasePath></tt> is as defined in <a href="?page=Fundamentals.Services">page service</a>.
|
|
|
9 |
</p>
|
|
|
10 |
<p id="220219" class="block-content">
|
|
|
11 |
The format of a page configuration file is as follows,
|
|
|
12 |
</p>
|
|
|
13 |
<com:TTextHighlighter Language="xml" CssClass="source block-content" id="code_220097">
|
|
|
14 |
<configuration>
|
|
|
15 |
<paths>
|
|
|
16 |
<alias id="AliasID" path="AliasPath" />
|
|
|
17 |
<using namespace="Namespace" />
|
|
|
18 |
</paths>
|
|
|
19 |
<modules>
|
|
|
20 |
<module id="ModuleID" class="ModuleClass" PropertyName="PropertyValue" ... />
|
|
|
21 |
</modules>
|
|
|
22 |
<parameters>
|
|
|
23 |
<parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... />
|
|
|
24 |
</parameters>
|
|
|
25 |
<include file="path.to.extconfig" when="PHP expression" />
|
|
|
26 |
<authorization>
|
|
|
27 |
<allow pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="get" />
|
|
|
28 |
<deny pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="post" />
|
|
|
29 |
</authorization>
|
|
|
30 |
<pages PropertyName="PropertyValue" ...>
|
|
|
31 |
<page id="PageID" PropertyName="PropertyValue" ... />
|
|
|
32 |
</pages>
|
|
|
33 |
</configuration>
|
|
|
34 |
</com:TTextHighlighter>
|
|
|
35 |
<p id="220220" class="block-content">
|
|
|
36 |
The <tt><paths></tt>, <tt><modules></tt>, <tt><parameters></tt> and <tt><include></tt> are similar to those in an application configuration. The <tt><authorization></tt> element specifies the authorization rules that apply to the current page directory and all its subdirectories. For more details, see <a href="?page=Advanced.Auth">authentication and authorization</a> section. The <tt><pages></tt> element specifies the initial values for the properties of pages. Each <tt><page></tt> element specifies the initial property values for a particular page identified by the <tt>id</tt> attribute. Initial property values given in the <tt><pages></tt> element apply to all pages in the current directory and all its subdirectories.
|
|
|
37 |
</p>
|
|
|
38 |
<p id="220221" class="block-content">
|
|
|
39 |
Complete specification of page configurations can be found in the <a href="<%~../../../../../docs/specs/config.dtd%>">DTD</a> and <a href="<%~../../../../../docs/specs/config.xsd%>">XSD</a> files.
|
|
|
40 |
</p>
|
|
|
41 |
|
|
|
42 |
<com:SinceVersion Version="3.1.1" />
|
|
|
43 |
<p class="block-content">
|
|
|
44 |
Since version 3.1.1, the <tt>id</tt> attribute in the <page> element can be a relative page path pointing to a page in the subdirectory of the directory containing the page configuration. For example, <tt>id="admin.Home"</tt> refers to the <tt>Home</tt> page under the <tt>admin</tt> directory. The <tt>id</tt> attribute can also contain wildcard '*' to match all pages under the specified directory. For example, <tt>id="admin.*"</tt> refers to all pages under the <tt>admin</tt> directory and its subdirectories. This enhancement allows developers to centralize their page configurations (e.g. put all page initializations in the aplication configuration or the root page configuration.)
|
|
|
45 |
</p>
|
|
|
46 |
|
|
|
47 |
<div class="last-modified">$Id: PageConfig.page 2214 2007-09-11 13:01:29Z xue $</div></com:TContent>
|