#set to the result of a #parse?

View: New views
6 Messages — Rating Filter:   Alert me  

#set to the result of a #parse?

by White, Tim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi there -
 
 Just curious if there is a way to do somthing like this:
 
 #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
 
The idea being that fullInfoYesNo.vm contains YES or NO.
 
I know I can put the whole #set into the #parsed file, but other
processes are using that same file, and need it to be just YES or NO.
 
Thanks,
 
Tim


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.

Re: #set to the result of a #parse?

by wglass :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You could write a custom directive to do this.  Just take the one for #parse
and modify it slightly.

WILL

On Fri, May 2, 2008 at 1:42 PM, White, Tim <Tim.White@...> wrote:

> Hi there -
>
>  Just curious if there is a way to do somthing like this:
>
>  #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
>
> The idea being that fullInfoYesNo.vm contains YES or NO.
>
> I know I can put the whole #set into the #parsed file, but other
> processes are using that same file, and need it to be just YES or NO.
>
> Thanks,
>
> Tim
>
>
> This communication is the property of Qwest and may contain confidential
> or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful.  If you have received this communication
> in error, please immediately notify the sender by reply e-mail and destroy
> all copies of the communication and any attachments.
>



--
Forio Business Simulations

Will Glass-Husain
wglass@...
www.forio.com

Re: #set to the result of a #parse?

by Nathan Bubna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

#set( $processFullInfo = "#parse( 'fullInfoYesNo.vm' )" )

:)

On Fri, May 2, 2008 at 1:42 PM, White, Tim <Tim.White@...> wrote:

> Hi there -
>
>   Just curious if there is a way to do somthing like this:
>
>   #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
>
>  The idea being that fullInfoYesNo.vm contains YES or NO.
>
>  I know I can put the whole #set into the #parsed file, but other
>  processes are using that same file, and need it to be just YES or NO.
>
>  Thanks,
>
>  Tim
>
>
>  This communication is the property of Qwest and may contain confidential or
>  privileged information. Unauthorized use of this communication is strictly
>  prohibited and may be unlawful.  If you have received this communication
>  in error, please immediately notify the sender by reply e-mail and destroy
>  all copies of the communication and any attachments.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: #set to the result of a #parse?

by White, Tim :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

D'oh!

-----Original Message-----
From: Nathan Bubna [mailto:nbubna@...]
Sent: Friday, May 02, 2008 2:52 PM
To: Velocity Users List
Subject: Re: #set to the result of a #parse?

#set( $processFullInfo = "#parse( 'fullInfoYesNo.vm' )" )

:)

On Fri, May 2, 2008 at 1:42 PM, White, Tim <Tim.White@...> wrote:

> Hi there -
>
>   Just curious if there is a way to do somthing like this:
>
>   #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
>
>  The idea being that fullInfoYesNo.vm contains YES or NO.
>
>  I know I can put the whole #set into the #parsed file, but other  
> processes are using that same file, and need it to be just YES or NO.
>
>  Thanks,
>
>  Tim
>
>
>  This communication is the property of Qwest and may contain
> confidential or  privileged information. Unauthorized use of this
> communication is strictly  prohibited and may be unlawful.  If you
> have received this communication  in error, please immediately notify
> the sender by reply e-mail and destroy  all copies of the
communication and any attachments.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: #set to the result of a #parse?

by scott.grunewald :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any way to #parse a string variable rather than a file?
 
I have a java class that passes a string with in-line references, like so:
 
$refstring = "The beverage I like is ${beverage}."
 
The $beverage variable is populated before this point in the script, but when I return the $refstring variable it is displayed unparsed. How is #parse used to make Velocity re#parse a string variable?
 
Thank you,
 
Scott Grunewald
scott.grunewald@...
AIM: ScottGrunewald
Office #: 905-804-6942

________________________________

From: White, Tim [mailto:Tim.White@...]
Sent: Fri 5/2/2008 5:08 PM
To: Velocity Users List
Subject: RE: #set to the result of a #parse?



