[libRETS-users] Strange Error

Bill Linker blinker at ziprealty.com
Thu Dec 20 13:13:19 CST 2007


FYI, these are the Metadata fields (see below) that I dump out for each
new source. This WriteLine() call is nested inside 3 foreach loops to
get all resources, all classes, and all tables. By the way, I output the
lookups into a separate file with a different header row. With the data
tab-delimited like this, I can then easily open it in Excel, apply
AutoFilter to the data set and search for the values I care about. I
dump out the system data separately since it does not matter if it is
sortable.

If you do not already have a database setup to do something similar to
what Tony Russo suggested, you could just load the table (field/column
in "normal" terms) ShortName or LongName into a hashtable, using the
numerically-valued SystemName as the key.

Then when outputing the header row of your file(s), use the hash to
lookup and output the columns names instead of numbers. Or to save
processor clock cycles, use the hash once per file format type (i.e.
once per unique select list) to generate a header string that you just
output to all similar files.


Bill



os.WriteLine("Resource\tResource Standard Name\tClass\tClass Standard
Name\tClass Description\tTable System Name\tStandard Name\tShort Name\t"
+
                             "Long Name\tDB Name\tLookup Name\tData
Type\tUnique?\tMax Length\tUnits\tSearchable");
...
...
...
os.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{1
1}\t{12}\t{13}\t{14}\t{15}",
                                              resource.GetResourceID(),
 
resource.GetStandardName(),
                                              aClass.GetClassName(),
                                              aClass.GetStandardName(),
                                              aClass.GetDescription(),
                                              table.GetSystemName(),
                                              table.GetStandardName(),
                                              table.GetShortName(),
                                              table.GetLongName(),
                                              table.GetDBName(),
                                              table.GetLookupName(),
                                              table.GetDataType(),
                                              table.IsUnique(),
                                              table.GetMaximumLength(),
                                              table.GetUnits(),
                                              table.IsSearchable()


-----Original Message-----
From: librets-users-bounces at crt.realtors.org
[mailto:librets-users-bounces at crt.realtors.org] On Behalf Of Tony Russo
Sent: Thursday, December 20, 2007 8:27 AM
To: 'For discussion and help for and by the users of the libRETS
C++library'
Subject: Re: [libRETS-users] Strange Error

Hi Russ,

I'm sure there are a number of ways to handle local mapping. We use a
combination of SQL tables and PHP Associative arrays.

The mlxChange field number to descriptive field name mapping can be
found in
the table metadata.

At startup for our RETS accounts we put a snap shot of the MLS metadata
into
a a couple of SQL tables (metadata_fields & metadata_tables).

We create a custom translation SQL table (db_schema) and store the MLS
Field
Name and our Standard SQL Field Name along with several other important
fields we use for both RETS and proprietary FTP accounts.

When we need to map in either direction we load an PHP Associative array
from the db_schema SQL table for that account so we can use a common
code
base across all (RETS and proprietary FTP) accounts.

mlxChange Example: 

	metadata shows
	  157 is ListingID ML#
	  276 is Type of Property

The php arrays would look in part like this:

$MLStoSQL Array
(
    [157] => MLSnumber
    [276] => PropType
)

$SQLtoMLS Array
(
    [MLSnumber] => 157
    [PropType]  => 276
)

Hope this helps.

Tony

-----Original Message-----
From: librets-users-bounces at crt.realtors.org
[mailto:librets-users-bounces at crt.realtors.org] On Behalf Of Russ Perna
Sent: Thursday, December 20, 2007 10:14 AM
To: 'For discussion and help for and by the users of the libRETS
C++library'
Subject: Re: [libRETS-users] Strange Error

I finally got in touch with someone at InterRealty and it appears that
they
had some sort of configuration issue on their end. They made some change
and
I can login and run my query now.

I have one more question and I should be good to go. When I did my other
RETS boards, I was immediately able to parse the returned data by field
name, whereas here I am required to query by field number since using
the
field name throws an error. I assume I have to match up the metadata
somehow, but I'm not sure how I would go about doing this. Anyone have
any
thoughts.

Thanks a lot to everyone for working me through our other issue.

Thanks,
Russ
 
 

-----Original Message-----
From: librets-users-bounces at crt.realtors.org
[mailto:librets-users-bounces at crt.realtors.org] On Behalf Of Mark Klein
Sent: Wednesday, December 19, 2007 10:52 PM
To: For discussion and help for and by the users of the libRETS C++
library
Subject: Re: [libRETS-users] Strange Error


On Dec 19, 2007, at 10:06 AM, Russ Perna wrote:

> This is the request from RETS Connector:
> URI:
> /Search.asmx/Search? 
> SearchType=Property&Class=1&Select=217&Format=COMPACT&Qu
> eryType=DMQL2&Query=(290=%7CACT),(40=%7C440)
>
> This is the request from libRets:
> URI:
> /Search.asmx/Search?Class=1&Count=1&Format=COMPACT&Query=(290%
> 3dACT),(40%3d4
> 40)&QueryType=DMQL2&SearchType=Property&Select=217&StandardNames=0

Sorry for being late to the party. :-)

I don't see in the thread whether or not you actually tried the proper
lookup syntax. I would expect to see the query from librets to look
like:

...;Query=(290%3d%7cACT),(40%3d%7c440)...

One thing to try is to attempt to issue this query from your favorite
browser if possible (some servers will allow it, some won't). You can
also
try it from cURL. Here is a sample using the crt demo server:

http://demo.crt.realtors.org:6103/rets/login

(use Joe for the user and Schmoe for the password)

The next line may be wrapped, so you may need to untangle it ... it
should
be one long line:

http://demo.crt.realtors.org:6103/rets/search? 
Format=COMPACT&SearchType=Property&Class=ResidentialProperty&StandardNam
es=0&QueryType=DMQL&Query=(LN%3D1%2B)%2C(BATHS%3D3%2B)%2C(BEDROOMS%
3D3%2B)

This should show 3 properties. Unfortunately, I can't demo this with a
lookup.

Try doing the same with your provider and see if the query works outside
of
librets. That will help us get a better handle on things.

Regards,



M.



--
Mark Klein
PGP Key Available
www.dis.com


_______________________________________________
libRETS-users mailing list
libRETS-users at crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users


_______________________________________________
libRETS-users mailing list
libRETS-users at crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users


_______________________________________________
libRETS-users mailing list
libRETS-users at crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users



More information about the libRETS-users mailing list