Re: Velocity tools download link is broken

2018-02-08 Thread Claude Brisson

Thanks. Fixed.


On 08/02/2018 13:53, sebb wrote:

On 8 February 2018 at 11:04, jmeter tea  wrote:

Hello,

The download velocity tools source is broken in site
http://velocity.apache.org/download.cgi#tools
link is to
http://apache.spd.co.il//velocity/tools/2.0-src/velocity-tools-2.0-src.zip

The path should be

http://apache.spd.co.il//velocity/tools/2.0/velocity-tools-2.0-src.zip

i.e. drop the -src suffix from the directory name


FYI

-
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: Velocity tools download link is broken

2018-02-08 Thread sebb
On 8 February 2018 at 11:04, jmeter tea  wrote:
> Hello,
>
> The download velocity tools source is broken in site
> http://velocity.apache.org/download.cgi#tools
> link is to
> http://apache.spd.co.il//velocity/tools/2.0-src/velocity-tools-2.0-src.zip

The path should be

http://apache.spd.co.il//velocity/tools/2.0/velocity-tools-2.0-src.zip

i.e. drop the -src suffix from the directory name

>
> FYI

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



Velocity tools download link is broken

2018-02-08 Thread jmeter tea
Hello,

The download velocity tools source is broken in site
http://velocity.apache.org/download.cgi#tools
link is to
http://apache.spd.co.il//velocity/tools/2.0-src/velocity-tools-2.0-src.zip

FYI


link of velocity-tools- 3.0-SNAPSHOT

2017-10-06 Thread Daniel Dias Dos Santos
Hello everyone,

I need the link for maven to download SNAPSHOT from Velocity-tools
3.0, but I do not find information on the site for which link to add
in pom.xml to download it. The reason I'm updating the SPEC MVC 1.0
depts, but when I use the velocity-engine-core together with
Velocity-Tools-2.0 of the error, probably because of conflicts or are
not compatible.

Thanks.
--

*Daniel Dias dos Santos*
Java Developer
Diretor SouJava & JCP Member
GitHub: https://github.com/Daniel-Dos
Linkedin: http://br.linkedin.com/in/danieldiassantos
Twitter: http://twitter.com/danieldiasjava

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



Re: $link

2015-02-19 Thread Philippe de Rochambeau

You don’t see any $esc.url() because unescaped URLs, such as the one below 
(notice the lack of %20 between ‘the’  and ‘man’) work fine, as far as I am 
concerned.

I do have ‘year’, ‘month’ and ‘day’ fields, but I find it simpler to split the 
URL rather than padding the day and the month with a zero whenever they are 
less than 10.

I could perhaps use $display.printf to pad the day and month, but 
unfortunately, the Display Tool is not available in SOLR 4.9, as far as I know.

Cheers,

Philippe


>> http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the
>>  man



Le 19 févr. 2015 à 16:42, Erik Hatcher  a écrit :