D'oh!

-----Original Message-----
From: Nathan Bubna [mailto:nbubna@...]
Sent: Friday, May 02, 2008 2:52 PM
To: Velocity Users List
Subject: Re: #set to the result of a #parse?

#set( $processFullInfo = "#parse( 'fullInfoYesNo.vm' )" )

:)

On Fri, May 2, 2008 at 1:42 PM, White, Tim <Tim.White@...> wrote:

> Hi there -
>
>   Just curious if there is a way to do somthing like this:
>
>   #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
>
>  The idea being that fullInfoYesNo.vm contains YES or NO.
>
>  I know I can put the whole #set into the #parsed file, but other
> processes are using that same file, and need it to be just YES or NO.
>
>  Thanks,
>
>  Tim
>
>
>  This communication is the property of Qwest and may contain
> confidential or  privileged information. Unauthorized use of this
> communication is strictly  prohibited and may be unlawful.  If you
> have received this communication  in error, please immediately notify
> the sender by reply e-mail and destroy  all copies of the
communication and any attachments.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...






This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...

Re: #set to the result of a #parse?

by Nathan Bubna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, May 2, 2008 at 3:30 PM,  <scott.grunewald@...> wrote:
> Is there any way to #parse a string variable rather than a file?
>
>  I have a java class that passes a string with in-line references, like so:
>
>  $refstring = "The beverage I like is ${beverage}."
>
>  The $beverage variable is populated before this point in the script, but when I return the $refstring variable it is displayed unparsed. How is #parse used to make Velocity re#parse a string variable?

#parse doesn't do this.  in all currently released versions of
Velocity, you have to use something like the RenderTool
(http://velocity.apache.org/tools/releases/1.4/generic/RenderTool.html).
 In Velocity 1.6, there will be a new directive that you will be able
to use like this:  #evaluate( $refstring )


>  Thank you,
>
>  Scott Grunewald
>  scott.grunewald@...
>  AIM: ScottGrunewald
>  Office #: 905-804-6942
>
>  ________________________________
>
>  From: White, Tim [mailto:Tim.White@...]
>  Sent: Fri 5/2/2008 5:08 PM
>  To: Velocity Users List
>  Subject: RE: #set to the result of a #parse?
>
>
>
>
>
>  D'oh!
>
>  -----Original Message-----
>  From: Nathan Bubna [mailto:nbubna@...]
>  Sent: Friday, May 02, 2008 2:52 PM
>  To: Velocity Users List
>  Subject: Re: #set to the result of a #parse?
>
>  #set( $processFullInfo = "#parse( 'fullInfoYesNo.vm' )" )
>
>  :)
>
>  On Fri, May 2, 2008 at 1:42 PM, White, Tim <Tim.White@...> wrote:
>  > Hi there -
>  >
>  >   Just curious if there is a way to do somthing like this:
>  >
>  >   #set ($processFullInfo = #parse("fullInfoYesNo.vm"))
>  >
>  >  The idea being that fullInfoYesNo.vm contains YES or NO.
>  >
>  >  I know I can put the whole #set into the #parsed file, but other
>  > processes are using that same file, and need it to be just YES or NO.
>  >
>  >  Thanks,
>  >
>  >  Tim
>  >
>  >
>  >  This communication is the property of Qwest and may contain
>  > confidential or  privileged information. Unauthorized use of this
>  > communication is strictly  prohibited and may be unlawful.  If you
>  > have received this communication  in error, please immediately notify
>  > the sender by reply e-mail and destroy  all copies of the
>  communication and any attachments.
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@...
>  For additional commands, e-mail: user-help@...
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@...
>  For additional commands, e-mail: user-help@...
>
>
>
>
>
>
>  This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information.  If you have received it in error, please notify the sender immediately and delete the original.  Any other use of the email by you is prohibited.
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: user-unsubscribe@...
>  For additional commands, e-mail: user-help@...
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...