You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@forrest.apache.org by Web Maestro Clay <th...@gmail.com> on 2006/03/24 02:03:04 UTC

OpenOffice.org Plugin List styling problem

I'm wondering if anyone has come up with a solution to an  
OpenOffice.org problem where it inconsistently styles lists. Here's a  
relevant snippet of the OpenOffice.org Writer's 'content.xml' file:

<text:unordered-list text:style-name="L1">
   <text:list-item>
     <text:p text:style-name="P1">
       Direct sale from wet or exchange inventory
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P1">
       Exchange delivery from wet or exchange inventory
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P1">
       Pipeline and truck transfers
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P1">
       Purchases or exchange receipts into wet inventory
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P1">
       Product, volume, price, tax, or freight adjustments
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P1">
       Outright reversal of a previously-billed invoice
     </text:p>
   </text:list-item>
   <text:list-item>
     <text:p text:style-name="P2">
       Exchange settlements
     </text:p>
   </text:list-item>
</text:unordered-list>

NOTE: I did not specifically apply the style P2 to the last item, and  
I can't seem to get rid of it.

Forrest appears to wrap the text for each list-item with <p></p>  
tags, which doesn't seem to 'help', as seen in the
Forrest HTML Output:
<ul>
<li>
<p class="P1">Direct sale from wet or exchange inventory </p>
</li>
<li>
<p class="P1">Exchange delivery from wet or exchange inventory </p>

</li>
<li>
<p class="P1">Pipeline and truck transfers </p>
</li>
<li>
<p class="P1">Purchases or exchange receipts into wet inventory </p>
</li>
<li>
<p class="P1">Product, volume, price, tax, or freight adjustments </p>
</li>
<li>
<p class="P1">Outright reversal of a previously-billed invoice </p>
</li>

<li>
<p class="instruction">Exchange settlements </p>
</li>
</ul>

Although I want to use the 'class="instruction"' for other documents,  
I tried commenting out the XSL in the two plugins files as follows,  
but it didn't help:

   <!--+
       | special list format p2
       |
       | 0verwrites template in openoffice-common2forrest
       | to allow for bulleted list item 'forrest: instructional  
step' in oo to
       | become a simple para with a class-attr in forrest (instruction)
       | In order to do so, this template omits the <ul>-Element
       | and bypasses the processing of the <li>-Element.
       |
       +-->
      <!-- Commented out by CL 20060323
   <xsl:template match="text:unordered-list[@text:style-name='L2']">
       <xsl:apply-templates select="text:list-item/text:p"/>
       <xsl:apply-templates select="text:list-item/text:unordered- 
list"/>
       <xsl:apply-templates select="text:list-item/text:ordered-list"/>
   </xsl:template>
      -->

   <!--+
       | Instructional step
       +-->
       <!-- Commented out by CL 20060323
   <xsl:template match="text:p[@text:style-name='P2']">
     <p class="instruction">
       <xsl:apply-templates/>
     </p>
   </xsl:template>
      -->
</xsl:stylesheet>

NOTE: The above change was made to both of the following files:  
forrest/trunk/plugins/org.apache.forrest.plugin.input.OpenOffice.org/ 
resources/stylesheets/openoffice-writer-to-forrest.xsl
forrest/trunk/build/plugins/ 
org.apache.forrest.plugin.input.OpenOffice.org/resources/stylesheets/ 
openoffice-writer-to-forrest.xsl

Any ideas?

Clay Leeds
the.webmaestro@gmail.com

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet




OOo & Forrest - Missing Styles (was Re: OpenOffice.org Plugin List styling problem)

Posted by Web Maestro Clay <th...@gmail.com>.
On Mar 24, 2006, at 6:07 AM, Clay Leeds wrote:
> The OpenOffice styling system is tough to get a handle on. I may  
> choose the style 'Heading 2', but it seems to be that if the style  
> didn't come directly from the Forrest sample file in the Forrest  
> plug-in directory (even if those styles have been 'loaded' into the  
> current document via Styles Load [x] Overwrite), Forrest doesn't  
> generate the style as expected.
>
> I was able to workaround the list problem to some degree (95%  
> effective) by selecting above and below the list area and applying  
> the 'Default' paragraph style.
>
> Unfortunately, I am having additional problems applying 'Heading x'  
> styles. They get translated into <p class="Heading 2"> elements  
> instead of <h2>:
>
> <p class="Heading 2">Transaction Types Supported</p>
>
> I think the problem is that I'm starting from blank documents and  
> importing the Forrest-related styles, rather than starting from the  
> Forrest documents. I'm going to see about modifying OpenOffice.org  
> startup system, so new documents are based on Forrest's 'openoffice- 
> writer.sxw'.
>
> One other relevant point, is that I'm using NeoOffice/J (a Mac OS X/ 
> Java port of OpenOffice.org based on 1.1.5 which doesn't require X11).
>
> Clay Leeds

I thought I'd add, that it appears that OpenOffice.org 2.x appears to  
work better than OOo 1.x in this regard. Although the styles will  
disappear when deleted from a document, at least, the style can be re- 
added when launched again (unlike in OOo 1.x).

