HANAX wrote:
It seems good but it does not work :) I think I finally understood an idea how to "include" files, but it seems 
that forrest doesn't know that it should include something. I mean: how can it know, that <vxml:grammar 
src="simple.jsgf"/> stands for "include external file"? It can't check every attribute value which 
seems have good format for pattern... So I think that this cause that solution doesn't work. Shouldn't I use some xsl 
"instruction for include" or something like that?

(can you please make comments inline so that the context of the discussion is not lost. It makes reading the archives much easier.)

It does not work in which context ("forrest run" and/or "forrest site"?)

You are correct that Forrest cannot know to include this particular file if we do Forrest site. However, with "forrest run" the document should be requested by the client and therefore Forrest would know to serve it.

Lets get it working with "forrest run", we'll solve the "forrest site" issue later.

With the changes I recommend you should be able to request you *.jsgf file in the browser and see it, if you don't then it is a problem with the matcher.

One problem is that I told you to use pattern="**.jsgf", this but I also told you to take out the path to the grammar file. Hence the match will not work (** matches patterns with at least one '/' in them)

You should change the pattern to "*.jsgf"

Ross

______________________________________________________________________
PÔVODNÁ SPRÁVA
Od: "Ross Gardler" <[EMAIL PROTECTED]>
Pre: "HANAX" <[EMAIL PROTECTED]>
Predmet: Re: additional resources for plugins (was Re: problem)
Dátum/Čas: 28. 7. 2005 11:57:53


HANAX wrote:

Ok, so what I need:

root
+--Grammars
  +--simple.jsgf
+--index.mxml

and how it should look in code
<vxml:grammar src="..\Grammars\simple.jsgf"/>


[WARNING] I have not tested this, so if it does not work come back with error messages

Make that <vxml:grammar src="simple.jsgf"/> and make Forrest worry about where to find the file, like this...

Add a match to your plugin sitemap:

<map:match pattern="**.jsgf">
  <map:generate src="resources/grammars/{1}.jsgf"/>
  <map:serialize type="xml"/>
</map:match>

(I'm assuming your grammar file is XML)

Place your grammar file in PLUGIN_HOME/resources/grammars


My questions are:
- is the path correct? Is ok to have grammars dir in output build dir? If not, 
where to palce all related files I need?


Like I said before, it depends who writes these grammars...


- I need that this file will be automatically copied while processing. How to do that? 
How to tell forrest that "I use these files, please copy them for me into buit 
site"


In the above solution it should all happen auotmatically (be sure to tests "forrest site")


This grammar is created by myself.


Yourself in what role? I am assuming you mean the plugin designer rather than site designer or content editor. If you mean something else then the above solution is only partially correct.


There is another way - embedding all grammars into mxml file, but because of 
reuseability I'll prefer external source.


+1


So to be concrete, now I have structure:
plugin\resources
+--grammars
+--stylesheets


good


and need to have structure afret build as I wrote before.
I really can't explain better with my english :) It's simply the general problem of using external files. For example css or images... I can design it in plugin folder and

everything will be ok, but how these realted files will be copied to result site?
You explained perfectly well I think :-)

Let us know if my approach works.

Ross







Reply via email to