> I don’t see any $esc() usage below, so looks like I’m missing the full 
> picture.
> 
> However, seeing how you’re splitting off pieces of the “url” field in the 
> results display, maybe it’d make sense to script that piecing out of the url 
> at index time instead into separate fields (month, day, year) or in some way 
> massage the incoming data to be what you need in the results?
> 
>   Erik
> 
> 
> 
> 
>> On Feb 19, 2015, at 10:25 AM, phi...@free.fr wrote:
>> 
>> Here's the code:
>> 
>> -
>> 
>> 
>> 
>> 
>> 
>> ## e.g., apdf0 in /apdf0/189311/28/003_E_PDF.pdf
>> #set($pdf_dir_v = $list.get($doc.getFirstValue('url').split("/"),1))
>> 
>> ## e.g., 189311
>> #set($pdf_year_mon_v = $list.get($doc.getFirstValue('url').split("/"),2))
>> 
>> ## e.g., 28
>> #set($pdf_day_v = $list.get($doc.getFirstValue('url').split("/"),3))
>> 
>> ## e.g., 003_E_PDF.pdf
>> #set($pdf_name_v= $list.get($doc.getFirstValue('url').split("/"),4))
>> 
>> ## Generated URL example: 
>> http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the%20man<http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the%20man>
>> #if ($params.q and $pdf_dir_v and $pdf_year_mon_v and $pdf_day_v and 
>> $pdf_name_v)
>> 
>>  ##set ( $paramsQ = $params.q )
>>  ## Remove double quotes
>>  #set ( $temp0 = $params.q.replaceAll("\"", "") )
>>  ##temp0 : $temp0
>>  
>>  #set ($andIndex = $temp0.indexOf("AND"))
>>  #if ($andIndex >= 0) 
>>  ## eg. "time" in example above
>>  #set ($temp2 = $temp0.substring(0, $andIndex))
>>  #else
>>  #set ($temp2 = $temp0)
>>  #end
>>  ##1) temp2 = $temp2
>>  
>>  #set ($orIndex = $temp0.indexOf("OR"))
>>  #if ($orIndex >= 0) 
>>  ## eg. "time" in example above
>>  #set ($temp2 = $temp0.substring(0, $orIndex))
>>  #else
>>  #set ($temp2 = $temp0)
>>  #end
>>  ##2) temp2 = $temp2
>>  
>>  #if ($temp2 and $temp2.length() > 0) 
>>  ##3) temp2 = '$temp2'
>>  #set( $viewer_js_url = 
>> "/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}#tv=${temp2}"
>>  )
>>  #else
>>  ## If the user didn't select a search criteria (q), let him 
>> view PDF anyway
>>  #set( $viewer_js_url = 
>> "/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}"
>>  )
>>  #end
>> 
>> #end
>> 
>> ---
>> 
>> - Mail original -
>> De: "Erik Hatcher" mailto:erik.hatc...@gmail.com>>
>> À: "Velocity Users List" 
>> mailto:user@velocity.apache.org>>
>> Envoyé: Jeudi 19 Février 2015 16:19:25
>> Objet: Re: $link
>> 
>> If you could show me what you’ve done, I’d be happy to adjust VrW to better 
>> suit your needs if that makes sense.
>> 
>> Feedback welcome!
>> 
>> 
>> —
>> Erik Hatcher, Senior Solutions Architect
>> http://www.lucidworks.com <http://www.lucidworks.com/> 
>> <http://www.lucidworks.com/<http://www.lucidworks.com/>>
>> 
>> 
>> 
>> 
>>> On Feb 19, 2015, at 10:16 AM, phi...@free.fr wrote:
>>> 
>>> Hi Erik,
>>> 
>>> thanks for the pointers.
>>> 
>>> I ended up using a combination of Java String methods and $esc.url().
>>> 
>>> Philippe
>>> 
>>> - Mail original -
>>> De: "E

Re: $link

2015-02-19 Thread Erik Hatcher
I don’t see any $esc() usage below, so looks like I’m missing the full picture.

However, seeing how you’re splitting off pieces of the “url” field in the 
results display, maybe it’d make sense to script that piecing out of the url at 
index time instead into separate fields (month, day, year) or in some way 
massage the incoming data to be what you need in the results?

Erik