Clay Leeds
the.webmaestro@gmail.com

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet




Re: OpenOffice.org Plugin List styling problem

Posted by Clay Leeds <we...@mac.com>.
On Mar 24, 2006, at 9:05 AM, Ross Gardler wrote:
> Clay Leeds wrote:
>> On Mar 24, 2006, at 6:45 AM, Ross Gardler wrote:
>>> Clay Leeds wrote:
>>>
>>>> I think the problem is that I'm starting from blank documents  
>>>> and   importing the Forrest-related styles, rather than starting  
>>>> from  the  Forrest documents. I'm going to see about modifying   
>>>> OpenOffice.org  startup system, so new documents are based on   
>>>> Forrest's 'openoffice- writer.sxw'.
>>>
>>> That sounds like a good solution. If you figure out how to do  
>>> this  then a patch for the docs would be welcome.
>> Editing Default Styles - NeoWiki (from the NeoOffice/J project)
>> http://neowiki.sixthcrusade.com/index.php/Editing_Default_Styles
>> The main problem I have with this solution, is that it now starts   
>> with a page full of Forrest stuff (it contains all the content of   
>> openoffice-writer.sxw, rather than just its styles.
>> Any ideas to improve this?
>
> When the original plugin was created the intention was to use a  
> template rather than a document. I remember there being a problem  
> with this, but can't remember what it is - will be in the dev  
> archives.
>
> If the  problem with tempaltes still exists you could create a  
> "Forrest" blank document as your seed. You'll still have to do a  
> "Save As" to give it your own name though.
>
> Ross

I think you're referring to a problem you and I troubleshooted  
(troubleshot?) in 2004. The ultimate 'solution' I ended up using was  
to start from the openoffice-writer.sxw file for *each* document.  
This required retaining the Forrest content to ensure the styles  
remained available. This was unwieldy. Why? Because (for example) as  
soon as the content styled as 'Forrest:Note' was deleted and the  
document saved, the 'Forrest:Note' style was no longer available to  
the document--even if some content styled as Forrest:Note was pasted  
in from another document).

