You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by de...@lenya.apache.org on 2005/03/07 10:10:21 UTC

[Lenya Wiki] Updated: PublicationTemplating

   Date: 2005-03-07T01:10:21
   Editor: AndreasHartmann
   Wiki: Lenya Wiki
   Page: PublicationTemplating
   URL: http://wiki.apache.org/lenya/PublicationTemplating

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -1,157 +1 @@
-'''Note:''' This feature is available only in Lenya 1.4.
-
-=== What is Publication Templating? ===
-
-Imagine you are a company or organisation with some departments which want to edit their
-content using a Lenya-based CMS. All departments use similar publications, sharing lots
-of functionality. The layout is based on a common corporate identity, but some departments
-want to use their own logo or tweak the navigation menu style.
-
-If all departments develop their own publications, it will be very hard to keep them
-consistent, to add changes to all publications or to update them to a newer Lenya version.
-This can be simplified using publication templates. You define a base (template) publication
-which all others are derived from.
-
-{{{
-                        +----------------------+
-                        | Template Publication |
-                        +----------------------+
-                                    |
-           +-----------------+------+---------------------+
-           |                 |                            |
-   +--------------+  +--------------+             +--------------+
-   | Department A |  | Department B |     ...     | Department X |
-   +--------------+  +--------------+             +--------------+
-}}}
-
-Multiple layers of templates are supported.
-
-{{{
-                    +--------------------------------+
-                    | University Website Publication |
-                    +--------------------------------+
-                                    |
-           +-----------------+------+------------------------+
-           |                 |                               |
-   +------------+  +--------------------+             +-------------+
-   | Uni Zurich |  | Harvard University |     ...     | UC Berkeley |
-   +------------+  +--------------------+             +-------------+
-                             |
-              +----------+---+-----------+
-              |          |               |
-        +----------+  +-----+       +---------+
-        | Business |  | Law |  ...  | Medical |
-        +----------+  +-----+       +---------+
-}}}
-
-
-=== The Concept of Publication Templating ===
-
- * There is a publication {{{my-pub}}}.
- * It depends on a template which is called {{{template(my-pub)}}}.
- * When a file is requested using the templating mechanism ({{{fallback://xslt/page2xhtml.xsl}}}), it is searched in a certain traversing order:
-  * {{{context://lenya/pubs/my-pub/xslt/page2xhtml.xsl}}}
-  * {{{context://lenya/pubs/template(my-pub)/xslt/page2xhtml.xsl}}}
-  * {{{context://lenya/pubs/template(template(my-pub))/xslt/page2xhtml.xsl}}}
-  * ...
-  * {{{context://xslt/page2xhtml.xsl}}}
-
-Note that, in contrast to the existing fallback mechanism, the prefix {{{lenya}}} is not used,
-but the path is resolved relatively to the {{{context://}}} root.
-
-=== Declaration of a Template ===
-
- * The template of a publication is declared in {{{my-pub/config/publication.xconf}}}:
-
- {{{
-<publication>
-  ...
-  <templates>
-    <template id="my-template"/>
-  </templates>
-  ...
-</publication>
-}}}
-
-=== Usage ===
-
-To invoke publication templating, it is necessary to use the {{{fallback://}}} protocol for all relevant files.
-For an XSLT stylesheet, the according pipeline looks as follows:
-
- {{{
-<map:transform src="fallback://xslt/doctypes/doctype2xhtml.xsl">
-}}}
-
-=== XSLT Include and Import ===
-
-To leverage the publication templating concept, it is necessary to apply it to included or imported
-stylesheets as well. Fortunately, we can make use of the {{{fallback:/}}} protocol in XSLT stylesheets.
-At the moment, this only works with Xalan which means you have to use this one as the default transformer.
-
- {{{
-<xsl:include href="fallback://header.xsl"/>
-}}}
-
-To simplify overriding of XSLT stylesheets, it would be useful to import
-the template stylesheet. For this purpose, an additional {{{template}}}
-source factory could be used, which skips the current publication when
-resolving the file:
-
- {{{
-<xsl:import href="template://template/xslt/common/header.xsl"/>
-}}}
-
-
-=== Sitemaps ===
-
-If a sitemap is loaded from a template publication, it is very important that the sitemap
-is completely fallback-enabled. Otherwise, the source resolver will resolve sources relatively
-to the template sitemap instead of using the overridden ones.
-
-In {{{lenya/global-sitemap.xmap}}}, all publication sitemaps have to be mounted
-using the fallback module, for instance
-
- {{{
-<!-- Enter the actual publication -->
-<map:match pattern="*/**">
-  <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}"/>
-</map:match>
-}}}
-
-=== Usecases ===
-
-The UsecaseFramework supports publication templating by default.
-
-If you can't (or don't want to) use the usecase framework, you have to implement your own usecase sitemap.
-The traversing order for usecase sitemaps is
-
- * {{{context://lenya/pubs/my-pub/usecase.xmap}}}
- * {{{context://lenya/pubs/template(my-pub)/usecase.xmap}}}
- * {{{context://lenya/pubs/template(template(my-pub))/usecase.xmap}}}
- * ...
- * {{{context://lenya/usecase.xmap}}}
-
-This behaviour is achieved by the usecase fallback module
-which is called in {{{global-sitemap.xmap}}}:
-
- {{{
-<map:match type="usecase" pattern="*">
-  <map:mount src="{usecase-fallback:{1}}" uri-prefix=""/>
-</map:match>
-}}}
-
-The decision which {{{usecase.xmap}}} to choose is based on the
-usecase configuration in {{{publication.xconf}}}. To declare a
-usecase to be implemented by a publication, add the corresponding
-entry:
-
- {{{
-<publication>
-  ...
-  <usecases>
-    <usecase name="create"/>
-  </usecases>
-  ...
-</publication>
-}}}
-
+Moved to Lenya documentation.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org