Login | Register
My pages Projects Community openCollabNet

Discussions > dev > [PATCH] Eliminate need for hacked Village

Project highlights: Architectural Overview

joist
Discussion topic

Hide all messages in topic

All messages in topic

Re: [joist-dev] Re: [PATCH] Eliminate need for hacked Village

Author Jon Stevens <jon at collab dot net>
Full name Jon Stevens <jon at collab dot net>
Date 2000-04-18 10:03:43 PDT
Message on 4/18/00 9:43 AM, Daniel L. Rall <dlr at finemaltcoding dot com> wrote:

> Jon, you had downloaded and used a newer version of WebMacro. Did you
> have problems with this?

Yes. It was the version that is bundled with Turbine. I'm not sure which
version that is though. :-( It definitely isn't the latest, but it is
probably more recent than what is being used with Joist.

-jon

--
Scarab -
      Java Servlet Based - Open Source
         Bug/Issue Tracking System
        <http://scarab.tigris.org/>

Re: [PATCH] Eliminate need for hacked Village

Author dlr
Full name Daniel Rall
Date 2000-04-18 09:43:24 PDT
Message > > WM is *supposed* to apply .toString() to the end of all objects...
>
> Well, that's the obvious thing to try, and I believe it was tried and failed
> (hence the need for the non-obvious). That was on an older version of WM,
> though, so maybe it works now.

Jon, you had downloaded and used a newer version of WebMacro. Did you
have problems with this?
--

Daniel Rall (dlr at finemaltcoding dot com)

Re: [PATCH] Eliminate need for hacked Village

Author David Pellegrini <davidp at xsitedesign dot com>
Full name David Pellegrini <davidp at xsitedesign dot com>
Date 2000-04-17 23:57:23 PDT
Message Jon Stevens wrote:
>
> on 4/17/00 11:41 PM, David Pellegrini <davidp at xsitedesign dot com> wrote:
>
> > $record.getValue("n​ame").toString()); [exhibit B]
>
> You don't need to do that though...
>
> $record.getValue("name")
>
> that is all you need to do.
>
> WM is *supposed* to apply .toString() to the end of all objects...

Well, that's the obvious thing to try, and I believe it was tried and failed
(hence the need for the non-obvious). That was on an older version of WM,
though, so maybe it works now.

-davidp

Re: [PATCH] Eliminate need for hacked Village

Author Jon Stevens <jon at collab dot net>
Full name Jon Stevens <jon at collab dot net>
Date 2000-04-17 23:42:46 PDT
Message on 4/17/00 11:41 PM, David Pellegrini <davidp at xsitedesign dot com> wrote:

> $record.getValue("n​ame").toString()); [exhibit B]

You don't need to do that though...

$record.getValue("name")

that is all you need to do.

WM is *supposed* to apply .toString() to the end of all objects...

-jon

--
Scarab -
      Java Servlet Based - Open Source
         Bug/Issue Tracking System
        <http://scarab.tigris.org/>

Re: [PATCH] Eliminate need for hacked Village

Author David Pellegrini <davidp at xsitedesign dot com>
Full name David Pellegrini <davidp at xsitedesign dot com>
Date 2000-04-17 23:41:20 PDT
Message Manoj Kasichainula wrote:
>
> This patch to JOIST eliminates the need for the hacked version of
> Village, by replacing getStringValue() with getValue().toString().
>
> I've been told that Dave added getStringValue() to workaround a
> problem with getValue.toString() in Village 1.0.6. 1.0.7 fixes a
> related bug, so I'd imagine the hack is no longer necessary. Is this
> true?

No. I added the patch to Record in order to make the webmacro template
writing more palatable, not to fix any bug. Bear in mind that the intent was
to make the templates easy for html programmers to write. So in the interest
of simplicity, I judged this:

    $record.getStringVa​lue("name")); [exhibit A]

easier to deal with than:

    $record.getValue("n​ame").toString()); [exhibit B]

especially given as often as this idiom is used. Now, if Elicia and whoever
else ends up writing templates feels that "B" is fine by them, then so be it.
We can do an easy batch edit to convert A->B.

BTW, Record.getStringValue() is not the only addition I made to village. I
also added DataSet.records() in order to make looping through a DataSet
possible. The alternative is to process the DataSet in the servlets by
looping through the DataSet and putting the Records into an Enumeration or
somesuch. But this is extra code and extra processing that is unnecessary in
the grand scheme. It would also be fairly painful to convert the existing
code, i.e., we can't just do a batch edit.

>
> I guess this shouldn't be committed to CVS if hocus and the sXc boxen
> won't be upgraded past Village 1.0.6 right now. But, the RPMs I'm
> building use Village 1.1, so the patch will be applied for them.
>
> Thoughts?


Here's what I added:

[davidp@womb src]$ rcsdiff -r1.3 -r1.2 DataSet.java
====================​====================​====================​=======
RCS file: RCS/DataSet.java,v
retrieving revision 1.3
retrieving revision 1.2
diff -r1.3 -r1.2
34c34
< @version $Revision: 1.3 $
---
> @version $Revision: 1.2 $
170,184d169
< * Gets the Vector of Records for this DataSet
< *
< * @return the records vector for this DataSet
< * @exception SQLException
< * @exception DataSetException
< */
< public Vector records() throws SQLException, DataSetException
< {
< if (this.records == null)
< throw new DataSetException ("records is null.");
<
< return this.records;
< }
<
< /**
626c611
< }
---
> }
\ No newline at end of file
[davidp@womb src]$ rcsdiff -r1.3 -r1.2 Record.java
====================​====================​====================​=======
RCS file: RCS/Record.java,v
retrieving revision 1.3
retrieving revision 1.2
diff -r1.3 -r1.2
32c32
< @version $Revision: 1.3 $
---
> @version $Revision: 1.2 $
497,506d496
< gets the value in columnName as a String. Null becomes empty string.
< @return the Value object in columnName as a String
< */
< public String getStringValue (String columnName) throws DataSetException
< {
< String theString = (getValue(schema().index
(columnName)).asString());
< return (theString == null? "": theString);
< }
<
< /**
1236c1226
< }
---
> }
\ No newline at end of file

[PATCH] Eliminate need for hacked Village

Author Manoj Kasichainula <manoj at collab dot net>
Full name Manoj Kasichainula <manoj at collab dot net>
Date 2000-04-17 21:08:49 PDT
Message This patch to JOIST eliminates the need for the hacked version of
Village, by replacing getStringValue() with getValue().toString().

I've been told that Dave added getStringValue() to workaround a
problem with getValue.toString() in Village 1.0.6. 1.0.7 fixes a
related bug, so I'd imagine the hack is no longer necessary. Is this
true?

I guess this shouldn't be committed to CVS if hocus and the sXc boxen
won't be upgraded past Village 1.0.6 right now. But, the RPMs I'm
building use Village 1.1, so the patch will be applied for them.

Thoughts?
Attachments
Messages per page: