You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Thorsten Scherler <th...@apache.org> on 2005/03/12 22:13:16 UTC

Re: Embedding forrest in custom software

On Sat, 2005-03-12 at 20:26 +0200, Arik Kfir wrote:
> Hello,
> 
> We are thinking about embedding Forrest as a content generation engine 
> in our software.

Apache lenya is trying to do the same thing. :) 

I changed the response address to the dev list because we discuss such
things in the dev list. ;-)

>  Currently, the direction we want to take is simply 
> embedding the Ant runtime itself, and use it to activate Forrest.
> 
> In details we will:
> 1. Add the Ant JAR files into our classpath.

+1

> 2. Add the xml-forrest.jar to the classpath

+1

> 3. Add required JAR files from Forrest's "lib" directory to the 
> classpath (we're not sure which ones we really need - would appreciate 
> help on this).

That really depends which features of forrest you will going to use.

> 4. Create a template project structure (e.g. src/documentation, 
> forrest.properties, etc) in a temporary directory

Why temporary directory?


> 5. Activate Ant in code (manually create the Project, etc) to run 
> Forrest via its standard build.xml file.
> 

you wrote content generation engine, you will use then the normal
"forrest"-target you mean? 

By following this target you will find out which other libs are
involved.

> Before I start working on this, I was wondering if anyone had any 
> experience in doing this, or any tips/tricks on the subject.
> 

We are using in the 0.7 plugins to extract additional functionality from
the core. Have a look on that. That will give you an idea.

HTH

> 10x in advance!
>     Arik Kfir.
> 
> 

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: Embedding forrest in custom software

Posted by David Crossley <cr...@apache.org>.
Arik Kfir wrote:
> Thorsten Scherler wrote:
> Arik Kfir wrote:
> 
> >>We are thinking about embedding Forrest as a content generation engine 
> >>in our software.
> >
> >Apache lenya is trying to do the same thing. :) 
> >
> >I changed the response address to the dev list because we discuss such
> >things in the dev list. ;-)
> >
> Actually I intentionally sent it to the user list because even though 
> I'm embedding forrest in other software, I'm using it as a forrest 
> user...but on the other hand, this subject can/might get technical so 
> perhaps it's better...

Yes, better to discuss potentially complicated stuff here.
Hopefully the outcome of this discussion will be an FAQ which
the user list people can just read.

> >>Currently, the direction we want to take is simply 
> >>embedding the Ant runtime itself, and use it to activate Forrest.
> >>
> >>In details we will:
> >>1. Add the Ant JAR files into our classpath.
> >
> >+1
> >
> >>2. Add the xml-forrest.jar to the classpath
> >
> >+1
> >
> >>3. Add required JAR files from Forrest's "lib" directory to the 
> >>classpath (we're not sure which ones we really need - would appreciate 
> >>help on this).
> >
> >That really depends which features of forrest you will going to use.
> >
> Yes, I think I'll manage to sort which ones I need...even if it will be 
> on a trial-by-error way ;-)  (I got a "ClassNotFound rain coming" fuzzy 
> feeling...)

Have you seen:
http://forrest.apache.org/docs/your-project.html#invoking_from_ant
or if using 0.7-dev:
http://forrest.apache.org/docs/dev/your-project.html#invoking_from_ant

You might also need tools/ant/lib/ant-apache-resolver.jar

--David

Re: Embedding forrest in custom software

Posted by Arik Kfir <ar...@users.sourceforge.net>.
Hi Thorsten,

Thorsten Scherler wrote:

>On Sat, 2005-03-12 at 20:26 +0200, Arik Kfir wrote:
>  
>
>>Hello,
>>
>>We are thinking about embedding Forrest as a content generation engine 
>>in our software.
>>    
>>
>
>Apache lenya is trying to do the same thing. :) 
>
>I changed the response address to the dev list because we discuss such
>things in the dev list. ;-)
>
>  
>
Actually I intentionally sent it to the user list because even though 
I'm embedding forrest in other software, I'm using it as a forrest 
user...but on the other hand, this subject can/might get technical so 
perhaps it's better...

>> Currently, the direction we want to take is simply 
>>embedding the Ant runtime itself, and use it to activate Forrest.
>>
>>In details we will:
>>1. Add the Ant JAR files into our classpath.
>>    
>>
>
>+1
>
>  
>
>>2. Add the xml-forrest.jar to the classpath
>>    
>>
>
>+1
>
>  
>
>>3. Add required JAR files from Forrest's "lib" directory to the 
>>classpath (we're not sure which ones we really need - would appreciate 
>>help on this).
>>    
>>
>
>That really depends which features of forrest you will going to use.
>
>  
>
Yes, I think I'll manage to sort which ones I need...even if it will be 
on a trial-by-error way ;-)  (I got a "ClassNotFound rain coming" fuzzy 
feeling...)