I think this is primarily a OpenOffice.org issue. Nevertheless, it  
dramatically affects it's value. It's possible that OOo 2.x fixes  
this problem (I'm going to analyze this further).

Clay Leeds
webmaestro@mac.com

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet




Re: OpenOffice.org Plugin List styling problem

Posted by Ross Gardler <rg...@apache.org>.
Clay Leeds wrote:
> On Mar 24, 2006, at 6:45 AM, Ross Gardler wrote:
> 
>> Clay Leeds wrote:
>>
>>> I think the problem is that I'm starting from blank documents and   
>>> importing the Forrest-related styles, rather than starting from  the  
>>> Forrest documents. I'm going to see about modifying  OpenOffice.org  
>>> startup system, so new documents are based on  Forrest's 'openoffice- 
>>> writer.sxw'.
>>
>>
>> That sounds like a good solution. If you figure out how to do this  
>> then a patch for the docs would be welcome.
> 
> 
> Editing Default Styles - NeoWiki (from the NeoOffice/J project)
> http://neowiki.sixthcrusade.com/index.php/Editing_Default_Styles
> 
> The main problem I have with this solution, is that it now starts  with 
> a page full of Forrest stuff (it contains all the content of  
> openoffice-writer.sxw, rather than just its styles.
> 
> Any ideas to improve this?

When the original plugin was created the intention was to use a template 
rather than a document. I remember there being a problem with this, but 
can't remember what it is - will be in the dev archives.

If the  problem with tempaltes still exists you could create a "Forrest" 
blank document as your seed. You'll still have to do a "Save As" to give 
it your own name though.

Ross

Re: OpenOffice.org Plugin List styling problem

Posted by Clay Leeds <we...@mac.com>.
On Mar 24, 2006, at 6:45 AM, Ross Gardler wrote:
> Clay Leeds wrote:
>> I think the problem is that I'm starting from blank documents and   
>> importing the Forrest-related styles, rather than starting from  
>> the  Forrest documents. I'm going to see about modifying  
>> OpenOffice.org  startup system, so new documents are based on  
>> Forrest's 'openoffice- writer.sxw'.
>
> That sounds like a good solution. If you figure out how to do this  
> then a patch for the docs would be welcome.

Editing Default Styles - NeoWiki (from the NeoOffice/J project)
http://neowiki.sixthcrusade.com/index.php/Editing_Default_Styles

The main problem I have with this solution, is that it now starts  
with a page full of Forrest stuff (it contains all the content of  
openoffice-writer.sxw, rather than just its styles.

Any ideas to improve this?

BTW, there's also a step-by-step for setting up Calc default templates:
http://trinity.neooffice.org/modules.php? 
name=Forums&file=viewtopic&p=9088#9088

> Building upon this idea, I've always hoped that one day I will find  
> the time to create a custom config for OOo that will only provide  
> the elements we allow.
>
> Ross

Clay Leeds
webmaestro@mac.com

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet




Re: OpenOffice.org Plugin List styling problem

Posted by Ross Gardler <rg...@apache.org>.
Clay Leeds wrote:
> On Mar 23, 2006, at 5:03 PM, Web Maestro Clay wrote:
> 
>> I'm wondering if anyone has come up with a solution to an  
>> OpenOffice.org problem where it inconsistently styles lists. Here's  a 
>> relevant snippet of the OpenOffice.org Writer's 'content.xml' file:
> 
> 
> <snip>
> 
>> NOTE: The above change was made to both of the following files:  
>> forrest/trunk/plugins/ 
>> org.apache.forrest.plugin.input.OpenOffice.org/resources/ 
>> stylesheets/openoffice-writer-to-forrest.xsl
>> forrest/trunk/build/plugins/ 
>> org.apache.forrest.plugin.input.OpenOffice.org/resources/ 
>> stylesheets/openoffice-writer-to-forrest.xsl
>>
>> Any ideas?
> 
> 
> The OpenOffice styling system is tough to get a handle on. I may  choose 
> the style 'Heading 2', but it seems to be that if the style  didn't come 
> directly from the Forrest sample file in the Forrest plug- in directory 
> (even if those styles have been 'loaded' into the  current document via 
> Styles Load [x] Overwrite), Forrest doesn't  generate the style as 
> expected.

Yes, this is by design. It is impossible to predict what someone has 
defined "heading 2" in Open Office to be. I've seen users who use it for 
really random things, not just section headings. Hence we force a user 
to use a defined style.

Remember one of our goals is to provide a consistent look and feel 
across all documents. With an editor like OOo there is too many 
variations of style to achieve the same look in the editor to be able to 
be consistent in the final rendering. The solution to date has to 
severely restrict what the user is allowed to use.

I did implement a partial solution in the past that allowed some style 
information to be passed through as embedded CSS. I'd like to see more 
work on this kind of support for other elements (like heading 2). The 
problem is that there is no guarantee that a user will use heading to as 
a section heading.

> I was able to workaround the list problem to some degree (95%  
> effective) by selecting above and below the list area and applying  the 
> 'Default' paragraph style.
> 
> Unfortunately, I am having additional problems applying 'Heading x'  
> styles. They get translated into <p class="Heading 2"> elements  instead 
> of <h2>:
> 
> <p class="Heading 2">Transaction Types Supported</p>

That sounds like a side effect of the partial styling info I refer to above.

> I think the problem is that I'm starting from blank documents and  
> importing the Forrest-related styles, rather than starting from the  
> Forrest documents. I'm going to see about modifying OpenOffice.org  
> startup system, so new documents are based on Forrest's 'openoffice- 
> writer.sxw'.

That sounds like a good solution. If you figure out how to do this then 
a patch for the docs would be welcome.

Building upon this idea, I've always hoped that one day I will find the 
time to create a custom config for OOo that will only provide the 
elements we allow.

Ross

Re: OpenOffice.org Plugin List styling problem

Posted by Clay Leeds <we...@mac.com>.
On Mar 23, 2006, at 5:03 PM, Web Maestro Clay wrote:
> I'm wondering if anyone has come up with a solution to an  
> OpenOffice.org problem where it inconsistently styles lists. Here's  
> a relevant snippet of the OpenOffice.org Writer's 'content.xml' file:

<snip>

> NOTE: The above change was made to both of the following files:  
> forrest/trunk/plugins/ 
> org.apache.forrest.plugin.input.OpenOffice.org/resources/ 
> stylesheets/openoffice-writer-to-forrest.xsl
> forrest/trunk/build/plugins/ 
> org.apache.forrest.plugin.input.OpenOffice.org/resources/ 
> stylesheets/openoffice-writer-to-forrest.xsl
>
> Any ideas?

The OpenOffice styling system is tough to get a handle on. I may  
choose the style 'Heading 2', but it seems to be that if the style  
didn't come directly from the Forrest sample file in the Forrest plug- 
in directory (even if those styles have been 'loaded' into the  
current document via Styles Load [x] Overwrite), Forrest doesn't  
generate the style as expected.

I was able to workaround the list problem to some degree (95%  
effective) by selecting above and below the list area and applying  
the 'Default' paragraph style.

Unfortunately, I am having additional problems applying 'Heading x'  
styles. They get translated into <p class="Heading 2"> elements  
instead of <h2>:

<p class="Heading 2">Transaction Types Supported</p>

I think the problem is that I'm starting from blank documents and  
importing the Forrest-related styles, rather than starting from the  
Forrest documents. I'm going to see about modifying OpenOffice.org  
startup system, so new documents are based on Forrest's 'openoffice- 
writer.sxw'.

One other relevant point, is that I'm using NeoOffice/J (a Mac OS X/ 
Java port of OpenOffice.org based on 1.1.5 which doesn't require X11).

Clay Leeds
webmaestro@mac.com

My religion is simple. My religion is kindness.
-- HH Dalai Lama of Tibet