ASF Bugzilla – Attachment 21078 Details for
Bug 43769
chainsaw refactoring of global and default sitemap
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
next iteration
sitemap-cleanup.diff (text/plain), 43.52 KB, created by
J
on 2007-11-01 13:49:23 UTC
(
hide
)
Description:
next iteration
Filename:
MIME Type:
Creator:
J
Created:
2007-11-01 13:49:23 UTC
Size:
43.52 KB
patch
obsolete
>Index: src/README_SITEMAP_REFACTORING.txt >=================================================================== >--- src/README_SITEMAP_REFACTORING.txt (revision 0) >+++ src/README_SITEMAP_REFACTORING.txt (revision 0) >@@ -0,0 +1,15 @@ >+THIS IS WORK IN PROGRESS. DON'T USE IT FOR ANYTHING OTHER THAN PLAYING. >+ >+known to work: >+============== >+ >+index page, >+browsing around in authoring >+most usecases >+ >+known not to work: >+================== >+ >+bxe, >+tinymce >+requests of the form <pubname>/<area>/ (i.e. without a document specified) >Index: src/modules/tinymce/sitemap.xmap >=================================================================== >--- src/modules/tinymce/sitemap.xmap (revision 590722) >+++ src/modules/tinymce/sitemap.xmap (working copy) >@@ -21,19 +21,6 @@ > > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> > >- <map:resources> >- <map:resource name="style-cms-page"> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{request:locale}"/> >- </map:transform> >- <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"> >- <map:parameter name="publicationid" value="{page-envelope:publication-id}"/> >- </map:transform> >- <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> >- <map:transform type="proxy"/> >- </map:resource> >- </map:resources> >- > <map:pipelines> > > <map:pipeline internal-only="yes"> >@@ -51,16 +38,18 @@ > > <map:match pattern="tinymce.getUsecaseMessages"> > <map:generate type="jx" src="fallback://lenya/modules/usecase/templates/messages.jx"/> >+<!-- > <map:transform type="i18n"> > <map:param name="locale" value="[request:locale}"/> > </map:transform> > <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> >+--> > <map:serialize type="xml"/> > </map:match> > > </map:pipeline> > >- <map:pipeline> >+ <map:pipeline type="profile-noncaching"> > > <!-- this is the view of the usecase (see config/cocoon-xconf/usecase-tinymce-edit.xconf) --> > >@@ -78,7 +67,6 @@ > <map:select type="resource-exists"> > <map:when test="fallback://lenya/modules/tinymce/resources/tinymce/jscripts/tiny_mce/langs/{request:locale}.js"> > <map:transform src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl"> >- <map:parameter name="contextPath" value=""/> > <map:parameter name="continuationId" value="{flow-continuation:id}"/> > <map:parameter name="usecaseName" value="{request-param:lenya.usecase}"/> > <map:parameter name="publicationid" value="{page-envelope:publication-id}"/> >@@ -87,7 +75,6 @@ > </map:when> > <map:otherwise> > <map:transform src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl"> >- <map:parameter name="contextPath" value=""/> > <map:parameter name="continuationId" value="{flow-continuation:id}"/> > <map:parameter name="usecaseName" value="{request-param:lenya.usecase}"/> > <map:parameter name="publicationid" value="{page-envelope:publication-id}"/> >@@ -97,12 +84,11 @@ > </map:select> > </map:when> > <!-- TinyMCE is not installed - generate info page for the user --> >+ <!-- FIXME: this results in a checked-out document. not nice. The check has to be done in the usecase, i guess. --> > <map:otherwise> > <map:generate src="fallback://lenya/modules/tinymce/resources/misc/download.xml"/> > </map:otherwise> > </map:select> >- <map:call resource="style-cms-page"/> >- <map:serialize type="xhtml"/> > </map:match> > > </map:pipeline> >Index: src/modules/tinymce/xslt/page2edit.xsl >=================================================================== >--- src/modules/tinymce/xslt/page2edit.xsl (revision 590722) >+++ src/modules/tinymce/xslt/page2edit.xsl (working copy) >@@ -12,7 +12,6 @@ > textarea into the div#body tag. > --> > >-<xsl:param name="contextPath" select="'tinymce.ERROR'"/> > <xsl:param name="continuationId" select="'tinymce.ERROR'"/> > <xsl:param name="usecaseName" select="'tinymce.ERROR'"/> > <xsl:param name="publicationid" /> >@@ -24,12 +23,6 @@ > the <tinymceWrapper/> is the document element set by the aggregator. > --> > <xsl:template match="tinymceWrapper"> >- <xsl:if test="$contextPath='tinymce.ERROR'"> >- <xsl:message terminate="yes"> >- <i18n:text>Missing contextPath parameter!</i18n:text> >- <i18n:text>Check your tinymce sitemap.</i18n:text> >- </xsl:message> >- </xsl:if> > <xsl:if test="$continuationId='tinymce.ERROR'"> > <xsl:message terminate="yes"> > <i18n:text>Missing continuationId parameter!</i18n:text> >@@ -145,7 +138,6 @@ > to the Lenya authoring GUI) to TinyMCE for true WYSIWYG editing */ > > config['content_css'] = "</xsl:text> >- <xsl:value-of select="$contextPath"/> > <xsl:text>/modules/tinymce/css/editor_content.css</xsl:text> > <xsl:for-each select="../xhtml:link[@rel='stylesheet' and not(contains(@href, '/lenya/css/'))]"> > <xsl:text>,</xsl:text> >Index: src/pubs/default/sitemap.xmap >=================================================================== >--- src/pubs/default/sitemap.xmap (revision 590738) >+++ src/pubs/default/sitemap.xmap (working copy) >@@ -18,37 +18,17 @@ > > <!-- $Id$ --> > >- >-<!-- ============ cruft removal project: ================ >- >- lenyabody-** is only used internally in this sitemap and could be refactored without side effects. >- currently we use lenyabody-raw-[edit|view], lenyabody-[edit|view], and now also document-content. >- i'm sure this can be simplified. >- >---> >- >- > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> > >+<!-- > <map:components> >- <map:transformers default="xslt"> >- <map:transformer name="metaData" logger="lenya.sitemap.transformer.metaData" src="org.apache.lenya.cms.cocoon.transformation.MetaDataTransformer"/> >- </map:transformers> >- <map:serializers default="xhtml"> >+ <map:serializers default="xml"> > <map:serializer logger="sitemap.serializer.links" name="links" src="org.apache.lenya.cms.cocoon.serialization.LinkSerializer"/> > </map:serializers> > </map:components> >+--> > > <map:views> >-<!-- ============ cruft removal project: ================ >- >-this view's from-label does not exist. >- >- <map:view from-label="aggregation" name="aggregation"> >- <map:serialize type="xml"/> >- </map:view> >- >---> > <map:view from-position="last" name="links"> > <map:serialize type="links" /> > </map:view> >@@ -56,21 +36,6 @@ > > <!-- =========================== Resources ================================= --> > >-<!-- >- FIXME: This seems to be unused... >- >- <map:resources> >- <map:resource name="style-cms-page"> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{request:locale}"/> >- </map:transform> >- <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> >- <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> >- <map:transform type="proxy"/> >- </map:resource> >- </map:resources> >---> >- > <map:pipelines> > > <!-- FIXME: the location of Lenya's cache should either be a global convention >@@ -81,11 +46,8 @@ > </global-variables> > </map:component-configurations> > >- >- >- > <!-- This pipeline handles helper requests and metadata, not the actual publication documents --> >- <map:pipeline> >+ <map:pipeline type="profile-noncaching"> > > <!-- Neutron introspection > The location of the introspection file is defined in <link rel="neutron-introspection"/> >@@ -110,22 +72,6 @@ > </map:select> > </map:match> > >-<!-- >- FIXME: the whole webdav shebang should be handled by the webdav module sitemap. >---> >- <!-- catch webdav GET requests. --> >- <map:match pattern="*/webdav**"> >- <map:mount uri-prefix="{1}/" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/> >- </map:match> >- >- <!-- catch PUT requests (used by webdav clients) --> >- <map:select type="request-method"> >- <!-- many client editors like to PUT changes --> >- <map:when test="PUT"> >- <map:mount uri-prefix="" src="{fallback:lenya/modules/webdav/sitemap.xmap}" check-reload="true" reload-method="synchron"/> >- </map:when> >- </map:select> >- > <!-- FIXME: this should be merged with the getDoctypeXSLT/* matcher below. currently, it is necessary > so that "getDoctypeXSLT/" requests do not get eaten by the **/ matcher below. > Plus it should be moved to an internal-only pipeline. >@@ -137,43 +83,22 @@ > > <!-- Requests ending in a slash are redirected to the corresponding index.html page to mimic > standard web browser behaviour. --> >- <!-- FIXME: this will trigger a HTTP redirect. Maybe it's more effective to do an internal redirect using >- a cocoon:/ URI? An apache httpd server will not send a HTTP redirect when a directory is requested, but >- serve the index.html file implicitly IIRC. --> >+ <!-- FIXME: doesn't work --> >+<!-- > <map:match pattern="**/"> >- <map:redirect-to uri="index.html"/> >+ <map:redirect-to uri="{1}/index.html"/> >+ <map:serialize/> > </map:match> >+--> > > </map:pipeline> >- > >- <map:pipeline type="caching"> >+ <map:pipeline type="profile-noncaching"> > >- <!-- RSS formatting. >- FIXME: this should be handled by an RSS feed module! >- --> >- <map:match pattern="**.rss"> >- <map:generate src="{resource-type:format-rss}"/> >- <map:serialize type="xml"/> >- </map:match> >- >- <!-- FIXME: either this should be moved into a metadata module, or at least we need to establish >- some standard for magic extra suffixes and stick to it. >- Here we use .html.meta, bxe uses .bxe.html. >- --> >- <map:match pattern="*/**.html.meta"> >- <map:generate type="lenyaMetaData" src="lenya-document:{page-envelope:document-uuid},area={1}"/> >- <map:serialize type="xml"/> >- </map:match> >- <map:match pattern="**meta"> >- <map:generate type="lenyaMetaData" src="lenya-document:{request-param:uuid},lang={request-param:lang},pubid={request-param:pubid},area={request-param:area}"/> >- <map:serialize type="xml"/> >- </map:match> >- >- <!-- {1:rendertype}/{2:pub}/{3:area}/{4:path} --> >- <map:match pattern="document-content/*/*/*/**"> >+ <!-- {1:pub}/{2:area}/{3:path} --> >+ <map:match pattern="document-content/*/*/**"> > <map:act type="language-exists"> >- <map:generate src="{resource-type:format-xhtml}?rendertype={../1}"/> >+ <map:generate src="{resource-type:format-xhtml}"/> > <map:serialize type="xml"/> > </map:act> > <!-- if the action fails (i.e. the document does not exist), create a nice error page. --> >@@ -181,30 +106,27 @@ > <map:transform src="fallback://lenya/xslt/exception/document-does-not-exist.xsl"> > <map:parameter name="requestUrl" value="{request:requestURI}"/> > <map:parameter name="contextPath" value="{request:contextPath}"/> >- <map:parameter name="pub" value="{2}"/> >- <map:parameter name="path" value="/{4}"/> >- <map:parameter name="area" value="{3}"/> >+ <map:parameter name="pub" value="{1}"/> >+ <map:parameter name="path" value="/{3}"/> >+ <map:parameter name="area" value="{2}"/> > </map:transform> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{page-envelope:language}"/> >- </map:transform> > <map:serialize type="xml"/> > </map:match> >- >+ > <!-- > This matcher aggregates the Lenya page: breadcrumbs, tabs, menu etc. and the actual document content. >- /lenyabody-raw-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:default-language}/{6:language}/{7:path} >+ /aggregate-content/{1:publication-id}/{2:area}/{3:doctype}/{4:default-language}/{5:language}/{6:path} > --> >- <map:match pattern="lenyabody-raw-*/*/*/*/*/*/**"> >+ <map:match pattern="aggregate-content/*/*/*/*/*/**"> > <map:aggregate element="cmsbody"> >- <map:part src="cocoon://modules/sitetree/breadcrumb/{2}/{3}/{5}/{6}/{7}.xml"/> >- <map:part src="cocoon://modules/sitetree/tabs/{2}/{3}/{5}/{6}/{7}.xml"/> >- <map:part src="cocoon://modules/sitetree/menu/{2}/{3}/{5}/{6}/{7}.xml"/> >- <map:part src="cocoon://modules/sitetree/search/{2}/{3}/{5}/{6}/{7}.xml"/> >+ <map:part src="cocoon://modules/sitetree/breadcrumb/{1}/{2}/{4}/{5}/{6}.xml"/> >+ <map:part src="cocoon://modules/sitetree/tabs/{1}/{2}/{4}/{5}/{6}.xml"/> >+ <map:part src="cocoon://modules/sitetree/menu/{1}/{2}/{4}/{5}/{6}.xml"/> >+ <map:part src="cocoon://modules/sitetree/search/{1}/{2}/{4}/{5}/{6}.xml"/> > <map:part src="cocoon://modules/languageselector/text-none/flagsize-13"/> >- <map:part src="cocoon:/document-content/{1}/{2}/{3}/{7}"/> >+ <map:part src="cocoon:/document-content/{1}/{2}/{6}"/> > </map:aggregate> >- <map:serialize type="xml"/> >+ <map:serialize/> > </map:match> > > <!-- >@@ -223,30 +145,29 @@ > <map:generate src="fallback://xslt/page2xhtml.xsl"/> > </map:otherwise> > </map:select> >- <map:serialize type="xml"/> >+ <map:serialize/> > </map:match> > > </map:pipeline> > > <!-- This is the pipeline that ultimately builds the page. --> >- <map:pipeline type="noncaching"> >+ <map:pipeline type="profile-noncaching"> > > <!-- > This matcher takes the raw aggregated page content and applies SVG rendering and a doctype-specific >- XSL transformation. It makes some meta information available to the XSLT, and demonstrates the use >- of the LenyaMetaDataTransformer (see below). >- /lenyabody-{1:rendertype}/{2:publication-id}/{3:area}/{4:doctype}/{5:path} >+ XSL transformation. It makes some meta information available to the XSLT. >+ /transform-content/{1:publication-id}/{2:area}/{3:doctype}/{4:path} > --> >- <map:match pattern="lenyabody-*/*/*/*/**"> >- <map:generate src="cocoon:/lenyabody-raw-{1}/{2}/{3}/{4}/{page-envelope:default-language}/{page-envelope:document-language}/{5}"/> >+ <map:match pattern="transform-content/*/*/*/**"> >+ <map:generate src="cocoon:/aggregate-content/{1}/{2}/{3}/{page-envelope:default-language}/{page-envelope:document-language}/{4}"/> > <map:transform src="fallback://lenya/modules/svg/xslt/image2svg.xsl"/> >- <map:transform src="cocoon:/getDoctypeXSLT/{4}"> >- <map:parameter name="root" value="/{2}/{3}"/> >- <map:parameter name="publication-id" value="{2}"/> >- <map:parameter name="area" value="{3}"/> >+ <map:transform src="cocoon:/getDoctypeXSLT/{3}"> >+ <map:parameter name="root" value="/{1}/{2}"/> >+ <map:parameter name="publication-id" value="{1}"/> >+ <map:parameter name="area" value="{2}"/> > <map:parameter name="url" value="{page-envelope:document-url}"/> > <map:parameter name="document-path" value="{page-envelope:document-path}"/> >- <map:parameter name="document-type" value="{4}"/> >+ <map:parameter name="document-type" value="{3}"/> > <map:parameter name="language" value="{page-envelope:document-language}"/> > <map:parameter name="contextprefix" value="{request:contextPath}"/> > <map:parameter name="lastPublishedUser" value="{access-control:user-name:{workflow:lastUser.publish}}"/> >@@ -255,58 +176,18 @@ > <map:parameter name="author" value="{properties:pubs.default.author}"/> > <map:parameter name="nodeName" value="{page-envelope:document-name}"/> > </map:transform> >- >- <!-- FIXME: why is the title handling inside a language-exists action? please document! --> > <map:act type="language-exists"> > <map:transform src="fallback://xslt/addXhtmlTitle.xsl"> > <map:parameter name="title" value="{dublincore:title}"/> > </map:transform> > </map:act> >- >- <!-- This is a demonstration of the generic meta data transformer >- described in bug 39891. >- >- 1) define the ns: xmlns:meta="http://apache.org/lenya/meta/1.0/" >- 2) use it in above xsl like e.g. >- <meta:value ns="http://purl.org/dc/elements/1.1/" element="date" uuid="{@uuid}"/> >- >- Where @ns is the namespace for which you want to retrieve the @element for. >- If there is more then one element registered then the transformer returns: >- <value xmlns="http://apache.org/lenya/meta/1.0/" value="2005-09-11 12:44:05" element="date" /> >- <value xmlns="http://apache.org/lenya/meta/1.0/" value="2006-09-11 12:44:05" element="date" /> >- >- Otherwise it will return the value as characters. >- --> >- <map:transform type="metaData"> >- <map:parameter name='pubid' value='{page-envelope:publication-id}'/> >- <map:parameter name='area' value='{page-envelope:area}'/> >- </map:transform> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{page-envelope:language}"/> >- </map:transform> >- <map:transform type="uuid2url"/> >- <map:serialize type="xml"/> >+ <map:serialize/> > </map:match> > > </map:pipeline> > >- <!-- This is the main entry point into the publication. This >- pipeline uses the uriparametrizer to determine the doctype of this >- request. It then aggregates the lenya menu (for the given area) and >- the lenya body, the actual document. --> > <map:pipeline> >- > <!-- >- FIXME: this is a BXE-specific hack that should be handled by BXE's module sitemap. The publication >- should not be concerned with BXE-specific pre-processing of documents. >- --> >- <map:match pattern="**.bxe.html"> >- <map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >- <map:transform type="proxy"/> >- <map:serialize type="xml"/> >- </map:match> >- >- <!-- > Finally: this matcher handles requests for publication documents. > /{1:area}/{2:document-path}.html > --> >@@ -322,14 +203,14 @@ > <map:redirect-to uri="{request:requestUri}?lenya.usecase=export.importExampleContent"/> > </map:otherwise> > </map:select> >- >+ > <!-- If the requested language version of the document exists, we set a last-modified header. --> > <map:act type="language-exists"> > <map:act type="set-header"> > <map:parameter name="Last-Modified" value="{date-iso8601-rfc822:{page-envelope:document-lastmodified}}" /> > </map:act> > </map:act> >- >+ > <!-- > HEAD requests shouldn't have all the xslt overhead, all the user wants is the HTTP header information. > So the actual content generation is bypassed. >@@ -339,50 +220,28 @@ > <map:generate src="context://lenya/content/util/empty.xml" /> > <map:serialize type="xhtml"/> > </map:when> >- </map:select> >- >- <!-- >- Lenya provides its own caching mechanism. There is a source writing transformer that will store rendered pages >- in {global:cache-dir}. Hence we should first check for every request if a cached version already exists, before >- starting the actual rendering process. >- NOTE: the cache is disabled by default. That means it has seen very little testing. And it does not do proper cache >- invalidation, so it's probably only useful as a quick performance hack on a mostly static site. >- --> >- <!-- do we have this request in the cache? --> >- <map:select type="resource-exists"> >- <map:when test="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.htmlDISABLED"> >- <!-- YES. Just read it from the cache and be done: --> >- <map:read src="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html" mime-type="text/html"/> >- </map:when> >- <!-- No. Generate the page and write it to the cache. --> >- <map:otherwise> >- <!-- >- FIXME: the "rendertype" parameter is a hack for BXE and should be handled by the bxe module. >- Moreover, it doesn't make much sense to cache documents in the authoring area that are about to be edited anyway. >- --> >- <map:select type="parameter"> >- <map:parameter name="parameter-selector-test" value="{request-param:rendertype}"/> >- <map:when test="edit"> >- <!-- put the bxe_xpath attribute into the page --> >- <map:generate src="cocoon:/lenyabody-edit/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >- </map:when> >- <map:otherwise> >- <!-- sane page w/o hacks --> >- <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >- </map:otherwise> >- </map:select> >+ </map:select> > >- <!-- Menu generation --> >+ <!-- Live area doesn't get a menu, all others do: --> > <map:select type="parameter"> > <!-- you remember that {1} is the area, right? --> > <map:parameter name="parameter-selector-test" value="{1}"/> > <map:when test="live"> >- <!-- do nothing for live --> >+ <map:generate src="cocoon:/transform-content/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >+ <map:act type="set-header"> >+ <map:parameter name="Expires" value="{date-iso8601-rfc822:{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}:expires}}"/> >+ </map:act> > </map:when> > <map:otherwise> > <!-- for all other areas, we want a GUI menu (handled by global-sitemap.xmap --> > <!-- FIXME: the ?doctype parameter doesn't seem to be used (see global-sitemap.xmap). --> >- <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml?doctype={page-envelope:document-type}"/> >+ <map:generate src="cocoon:/transform-content/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >+ <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}.xml"/> >+ <!-- tell the browser not to cache stuff so that the user always sees up-to-date content --> >+ <map:act type="set-header"> >+ <map:parameter name="Cache-Control" value="no-cache" /> >+ <map:parameter name="Pragma" value="no-cache"/> >+ </map:act> > <!-- > external broken link reporting (pretty much untested) > TODO: External Links checking should be optional on a document by document basis. >@@ -395,66 +254,19 @@ > </map:otherwise> > </map:select> > >- <!-- >- strip xhtml namespace prefix to ensure compatibility with non-XML conformant browsers >- workaround to avoid empty script, style and textarea tags (firefox chokes on those) >- --> >- <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> >- >- >- <!-- Cache writing --> >- <map:select type="parameter"> >- <map:parameter name="parameter-selector-test" value="{1}"/> >- <!-- for live area: --> >- <map:when test="live"> >- <!-- prepare content for source writing transformer --> >- <map:transform src="fallback://lenya/xslt/authoring/edit/addSourceTags.xsl"> >- <map:parameter name="source" value="context:/lenya/pubs/{page-envelope:publication-id}/{global:cache-dir}/{1}/{2}.html"/> >- </map:transform> >- <map:transform type="write-source"> >- <map:parameter name="serializer" value="xhtml"/> >- </map:transform> >- <!-- remove the source writing transformer cruft again before serving the page --> >- <map:transform src="fallback://lenya/xslt/authoring/edit/removeSourceTags.xsl"/> >- <!-- set cache expiration header according to resource type configuration (<expires/>) --> >- <map:act type="set-header"> >- <map:parameter name="Expires" value="{date-iso8601-rfc822:{doc-info:{page-envelope:publication-id}:{page-envelope:area}:{page-envelope:document-uuid}:{page-envelope:document-language}:expires}}"/> >- </map:act> >- </map:when> >- <!-- for other areas --> >- <map:otherwise> >- <!-- tell the browser not to cache stuff so that the user always sees up-to-date content --> >- <map:act type="set-header"> >- <map:parameter name="Cache-Control" value="no-cache" /> >- <map:parameter name="Pragma" value="no-cache"/> >- </map:act> >- </map:otherwise> >- </map:select> >- >- <!-- pretty-print output for easier debugging and for the benefit of new users >- NOTE: you may want to disable this in production for performance reasons, >- but it's on by default in the default publication to make the generated code >- easier to work with for new users. --> >- <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/> >- >- <!-- the proxy transformer handles proxy-related URL rewriting --> >- <map:transform type="proxy"/> >- > <map:act type="language-exists"> >- <map:serialize type="xhtml"/> >+ <map:serialize/> > </map:act> > <!-- > When the requested document does not exist, we generate a nice error page. > Still, it's not what the user wants, so make sure we send a 404 "not found". > --> > <map:serialize type="xhtml" status-code="404"/> >- </map:otherwise> >- </map:select> > > </map:match> >- >+ > </map:pipeline> >- >+ > <!-- > This pipeline handles all requests that do *not* end in ".html". > --> >@@ -479,22 +291,19 @@ > If the action above fails (e.g. the document does not exist), call into the lenyabody pipeline. > It will generate a nice document-does-not-exist page for us. > --> >- <map:generate src="cocoon:/lenyabody-view/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> >+ <map:generate src="cocoon:/transform-content/{page-envelope:publication-id}/{page-envelope:area}/{page-envelope:document-type}{page-envelope:document-path}"/> > <map:select type="parameter"> > <map:parameter name="parameter-selector-test" value="{1}"/> > <map:when test="live"/> > <map:otherwise> >- <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}?doctype={page-envelope:document-type}"/> >+ <map:transform src="cocoon://lenya-page/{page-envelope:publication-id}/{1}/{2}/?doctype={page-envelope:document-type}"/> > </map:otherwise> > </map:select> >- <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> >- <map:transform type="proxy"/> > <map:serialize type="xhtml" status-code="404"/> > > </map:match> > > </map:pipeline> > >- > </map:pipelines> > </map:sitemap> >Index: src/webapp/global-sitemap.xmap >=================================================================== >--- src/webapp/global-sitemap.xmap (revision 590728) >+++ src/webapp/global-sitemap.xmap (working copy) >@@ -20,33 +20,24 @@ > > <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> > >-<!-- =========================== Resources ================================= --> >- >- <!--+ >- | Resources are pipeline fragments that may be used from different >- | pipeline fragments. For our needs, they behave exactly like >- | pipelines, only that they are not accessible from outside. >- | Hence I will explain what's inside below for pipelines. >- +--> >- > <map:resources> >+ > <map:resource name="style-cms-page"> >+ <!-- FIXME: it's unfortunate that this page2xhtml.xsl is something entirely different >+ than the publication's page2xhtml.xsl, and it's not in the same "fallback path"... --> >+ <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> > <map:transform type="i18n"> > <map:parameter name="locale" value="{request:locale}"/> > </map:transform> >- <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl"/> >+ <map:transform type="uuid2url"/> > <map:transform type="proxy"/> >- <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/> >+ <map:transform src="fallback://lenya/xslt/util/strip_namespaces.xsl"/> > <map:transform src="fallback://lenya/modules/prettyprinting/xslt/xml2nicexml.xsl"/> >- </map:resource> >- <map:resource name="i18n"> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{request:locale}"/> >- </map:transform> >+ <map:serialize type="xhtml"/> > </map:resource> >+ > <map:resource name="proxy-css"> >- <map:act type="resource-exists" >- src="{url}.xml"> >+ <map:act type="resource-exists" src="{url}.xml"> > <map:generate src="{../url}.xml"/> > <map:transform src="fallback://lenya/resources/css/css.xsl"> > <map:parameter name="root" value="/{page-envelope:publication-id}/{page-envelope:area}"/> >@@ -56,6 +47,7 @@ > <map:generate type="text" src="{url}.css"/> > <map:call resource="prepare-proxy-css"/> > </map:resource> >+ > <map:resource name="prepare-proxy-css"> > <map:transform type="pattern" > src="fallback://lenya/chaperon/grammars/link.xlex"/> >@@ -68,84 +60,43 @@ > </map:resource> > </map:resources> > >-<!-- =========================== Pipelines ================================= --> >- >- <!--+ >- | Pipelines. The beef. Pipelines specify how the processing of your >- | content is done. Usually, a pipeline consists of several fragments >- | that specify the generation, transformation, and serialization of >- | SAX events. >- | >- | Processing is done in two steps: >- | >- | 1) The top level elements are executed in order of appearance until >- | one signals success. These top level elements are usually >- | matchers. >- | >- | Other components are called depth-first to determine what >- | fragments make up the processing pipeline. When a component >- | fails, no nested components are called but the next component on >- | the same level. >- | >- | 2) Once it is determined which generator, which transformers and >- | wich serializer is used, these components are executed. During >- | this, the pipeline may not be changed. >- | >- | You may have as many pipelines in your sitemap as you like. >- +--> > <map:pipelines> > > <map:component-configurations> > <global-variables> >- <!--+ >- | Define global parameters here: >- | <skin>my_skin</skin> >- | ... >- | You can access them by {global:*name*}, e.g. {global:skin}. >- | These values are inherited into sub-sitemaps and can >- | be extended there. >- +--> >- >- <!-- pipeline expiration, see http://httpd.apache.org/docs/2.0/mod/mod_expires.html for syntax documentation --> > <pipeline-expiration>now</pipeline-expiration> >- <!-- >- <pipeline-expiration>access plus 2 hours</pipeline-expiration> >- --> > </global-variables> > </map:component-configurations> > >-<!-- =========================== Pipelines ================================= --> >- >+<!-- > <map:pipeline> >- <map:match pattern="aggregate-publications"> >- <map:generate type="directory" src="lenya/pubs"/> >- <map:transform src="lenya/xslt/util/aggregate-publications.xsl"/> >- <map:transform type="xinclude"/> >- <map:serialize type="xml"/> >+ <map:match pattern="cforms/ajax/**"> >+ <map:read src="resource://org/apache/cocoon/ajax/resources/{1}"/> > </map:match> > </map:pipeline> > >- <!-- ajax --> > <map:pipeline> >- <map:match pattern="cforms/ajax/**"> >- <map:read src="resource://org/apache/cocoon/ajax/resources/{1}"/> >- </map:match> >- </map:pipeline> >- >- <!-- dojo --> >- <map:pipeline> > <map:match pattern="cforms/dojo/**"> > <map:read src="resource://org/apache/cocoon/dojo/resources/{1}"/> > </map:match> >- </map:pipeline> >+ </map:pipeline> > >- <!-- cforms --> > <map:pipeline> > <map:match pattern="cforms/forms/**"> > <map:read src="resource://org/apache/cocoon/forms/resources/{1}"/> > </map:match> > </map:pipeline> >+--> > >+ <map:pipeline internal-only="true"> >+ <map:match pattern="aggregate-publications"> >+ <map:generate type="directory" src="lenya/pubs"/> >+ <map:transform src="lenya/xslt/util/aggregate-publications.xsl"/> >+ <map:transform type="xinclude"/> >+ <map:serialize type="xml"/> >+ </map:match> >+ </map:pipeline> >+ > <map:pipeline> > <!-- Lenya GUI --> > <map:match pattern="lenya/**"> >@@ -177,28 +128,6 @@ > <!-- Disable menu items according to usecase policies --> > <map:transform type="usecasemenu"/> > >-<!-- >- XUL is untested and unsupported. >- >- <map:select type="request-parameter"> >- <map:parameter name="parameter-name" value="uiml"/> >- <map:when test="xul"> >- <map:transform src="fallback://lenya/xslt/menu/menu2xul.xsl"> >- <map:parameter name="publicationid" value="{1}"/> >- <map:parameter name="area" value="{2}"/> >- <map:parameter name="documenturl" value="{page-envelope:document-url}"/> >- <map:parameter name="documentid" value="{page-envelope:document-uuid}"/> >- <map:parameter name="userid" value="{access-control:user-id}"/> >- <map:parameter name="servertime" value="{date-i18n:currentDate}"/> >- <map:parameter name="workflowstate" value="{workflow:state}"/> >- <map:parameter name="islive" value="{workflow:variable.is_live}"/> >- <map:parameter name="usecase" value="{request-param:lenya.usecase}"/> >- <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/> >- <map:parameter name="newMessages" value="{inbox:newMessageCount}"/> >- </map:transform> >- </map:when> >- <map:otherwise> >---> > <map:transform src="fallback://lenya/xslt/menu/menubar2xhtml.xsl"> > <map:parameter name="publicationid" value="{1}"/> > <map:parameter name="area" value="{2}"/> >@@ -212,41 +141,22 @@ > <map:parameter name="tabGroup" value="{usecase:tabGroup:{request-param:lenya.usecase}}"/> > <map:parameter name="newMessages" value="{inbox:newMessageCount}"/> > </map:transform> >-<!-- >- </map:otherwise> >- </map:select> >---> >- <map:call resource="i18n"/> >- >- <!-- Generate the meta-stylesheet --> >-<!-- >- XUL is untested and unsupported >- <map:select type="request-parameter"> >- <map:parameter name="parameter-name" value="uiml"/> >- <map:when test="xul"> >- <map:transform src="fallback://lenya/xslt/menu/menu2xsltwithxul.xsl"> >- <map:parameter name="publicationid" value="{1}"/> >- <map:parameter name="area" value="{2}"/> >- <map:parameter name="documenturl" value="{page-envelope:document-url}"/> >- </map:transform> >- </map:when> >- <map:otherwise> >---> >+ > <map:transform src="fallback://lenya/xslt/menu/menu2xslt.xsl"> > <map:parameter name="publicationid" value="{1}"/> > <map:parameter name="area" value="{2}"/> > <map:parameter name="documenturl" value="{page-envelope:document-url}"/> > </map:transform> >-<!-- >- </map:otherwise> >- </map:select> >---> >+ > <map:serialize type="xml"/> > </map:match> >- >+ > </map:pipeline> >+ >+ > <!-- menus --> >- <map:pipeline> >+ <map:pipeline internal-only="true"> >+ > <!-- menu-xml/modules --> > <!-- menu-xml/modules/{pub-id}/{area}.xml --> > <map:match pattern="menu-xml/modules/*/*.xml"> >@@ -257,9 +167,7 @@ > <map:transform type="xinclude"/> > <map:serialize type="xml"/> > </map:match> >- </map:pipeline> > >- <map:pipeline> > <!-- menu-xml/module/{area}/{module-id}.xml --> > <map:match pattern="menu-xml/module/*/*.xml"> > <map:select type="resource-exists"> >@@ -272,27 +180,27 @@ > </map:otherwise> > </map:select> > </map:match> >- >+ > <!-- menu-xml/{publication-id}/admin/... --> > <map:match pattern="menu-xml/*/admin/**" internal-only="true"> > <map:generate type="serverpages" src="lenya/content/menus/admin.xsp"/> > <map:serialize type="xml"/> > </map:match> >- >+ > <!-- menu-xml/{publication-id}/... --> > <map:match pattern="menu-xml/*/**" internal-only="true"> > <map:mount uri-prefix="menu-xml/{1}/" src="{fallback:menus.xmap}" check-reload="true" reload-method="synchron" pass-through="true"/> > </map:match> >- >+ > <!-- Access Control Policies --> > <map:match pattern="*/policies/**"> > <map:mount uri-prefix="{1}/policies" src="lenya/pubs/{1}/policies-sitemap.xmap" check-reload="true" reload-method="synchron" pass-through="true"/> > </map:match> >- >+ > </map:pipeline> > > <!-- Module requests --> >- >+ > <!-- preliminary handler for internal module requests to avoid the resource-exists check --> > <map:pipeline internal-only="true"> > <map:match pattern="modules/*/**"> >@@ -335,13 +243,6 @@ > > </map:match> > </map:pipeline> >- >- <!-- Internal usecases --> >- <map:pipeline internal-only="true"> >- <map:match pattern="*/**"> >- <map:mount uri-prefix="{1}" src="lenya/pubs/{1}/sitemap.xmap" check-reload="true" reload-method="synchron"/> >- </map:match> >- </map:pipeline> > > <map:pipeline> > >@@ -354,9 +255,9 @@ > <map:match type="usecase" pattern="*"> > <map:mount uri-prefix="" src="lenya/usecase.xmap" check-reload="true" reload-method="synchron"/> > </map:match> >- >+ > </map:pipeline> >- >+ > <map:pipeline> > <map:match pattern="index.html"> > <map:aggregate element="aggregation-wrapper" label="aggregate"> >@@ -406,6 +307,7 @@ > </map:select> > </map:match> > >+ <!-- FIXME: there is a problem with authorization: nobody is allowed to actually access this match. --> > <map:match pattern="*/"> > <map:redirect-to uri="introduction.html"/> > </map:match> >@@ -421,19 +323,23 @@ > </map:aggregate> > <map:transform src="lenya/xslt/util/introduction.xsl"/> > <map:call resource="style-cms-page"/> >- <map:serialize /> >+ <map:serialize type="xhtml"/> > </map:match> >+ >+ <!-- do the sane thing if user requests an area w/o trailing slash --> >+ <map:match pattern="*/*"> >+ <map:redirect-to uri="{2}/"/> >+ </map:match> > > </map:pipeline> > >- <!-- preliminary handler for internal publication requests to avoid the resource-exists check --> > <map:pipeline internal-only="true"> >- <map:match pattern="*/**"> >- <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/> >+ <map:match pattern="enterPublication-*/**"> >+ <map:mount uri-prefix="enterPublication-{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/> > </map:match> > </map:pipeline> > >- <map:pipeline> >+ <map:pipeline type="profile-noncaching"> > > <!-- Resources --> > >@@ -468,19 +374,24 @@ > <map:generate type="jx" src="lenya/content/exception/publication-does-not-exist.jx"> > <map:parameter name="publicationId" value="{1}"/> > </map:generate> >- <map:transform type="i18n"> >- <map:parameter name="locale" value="{request:locale}"></map:parameter> >- </map:transform> > <map:call resource="style-cms-page"/> > <map:serialize status-code="404" /> > </map:when> > <map:otherwise> >+ >+<!-- > <map:mount uri-prefix="{1}" src="{fallback:sitemap.xmap}" check-reload="true" reload-method="synchron"/> >+--> >+ <map:generate src="cocoon:/enterPublication-{1}/{2}"/> >+ <map:call resource="style-cms-page"/> >+ >+ <map:serialize type="xhtml"/> > </map:otherwise> > </map:select> > </map:match> >- </map:pipeline> > >+ </map:pipeline> >+ > </map:pipelines> > > </map:sitemap> >Index: tools/proxytest/README >=================================================================== >--- tools/proxytest/README (revision 590722) >+++ tools/proxytest/README (working copy) >@@ -1,7 +1,14 @@ > If you want to play with Lenya in Jetty 6.1.6, please take a look at jetty6.xml > and follow the instructions in the comment header. > >+Running Jetty 6.1.6 is orthogonal to proxy testing; the server configuration >+includes both ajp://localhost:8009 and http://localhost:8888, so you can >+just drop it in, replacing the old version, without bothering about the >+proxy stuff. Please follow up on bug >+http://issues.apache.org/bugzilla/show_bug.cgi?id=43729 with success and >+problem reports. > >+ > *.* > > >@@ -41,5 +48,26 @@ > http://www.example.com/lenya/default/authoring/ and > http://customer.example.com. > >-It doesn't quite work as it should, but you get the idea. >+It doesn't quite work as it should (redirects from the Lenya servlet are >+wrong), but you get the idea. > >+The proxy example setting simulates the following situation: >+* A customer wants a company hostname and URLs without Lenya-specific >+ path components for the live site. >+* The server uses name-based virtual hosting with just one IP, i.e. >+ there can only be one SSL vhost, which is shared among several >+ customers. This implies the need for sub-directories in the proxy >+ URL. >+* "authoring" should be ssl-protected. There is no need for a >+ customer hostname here, since it's not publicly visible. >+* Any SSL-protected documents in "live" can be handled by the SSL >+ vhost (not using the company hostname is ok in this case). >+ >+The desired customer hostname is customer.example.com. >+The SSL vhost is called www.example.com. >+The Lenya CMS for our customer is reachable as >+https://www.example.com/lenya/customer/authoring >+The global proxy for non-publication-specific resources shall be >+http://www.example.com/lenya. >+ >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43769
:
21076
|
21078
|
21081