> On Feb 19, 2015, at 10:25 AM, phi...@free.fr wrote:
> 
> Here's the code:
> 
> -
> 
> 
> 
> 
> 
> ## e.g., apdf0 in /apdf0/189311/28/003_E_PDF.pdf
> #set($pdf_dir_v = $list.get($doc.getFirstValue('url').split("/"),1))
> 
> ## e.g., 189311
> #set($pdf_year_mon_v = $list.get($doc.getFirstValue('url').split("/"),2))
> 
> ## e.g., 28
> #set($pdf_day_v = $list.get($doc.getFirstValue('url').split("/"),3))
> 
> ## e.g., 003_E_PDF.pdf
> #set($pdf_name_v= $list.get($doc.getFirstValue('url').split("/"),4))
> 
> ## Generated URL example: 
> http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the%20man
>  
> <http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the%20man>
> #if ($params.q and $pdf_dir_v and $pdf_year_mon_v and $pdf_day_v and 
> $pdf_name_v)
> 
>   ##set ( $paramsQ = $params.q )
>   ## Remove double quotes
>   #set ( $temp0 = $params.q.replaceAll("\"", "") )
>   ##temp0 : $temp0
>   
>   #set ($andIndex = $temp0.indexOf("AND"))
>   #if ($andIndex >= 0) 
>   ## eg. "time" in example above
>   #set ($temp2 = $temp0.substring(0, $andIndex))
>   #else
>   #set ($temp2 = $temp0)
>   #end
>   ##1) temp2 = $temp2
>   
>   #set ($orIndex = $temp0.indexOf("OR"))
>   #if ($orIndex >= 0) 
>   ## eg. "time" in example above
>   #set ($temp2 = $temp0.substring(0, $orIndex))
>   #else
>   #set ($temp2 = $temp0)
>   #end
>   ##2) temp2 = $temp2
>   
>   #if ($temp2 and $temp2.length() > 0) 
>   ##3) temp2 = '$temp2'
>   #set( $viewer_js_url = 
> "/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}#tv=${temp2}"
>  )
>   #else
>   ## If the user didn't select a search criteria (q), let him 
> view PDF anyway
>   #set( $viewer_js_url = 
> "/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}"
>  )
>   #end
> 
> #end
> 
> ---
> 
> - Mail original -
> De: "Erik Hatcher" mailto:erik.hatc...@gmail.com>>
> À: "Velocity Users List"  <mailto:user@velocity.apache.org>>
> Envoyé: Jeudi 19 Février 2015 16:19:25
> Objet: Re: $link
> 
> If you could show me what you’ve done, I’d be happy to adjust VrW to better 
> suit your needs if that makes sense.
> 
> Feedback welcome!
> 
> 
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com <http://www.lucidworks.com/> 
> <http://www.lucidworks.com/ <http://www.lucidworks.com/>>
> 
> 
> 
> 
>> On Feb 19, 2015, at 10:16 AM, phi...@free.fr wrote:
>> 
>> Hi Erik,
>> 
>> thanks for the pointers.
>> 
>> I ended up using a combination of Java String methods and $esc.url().
>> 
>> Philippe
>> 
>> - Mail original -
>> De: "Erik Hatcher" 
>> À: "Velocity Users List" 
>> Envoyé: Jeudi 19 Février 2015 16:01:12
>> Objet: Re: $link
>> 
>> I love how the Velocity list e-mails end up being about Solr ;)   
>> 
>> Here are the tools that (Solr 5, a little bit different that previous Solr 
>> versions) has these tools:
>> 
>> context.put("esc", new EscapeTool());
>> context.put("date", new ComparisonDateTool());
>> context.put("list", new ListTool());
>> context.put("math", new MathTool());
>> context.put("number", new NumberTool());
>> context.put("sort", new SortTool());
>> context.put("display", new DisplayTool());
>> context.put("resource", new SolrVelocityResourceTool(
>>   request.getCore().getSolrConfig().getResourceLoader().getClassLoader(),
>>   request.getParams().get(LOCALE)));
>> 
>> LinkTool is not wired in.   There isn’t really a way to add new tools into 
>> the mix without plugging in

Re: $link

2015-02-19 Thread phiroc
Here's the code:

-





## e.g., apdf0 in /apdf0/189311/28/003_E_PDF.pdf
#set($pdf_dir_v = $list.get($doc.getFirstValue('url').split("/"),1))

## e.g., 189311
#set($pdf_year_mon_v = $list.get($doc.getFirstValue('url').split("/"),2))
 
## e.g., 28
#set($pdf_day_v = $list.get($doc.getFirstValue('url').split("/"),3))

## e.g., 003_E_PDF.pdf
#set($pdf_name_v= $list.get($doc.getFirstValue('url').split("/"),4))

## Generated URL example: 
http://abc.com:8983/inytapdf0/pdfjs/web/viewer.html?file=../../189009/01/002_E_PDF.pdf#tv=the%20man
#if ($params.q and $pdf_dir_v and $pdf_year_mon_v and $pdf_day_v and 
$pdf_name_v)

##set ( $paramsQ = $params.q )
## Remove double quotes
#set ( $temp0 = $params.q.replaceAll("\"", "") )
##temp0 : $temp0

