RE: $link

2015-02-19 Thread Logan Stinger
SOLR uses response writers to convert a SOLR response in to the desired output 
format.  There are various response writers you can use right out of the box 
and you can control which one is used via command line parameters or via 
solrconfig.xml file.  Ie. wt=xml, wt=json, wt=velocity
The VelocityResponseWriter class has a hard coded list of tools that it injects 
in to the context.  I don't know what version of velocity you are using but the 
link below is the source of the VelocityResponseWriter for version 3.5.  I'm 
sure later versions of this class are similar.  I have a custom version of this 
class in my project that only injects the tools I use/need.

http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-velocity/3.5.0/org/apache/solr/response/VelocityResponseWriter.java

-Original Message-
From: phi...@free.fr [mailto:phi...@free.fr] 
Sent: Thursday, February 19, 2015 8:03 AM
To: Velocity Users List
Subject: Re: $link

Hi,

I am using the SOLR version of Velocity, running in Tomcat, which doesn't seem 
to have a toolbox.xml file. I have manually created such a file, and added it to

...apache-tomcat-8.0.15/webapps/solr/WEB-INF

but to no avail.

Philippe



- Mail original -
De: "Mike Kienenberger" 
À: "Velocity Users List" 
Envoyé: Jeudi 19 Février 2015 14:30:14
Objet: Re: $link

Add "link" to your velocity toolbox.xml file.

If you search for "math", you should be able to find the file and 
then add a new entry for "link"

See LinkTool.html for more information specific to link.

http://velocity.apache.org/tools/devel/view/LinkTool.html


See config.html for general information on tool configuration.

http://velocity.apache.org/tools/releases/2.0/config.html


On Thu, Feb 19, 2015 at 5:59 AM,   wrote:
> Hi,
>
> how do you access $link in velocity templates?
>
> I have access to $math, but not link.
>
> Many thanks.
>
> Philippe
>
> -
> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
> For additional commands, e-mail: user-h...@velocity.apache.org
>

-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



RE: Standalone pages

2014-10-09 Thread Logan Stinger
It depends on the contents of your velocity file. 

 If your velocity file contains no variables that need replaced by the velocity 
engine and is simply an html page then the answer is yes.  You simply need to 
place the file in a directory that is accessible via url.  I'm assuming you 
have an images folder or some other folder where you can currently access image 
from e.g.   You would simply put 
your velocity file in a similar directory and reference it 
http://myserver:8983/static/velocityfile.vm.  You would also need to make sure 
your server is configured to send the proper content-type headers for such a 
request (map .vm extensions to content-type text/html).  

If your velocity file is not static and has variables or velocity code that 
needs processed then your best bet might be to create a filter such that urls 
of *.vm get processed by this filter and the results spit out.


-Original Message-
From: phi...@free.fr [mailto:phi...@free.fr] 
Sent: Thursday, October 09, 2014 8:13 AM
To: Velocity Users List
Subject: Re: Standalone pages

Hi Erik,

thank you for your reply.

However, come to think of it, my question is not SOLR-specific.

I would like to know if it is possible to create lightweight Web pages with 
Velocity, in Tomcat, without resorting to servlets, JSP, etc.

In other words, can you add a Velocity template to a Tomcat server as easily as 
you can drop a .php file in an Apache server's DocumentRoot directory.

Many thanks.

Philippe



- Mail original -
De: "Erik Hatcher" 
À: "Velocity Users List" 
Envoyé: Jeudi 9 Octobre 2014 14:59:02
Objet: Re: Standalone pages

Philiippe - I just noticed you posted this to the velocity user list.  How Solr 
uses Velocity is perhaps a bit niche/different, so best to ask over on the Solr 
user list for future questions about the Solr/Velocity integration.  But I’m on 
both lists :)

Erik

On Oct 9, 2014, at 4:19 AM, phi...@free.fr wrote:

> Hello,
> 
> I am using currently the Velocity templates that come with the example 
> provided with SOLR, in Tomcat 7.
> 
> I would like to add a Velocity template called test.vm, in the 
> example/solr/mycollection directory, to display an HTML page containing an 
> image.
> 
> Unfortunately, the following URL
> 
> http://myserver:8983/solr/mycollection/test
> 
> returns a 404 error.
> 
> http://myserver:8983/solr/mycollection/browse
> 
> works, though.
> 
> How does one create "standalone" Velocity pages, such as test.vm?
> 
> Many thanks.
> 
> Philippe
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
> For additional commands, e-mail: user-h...@velocity.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org


-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



RE: Custom Java Object stored in Velocity Context

2011-06-02 Thread Logan Stinger
I'm using velocity 1.6.4 as packaged with Solr.  So everything is going
through the VelocityResponseWriter which is also part of Solr.  I was adding
objects to the context using response.add("name" value);  and in the
VelocityResponseWriter the Solr response is added to the VelocityContext but
it appears as though the object goes through some serialization prior to
getting added.  I just made my own version of VelocityResponseWriter and it
solved the issue.  Thanks for your help.

-Original Message-
From: Nathan Bubna [mailto:nbu...@gmail.com] 
Sent: Wednesday, June 01, 2011 10:48 PM
To: Velocity Users List
Subject: Re: Custom Java Object stored in Velocity Context

Well, i've got no problems getting Velocity to call public methods on
instances of publicly declared classes.  Got any more info you can share?
Like the class in question?  Velocity version?  Log messages?
Anything?

