« Return to Thread: upgrading

Re: upgrading

by Charles Harvey III :: Rate this Message:

Reply to Author | View in Thread

I would like to start migrating my tools to the 2.0 path.  Is there a
good document
on the site that tells me how to do do?  I have been looking and I'm not
sure if I
am looking in the right places.

Thanks.


Charlie


Nathan Bubna said the following on 4/1/2008 3:16 PM:

> yep, that's the idea.  as for the init() method, you only need it if
> your tool needs access to the  initData for that scope (ServletContext
> for application scope and ViewContext for request or session scope).
> if your tool doesn't need access to any of those things, then it
> doesn't need an init(Object) method.
>
> of course, this is all with Tools 1.3 or Tools 1.4.  with Tools 2,
> things get even easier. :)
>
> On Tue, Apr 1, 2008 at 12:05 PM, Charles Harvey III <charlieh@...> wrote:
>  
>> As far as your own tools goes, I want to make sure I've got it right:
>>
>>  Old:
>>  -------------------------------------------------------------
>>  public class MyTool implements ViewTool
>>  {
>>     private String theString;
>>
>>     public void init( Object o )
>>     {
>>         if( !( obj instanceof ViewContext ) )
>>         {
>>             throw new IllegalArgumentException( "Tool can only be
>>  initialized with a ViewContext" );
>>         }
>>     }
>>
>>     public String getTheString()
>>     {
>>         return "this string comes from a velocity tool";
>>     }
>>  }
>>  -------------------------------------------------------------
>>
>>
>>  New:
>>  -------------------------------------------------------------
>>  public class MyTool
>>  {
>>     private String theString;
>>
>>     public void init( Object o )
>>     {
>>         if( !( obj instanceof ViewContext ) )
>>         {
>>             throw new IllegalArgumentException( "Tool can only be
>>  initialized with a ViewContext" );
>>         }
>>     }
>>
>>     public String getTheString()
>>     {
>>         return "this string comes from a velocity tool";
>>     }
>>  }
>>  -------------------------------------------------------------
>>
>>
>>  Do I still need the init method?  Or can I skip that too?
>>
>>  Thanks.
>>
>>
>>  Charlie
>>
>>
>>
>>
>>
>>  Nathan Bubna said the following on 4/1/2008 1:06 PM:
>>
>>
>>    
>>> there are some issues with multi-line comments within macros in Velocity 1.5
>>>      
>>  >
>>  > if you have written your own custom tools, then you'll find the
>>  > ViewTool and Configurable interfaces have been axed in VelocityTools
>>  > 1.4.  just remove the implements declarations for those interfaces.
>>  > they are unnecessary, as Tools 1.4 will automatically look for their
>>  > methods in any tool class.  if you haven't written any tools of your
>>  > own, i don't think there's anything to be concerned about.
>>  >
>>  > that's all i can think of right now, but of course, feel free to ask
>>  > questions/report problems here.
>>  >
>>  > On Tue, Apr 1, 2008 at 8:49 AM, Glenn Holmer <gholmer@...> wrote:
>>  >
>>  >> I'm doing maintenance on an app that uses Velocity 1.4 and VelocityTools
>>  >>  1.1, and would like to upgrade to Velocity 1.5 and tools 1.4.  Are there
>>  >>  any gotchas I should watch out for?
>>  >>
>>  >>  --
>>  >>  ____________________________________________________________
>>  >>  Glenn Holmer                          gholmer@...
>>  >>  Software Engineer                        phone: 414-908-1809
>>  >>  Weyco Group, Inc.                          fax: 414-908-1601
>>  >>
>>  >>
>>  >>  ---------------------------------------------------------------------
>>  >>  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@...
>>  >
>>  >
>>  >
>>
>>  ---------------------------------------------------------------------
>>  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@...
>
>
>  

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

 « Return to Thread: upgrading

LightInTheBox - Buy quality products at wholesale price