You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Joern Nettingsmeier <po...@uni-due.de> on 2006/09/07 16:10:28 UTC

bxe broken in trunk..

"No bxe_xpath found found in your Layout (HTML) file"

verified with clean checkout and default publication.

any takers?





-- 
"I don't need backups. I need restore!" - Trad.

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736


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


Re: bxe broken in trunk..

Posted by Andreas Hartmann <an...@apache.org>.
Jonathan Addison wrote:

[...]

> Previously when it was <div id="body" bxe_xpath="..."> it went through 
> these stylesheets with no problem, and since <div id="body"> has now 
> been moved to page2xhtml.xsl it would make sense to move the bxe_xpath 
> parameter there as well.
> 
> This would also remove another reference to bxe from the resource type 
> modules, which is a good thing IMO.

Sounds good, would you mind filing a bug and attaching a patch?
Thanks a lot for investigating!

BTW, sorry that I broke it, it was necessary to remove invalid CSS
requests.

-- Andreas


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


Re: bxe broken in trunk..

Posted by Jonathan Addison <jo...@wyona.com>.
Jörn Nettingsmeier wrote:
> Jonathan Addison wrote:
>> Hi Jörn,
>>
>> Jörn Nettingsmeier wrote:
>>> Joern Nettingsmeier wrote:
>>>> "No bxe_xpath found found in your Layout (HTML) file"
>>>> verified with clean checkout and default publication.
>>
>> I believe this has to do with the recent changes to page2xhtml.xsl in 
>> the default pub and xhtml2xhtml.xsl in the xhtml module (rev 439367).
>
> yeah, i have just made sure it's indeed r439367.
>
>> Specifically, changing from this code in xhtml2xhtml.xsl:
>>
>> <div id="body">
>>    <xsl:if test="$rendertype = 'edit'">
>>      <xsl:attribute 
>> name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
>>    </xsl:if>
>>    <xsl:apply-templates select="xhtml:body/node()"/>
>>  </div>
>>
>> to this:
>>
>> <html>
>>    <body>
>>      <xsl:if test="$rendertype = 'edit'">
>>        <xsl:attribute 
>> name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
>>      </xsl:if>
>>      <xsl:apply-templates select="xhtml:body/node()"/>
>>    </body>
>>  </html>
>>
>> I will test moving
>>
>> <xsl:if test="$rendertype = 'edit'">
>>     <xsl:attribute 
>> name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
>> </xsl:if>
>>
>> to page2xhtml.xsl as a fix.
>
> yes, the problem is that the body element carries the bxe_xpath 
> attribute, and it's lost in transformation.
>
> when i look at the stages in
>
>   lenyabody-edit/default/authoring/homepage/index.html,
>
> after the aggregation i see
>
> ...
>   </div>
>   <html xmlns="http://www.w3.org/1999/xhtml" 
> xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
> xmlns:xhtml="http://www.w3.org/1999/xhtml">
>     <head>
>       <link type="text/css" 
> href="/default/modules/homepage/css/homepage.css" rel="stylesheet" />
>     </head>
>     <body bxe_xpath="/xhtml:html/xhtml:body">
>       <h1>Hello and welcome to the Lenya default publication!</h1>
> ...
>
> as you can see, the bxe_xpath attribute is there. but after the xslt 
> transform with src=fallback://xslt/page2xhtml-homepage.xsl, it's gone:

Yes, but <body bxe_xpath="..."> will never work.  There is another stage 
in between,  ( xhtml2xhtml.xsl -> *menu2xslt.xsl* -> page2xhtml.xsl ) 
where the top lenya menus are added, and menu2xslt.xsl strips out this 
<body> tag and creates a new one.

Here is the menu2xslt.xsl code:
<body>
   <xsl:apply-templates select="xhtml:div[@id = 'lenya-logo']"/>
    <xsl:apply-templates select="xhtml:div[@id = 'lenya-menus']"/>
    <div id="lenya-cmsbody">
       <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
    </div>
    <script type="text/javascript"> initialize(); </script>
</body>

You can see where this is called in the global-sitemap.xmap by searching 
for menu2xslt.xsl.

Previously when it was <div id="body" bxe_xpath="..."> it went through 
these stylesheets with no problem, and since <div id="body"> has now 
been moved to page2xhtml.xsl it would make sense to move the bxe_xpath 
parameter there as well.

This would also remove another reference to bxe from the resource type 
modules, which is a good thing IMO.


