summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-02-21 19:32:36 +0000
committerxue <>2006-02-21 19:32:36 +0000
commit2f29591dc5a20086ad2c0e4e3689f7c0b9ab7b02 (patch)
tree6c5310695c2cc8dd47c4b7d6a36e68649d732c10
parentbc8fcfba51fd93330d3c1855d7f948c53c8a1968 (diff)
Added DTD and XSD for app and page configurations.
-rw-r--r--.gitattributes4
-rw-r--r--demos/quickstart/protected/pages/Configurations/AppConfig.page3
-rw-r--r--demos/quickstart/protected/pages/Configurations/PageConfig.page5
-rw-r--r--framework/Specs/ApplicationConfiguration.dtd40
-rw-r--r--framework/Specs/ApplicationConfiguration.xsd200
-rw-r--r--framework/Specs/PageConfiguration.dtd54
-rw-r--r--framework/Specs/PageConfiguration.xsd143
7 files changed, 449 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
index 9f3c92e4..338130f2 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -584,6 +584,10 @@ framework/Security/TAuthorizationRule.php -text
framework/Security/TMembershipManager.php -text
framework/Security/TSecurityManager.php -text
framework/Security/TUserManager.php -text
+framework/Specs/ApplicationConfiguration.dtd -text
+framework/Specs/ApplicationConfiguration.xsd -text
+framework/Specs/PageConfiguration.dtd -text
+framework/Specs/PageConfiguration.xsd -text
framework/TApplication.php -text
framework/TApplicationComponent.php -text
framework/TComponent.php -text
diff --git a/demos/quickstart/protected/pages/Configurations/AppConfig.page b/demos/quickstart/protected/pages/Configurations/AppConfig.page
index 8d998f85..f72ab876 100644
--- a/demos/quickstart/protected/pages/Configurations/AppConfig.page
+++ b/demos/quickstart/protected/pages/Configurations/AppConfig.page
@@ -37,6 +37,9 @@ Note, if the <tt>value</tt> attribute is not specified, the whole parameter XML
</li>
</ul>
<p>
+Complete specification of application configurations can be found in the <a href="<%~../../../../../framework/Specs/ApplicationConfiguration.dtd%>">DTD</a> and <a href="<%~../../../../../framework/Specs/ApplicationConfiguration.xsd%>">XSD</a> files.
+</p>
+<p>
By default without explicit configuration, a PRADO application when running will load a few core modules, such as <tt>THttpRequest</tt>, <tt>THttpResponse</tt>, etc. It will also provide the <tt>TPageService</tt> 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.
</p>
diff --git a/demos/quickstart/protected/pages/Configurations/PageConfig.page b/demos/quickstart/protected/pages/Configurations/PageConfig.page
index bd8a7186..6f489987 100644
--- a/demos/quickstart/protected/pages/Configurations/PageConfig.page
+++ b/demos/quickstart/protected/pages/Configurations/PageConfig.page
@@ -9,6 +9,7 @@ When a user requests a page stored under <tt>&lt;BasePath&gt;/dir1/dir2</tt>, th
</p>
<p>
The format of a page configuration file is as follows,
+</p>
<com:TTextHighlighter Language="xml" CssClass="source">
<configuration>
<paths>
@@ -30,7 +31,11 @@ The format of a page configuration file is as follows,
</parameters>
</configuration>
</com:TTextHighlighter>
+<p>
The <tt>&lt;paths&gt;</tt>, <tt>&lt;modules&gt;</tt> and <tt>&lt;parameters&gt;</tt> are similar to those in an application configuration. The <tt>&lt;authorization&gt;</tt> 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 <tt>&lt;pages&gt;</tt> element specifies the initial values for the properties of pages. Each <tt>&lt;page&gt;</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>&lt;pages&gt;</tt> element apply to all pages in the current directory and all its subdirectories.
</p>
+<p>
+Complete specification of page configurations can be found in the <a href="<%~../../../../../framework/Specs/PageConfiguration.dtd%>">DTD</a> and <a href="<%~../../../../../framework/Specs/PageConfiguration.xsd%>">XSD</a> files.
+</p>
</com:TContent> \ No newline at end of file
diff --git a/framework/Specs/ApplicationConfiguration.dtd b/framework/Specs/ApplicationConfiguration.dtd
new file mode 100644
index 00000000..b85a0595
--- /dev/null
+++ b/framework/Specs/ApplicationConfiguration.dtd
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is the XML Schema Definition for the application.xml file used in Prado/3 framework. -->
+<!-- @package prado.config -->
+<!-- @author Robert Kummer <r.kummer@ipunkt.biz> -->
+<!-- @since Prado/3.0b rev688 -->
+<!-- @version 1.0/2006-02-21 -->
+<!ELEMENT application (paths, modules, services, parameters)>
+<!ATTLIST application
+ id CDATA #REQUIRED
+ Mode (Off | Debug | Normal | Performance) #REQUIRED
+>
+<!ELEMENT paths (alias? | using?)+>
+<!ELEMENT modules (module+)>
+<!ELEMENT services (service+)>
+<!ELEMENT parameters (parameter+)>
+<!ELEMENT module (#PCDATA)>
+<!ATTLIST module
+ id CDATA #REQUIRED
+ class CDATA #REQUIRED
+>
+<!ELEMENT parameter (#PCDATA)>
+<!ATTLIST parameter
+ id CDATA #REQUIRED
+ class CDATA #IMPLIED
+ value CDATA #IMPLIED
+>
+<!ELEMENT alias EMPTY>
+<!ATTLIST alias
+ id CDATA #REQUIRED
+ path CDATA #REQUIRED
+>
+<!ELEMENT using EMPTY>
+<!ATTLIST using
+ namespace CDATA #REQUIRED
+>
+<!ELEMENT service (#PCDATA)>
+<!ATTLIST service
+ id CDATA #REQUIRED
+ class CDATA #REQUIRED
+>
diff --git a/framework/Specs/ApplicationConfiguration.xsd b/framework/Specs/ApplicationConfiguration.xsd
new file mode 100644
index 00000000..c66dfed5
--- /dev/null
+++ b/framework/Specs/ApplicationConfiguration.xsd
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- This is the XML Schema Definition for the config.xml file(s) used in Prado/3 framework. -->
+<!-- @package prado.config -->
+<!-- @author Robert Kummer <r.kummer@ipunkt.biz> -->
+<!-- @since Prado/3.0b rev688 -->
+<!-- @version 1.0/2006-02-21 -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:complexType name="aliasType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="path" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="allowType">
+ <xs:attribute name="pages" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="users" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-|\*|\?]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="roles" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="verb" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="get"/>
+ <xs:enumeration value="post"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="authorizationType">
+ <xs:sequence>
+ <xs:element name="allow" type="allowType"/>
+ <xs:element name="deny" type="denyType"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="configuration">
+ <xs:annotation>
+ <xs:documentation>configuration content for page sections in prado3 framework</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="paths" type="pathsType" minOccurs="0"/>
+ <xs:element name="modules" type="modulesType" minOccurs="0"/>
+ <xs:element name="authorization" type="authorizationType" minOccurs="0"/>
+ <xs:element name="pages" type="pagesType" minOccurs="0"/>
+ <xs:element name="parameters" type="parametersType" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="denyType">
+ <xs:attribute name="pages" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="users" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-|\*|\?]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="roles" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:pattern value="(([a-zA-Z0-9_\-]*),?)+"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="verb" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="post"/>
+ <xs:enumeration value="get"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:complexType name="moduleType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ModuleID"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="class" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ModuleClass"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="modulesType">
+ <xs:sequence>
+ <xs:element name="module" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="moduleType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##local" processContents="lax"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="pageType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="PageID"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="pagesType">
+ <xs:sequence>
+ <xs:element name="page" type="pageType" maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="MasterClass" type="xs:string" use="optional"/>
+ <xs:attribute name="Theme" type="xs:string" use="optional"/>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="parameterType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ParameterID"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="class" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="ParameterClass"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="value" type="xs:string" use="optional"/>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="parametersType">
+ <xs:sequence>
+ <xs:element name="parameter" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="parameterType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##local" processContents="lax"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="pathsType">
+ <xs:choice maxOccurs="unbounded">
+ <xs:element name="alias" type="aliasType" minOccurs="0"/>
+ <xs:element name="using" type="usingType" minOccurs="0"/>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="usingType">
+ <xs:attribute name="namespace" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Namespace"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema>
diff --git a/framework/Specs/PageConfiguration.dtd b/framework/Specs/PageConfiguration.dtd
new file mode 100644
index 00000000..e140f468
--- /dev/null
+++ b/framework/Specs/PageConfiguration.dtd
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This is the XML Schema Definition for the config.xml file(s) used in Prado/3 framework. -->
+<!-- @package prado.config -->
+<!-- @author Robert Kummer <r.kummer@ipunkt.biz> -->
+<!-- @since Prado/3.0b rev688 -->
+<!-- @version 1.0/2006-02-21 -->
+<!ELEMENT allow EMPTY>
+<!ATTLIST allow
+ pages CDATA #IMPLIED
+ users CDATA #IMPLIED
+ roles CDATA #IMPLIED
+ verb (get | post) #REQUIRED
+>
+<!ELEMENT deny EMPTY>
+<!ATTLIST deny
+ pages CDATA #IMPLIED
+ users CDATA #IMPLIED
+ roles CDATA #IMPLIED
+ verb (post | get) #REQUIRED
+>
+<!ELEMENT configuration (paths?, modules?, authorization?, pages?, parameters?)>
+<!ELEMENT paths (alias? | using?)+>
+<!ELEMENT modules (module+)>
+<!ELEMENT authorization (allow, deny)>
+<!ELEMENT pages (page+)>
+<!ATTLIST pages
+ MasterClass CDATA #IMPLIED
+ Theme CDATA #IMPLIED
+>
+<!ELEMENT parameters (parameter+)>
+<!ELEMENT module (#PCDATA)>
+<!ATTLIST module
+ id (ModuleID) #REQUIRED
+ class (ModuleClass) #REQUIRED
+>
+<!ELEMENT page EMPTY>
+<!ATTLIST page
+ id (PageID) #REQUIRED
+>
+<!ELEMENT parameter (#PCDATA)>
+<!ATTLIST parameter
+ id (ParameterID) #REQUIRED
+ class (ParameterClass) #IMPLIED
+ value CDATA #IMPLIED
+>
+<!ELEMENT alias EMPTY>
+<!ATTLIST alias
+ id CDATA #REQUIRED
+ path CDATA #REQUIRED
+>
+<!ELEMENT using EMPTY>
+<!ATTLIST using
+ namespace (Namespace) #REQUIRED
+>
diff --git a/framework/Specs/PageConfiguration.xsd b/framework/Specs/PageConfiguration.xsd
new file mode 100644
index 00000000..c1d9a1ef
--- /dev/null
+++ b/framework/Specs/PageConfiguration.xsd
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- This is the XML Schema Definition for the application.xml file used in Prado/3 framework. -->
+<!-- @package prado.config -->
+<!-- @author Robert Kummer <r.kummer@ipunkt.biz> -->
+<!-- @since Prado/3.0b rev688 -->
+<!-- @version 1.0/2006-02-21 -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+ <xs:complexType name="aliasType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="path" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+ <xs:element name="application">
+ <xs:annotation>
+ <xs:documentation>configuration content for the whole application in prado3 framework</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="paths" type="pathsType"/>
+ <xs:element name="modules" type="modulesType"/>
+ <xs:element name="services" type="servicesType"/>
+ <xs:element name="parameters" type="parametersType"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string" use="required"/>
+ <xs:attribute name="Mode" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="Off"/>
+ <xs:enumeration value="Debug"/>
+ <xs:enumeration value="Normal"/>
+ <xs:enumeration value="Performance"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:complexType name="moduleType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="class" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="modulesType">
+ <xs:sequence>
+ <xs:element name="module" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="moduleType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##local" processContents="lax"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="parameterType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="class" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="value" type="xs:string" use="optional"/>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="parametersType">
+ <xs:sequence>
+ <xs:element name="parameter" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="parameterType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##local" processContents="lax"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="pathsType">
+ <xs:choice maxOccurs="unbounded">
+ <xs:element name="alias" type="aliasType" minOccurs="0"/>
+ <xs:element name="using" type="usingType" minOccurs="0"/>
+ </xs:choice>
+ </xs:complexType>
+ <xs:complexType name="serviceType">
+ <xs:attribute name="id" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="class" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ <xs:anyAttribute namespace="##local" processContents="lax"/>
+ </xs:complexType>
+ <xs:complexType name="servicesType">
+ <xs:sequence>
+ <xs:element name="service" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:complexContent>
+ <xs:extension base="serviceType">
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:any namespace="##local" processContents="lax"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="usingType">
+ <xs:attribute name="namespace" use="required">
+ <xs:simpleType>
+ <xs:restriction base="xs:string"/>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+</xs:schema>