>>4. Create a template project structure (e.g. src/documentation, 
>>forrest.properties, etc) in a temporary directory
>>    
>>
>
>Why temporary directory?
>
>  
>
This is due to the nature of the application we are writing - the 
documentation submitted by the user goes through other modifications 
because eventually coming to forrest, and so I need a "staging" 
directory where the generated, forrest-ready, documentation will be 
stored. But this has no barring on this subject.

>  
>
>>5. Activate Ant in code (manually create the Project, etc) to run 
>>Forrest via its standard build.xml file.
>>
>>    
>>
>
>you wrote content generation engine, you will use then the normal
>"forrest"-target you mean? 
>
>By following this target you will find out which other libs are
>involved.
>
>  
>
10x, will check it out

>>Before I start working on this, I was wondering if anyone had any 
>>experience in doing this, or any tips/tricks on the subject.
>>
>>    
>>
>
>We are using in the 0.7 plugins to extract additional functionality from
>the core. Have a look on that. That will give you an idea.
>
>  
>
I will, though it won't be too much "deep water" for me, as I'm not 
fully proficient with the forrest internals (yet, I hope ;-))

>HTH
>
>  
>
>>10x in advance!
>>    Arik Kfir.
>>
>>
>>    
>>
>
>salu2
>  
>
10x for all the help!

Re: Embedding forrest in custom software

Posted by Ross Gardler <rg...@apache.org>.
Arik Kfir wrote:
> 10x Ross,
> 
> I'll take a look at them both. If the Eclipse plugin really does "embed" 
> forrest than that is exactly what I need! Will post again should 
> problems arise.

The Eclipse plugin embeds Forrest in an Eclipse plugin (suprise!). What 
youend up with is Forrest embedded in Eclipse.

If you don't know how eclipse works it may seem a little confusing as 
there are lots of hooks in the Eclipse platform being used.  Might be 
easier to start from the forrest.sh|bat script in that case.

However, if you do know how Eclipse works you may find it useful to look 
at 
http://svn.apache.org/viewcvs.cgi/forrest/trunk/tools/eclipse/src/org/apache/forrest/eclipse/job/ForrestRunner.java?rev=153349&view=markup

This is the clasee that does the work of setting up the classpath needed 
and so on.

> After I'm finished, I'll try (if time permits...) to 
> summarize my experience into a document about how to embed Forrest in 
> other software, so that you will be able to put it on your site, for 
> others that will need to do the same (I imagine it might be useful to 
> someone...).

That would be very much appreciated, I am sure you will not be the only 
user needing to do this (in fact I know you aren't)

Ross

Re: Embedding forrest in custom software

Posted by Arik Kfir <ar...@users.sourceforge.net>.
10x Ross,

I'll take a look at them both. If the Eclipse plugin really does "embed" 
forrest than that is exactly what I need! Will post again should 
problems arise. After I'm finished, I'll try (if time permits...) to 
summarize my experience into a document about how to embed Forrest in 
other software, so that you will be able to put it on your site, for 
others that will need to do the same (I imagine it might be useful to 
someone...).

cheers

Ross Gardler wrote:

> Thorsten Scherler wrote:
>
>> On Sat, 2005-03-12 at 20:26 +0200, Arik Kfir wrote:
>
>
> <snip what="a plan for embedding Forrest"/>
>
>>> Before I start working on this, I was wondering if anyone had any 
>>> experience in doing this, or any tips/tricks on the subject.
>>>
>>
>
> In short what you describe is about right.
>
> If you take a look at the Forrest Eclipse plugin in the tools 
> directory you will see exactly what needs to be done with respect to 
> classpath etc.
>
> But even easier still will be to look at the forrest.bat|sh file which 
> sets up the classpath for forrest. You don't need to do anything other 
> than what this script does.
>
> Ross
>
>


Re: Embedding forrest in custom software

Posted by Ross Gardler <rg...@apache.org>.
Thorsten Scherler wrote:
> On Sat, 2005-03-12 at 20:26 +0200, Arik Kfir wrote:

<snip what="a plan for embedding Forrest"/>

>>Before I start working on this, I was wondering if anyone had any 
>>experience in doing this, or any tips/tricks on the subject.
>>
> 

In short what you describe is about right.

If you take a look at the Forrest Eclipse plugin in the tools directory 
you will see exactly what needs to be done with respect to classpath etc.

But even easier still will be to look at the forrest.bat|sh file which 
sets up the classpath for forrest. You don't need to do anything other 
than what this script does.

Ross