On Wed, Jun 1, 2011 at 7:53 PM, Logan Stinger  wrote:
> The class is very simple right now, public class with 5 public getters and
setters.  Nothing else to it.  I've tried sticking a few other classes in
the context to test them.  I have been unable to get anything but the
toString representation of any of them.
>
> On Jun 1, 2011, at 5:15 PM, Nathan Bubna wrote:
>
>> The class of the object and the method itself must be declared public.
>>
>> On Wed, Jun 1, 2011 at 1:38 PM, Logan Stinger 
wrote:
>>
>>> I have the following code:
>>>
>>> …
>>>
>>> List history =
>>> repository.getDocumentHistoryForId("8B2F2F53-7DEA-45B6-84BA-60F2FA11
>>> F07D");
>>>
>>> context.put("documentHistory", history);
>>>
>>>
>>>
>>> Then in my notes.vm file I have the following:
>>>
>>> #foreach($doc in $response.response.get("documentHistory"))
>>>
>>> $doc
>>>
>>> #end
>>>
>>>
>>>
>>> The rendered output is what I would expect.  However, I don’t want 
>>> to see the toString() representation of my object.  I want to see 
>>> the value of a particular method call on my object.
>>>
>>>
>>>
>>> So I changed my notes.vm to be this:
>>>
>>> #foreach($doc in $response.response.get("documentHistory"))
>>>
>>> $doc.isMax()
>>>
>>> #end
>>>
>>>
>>>
>>> In this case my rendered output is simply:
>>>
>>> $doc.isMax() $doc.isMax()
>>>
>>>
>>>
>>> I was under the impression that I could add any java object to the 
>>> velocity context and call any method on that object in my velocity 
>>> template.  Am I misunderstanding?
>>>
>>>
>>>
>>>
>>>
>>> *Logan Stinger*
>>>
>>> *[image: Description: bluelid_logo_small]*
>>>
>>> * *
>>>
>>> (515) 281-6702
>>>
>>> (515) 822-8212
>>>
>>> lstin...@bluelid.com
>>>
>>>
>>>
>>>
>>>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
> For additional commands, e-mail: user-h...@velocity.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



Re: Custom Java Object stored in Velocity Context

2011-06-01 Thread Logan Stinger
The class is very simple right now, public class with 5 public getters and 
setters.  Nothing else to it.  I've tried sticking a few other classes in the 
context to test them.  I have been unable to get anything but the toString 
representation of any of them.

On Jun 1, 2011, at 5:15 PM, Nathan Bubna wrote:

> The class of the object and the method itself must be declared public.
> 
> On Wed, Jun 1, 2011 at 1:38 PM, Logan Stinger  wrote:
> 
>> I have the following code:
>> 
>> …
>> 
>> List history =
>> repository.getDocumentHistoryForId("8B2F2F53-7DEA-45B6-84BA-60F2FA11F07D");
>> 
>> context.put("documentHistory", history);
>> 
>> 
>> 
>> Then in my notes.vm file I have the following:
>> 
>> #foreach($doc in $response.response.get("documentHistory"))
>> 
>> $doc
>> 
>> #end
>> 
>> 
>> 
>> The rendered output is what I would expect.  However, I don’t want to see
>> the toString() representation of my object.  I want to see the value of a
>> particular method call on my object.
>> 
>> 
>> 
>> So I changed my notes.vm to be this:
>> 
>> #foreach($doc in $response.response.get("documentHistory"))
>> 
>> $doc.isMax()
>> 
>> #end
>> 
>> 
>> 
>> In this case my rendered output is simply:
>> 
>> $doc.isMax() $doc.isMax()
>> 
>> 
>> 
>> I was under the impression that I could add any java object to the velocity
>> context and call any method on that object in my velocity template.  Am I
>> misunderstanding?
>> 
>> 
>> 
>> 
>> 
>> *Logan Stinger*
>> 
>> *[image: Description: bluelid_logo_small]*
>> 
>> * *
>> 
>> (515) 281-6702
>> 
>> (515) 822-8212
>> 
>> lstin...@bluelid.com
>> 
>> 
>> 
>> 
>> 


-
To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
For additional commands, e-mail: user-h...@velocity.apache.org



Custom Java Object stored in Velocity Context

2011-06-01 Thread Logan Stinger


I have the following code:

.

List history =
repository.getDocumentHistoryForId("8B2F2F53-7DEA-45B6-84BA-60F2FA11F07D");

context.put("documentHistory", history);

 

Then in my notes.vm file I have the following:

#foreach($doc in $response.response.get("documentHistory"))

$doc

#end

 

The rendered output is what I would expect.  However, I don't want to see
the toString() representation of my object.  I want to see the value of a
particular method call on my object.

 

So I changed my notes.vm to be this:

#foreach($doc in $response.response.get("documentHistory"))

$doc.isMax()

#end

 

In this case my rendered output is simply:

$doc.isMax() $doc.isMax()

 

I was under the impression that I could add any java object to the velocity
context and call any method on that object in my velocity template.  Am I
misunderstanding?

 

 

Logan Stinger

Description: bluelid_logo_small

 

(515) 281-6702

(515) 822-8212

 <mailto:lstin...@bluelid.com> lstin...@bluelid.com

 

 



Velocity.log file location

2011-05-12 Thread Logan Stinger


I'm using a nightly build of Solr 4.0 and I'm deploying the solr.war file to
jboss 6.0.0.  The velocity.log file gets written to the directory I'm in
when I start JBoss.  Where do I specify where this log file should be
written too?

 

Logan Stinger

Description: bluelid_logo_small

 

(515) 281-6702

(515) 822-8212

 <mailto:lstin...@bluelid.com> lstin...@bluelid.com

 

 



Velocity log file

2011-05-12 Thread Logan Stinger


I'm using velocity as part of Solr.  I am deploying my web app on JBossAS
6.0.0.  The velocity.log file is being created in the directory I start
jboss from.  Where do I configure where the velocity.log file gets written
too?

 

Logan Stinger

Description: bluelid_logo_small

 

(515) 281-6702

(515) 822-8212

 <mailto:lstin...@bluelid.com> lstin...@bluelid.com