#set ($andIndex = $temp0.indexOf("AND"))
#if ($andIndex >= 0) 
## eg. "time" in example above
#set ($temp2 = $temp0.substring(0, $andIndex))
#else
#set ($temp2 = $temp0)
#end
##1) temp2 = $temp2

#set ($orIndex = $temp0.indexOf("OR"))
#if ($orIndex >= 0) 
## eg. "time" in example above
#set ($temp2 = $temp0.substring(0, $orIndex))
#else
#set ($temp2 = $temp0)
#end
##2) temp2 = $temp2

#if ($temp2 and $temp2.length() > 0) 
##3) temp2 = '$temp2'
#set( $viewer_js_url = 
"/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}#tv=${temp2}"
 )
#else
## If the user didn't select a search criteria (q), let him 
view PDF anyway
#set( $viewer_js_url = 
"/${pdf_dir_v}/pdfjs/web/viewer.html?file=../../${pdf_year_mon_v}/${pdf_day_v}/${pdf_name_v}"
 )
#end

#end

---

- Mail original -
De: "Erik Hatcher" 
À: "Velocity Users List" 
Envoyé: Jeudi 19 Février 2015 16:19:25
Objet: Re: $link

If you could show me what you’ve done, I’d be happy to adjust VrW to better 
suit your needs if that makes sense.

Feedback welcome!


—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>




> On Feb 19, 2015, at 10:16 AM, phi...@free.fr wrote:
> 
> Hi Erik,
> 
> thanks for the pointers.
> 
> I ended up using a combination of Java String methods and $esc.url().
> 
> Philippe
> 
> - Mail original -
> De: "Erik Hatcher" 
> À: "Velocity Users List" 
> Envoyé: Jeudi 19 Février 2015 16:01:12
> Objet: Re: $link
> 
> I love how the Velocity list e-mails end up being about Solr ;)   
> 
> Here are the tools that (Solr 5, a little bit different that previous Solr 
> versions) has these tools:
> 
> context.put("esc", new EscapeTool());
> context.put("date", new ComparisonDateTool());
> context.put("list", new ListTool());
> context.put("math", new MathTool());
> context.put("number", new NumberTool());
> context.put("sort", new SortTool());
> context.put("display", new DisplayTool());
> context.put("resource", new SolrVelocityResourceTool(
>request.getCore().getSolrConfig().getResourceLoader().getClassLoader(),
>request.getParams().get(LOCALE)));
> 
> LinkTool is not wired in.   There isn’t really a way to add new tools into 
> the mix without plugging in a new response writer based on Solr’s 
> VelocityResponseWriter (VrW) or overwriting the built-in one.  But you 
> probably don’t really need $link, do you?
> 
> There’s the $esc tool that allows for URL escaping.  It’s used to $esc.html() 
> and $esc.url() in the example templates.
> 
> Happy to help work through this, and even add the LinkTool if you feel it’d 
> be helpful (or work through a way to make tools pluggable in VrW).
> 
>Erik (author/maintainer of VrW)
> 
> 
> 
> 
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com
> 
> 
> 
> 
>> On Feb 19, 2015, at 9:40 AM, Logan Stinger  wrote:
>> 
>> 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 th

Re: $link

2015-02-19 Thread Erik Hatcher
If you could show me what you’ve done, I’d be happy to adjust VrW to better 
suit your needs if that makes sense.

Feedback welcome!


—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>




