From b5c09ced2f84a18afc11871904bd5706ae0ec3c2 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 26 Dec 2005 00:32:02 +0000 Subject: --- .../protected/pages/chap2/Configurations.page | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 demos/quickstart/protected/pages/chap2/Configurations.page (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/chap2/Configurations.page b/demos/quickstart/protected/pages/chap2/Configurations.page new file mode 100644 index 00000000..75a3d0aa --- /dev/null +++ b/demos/quickstart/protected/pages/chap2/Configurations.page @@ -0,0 +1,82 @@ + +

Configurations

+

+PRADO uses configurations to glue together components into pages and applications. There are application configurations, page folder configurations, and templates. Application and page folder configurations are optional if default values are used. Templates are mainly used by pages and template controls. They are optional, too. +

+

+In this section, we focus on the application and page folder configurations. Templates are detailed in the next few sections. +

+ + +

Application Configurations

+

+Application configurations are used to specify the global behavior of an application. This consists of specifying the paths, modules, services and parameters that will be used in an application. +

+

+Application configurations are stored in an XML file which is passed as a parameter to the TApplication instance. The format of application configurations is shown in the following, +

+<application PropertyName="PropertyValue" ...>
+  <paths>
+    <alias id="AliasID" path="AliasPath" />
+    <using namespace="Namespace" />
+  </paths>
+  <modules>
+    <module id="ModuleID" class="ModuleClass"  PropertyName="PropertyValue" ... />
+  </modules>
+  <services>
+    <service id="ServiceID" class="ServiceClass" PropertyName="PropertyValue" ... />
+  </services>
+  <parameters>
+    <parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... />
+  </parameters>
+</application>
+
+ +By default without explicit configuration, a PRADO application when running will load a few core modules, such as THttpRequest, THttpResponse, etc. It will also provide the TPageService as a default service. Configuration and usage of these modules and services are covered in individual sections of this tutorial. Note, if your application takes default settings for these modules and service, you do not need to provide an application configuration. However, if these modules or services are not sufficient, or you want to change their behavior by configuring their property values, you will need an application configuration. +

+ +
+

Page Folder Configurations

+

+Page folder configurations are mainly used by TPageService to modify or append the application configuration. As the name indicates, a page folder configuration is associated with a directory storing some page files. It is stored as an XML file named config.xml. +

+

+When a user requests a page stored under <BasePath>/dir1/dir2, the TPageService will try to parse and load config.xml files under <BasePath>/dir1 and <BasePath>/dir1/dir2. Paths, modules, and parameters specified in these configuration files will be appended or merged into the existing application configuration. +

+

+The format of a page folder configuration file is as follows, +

+<configuration>
+  <paths>
+    <alias id="AliasID" path="AliasPath" />
+    <using namespace="Namespace" />
+  </paths>
+  <modules>
+    <module id="ModuleID" class="ModuleClass"  PropertyName="PropertyValue" ... />
+  </modules>
+  <authorization>
+    <allow pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="post" />
+    <deny pages="PageID1,PageID2" users="User1,User2" roles="Role1,Role2" verb="post" />
+  </authorization>
+  <pages PropertyName="PropertyValue" ...>
+    <page id="PageID" PropertyName="PropertyValue" ... />
+  </pages>
+  <parameters>
+    <parameter id="ParameterID" class="ParameterClass" PropertyName="PropertyValue" ... />
+  </parameters>
+</configuration>
+
+The <paths>, <modules> and <parameters> are similar to those in an application configuration. The <authorization> specifies the authorization rules that apply to the current page directory and all its subdirectories. It will be explained in more detail in future sections. The <pages> element specifies the initial values for the properties of pages. Each <page> element specifies the initial property values for a particular page identified by the id<pages> element apply to all pages in the current directory and all its subdirectories. +

+ +
\ No newline at end of file -- cgit v1.2.3