You are viewing a plain text version of this content. The canonical link for it is here.
Posted to doxia-users@maven.apache.org by ol...@orange-ftgroup.com on 2008/06/26 10:16:41 UTC

RE : Snippet with file

Do you know where I can find the source code of this macro to help me understand what's wrong ?

Olivier Beyler
FT/RD/MAPS/AMS/SUME
Ingénieur Architecte
tél. 04 76 76 45 52
olivier.beyler@orange-ftgroup.com



-------- Message d'origine--------
De: Lammert Westerhoff [mailto:westerhoff@gmail.com]
Date: mer. 6/25/2008 10:50
À: doxia-users@maven.apache.org
Objet : Re: Snippet with file
 
It is indeed normal that you don't see the contents of the file. The macro
is searching for a line in the file that contains the Strings "START",
"SNIPPET" and "sommaire" (your specified id). This is where the snippet will
start. It also searching for a similar line but END instead of START. I'm
not 100% sure about the exact Strings. You can look into the source code of
the snippet macro in order to see the code that searches for the start of
the snippet.

2008/6/25 <ol...@orange-ftgroup.com>:

> Thanks again to every one
> I try and on command ligne it's work better
> With <param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
> There is no exception but I've only a square like if I have a
> <source></source> and not the content of the file is it normal ?
>
>
> -----Message d'origine-----
> De : Vincent Siveton [mailto:vincent.siveton@gmail.com]
> Envoyé : mercredi 25 juin 2008 19:22
> À : doxia-users@maven.apache.org
> Objet : Re: Snippet with file
>
> 2008/6/25  <ol...@orange-ftgroup.com>:
> > It's absolutly not situated into NetBeans tree.
> >
> > I think inside the plugin the project dir is overloaded by the maven
> > directory.  this is for this reason that it doesn't find the file.
> > Maven is embeded into Netbeans
>
> Did you try directly in the command line?
>
> Vincent
>
> > With <param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
> > I obtain
> > Caused by: java.io.FileNotFoundException: C:\Program Files\NetBeans
> > 6.1\src\site\xdoc\MU_32_sommaire.fr.xml (Le chemin d'accès spécifié est
> introuvable) Unfortunatly the file is located :
> > C:\projet\OdisSite\src\site\xdoc\MU_32_sommaire.fr.xml
> >
> >
> >
> > -----Message d'origine-----
> > De : Lukas Theussl [mailto:ltheussl@apache.org] Envoyé : mercredi 25
> > juin 2008 18:59 À : doxia-users@maven.apache.org Objet : Re: Snippet
> > with file
> >
> > The exception in your first mail said
> >
> > java.io.FileNotFoundException: C:\Program Files\NetBeans
> > 6.1\MU_32_sommaire.fr.xml
> >
> > so check where the file is located inside your netbeans dir and adjust
> the relative path accordingly.
> >
> > HTH,
> > -Lukas
> >
> >
> > olivier.beyler@orange-ftgroup.com wrote:
> >> Thanks, but I try both without success :-( If I put the full path
> >> <param name="file"
> >> value="C:\projet\OdisSite\src\site\xdoc/MU_32_sommaire.fr.xml"/>
> >> It works
> >> OdisSite is the name of the project and where is located the pom.xml
> file.
> >> As we use several computer the full path can't be use at the end.
> >> (some are on linux, windows...)
> >>
> >> The main idea is to try to separate a big file MU_32.xml into several
> file witch would be assembly by the macro.
> >>
> >>
> >>
> >>
> >> -----Message d'origine-----
> >> De : Lukas Theussl [mailto:ltheussl@apache.org] Envoyé : mercredi 25
> >> juin 2008 18:32 À : doxia-users@maven.apache.org Objet : Re: Snippet
> >> with file
> >>
> >> try
> >>
> >> <param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
> >>
> >> or
> >>
> >> <param name="file"
> >> value="projet/src/site/xdoc/MU_32_sommaire.fr.xml"/>
> >>
> >> (not sure about your project structure, I don't know what the three
> >> dots
> >> mean...)
> >>
> >> HTH,
> >> -Lukas
> >>
> >>
> >> olivier.beyler@orange-ftgroup.com wrote:
> >>
> >>>  <macro name="snippet">
> >>>             <param name="id" value="sommaire"/>
> >>>            <param name="file" value="MU_32_sommaire.fr.xml"/>
> >>>    </macro>
> >>>
> >>>
> >>> the MU_32_sommaire.fr.xml is locate into ...\projet\src\site\xdoc
> >>>
> >>>If I do that I obtain :
> >>>Caused by: java.io.FileNotFoundException: C:\Program Files\NetBeans
> 6.1\MU_32_sommaire.fr.xml (Le fichier spécifié est introuvable)
> >>>        at java.io.FileInputStream.open(Native Method)
> >>>        at java.io.FileInputStream.<init>(FileInputStream.java:106)
> >>>        at java.io.FileInputStream.<init>(FileInputStream.java:66)
> >>>        at
> sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
> >>>        at
> sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
> >>>        at java.net.URL.openStream(URL.java:1007)
> >>>        at
> org.apache.maven.doxia.macro.snippet.SnippetReader.readLines(SnippetReader.java:118)
> >>>        at
> org.apache.maven.doxia.macro.snippet.SnippetReader.readSnippet(SnippetReader.java:59)
> >>>        at
> org.apache.maven.doxia.macro.snippet.SnippetMacro.getSnippet(SnippetMacro.java:150)
> >>>        at
> org.apache.maven.doxia.macro.snippet.SnippetMacro.execute(SnippetMacro.java:110)
> >>>        ... 26 more
> >>>
> >>>Have you got any idea ? I don't want to put the absolute path to the
> >>>file as every one into the team has different path
> >>>
> >>>
> >>
> >>
> >>
> >
>



-- 
Lammert Westerhoff
westerhoff@gmail.com




Re: RE : Snippet with file

Posted by Lukas Theussl <lt...@apache.org>.
The snippet source code is at [1] but I don't think that this will help 
you more than what is documented on the doxia site [2]. In your case you 
need the lines

<!-- START SNIPPET: sommaire -->
... snippet to include ...
<!-- END SNIPPET: sommaire -->

inside MU_32_sommaire.fr.xml.

HTH,
-Lukas


[1] 
https://svn.apache.org/repos/asf/maven/doxia/doxia/tags/doxia-1.0-alpha-11/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/
[2] http://maven.apache.org/doxia/macros/index.html



olivier.beyler@orange-ftgroup.com wrote:
> Do you know where I can find the source code of this macro to help me understand what's wrong ?
> 
> Olivier Beyler
> FT/RD/MAPS/AMS/SUME
> Ingénieur Architecte
> tél. 04 76 76 45 52
> olivier.beyler@orange-ftgroup.com
> 
> 
> 
> -------- Message d'origine--------
> De: Lammert Westerhoff [mailto:westerhoff@gmail.com]
> Date: mer. 6/25/2008 10:50
> À: doxia-users@maven.apache.org
> Objet : Re: Snippet with file
>  
> It is indeed normal that you don't see the contents of the file. The macro
> is searching for a line in the file that contains the Strings "START",
> "SNIPPET" and "sommaire" (your specified id). This is where the snippet will
> start. It also searching for a similar line but END instead of START. I'm
> not 100% sure about the exact Strings. You can look into the source code of
> the snippet macro in order to see the code that searches for the start of
> the snippet.
> 
> 2008/6/25 <ol...@orange-ftgroup.com>:
> 
> 
>>Thanks again to every one
>>I try and on command ligne it's work better
>>With <param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
>>There is no exception but I've only a square like if I have a
>><source></source> and not the content of the file is it normal ?
>>
>>
>>-----Message d'origine-----
>>De : Vincent Siveton [mailto:vincent.siveton@gmail.com]
>>Envoyé : mercredi 25 juin 2008 19:22
>>À : doxia-users@maven.apache.org
>>Objet : Re: Snippet with file
>>
>>2008/6/25  <ol...@orange-ftgroup.com>:
>>
>>>It's absolutly not situated into NetBeans tree.
>>>
>>>I think inside the plugin the project dir is overloaded by the maven
>>>directory.  this is for this reason that it doesn't find the file.
>>>Maven is embeded into Netbeans
>>
>>Did you try directly in the command line?
>>
>>Vincent
>>
>>
>>>With <param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
>>>I obtain
>>>Caused by: java.io.FileNotFoundException: C:\Program Files\NetBeans
>>>6.1\src\site\xdoc\MU_32_sommaire.fr.xml (Le chemin d'accès spécifié est
>>
>>introuvable) Unfortunatly the file is located :
>>
>>>C:\projet\OdisSite\src\site\xdoc\MU_32_sommaire.fr.xml
>>>
>>>
>>>
>>>-----Message d'origine-----
>>>De : Lukas Theussl [mailto:ltheussl@apache.org] Envoyé : mercredi 25
>>>juin 2008 18:59 À : doxia-users@maven.apache.org Objet : Re: Snippet
>>>with file
>>>
>>>The exception in your first mail said
>>>
>>>java.io.FileNotFoundException: C:\Program Files\NetBeans
>>>6.1\MU_32_sommaire.fr.xml
>>>
>>>so check where the file is located inside your netbeans dir and adjust
>>
>>the relative path accordingly.
>>
>>>HTH,
>>>-Lukas
>>>
>>>
>>>olivier.beyler@orange-ftgroup.com wrote:
>>>
>>>>Thanks, but I try both without success :-( If I put the full path
>>>><param name="file"
>>>>value="C:\projet\OdisSite\src\site\xdoc/MU_32_sommaire.fr.xml"/>
>>>>It works
>>>>OdisSite is the name of the project and where is located the pom.xml
>>
>>file.
>>
>>>>As we use several computer the full path can't be use at the end.
>>>>(some are on linux, windows...)
>>>>
>>>>The main idea is to try to separate a big file MU_32.xml into several
>>
>>file witch would be assembly by the macro.
>>
>>>>
>>>>
>>>>
>>>>-----Message d'origine-----
>>>>De : Lukas Theussl [mailto:ltheussl@apache.org] Envoyé : mercredi 25
>>>>juin 2008 18:32 À : doxia-users@maven.apache.org Objet : Re: Snippet
>>>>with file
>>>>
>>>>try
>>>>
>>>><param name="file" value="src/site/xdoc/MU_32_sommaire.fr.xml"/>
>>>>
>>>>or
>>>>
>>>><param name="file"
>>>>value="projet/src/site/xdoc/MU_32_sommaire.fr.xml"/>
>>>>
>>>>(not sure about your project structure, I don't know what the three
>>>>dots
>>>>mean...)
>>>>
>>>>HTH,
>>>>-Lukas
>>>>
>>>>
>>>>olivier.beyler@orange-ftgroup.com wrote:
>>>>
>>>>
>>>>> <macro name="snippet">
>>>>>            <param name="id" value="sommaire"/>
>>>>>           <param name="file" value="MU_32_sommaire.fr.xml"/>
>>>>>   </macro>
>>>>>
>>>>>
>>>>>the MU_32_sommaire.fr.xml is locate into ...\projet\src\site\xdoc
>>>>>
>>>>>If I do that I obtain :
>>>>>Caused by: java.io.FileNotFoundException: C:\Program Files\NetBeans
>>
>>6.1\MU_32_sommaire.fr.xml (Le fichier spécifié est introuvable)
>>
>>>>>       at java.io.FileInputStream.open(Native Method)
>>>>>       at java.io.FileInputStream.<init>(FileInputStream.java:106)
>>>>>       at java.io.FileInputStream.<init>(FileInputStream.java:66)
>>>>>       at
>>
>>sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
>>
>>>>>       at
>>
>>sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
>>
>>>>>       at java.net.URL.openStream(URL.java:1007)
>>>>>       at
>>
>>org.apache.maven.doxia.macro.snippet.SnippetReader.readLines(SnippetReader.java:118)
>>
>>>>>       at
>>
>>org.apache.maven.doxia.macro.snippet.SnippetReader.readSnippet(SnippetReader.java:59)
>>
>>>>>       at
>>
>>org.apache.maven.doxia.macro.snippet.SnippetMacro.getSnippet(SnippetMacro.java:150)
>>
>>>>>       at
>>
>>org.apache.maven.doxia.macro.snippet.SnippetMacro.execute(SnippetMacro.java:110)
>>
>>>>>       ... 26 more
>>>>>
>>>>>Have you got any idea ? I don't want to put the absolute path to the
>>>>>file as every one into the team has different path
>>>>>
>>>>>
>>>>
>>>>
>>>>
> 
> 
>