> On Feb 19, 2015, at 10:16 AM, phi...@free.fr wrote:
> 
> Hi Erik,
> 
> thanks for the pointers.
> 
> I ended up using a combination of Java String methods and $esc.url().
> 
> Philippe
> 
> - Mail original -
> De: "Erik Hatcher" 
> À: "Velocity Users List" 
> Envoyé: Jeudi 19 Février 2015 16:01:12
> Objet: Re: $link
> 
> I love how the Velocity list e-mails end up being about Solr ;)   
> 
> Here are the tools that (Solr 5, a little bit different that previous Solr 
> versions) has these tools:
> 
> context.put("esc", new EscapeTool());
> context.put("date", new ComparisonDateTool());
> context.put("list", new ListTool());
> context.put("math", new MathTool());
> context.put("number", new NumberTool());
> context.put("sort", new SortTool());
> context.put("display", new DisplayTool());
> context.put("resource", new SolrVelocityResourceTool(
>request.getCore().getSolrConfig().getResourceLoader().getClassLoader(),
>request.getParams().get(LOCALE)));
> 
> LinkTool is not wired in.   There isn’t really a way to add new tools into 
> the mix without plugging in a new response writer based on Solr’s 
> VelocityResponseWriter (VrW) or overwriting the built-in one.  But you 
> probably don’t really need $link, do you?
> 
> There’s the $esc tool that allows for URL escaping.  It’s used to $esc.html() 
> and $esc.url() in the example templates.
> 
> Happy to help work through this, and even add the LinkTool if you feel it’d 
> be helpful (or work through a way to make tools pluggable in VrW).
> 
>Erik (author/maintainer of VrW)
> 
> 
> 
> 
> —
> Erik Hatcher, Senior Solutions Architect
> http://www.lucidworks.com
> 
> 
> 
> 
>> On Feb 19, 2015, at 9:40 AM, Logan Stinger  wrote:
>> 
>> 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
>&

Re: $link

2015-02-19 Thread phiroc
Hi Erik,

thanks for the pointers.

I ended up using a combination of Java String methods and $esc.url().

Philippe

- Mail original -
De: "Erik Hatcher" 
À: "Velocity Users List" 
Envoyé: Jeudi 19 Février 2015 16:01:12
Objet: Re: $link

I love how the Velocity list e-mails end up being about Solr ;)   

Here are the tools that (Solr 5, a little bit different that previous Solr 
versions) has these tools:

context.put("esc", new EscapeTool());
context.put("date", new ComparisonDateTool());
context.put("list", new ListTool());
context.put("math", new MathTool());
context.put("number", new NumberTool());
context.put("sort", new SortTool());
context.put("display", new DisplayTool());
context.put("resource", new SolrVelocityResourceTool(
request.getCore().getSolrConfig().getResourceLoader().getClassLoader(),
request.getParams().get(LOCALE)));

LinkTool is not wired in.   There isn’t really a way to add new tools into the 
mix without plugging in a new response writer based on Solr’s 
VelocityResponseWriter (VrW) or overwriting the built-in one.  But you probably 
don’t really need $link, do you?

There’s the $esc tool that allows for URL escaping.  It’s used to $esc.html() 
and $esc.url() in the example templates.

Happy to help work through this, and even add the LinkTool if you feel it’d be 
helpful (or work through a way to make tools pluggable in VrW).

Erik (author/maintainer of VrW)




—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com




> On Feb 19, 2015, at 9:40 AM, Logan Stinger  wrote:
> 
> 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
> 


-
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: $link

2015-02-19 Thread Erik Hatcher
I love how the Velocity list e-mails end up being about Solr ;)   

Here are the tools that (Solr 5, a little bit different that previous Solr 
versions) has these tools:

context.put("esc", new EscapeTool());
context.put("date", new ComparisonDateTool());
context.put("list", new ListTool());
context.put("math", new MathTool());
context.put("number", new NumberTool());
context.put("sort", new SortTool());
context.put("display", new DisplayTool());
context.put("resource", new SolrVelocityResourceTool(
request.getCore().getSolrConfig().getResourceLoader().getClassLoader(),
request.getParams().get(LOCALE)));

LinkTool is not wired in.   There isn’t really a way to add new tools into the 
mix without plugging in a new response writer based on Solr’s 
VelocityResponseWriter (VrW) or overwriting the built-in one.  But you probably 
don’t really need $link, do you?

There’s the $esc tool that allows for URL escaping.  It’s used to $esc.html() 
and $esc.url() in the example templates.

Happy to help work through this, and even add the LinkTool if you feel it’d be 
helpful (or work through a way to make tools pluggable in VrW).

Erik (author/maintainer of VrW)




—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com




> On Feb 19, 2015, at 9:40 AM, Logan Stinger  wrote:
> 
> 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
> 


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



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: $link