>
> ...
>   </div>
>      <div id="body">
>        <h1 
> xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
> xmlns:xhtml="http://www.w3.org/1999/xhtml">Hello and welcome to the 
> Lenya default publication!</h1>
>
>
> i'm not sure about the correct fix, since i haven't yet checked all 
> places where div#body is treated specially.
>
> while i've been struggling with the integration of tinymce, i have 
> become convinced that we must get rid of all the bxe hacks in the 
> publication sitemap, and i think it shouldn't be too hard.
> first step is to remove the lenyabody-[view|edit] kludge from the 
> sitemap. then the bxe usecase view must call into the publication 
> sitemap and get the standard rendering of the page without any hacks.
> then it can apply another transformation that will insert the 
> necessary kludges, which will thus be contained in the module and not 
> mess up sitemaps all over the place.
>
> this bug is a great example of why such a change is important.
>
> my tinymce module does not work yet as i'm still figuring out how to 
> get a flow and continuation id, but the basic approach is this:
>
> <map:pipelines>
>
>  <map:pipeline internal-only="yes">
>    <!-- when editing, the page should look exactly like the original,
>         and since we cannot know anything about the pipelines used for
>         rendering, we must delegate the job to the publication's own
>         sitemap. -->
>    <map:match pattern="tinymce.delegateToPubSitemap/**">
>      <map:mount
>        src="{fallback:{page-envelope:publication-id}:sitemap.xmap}"
>        uri-prefix="tinymce.delegateToPubSitemap"/>
>    </map:match>
> </map:pipeline>
>
> <map:pipeline>
>   <map:match pattern="tinymce.content">
>     <map:select type="resource-exists">
>       <!-- check if TinyMCE is installed -->
>       <map:when
> test="fallback://lenya/modules/tinymce/resources/tinymce/jscripts/tiny_mce/tiny_mce.js"> 
>
>         <map:generate
> src="cocoon:/tinymce.delegateToPubSitemap/authoring{page-envelope:document-url}"/> 
>
>         <map:serialize type="xml"/>
>       </map:when>
>       <!-- TinyMCE is not installed - generate info page for the user-->
>       <map:otherwise>
>         <map:generate 
> src="fallback://lenya/modules/tinymce/resources/misc/download.xhtml"/>
>         <map:call resource="style-cms-page"/>
>         <map:serialize type="xhtml" />
>       </map:otherwise>
>     </map:select>
>   </map:match>
> </map:pipeline>
>
> <map:pipeline>
>   <!-- this pattern is used as <view uri="..."/> -->
>   <map:match pattern="tinymce.edit">
>     <map:generate src="cocoon:/tinymce.content"/>
>       <map:transform
>           src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl">
>         <map:parameter name="contextPath"
>               value="{request:context}"/>
>         <map:parameter name="continuationId"
>               value="{flow-continuation:id}"/>
>         <map:parameter name="usecaseName"
>               value="{request-param:lenya.usecase}"/>
>       </map:transform>
>       <map:serialize type="xhtml"/>
>     </map:match>
>   </map:pipeline>
>
> </map:pipelines>
>
>
> as you can see, the usecase view consists of the normal view that is 
> then transformed with page2edit.xsl to add the necessary tinymce code 
> snippets:
>
> <xsl:param name="contextPath" select="'BUG!'"/>
> <xsl:param name="continuationId" select="'BUG!'"/>
> <xsl:param name="usecaseName" select="'BUG!'"/>
>
> <xsl:template match="xhtml:html/xhtml:head/xhtml:*[last()]">
>   <xsl:call-template name="identity"/>
>     <!-- the &#160; weirdness is a workaround for a firefox.
>          try without, and the whole page gets interpreted as a
>          comment or something. -->
>     <script
>       language="javascript"
>       type="text/javascript"
> src="{$contextPath}/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js">&#160; 
>
>     </script>
>     <script
>       language="javascript"
>       type="text/javascript" 
> src="{$contextPath}/modules/tinymce/javascript/tiny_lenya_glue.js">&#160;
>     </script>
>     <script
>       language="javascript"
>       type="text/javascript" 
> src="{$contextPath}/modules/tinymce/javascript/tiny_config.js">&#160;
>     </script>
> </xsl:template>
>
> <xsl:template match="xhtml:html/xhtml:body/xhtml:*[last()]">
>   <form method="post" name="tinymce" id="tinymce" style="display:none">
>     <input type="hidden" name="lenya.continuation"
>        value="{$continuationId}"/>
>     <input type="hidden" name="lenya.usecase" value="{$usecaseName}"/>
>  </form>
>  <xsl:call-template name="identity"/>
> </xsl:template>
>
> <xsl:template match="@*|node()" name="identity">
>   <xsl:copy>
>     <xsl:apply-templates select="@*|node()"/>
>   </xsl:copy>
> </xsl:template>
>
> i'm not really familiar with the internals of the bxe module, but i 
> think a similar approach could be made to work. the problem is that 
> there seems to be some weirdness going on with <view uri="..."/> type 
> usecases: for some reason, no flow is created. a workaround would be 
> to do the entire view in a jxtemplate and cinclude some pipeline content.
>
> wdyt?
>
>


