You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/01/21 03:16:36 UTC

cvs commit: jakarta-turbine-2/xdocs/howto extend-user-howto.xml

quintonm    2003/01/20 18:16:36

  Modified:    xdocs/howto extend-user-howto.xml
  Log:
  Added more documentation about the patch supplied in the how-to.
  
  Revision  Changes    Path
  1.9       +36 -8     jakarta-turbine-2/xdocs/howto/extend-user-howto.xml
  
  Index: extend-user-howto.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/xdocs/howto/extend-user-howto.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- extend-user-howto.xml	19 Dec 2002 15:16:13 -0000	1.8
  +++ extend-user-howto.xml	21 Jan 2003 02:16:36 -0000	1.9
  @@ -576,12 +576,31 @@
                   transaction.
               </p>
               <p>
  -                <b>
  -                    And the solution is...
  -                </b>
  +                There are a few solutions to this problem.  One would be to fix the torque
  +                template responsible for generating the code.  Another would be to implement
  +                the methods yourself.  Before exploring either of these options, you need to
  +                ask yourself if this problem will even affect you.  If not, don't worry about
  +                it.
               </p>
               <p>
  -                The solution involves altering a torque template so that the code that
  +                Implementing the methods yourself might be the simpliest route for someone
  +                new to Turbine and Torque.  This simply involves overriding the addBook()
  +                method in the example above with the two lines shown previously.  Of course,
  +                You would have to do this for each and every one that Torque generates
  +                for you.
  +            </p>
  +            <p>
  +                The same idea applies to the save(dbConn) method.  Simply override that method
  +                in your ExtendedTurbineUser class (or whatever you called your class) to perform
  +                the operation correctly.  You can get sample code from one of the other classes
  +                that Torque generated for you.
  +            </p>
  +            <p>
  +                If you want Torque to generate to code for you, you will have to modify the
  +                Object.vm template that Torque uses.
  +            </p>
  +            <p>
  +                The other solution involves altering a torque template so that the code that
                   generates the aspects of the save() method that handle related tables is
                   allowed to execute for the TurbineUserAlias class.  You need to apply the
                   following patch (most likely to the version of Object.vm copied to the
  @@ -629,17 +648,26 @@
   ]]>
           </source>
               <p>
  -                (Note: You will need to manually remove the line wrapping from the above
  -                patch).
  +                You will need to manually remove the line wrapping from the above
  +                patch.  You should also be aware that this patch is old.  It may or may not
  +                apply correctly.
               </p>
               <p>
                   Notice how although you can go <code>user.save(dbCon);</code> the
                   TurbineUser record will not be part of the transaction.
               </p>
               <p>
  -                It should be noted that I am currently using the code produced by this
  -                patched version quite successfully in a production system.
  +                I would suggest that you override the methods that do not
  +                get generated correctly in your ExtendedTurbineUser class.  Do so ONLY
  +                if this problem will affect you.
  +            </p>
  +            <p>
  +                The real solution to this problem is in modifing Turbine in such a way to
  +                allow Torque to generate the TurbineUser object.  This would elevate the
  +                need to extend TurbineUser altogether.  This solution is one not so easily
  +                implemented.
               </p>
  +
       </section>
   
     </body>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: cvs commit: jakarta-turbine-2/xdocs/howto extend-user-howto.xml

Posted by Scott Eade <se...@backstagetech.com.au>.
On 21/01/2003 1:16 PM, "quintonm@apache.org" <qu...@apache.org> wrote:

> quintonm    2003/01/20 18:16:36
> 
> Modified:    xdocs/howto extend-user-howto.xml
> Log:
> Added more documentation about the patch supplied in the how-to.
> 
>              <p>
> -                (Note: You will need to manually remove the line wrapping
> from the above
> -                patch).
> +                You will need to manually remove the line wrapping from the
> above
> +                patch.  You should also be aware that this patch is old.  It
> may or may not
> +                apply correctly.
>              </p>
It most certainly won't - for a start the file against which it was created
uses dbConn (i.e. It is Turbine 2.1)  The patch is also not in unidiff
format (I didn't know any better when I created it :-) and so it doesn't set
a good example.

> +            <p>
> +                The real solution to this problem is in modifing Turbine in
> such a way to
> +                allow Torque to generate the TurbineUser object.  This would
> elevate the
> +                need to extend TurbineUser altogether.  This solution is one
> not so easily
> +                implemented.
>              </p>
I don't think you mean "elevate", you may actually mean "eliminate", but
what you say is untrue - if Torque generates the TurbineUser object it will
greatly simplify the steps necessary to extend the TurbineUser object,
whether or not you need to extend it depends upon your application
requirements and design.  Also, the solution is in fact at hand - I think
Henning has committed it to cvs already, so it will be in Turbine 2.3.

I have a bunch of other small fixes to this document that I will patch
later, but you might like to make some changes to the stuff you have just
updated.

Other than the above this is good stuff.

Cheers,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au
.Mac Chat/AIM: seade at mac dot com
 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>