2015-02-19 Thread phiroc
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



Re: $link

2015-02-19 Thread Mike Kienenberger
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



$link

2015-02-19 Thread phiroc
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



Re: [tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

2014-12-09 Thread Christopher Schultz
Mike,

On 12/6/14 9:21 AM, Mike Kienenberger wrote:
> Glancing through this and through my own code, we were originally
> using the SecureLinkTool which extends the StrutsLinkTool.
> 
> But now I have a custom class that extends LinkTool and completely
> encodes the resulting url afterwards as we completely rewrite the url
> to a different format for a variety of other non-related reasons.
> 
> If SecureLinkTool doesn't do what you want, I'd suggest you subclass
> either SecureLinkTool or StrutsLinkTool to make it work the way you
> want.   Once you've done this, you just replace your "link" tool with
> your new class -- no other changes required in your templates or in
> the way you've been using $link.

Thanks. I'm more likely to hack and fix the original StrutsLinkTool (or
trace to the source and fix whatever that is).

For the meantime, I'll use my ugly hack because it's only used in one place.

Thanks,
-chris

> On Fri, Dec 5, 2014 at 8:20 PM, Christopher Schultz
>  wrote:
>> All,
>>
>> I'm using StrutsLinkTool and I have a "forward" defined in
>> struts-config.xml that is a complete URL (like
>> "http://www.google.com/?q=foo";). In my page, I have this:
>>
>> link text
>>
>> The page this link is on is served via HTTPS with no port number, so of
>> course I'm using the default port number for TLS (:443). In the page
>> source, the link looks like this:
>>
>> http://www.google.com:443/?q=foo";>link text
>>
>> The link is unfollowable because the server (not actually google.com)
>> returns a 400 response because of the HTTP protocol being used on an
>> HTTPS port. :(
>>
>> Is there a way to suppress the port number in this URL? I believe
>> [Struts]LinkTool is adding it because of the port number of the current
>> request.
>>
>> Technically speaking, this is a URL that we can simply specify directly
>> in the page, but it's nice to have it configured via struts-config.xml
>> to have all our "forwards" defined in one place.
>>
>> Thanks,
>> -chris
>>
>>
>>
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
> For additional commands, e-mail: user-h...@velocity.apache.org
> 



signature.asc
Description: OpenPGP digital signature


Re: [tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

2014-12-06 Thread Mike Kienenberger
Glancing through this and through my own code, we were originally
using the SecureLinkTool which extends the StrutsLinkTool.

But now I have a custom class that extends LinkTool and completely
encodes the resulting url afterwards as we completely rewrite the url
to a different format for a variety of other non-related reasons.

If SecureLinkTool doesn't do what you want, I'd suggest you subclass
either SecureLinkTool or StrutsLinkTool to make it work the way you
want.   Once you've done this, you just replace your "link" tool with
your new class -- no other changes required in your templates or in
the way you've been using $link.

On Fri, Dec 5, 2014 at 8:20 PM, Christopher Schultz
 wrote:
> All,
>
> I'm using StrutsLinkTool and I have a "forward" defined in
> struts-config.xml that is a complete URL (like
> "http://www.google.com/?q=foo";). In my page, I have this:
>
> link text
>
> The page this link is on is served via HTTPS with no port number, so of
> course I'm using the default port number for TLS (:443). In the page
> source, the link looks like this:
>
> http://www.google.com:443/?q=foo";>link text
>
> The link is unfollowable because the server (not actually google.com)
> returns a 400 response because of the HTTP protocol being used on an
> HTTPS port. :(
>
> Is there a way to suppress the port number in this URL? I believe
> [Struts]LinkTool is adding it because of the port number of the current
> request.
>
> Technically speaking, this is a URL that we can simply specify directly
> in the page, but it's nice to have it configured via struts-config.xml
> to have all our "forwards" defined in one place.
>
> Thanks,
> -chris
>
>
>

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



Re: [tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

2014-12-05 Thread Christopher Schultz
Mike,

On 12/5/14 8:23 PM, Mike Kienenberger wrote:
> I'm still using struts 1 and velocity on a project I'm actively
> working on this month.
> 
> I can take a look on Monday morning and see what we're doing.

Okay. I actually wrote this and tried to send it a few days ago but was
having SMTP issues across international borders (i.e. my V-prefixed ISP
has braindead SMTP servers, don't get me started). I finally got this
sent after returning to the US.

In the intervening days, I tried a few things that will work if
necessary. My current hack does something like this:

#set($myHref = $link.forward('my-link'))
#if('http' == $href.scheme && $href.port == '443')
#set($href = $href.port(80))
#end

link text

So it's doable... I was just hoping that it wouldn't require an ugly
hack like this. Fortunately, this is one of a *very* small number of
URLs that are (a) configured in struts-config.xml and (b) point to
resources external to our web application.

Thanks,
-chris

> On Fri, Dec 5, 2014 at 8:20 PM, Christopher Schultz
>  wrote:
>> All,
>>
>> I'm using StrutsLinkTool and I have a "forward" defined in
>> struts-config.xml that is a complete URL (like
>> "http://www.google.com/?q=foo";). In my page, I have this:
>>
>> link text
>>
>> The page this link is on is served via HTTPS with no port number, so of
>> course I'm using the default port number for TLS (:443). In the page
>> source, the link looks like this:
>>
>> http://www.google.com:443/?q=foo";>link text
>>
>> The link is unfollowable because the server (not actually google.com)
>> returns a 400 response because of the HTTP protocol being used on an
>> HTTPS port. :(
>>
>> Is there a way to suppress the port number in this URL? I believe
>> [Struts]LinkTool is adding it because of the port number of the current
>> request.
>>
>> Technically speaking, this is a URL that we can simply specify directly
>> in the page, but it's nice to have it configured via struts-config.xml
>> to have all our "forwards" defined in one place.
>>
>> Thanks,
>> -chris
>>
>>
>>
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@velocity.apache.org
> For additional commands, e-mail: user-h...@velocity.apache.org
> 



signature.asc
Description: OpenPGP digital signature


Re: [tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

2014-12-05 Thread Mike Kienenberger
I'm still using struts 1 and velocity on a project I'm actively
working on this month.

I can take a look on Monday morning and see what we're doing.

On Fri, Dec 5, 2014 at 8:20 PM, Christopher Schultz
 wrote:
> All,
>
> I'm using StrutsLinkTool and I have a "forward" defined in
> struts-config.xml that is a complete URL (like
> "http://www.google.com/?q=foo";). In my page, I have this:
>
> link text
>
> The page this link is on is served via HTTPS with no port number, so of
> course I'm using the default port number for TLS (:443). In the page
> source, the link looks like this:
>
> http://www.google.com:443/?q=foo";>link text
>
> The link is unfollowable because the server (not actually google.com)
> returns a 400 response because of the HTTP protocol being used on an
> HTTPS port. :(
>
> Is there a way to suppress the port number in this URL? I believe
> [Struts]LinkTool is adding it because of the port number of the current
> request.
>
> Technically speaking, this is a URL that we can simply specify directly
> in the page, but it's nice to have it configured via struts-config.xml
> to have all our "forwards" defined in one place.
>
> Thanks,
> -chris
>
>
>

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



[tools, struts1] On an HTTPS page, link to HTTP URL includes port number :443

2014-12-05 Thread Christopher Schultz
All,

I'm using StrutsLinkTool and I have a "forward" defined in
struts-config.xml that is a complete URL (like
"http://www.google.com/?q=foo";). In my page, I have this:

link text

The page this link is on is served via HTTPS with no port number, so of
course I'm using the default port number for TLS (:443). In the page
source, the link looks like this:

http://www.google.com:443/?q=foo";>link text

The link is unfollowable because the server (not actually google.com)
returns a 400 response because of the HTTP protocol being used on an
HTTPS port. :(

Is there a way to suppress the port number in this URL? I believe
[Struts]LinkTool is adding it because of the port number of the current
request.

Technically speaking, this is a URL that we can simply specify directly
in the page, but it's nice to have it configured via struts-config.xml
to have all our "forwards" defined in one place.

Thanks,
-chris





signature.asc
Description: OpenPGP digital signature