1.1 --- a/examples/Common/PEP241/__init__.py Sat Jul 16 18:25:53 2005 +0000
1.2 +++ b/examples/Common/PEP241/__init__.py Sat Jul 16 18:26:03 2005 +0000
1.3 @@ -8,6 +8,13 @@
1.4 import XSLOutput
1.5 import os
1.6
1.7 +# Site map imports.
1.8 +
1.9 +from WebStack.Resources.ResourceMap import MapResource
1.10 +from WebStack.Resources.Static import DirectoryResource
1.11 +
1.12 +# Resource classes.
1.13 +
1.14 class PEP241Resource(XSLForms.Resources.XSLFormsResource):
1.15
1.16 "A resource providing repository browsing."
1.17 @@ -80,4 +87,26 @@
1.18
1.19 self.send_output(trans, [trans_xsl], package)
1.20
1.21 +# Site map initialisation.
1.22 +
1.23 +def get_site():
1.24 +
1.25 + "Return a simple Web site resource."
1.26 +
1.27 + # Get the main resource and the directory used by the application.
1.28 +
1.29 + pep241_resource = PEP241Resource()
1.30 + directory = pep241_resource.resource_dir
1.31 +
1.32 + # Make a simple Web site.
1.33 +
1.34 + resource = MapResource({
1.35 + # Static resources:
1.36 + "styles" : DirectoryResource(os.path.join(directory, "styles"), {"css" : "text/css"}),
1.37 + # Main page:
1.38 + "" : pep241_resource
1.39 + })
1.40 +
1.41 + return resource
1.42 +
1.43 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/Common/Questionnaire/__init__.py Sat Jul 16 18:25:53 2005 +0000
2.2 +++ b/examples/Common/Questionnaire/__init__.py Sat Jul 16 18:26:03 2005 +0000
2.3 @@ -7,6 +7,13 @@
2.4 import XSLForms.Utils
2.5 import os
2.6
2.7 +# Site map imports.
2.8 +
2.9 +from WebStack.Resources.ResourceMap import MapResource
2.10 +from WebStack.Resources.Static import DirectoryResource
2.11 +
2.12 +# Resource classes.
2.13 +
2.14 class QuestionnaireEditorResource(XSLForms.Resources.XSLFormsResource):
2.15
2.16 "A resource providing a questionnaire editor."
2.17 @@ -71,4 +78,26 @@
2.18
2.19 self.send_output(trans, [trans_xsl], questionnaire)
2.20
2.21 +# Site map initialisation.
2.22 +
2.23 +def get_site():
2.24 +
2.25 + "Return a simple Web site resource."
2.26 +
2.27 + # Get the main resource and the directory used by the application.
2.28 +
2.29 + questionnaire_resource = QuestionnaireEditorResource()
2.30 + directory = questionnaire_resource.resource_dir
2.31 +
2.32 + # Make a simple Web site.
2.33 +
2.34 + resource = MapResource({
2.35 + # Static resources:
2.36 + "styles" : DirectoryResource(os.path.join(directory, "styles"), {"css" : "text/css"}),
2.37 + # Main page:
2.38 + "" : questionnaire_resource
2.39 + })
2.40 +
2.41 + return resource
2.42 +
2.43 # vim: tabstop=4 expandtab shiftwidth=4