-- 
Jonathan Addison                                 jon<at>wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
 


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


Re: bxe broken in trunk..

Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Jonathan Addison wrote:
> Hi Jörn,
> 
> Jörn Nettingsmeier wrote:
>> Joern Nettingsmeier wrote:
>>> "No bxe_xpath found found in your Layout (HTML) file"
>>> verified with clean checkout and default publication.
> 
> I believe this has to do with the recent changes to page2xhtml.xsl in 
> the default pub and xhtml2xhtml.xsl in the xhtml module (rev 439367).

yeah, i have just made sure it's indeed r439367.

> Specifically, changing from this code in xhtml2xhtml.xsl:
> 
> <div id="body">
>    <xsl:if test="$rendertype = 'edit'">
>      <xsl:attribute name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
>    </xsl:if>
>    <xsl:apply-templates select="xhtml:body/node()"/>
>  </div>
> 
> to this:
> 
> <html>
>    <body>
>      <xsl:if test="$rendertype = 'edit'">
>        <xsl:attribute 
> name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
>      </xsl:if>
>      <xsl:apply-templates select="xhtml:body/node()"/>
>    </body>
>  </html>
> 
> I will test moving
> 
> <xsl:if test="$rendertype = 'edit'">
>     <xsl:attribute name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
> </xsl:if>
> 
> to page2xhtml.xsl as a fix.

yes, the problem is that the body element carries the bxe_xpath 
attribute, and it's lost in transformation.

when i look at the stages in

   lenyabody-edit/default/authoring/homepage/index.html,

after the aggregation i see

...
   </div>
   <html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
xmlns:xhtml="http://www.w3.org/1999/xhtml">
     <head>
       <link type="text/css" 
href="/default/modules/homepage/css/homepage.css" rel="stylesheet" />
     </head>
     <body bxe_xpath="/xhtml:html/xhtml:body">
       <h1>Hello and welcome to the Lenya default publication!</h1>
...

as you can see, the bxe_xpath attribute is there. but after the xslt 
transform with src=fallback://xslt/page2xhtml-homepage.xsl, it's gone:

...
   </div>
      <div id="body">
        <h1 
xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
xmlns:xhtml="http://www.w3.org/1999/xhtml">Hello and welcome to the 
Lenya default publication!</h1>


i'm not sure about the correct fix, since i haven't yet checked all 
places where div#body is treated specially.

while i've been struggling with the integration of tinymce, i have 
become convinced that we must get rid of all the bxe hacks in the 
publication sitemap, and i think it shouldn't be too hard.
first step is to remove the lenyabody-[view|edit] kludge from the 
sitemap. then the bxe usecase view must call into the publication 
sitemap and get the standard rendering of the page without any hacks.
then it can apply another transformation that will insert the necessary 
kludges, which will thus be contained in the module and not mess up 
sitemaps all over the place.

this bug is a great example of why such a change is important.

my tinymce module does not work yet as i'm still figuring out how to get 
a flow and continuation id, but the basic approach is this:

<map:pipelines>

  <map:pipeline internal-only="yes">
    <!-- when editing, the page should look exactly like the original,
         and since we cannot know anything about the pipelines used for
         rendering, we must delegate the job to the publication's own 

         sitemap. -->
    <map:match pattern="tinymce.delegateToPubSitemap/**">
      <map:mount
        src="{fallback:{page-envelope:publication-id}:sitemap.xmap}"
        uri-prefix="tinymce.delegateToPubSitemap"/>
    </map:match>
</map:pipeline>

<map:pipeline>
   <map:match pattern="tinymce.content">
     <map:select type="resource-exists">
       <!-- check if TinyMCE is installed -->
       <map:when
test="fallback://lenya/modules/tinymce/resources/tinymce/jscripts/tiny_mce/tiny_mce.js">
         <map:generate
