Mailing List Archive

Problems with buttons and transform to PDF
Hi,
I've got some problems with Forrest and thus I'm writing hoping to find
answers to my questions. And the questions are:
1) I've edited "tabs.xml" to create my own menu and "site2xhtml.xsl" to
change colors and so on. And now I've got web-page I wanted, but the
tabs are not working. I have 5 Tabs and when I'm loading my project home
page the first Tab is selected. And clicking on others or anything I am
able to do cannot change it. When I click on another Tab, the menu is
updating and I see menu for the tab I selected, but the tab highlighted
is the first one.

Example: I have Tabs Tab1 Tab2 Tab3
and menu 1_label1 2_label1 3_label1
and menu 1_label2 2_label2 3_label2
and menu 1_label3 2_label3 3_label3

And Tab1 is always highlighted like it is selected. Even if I choose
Tab3 by pressing it, I'll have on screen
_Tab1_(active) Tab2 Tab3
and menu is 3_label1
3_label2
3_label3

Could anyone give me an advise - where and what should I edit to make it
work properly. Probably it has to do with colors... But I am tangled in
project files :)

2)I had a problem which shortly can be explained like this: Tab3-Dir was
set to NSS and I stored my files in my-project/content/xdocs/nss
accordingly, but then I tried to load my page with images, they did not
displayed on the screen. I checked properties of the box at the page,
where the image should have been. And I found what it's location
my-project/nss. The way I fix it was (I think) not obvious and proper -
I edited "resources.xmap" and added following:

<map:match pattern="**nss-images/**.*">
<map:read src="content/xdocs/nss/images/{2}.{3}"
mime-type="image/{3}" />
</map:match>

After that the images displayed at the web-page and that was what I
wanted. But the PDF-button functions now with errors - it's not showing
pictures at PDF file. It found the block I need at "document2fo.xsl"
concerning imgpath, but I do not want to edit it without any advise.

Could you tell me how to change this block, or comment my way to make
pictures displaying - it seems to me that it could be done in other
fashion.

With respect,
Timofey Rodionov.
Re: Problems with buttons and transform to PDF [ In reply to ]
Timofey Rodionov wrote:
> Hi,
>
> I've got some problems with Forrest and thus I'm writing hoping to
> find answers to my questions. And the questions are:

I cannot help with the first question, sorry. Perhaps someone else can.

> 2)I had a problem which shortly can be explained like this: Tab3-Dir
> was set to NSS and I stored my files in my-project/content/xdocs/nss
> accordingly, but then I tried to load my page with images, they did
> not displayed on the screen. I checked properties of the box at the
> page, where the image should have been. And I found what it's location
> my-project/nss. The way I fix it was (I think) not obvious and proper
> - I edited "resources.xmap" and added following:
>
>
>
> <map:match pattern="**nss-images/**.*">
>
> <map:read src="content/xdocs/nss/images/{2}.{3}"
>
> mime-type="image/{3}" />
>
> </map:match>
>
> After that the images displayed at the web-page and that was what I
> wanted. But the PDF-button functions now with errors - it's not
> showing pictures at PDF file. It found the block I need at
> "document2fo.xsl" concerning imgpath, but I do not want to edit it
> without any advise.
>
> Could you tell me how to change this block, or comment my way to make
> pictures displaying - it seems to me that it could be done in other
> fashion.

I gather that you are using version forrest-0.5.1

When you build the Forrest's documentation:
cd xml-forrest; ./build.sh; forrest
then you will see an example of using local images.
Go to the "Samples" tab and see the "How to with images".

You should not need to changes any "resources.xmap", nor any
other sitemap, nor any XSL stylesheets. It should just work.
I think that the images need to be in a relative directory
called "my-images".

If you are interested to see how that works behind-the-scenes,
then you can find the files that are involved by doing
cd xml-forrest; find . -type f | xargs grep "my-images"

Also make sure that you have followed
http://xml.apache.org/forrest/faq.html#pdf_images

--David
Re: Problems with buttons and transform to PDF [ In reply to ]
David Crossley wrote:
> Timofey Rodionov wrote:
>
>>Hi,
>>
>>I've got some problems with Forrest and thus I'm writing hoping to
>>find answers to my questions. And the questions are:
>
>
> I cannot help with the first question, sorry. Perhaps someone else can.
>
>
>>2)I had a problem which shortly can be explained like this: Tab3-Dir
>>was set to NSS and I stored my files in my-project/content/xdocs/nss
>>accordingly, but then I tried to load my page with images, they did
>>not displayed on the screen. I checked properties of the box at the
>>page, where the image should have been. And I found what it's location
>>my-project/nss. The way I fix it was (I think) not obvious and proper
>>- I edited "resources.xmap" and added following:
>>
>>
>>
>> <map:match pattern="**nss-images/**.*">
>>
>> <map:read src="content/xdocs/nss/images/{2}.{3}"
>>
>>mime-type="image/{3}" />
>>
>> </map:match>
>>
>>After that the images displayed at the web-page and that was what I
>>wanted. But the PDF-button functions now with errors - it's not
>>showing pictures at PDF file. It found the block I need at
>>"document2fo.xsl" concerning imgpath, but I do not want to edit it
>>without any advise.
>>
>>Could you tell me how to change this block, or comment my way to make
>>pictures displaying - it seems to me that it could be done in other
>>fashion.
>
>
> I gather that you are using version forrest-0.5.1
>

I have some improvements for PDF generation that will go into SVN after
the code freeze for 0.6 is done. It should fix the images problem (or
at least help)

>
> You should not need to changes any "resources.xmap", nor any
> other sitemap, nor any XSL stylesheets. It should just work.
> I think that the images need to be in a relative directory
> called "my-images".
>

Yes, IIRC, this is the only image location that works right now for PDF.

> If you are interested to see how that works behind-the-scenes,
> then you can find the files that are involved by doing
> cd xml-forrest; find . -type f | xargs grep "my-images"
>
> Also make sure that you have followed
> http://xml.apache.org/forrest/faq.html#pdf_images
>
> --David
>
>


--
Dave Brondsema : dave@brondsema.net
http://www.splike.com : programming
http://csx.calvin.edu : student org
http://www.brondsema.net : personal