src="cocoon:/tinymce.delegateToPubSitemap/authoring{page-envelope:document-url}"/>
         <map:serialize type="xml"/>
       </map:when>
       <!-- TinyMCE is not installed - generate info page for the user-->
       <map:otherwise>
         <map:generate 
src="fallback://lenya/modules/tinymce/resources/misc/download.xhtml"/>
         <map:call resource="style-cms-page"/>
         <map:serialize type="xhtml" />
       </map:otherwise>
     </map:select>
   </map:match>
</map:pipeline>

<map:pipeline>
   <!-- this pattern is used as <view uri="..."/> -->
   <map:match pattern="tinymce.edit">
     <map:generate src="cocoon:/tinymce.content"/>
       <map:transform
           src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl">
         <map:parameter name="contextPath"
               value="{request:context}"/>
         <map:parameter name="continuationId"
               value="{flow-continuation:id}"/>
         <map:parameter name="usecaseName"
               value="{request-param:lenya.usecase}"/>
       </map:transform>
       <map:serialize type="xhtml"/>
     </map:match>
   </map:pipeline>

</map:pipelines>


as you can see, the usecase view consists of the normal view that is 
then transformed with page2edit.xsl to add the necessary tinymce code 
snippets:

<xsl:param name="contextPath" select="'BUG!'"/>
<xsl:param name="continuationId" select="'BUG!'"/>
<xsl:param name="usecaseName" select="'BUG!'"/>

<xsl:template match="xhtml:html/xhtml:head/xhtml:*[last()]">
   <xsl:call-template name="identity"/>
     <!-- the &#160; weirdness is a workaround for a firefox.
          try without, and the whole page gets interpreted as a
          comment or something. -->
     <script
       language="javascript"
       type="text/javascript"
src="{$contextPath}/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js">&#160;
     </script>
     <script
       language="javascript"
       type="text/javascript" 
src="{$contextPath}/modules/tinymce/javascript/tiny_lenya_glue.js">&#160;
     </script>
     <script
       language="javascript"
       type="text/javascript" 
src="{$contextPath}/modules/tinymce/javascript/tiny_config.js">&#160;
     </script>
</xsl:template>

<xsl:template match="xhtml:html/xhtml:body/xhtml:*[last()]">
   <form method="post" name="tinymce" id="tinymce" style="display:none">
     <input type="hidden" name="lenya.continuation"
        value="{$continuationId}"/>
     <input type="hidden" name="lenya.usecase" value="{$usecaseName}"/>
  </form>
  <xsl:call-template name="identity"/>
</xsl:template>

<xsl:template match="@*|node()" name="identity">
   <xsl:copy>
     <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>
</xsl:template>

i'm not really familiar with the internals of the bxe module, but i 
think a similar approach could be made to work. the problem is that 
there seems to be some weirdness going on with <view uri="..."/> type 
usecases: for some reason, no flow is created. a workaround would be to 
do the entire view in a jxtemplate and cinclude some pipeline content.

wdyt?


-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736

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


Re: bxe broken in trunk..

Posted by Jonathan Addison <jo...@wyona.com>.
Hi Jörn,

Jörn Nettingsmeier wrote:
> Joern Nettingsmeier wrote:
>> "No bxe_xpath found found in your Layout (HTML) file"
>> verified with clean checkout and default publication.

I believe this has to do with the recent changes to page2xhtml.xsl in 
the default pub and xhtml2xhtml.xsl in the xhtml module (rev 439367).

Specifically, changing from this code in xhtml2xhtml.xsl:

<div id="body">
    <xsl:if test="$rendertype = 'edit'">
      <xsl:attribute name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
    </xsl:if>
    <xsl:apply-templates select="xhtml:body/node()"/>
  </div>

to this:

<html>
    <body>
      <xsl:if test="$rendertype = 'edit'">
        <xsl:attribute 
name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
      </xsl:if>
      <xsl:apply-templates select="xhtml:body/node()"/>
    </body>
  </html>

I will test moving

<xsl:if test="$rendertype = 'edit'">
     <xsl:attribute name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
</xsl:if>

to page2xhtml.xsl as a fix.

>
> same problem on zones. the trunk is really a bit dodgy today...
>
>
>
>
>


-- 
Jonathan Addison                                 jon<at>wyona.com
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
 


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


Re: bxe broken in trunk..

Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Joern Nettingsmeier wrote:
> "No bxe_xpath found found in your Layout (HTML) file"
> verified with clean checkout and default publication.

same problem on zones. the trunk is really a bit dodgy today...





-- 
"Open source takes the bullshit out of software."
	- Charles Ferguson on TechnologyReview.com

--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736


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