├── autogen.sh ├── project ├── build │ ├── dist-win-exclude │ ├── librets.xcconfig │ ├── version.mk │ ├── buildDMG.pl │ ├── fixdep.pl │ ├── buildDMG.sh │ ├── doxygen-footer.html │ ├── build-boost-osx.sh │ ├── win_files.pl │ ├── ac-macros │ │ ├── depends.m4 │ │ ├── ccache.m4 │ │ ├── examples.m4 │ │ ├── mingw.m4 │ │ ├── sql-compiler.m4 │ │ └── cppunit.m4 │ ├── dist-exclude │ ├── c-copyright.c │ ├── antlr_xcode.sh │ ├── template.h │ ├── config.vc.dist │ ├── node.js.mk │ └── php.mk ├── librets │ ├── test │ │ ├── src │ │ │ ├── resources │ │ │ │ ├── short-success-response.xml │ │ │ │ ├── invalid-http-response.txt │ │ │ │ ├── logout-cris.xml │ │ │ │ ├── logout-tarasoft.xml │ │ │ │ ├── search-response-error.xml │ │ │ │ ├── payloadlist-response-error.xml │ │ │ │ ├── search-response-no-records.xml │ │ │ │ ├── login-invalid.xml │ │ │ │ ├── abc123-1.gif │ │ │ │ ├── get-object-response-no-object.txt │ │ │ │ ├── test-response.txt │ │ │ │ ├── metadata-extended-char.xml │ │ │ │ ├── get-object-response-cris.txt │ │ │ │ ├── get-object-response-single.txt │ │ │ │ ├── search-response-pipe.xml │ │ │ │ ├── get-object-response-rapattoni.txt │ │ │ │ ├── search-response-error-extended.xml │ │ │ │ ├── search-response-extended-char.xml │ │ │ │ ├── get-object-response-multi-rets1-8.txt │ │ │ │ ├── get-object-response-single-rets1-8.txt │ │ │ │ ├── payloadlist-response-error-extended.xml │ │ │ │ ├── get-object-response-single-no-headers.txt │ │ │ │ ├── get-object-response-single-empty-headers.txt │ │ │ │ ├── logout-valid15.xml │ │ │ │ ├── get-object-response-single-location.txt │ │ │ │ ├── metadata-system-empty-comments.xml │ │ │ │ ├── update-response.xml │ │ │ │ ├── get-object-response-no-object-variman.txt │ │ │ │ ├── metadata-system.xml │ │ │ │ ├── search-response-extended-utf8.xml │ │ │ │ ├── server-response-no-class.xml │ │ │ │ ├── metadata-blank-data.xml │ │ │ │ ├── search-response-single-column.xml │ │ │ │ ├── server-response-custom.xml │ │ │ │ ├── search-response-no-count.xml │ │ │ │ ├── search-response-no-final-tab.xml │ │ │ │ ├── search-response-no-leading-tab.xml │ │ │ │ ├── update-response-error.xml │ │ │ │ ├── search-response.xml │ │ │ │ ├── update-response-warning.xml │ │ │ │ ├── metadata-class.xml │ │ │ │ ├── metadata-unknown.xml │ │ │ │ ├── server-response-property.xml │ │ │ │ ├── update-response-both.xml │ │ │ │ ├── login-valid10.xml │ │ │ │ ├── login-cris.xml │ │ │ │ ├── metadata-response.xml │ │ │ │ ├── get-object-response-multi-malformed.txt │ │ │ │ ├── get-object-response-multi-location.txt │ │ │ │ ├── login-valid15.xml │ │ │ │ └── payloadlist-response.xml │ │ │ ├── librets_test_Prefix.pch │ │ │ ├── TestMetadataElement.cpp │ │ │ ├── TestObject.cpp │ │ │ ├── TestObject.h │ │ │ ├── Makefile.vc │ │ │ ├── objects.vc │ │ │ └── TestMetadataElement.h │ │ └── sql │ │ │ ├── TestSqlMetadata.cpp │ │ │ └── TestSqlMetadata.h │ ├── test-network │ │ └── src │ │ │ ├── objects.vc │ │ │ └── resources │ │ │ ├── photo.1 │ │ │ ├── metadata-lookup.1 │ │ │ ├── metadata-lookup.3 │ │ │ ├── logout │ │ │ ├── metadata-system │ │ │ ├── metadata-lookup.2 │ │ │ ├── search.3 │ │ │ ├── metadata-class.2 │ │ │ ├── metadata-lookup-type.8 │ │ │ ├── metadata-class.3 │ │ │ ├── foreign_keys.1 │ │ │ ├── metadata-class.1 │ │ │ ├── metadata-lookup-type.3 │ │ │ ├── metadata-lookup-type.5 │ │ │ ├── metadata-lookup-type.9 │ │ │ ├── login │ │ │ ├── metadata-lookup-type.7 │ │ │ ├── metadata-lookup-type.2 │ │ │ ├── metadata-table.1 │ │ │ ├── update.1 │ │ │ ├── metadata-lookup-type.10 │ │ │ ├── metadata-lookup-type.1 │ │ │ ├── metadata-table.3 │ │ │ ├── metadata-lookup.4 │ │ │ └── metadata-class.4 │ ├── src │ │ ├── librets_Prefix.pch │ │ ├── config.h.in │ │ ├── MetadataFinder.cpp │ │ ├── MetadataLoader.cpp │ │ ├── MetadataElementCollector.cpp │ │ ├── XmlMetadataElementFactory.cpp │ │ ├── MetadataValidationLookup.cpp │ │ ├── RetsHttpResponse.cpp │ │ ├── MetadataValidationExternal.cpp │ │ ├── MetadataValidationExpression.cpp │ │ ├── MetadataValidationLookupType.cpp │ │ ├── MetadataValidationExternalType.cpp │ │ ├── RetsHttpClient.cpp │ │ ├── DmqlCriterion.cpp │ │ ├── MetadataEditMask.cpp │ │ ├── MetadataUpdateHelp.cpp │ │ ├── RetsHttpLogger.cpp │ │ ├── LookupOrCriterion.cpp │ │ ├── EqCriterion.cpp │ │ ├── GtCriterion.cpp │ │ ├── LtCriterion.cpp │ │ ├── LookupQuery.cpp │ │ ├── MetadataSearchHelp.cpp │ │ ├── RetsUnknownMetadataException.cpp │ │ ├── RetsErrorHandler.cpp │ │ ├── ExceptionErrorHandler.cpp │ │ ├── LookupColumnsQuery.cpp │ │ ├── MetadataColumnGroupControl.cpp │ │ ├── MetadataLookupType.cpp │ │ ├── MetadataResource.cpp │ │ ├── RetsHttpException.cpp │ │ ├── OrCriterion.cpp │ │ ├── AndCriterion.cpp │ │ └── MetadataFilterType.cpp │ ├── include │ │ └── librets │ │ │ ├── curl.h │ │ │ ├── template.h │ │ │ ├── error_forward.h │ │ │ ├── forward.h │ │ │ ├── SqlMetadata.h │ │ │ ├── DmqlCriterion.h │ │ │ ├── UserAgentAuthType.h │ │ │ ├── OrCriterion.h │ │ │ ├── AndCriterion.h │ │ │ ├── LtCriterion.h │ │ │ ├── EqCriterion.h │ │ │ ├── GtCriterion.h │ │ │ ├── LookupOrCriterion.h │ │ │ ├── LookupQuery.h │ │ │ ├── NotCriterion.h │ │ │ └── MetadataValidationExpression.h │ └── sql │ │ └── RetsSqlException.cpp ├── iRets │ ├── icon.png │ ├── iRets.icns │ ├── English.lproj │ │ ├── InfoPlist.strings │ │ └── MainMenu.nib │ │ │ ├── keyedobjects.nib │ │ │ ├── data.dependency │ │ │ └── info.nib │ ├── version.plist │ ├── iRets_Prefix.pch │ ├── Info.plist │ ├── main.m │ ├── AccountsArrayController.h │ ├── ResultListing.h │ ├── AccountsArrayController.m │ ├── LogController.h │ ├── TextViewHttpLogger.h │ └── RetsImage.h └── swig │ ├── perl │ ├── MANIFEST │ ├── logging.pl │ ├── Makefile.PL │ ├── Makefile.mingw │ └── search.pl │ ├── csharp │ ├── SimpleSqlMetadata.cs │ ├── RetsExceptionNative.cs │ ├── RetsHttpExceptionNative.cs │ ├── RetsReplyExceptionNative.cs │ ├── Sql2DMQL.cs │ ├── ObjectDescriptorEnumerator.cs │ ├── librets_sharp.cpp │ ├── Login.cs │ ├── TextWriterLogger.cs │ └── librets_sharp.h │ ├── python3 │ ├── README.txt │ ├── rets_logging.py │ ├── login.py │ ├── Makefile.vc │ ├── get_object.py │ └── search.py │ ├── java │ ├── RetsHttpException.java │ ├── RetsReplyException.java │ ├── CppInputStream.java │ ├── RetsException.java │ └── logging.java │ ├── python │ ├── README.txt │ ├── rets_logging.py │ ├── login.py │ ├── Makefile.vc │ ├── get_object.py │ └── search.py │ ├── node.js │ ├── binding.gyp.in │ ├── login.js │ └── search.js │ ├── ruby │ ├── logging.rb │ ├── login.rb │ ├── librets_ruby.h │ ├── get-object.rb │ └── search.rb │ ├── php5 │ ├── login.php │ ├── logging.php │ └── search.php │ └── shared_ptr_release.i ├── pin-all ├── librets-build-docker.sh ├── librets_documentation.tar.gz ├── vendorsrc └── vendorversions ├── pin-python ├── Makefile.xcode ├── aclocal.m4 ├── librets-build-freebsd.sh ├── doc └── build │ ├── mac-osx.txt │ ├── windows.txt │ └── unix.txt ├── librets-build-centos.sh ├── README.md ├── librets-build.sh ├── .gitignore └── LICENSE /autogen.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | autoconf --force 4 | -------------------------------------------------------------------------------- /project/build/dist-win-exclude: -------------------------------------------------------------------------------- 1 | .* 2 | *~ 3 | .svn 4 | -------------------------------------------------------------------------------- /project/build/librets.xcconfig: -------------------------------------------------------------------------------- 1 | #include "version.mk" 2 | -------------------------------------------------------------------------------- /pin-all: -------------------------------------------------------------------------------- 1 | Package: * 2 | Pin: release a=bullseye 3 | Pin-Priority: 1001 4 | -------------------------------------------------------------------------------- /project/build/version.mk: -------------------------------------------------------------------------------- 1 | VERSION = 1.6.6 2 | HEX_VERSION = 010606 3 | -------------------------------------------------------------------------------- /librets-build-docker.sh: -------------------------------------------------------------------------------- 1 | docker build -t librets:latest . 2 | docker run -it librets:latest /bin/bash 3 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/short-success-response.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /project/iRets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/iRets/icon.png -------------------------------------------------------------------------------- /project/build/buildDMG.pl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/build/buildDMG.pl -------------------------------------------------------------------------------- /project/iRets/iRets.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/iRets/iRets.icns -------------------------------------------------------------------------------- /project/librets/test/src/resources/invalid-http-response.txt: -------------------------------------------------------------------------------- 1 | 500 2 | Content-Type: text/plain 3 | 4 | A server error 5 | -------------------------------------------------------------------------------- /project/swig/perl/MANIFEST: -------------------------------------------------------------------------------- 1 | librets.pm 2 | librets_wrap.cpp 3 | Makefile.PL 4 | MANIFEST This list of files 5 | search.pl 6 | -------------------------------------------------------------------------------- /librets_documentation.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/librets_documentation.tar.gz -------------------------------------------------------------------------------- /project/librets/test/src/resources/logout-cris.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/logout-tarasoft.xml: -------------------------------------------------------------------------------- 1 | 2 | Connection Closed 3 | 4 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-error.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vendorsrc/vendorversions: -------------------------------------------------------------------------------- 1 | OpenSSL=1.1.1a 2 | Curl=7.64.0 3 | Antlr=2.7.7 4 | Boost=1.71.0 5 | Expat=2.2.6 6 | Pcre=8.42 7 | Swig=3.0.12 8 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/payloadlist-response-error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-no-records.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /project/librets/test-network/src/objects.vc: -------------------------------------------------------------------------------- 1 | # Automatically generated file list. Edits will be overwritten. 2 | X_OBJS = \ 3 | $(DIROBJ)\NetworkTest.obj 4 | -------------------------------------------------------------------------------- /project/iRets/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/iRets/English.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /project/librets/test/src/resources/login-invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/abc123-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/abc123-1.gif -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-no-object.txt: -------------------------------------------------------------------------------- 1 | 200 2 | Content-Type: text/xml 3 | 4 | 5 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/photo.1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test-network/src/resources/photo.1 -------------------------------------------------------------------------------- /project/iRets/English.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/iRets/English.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /project/librets/test/src/resources/test-response.txt: -------------------------------------------------------------------------------- 1 | 200 2 | Content-Type: text/plain 3 | Colon-Header: header:with:colons 4 | lowercase-header: foo 5 | 6 | this is 7 | sample text. 8 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-extended-char.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/metadata-extended-char.xml -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-cris.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-cris.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-single.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-single.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-pipe.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | |CITY| 4 | |AURORA| 5 | 6 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-rapattoni.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-rapattoni.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-error-extended.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | You can't do that, so try better next time. 4 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-extended-char.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/search-response-extended-char.xml -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-multi-rets1-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-multi-rets1-8.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-single-rets1-8.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-single-rets1-8.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/payloadlist-response-error-extended.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | You can't do that, so try better next time. 4 | 5 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-single-no-headers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-single-no-headers.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-single-empty-headers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NationalAssociationOfRealtors/libRETS/HEAD/project/librets/test/src/resources/get-object-response-single-empty-headers.txt -------------------------------------------------------------------------------- /project/librets/test/src/resources/logout-valid15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ConnectTime = 51 4 | Billing = 0.36 5 | SignOffMessage = Goodbye 6 | 7 | 8 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-single-location.txt: -------------------------------------------------------------------------------- 1 | 200 2 | Content-Type: image/gif 3 | Content-ID: abc123 4 | Object-ID: 1 5 | Content-Description: Front view 6 | Location: http://www.example.com/images/abc123.gif 7 | 8 | -------------------------------------------------------------------------------- /project/swig/csharp/SimpleSqlMetadata.cs: -------------------------------------------------------------------------------- 1 | 2 | using librets; 3 | 4 | public class SimpleSqlMetadata : SqlMetadata 5 | { 6 | public override bool IsLookupColumn(string tableName, string columnName) 7 | { 8 | return false; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /project/swig/python3/README.txt: -------------------------------------------------------------------------------- 1 | Example code in this directory requires Python 3.2 or newer. 2 | 3 | The actual libRETS extension module works on all Python versions supported by 4 | SWIG, which also includes 3.0 and 3.1. 5 | 6 | # vim: set tw=79: 7 | -------------------------------------------------------------------------------- /project/build/fixdep.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # SRC is no logger used, but left for compatiblity 4 | my $SRC = shift @ARGV; 5 | my $OBJ = shift @ARGV; 6 | 7 | while(<>) 8 | { 9 | s:(\S+)\.o:${OBJ}/${1}.o ${OBJ}/${1}.d:; 10 | print; 11 | } 12 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-system-empty-comments.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/update-response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ListingID ListPrice City ListDate 5 | LN000005 250000 Chicago 2004-07-04 6 | 7 | -------------------------------------------------------------------------------- /project/build/buildDMG.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # buildDMG.sh 4 | # librets 5 | # 6 | # Created by Dave Dribin on 3/31/05. 7 | # Copyright 2005 __MyCompanyName__. All rights reserved. 8 | 9 | 10 | ./buildDMG.pl -dmgName iRets.dmg -compressionLevel 5 \ 11 | ${TARGET_BUILD_DIR}/iRets.app -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-no-object-variman.txt: -------------------------------------------------------------------------------- 1 | 200 2 | RETS-Version: RETS/1.5 3 | Content-Type: text/xml;charset=ISO-8859-1 4 | Content-Length: 55 5 | Date: Thu, 26 May 2005 21:16:59 GMT 6 | Server: Apache-Coyote/1.1 7 | 8 | 9 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-system.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | The reference implementation of a RETS Server 4 | 5 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-extended-utf8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AgentID FirstName LastName 6 | AG000001 Carlos Núñez 7 | 8 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/server-response-no-class.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2008-06-12T10:30:00 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /project/build/doxygen-footer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Generated by  4 | 5 | doxygen 6 | 7 |
8 | 9 | 10 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-blank-data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ClassName 4 | 5 | CON 6 | 7 | 8 | -------------------------------------------------------------------------------- /pin-python: -------------------------------------------------------------------------------- 1 | Package: python3* 2 | Pin: release a=testing 3 | Pin-Priority: 1001 4 | 5 | Package: dh-python* 6 | Pin: release a=testing 7 | Pin-Priority: 1001 8 | 9 | Package: devscripts* 10 | Pin: release a=testing 11 | Pin-Priority: 1001 12 | 13 | Package: swig* 14 | Pin: release a=testing 15 | Pin-Priority: 1001 16 | -------------------------------------------------------------------------------- /project/build/build-boost-osx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export PYTHON_VERSION=2.3 4 | 5 | TOOLS="-sTOOLS=darwin" 6 | LIBS="--with-filesystem --with-date_time" 7 | STAGE=stage 8 | INSTALL="--prefix=/usr/local/encap/boost-1.32.0 --layout=system install" 9 | 10 | bjam $TOOLS $LIBS $STAGE 11 | sudo bjam $TOOLS $LIBS $INSTALL 12 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-single-column.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ListingID 6 | LN000005 7 | LN000004 8 | 9 | 10 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/server-response-custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is a custom field. 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-no-count.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ListingID ListPrice City ListDate 5 | LN000005 250000 Chicago 2004-07-04 6 | LN000004 380000 Buffalo Grove 2004-05-30 7 | 8 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 87 6 | Date: Tue, 26 Aug 2008 17:21:29 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup.3: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 87 6 | Date: Tue, 26 Aug 2008 17:21:31 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-no-final-tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ListingID ListPrice City ListDate 6 | LN000005 250000 Chicago 2004-07-04 7 | LN000004 380000 Buffalo Grove 2004-05-30 8 | 9 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response-no-leading-tab.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ListingID ListPrice City ListDate 6 | LN000005 250000 Chicago 2004-07-04 7 | LN000004 380000 Buffalo Grove 2004-05-30 8 | 9 | -------------------------------------------------------------------------------- /Makefile.xcode: -------------------------------------------------------------------------------- 1 | # On OS X, we support using xcode as well as the GNU autoconf stuff. 2 | # This is just a simple makefile to call xcodebuild to build librets 3 | 4 | all: librets 5 | 6 | librets: 7 | cd project/build && xcodebuild -target librets -configuration Development 8 | 9 | clean: 10 | cd project/build && xcodebuild -target librets -configuration Development clean 11 | -------------------------------------------------------------------------------- /project/iRets/English.lproj/MainMenu.nib/data.dependency: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBPaletteDependency 6 | 7 | DisclosableView 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /project/librets/src/librets_Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | * librets_Prefix.pch 3 | * librets 4 | * 5 | * Created by Dave Dribin on 3/29/05. 6 | * Copyright 2005 __MyCompanyName__. All rights reserved. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/update-response-error.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ListingID ListPrice City ListDate 5 | LN000005 250000 Chicago 2004-07-04 6 | 7 | ListPrice 10101 0 Are you kidding me? 8 | 9 | 10 | -------------------------------------------------------------------------------- /project/swig/csharp/RetsExceptionNative.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace librets { 4 | public class RetsExceptionNative : Exception { 5 | public RetsExceptionNative(string message, string extendedMessage) : base(message) { 6 | this.extendedMessage = extendedMessage; 7 | } 8 | private string extendedMessage; 9 | public string ExtendedMessage 10 | { 11 | get { return extendedMessage; } 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /project/swig/java/RetsHttpException.java: -------------------------------------------------------------------------------- 1 | package librets; 2 | 3 | public class RetsHttpException 4 | extends RetsException 5 | { 6 | public RetsHttpException(int httpResult, String meaning) 7 | { 8 | super(meaning); 9 | mHttpResult = httpResult; 10 | } 11 | 12 | public int getHttpResult() 13 | { 14 | return mHttpResult; 15 | } 16 | 17 | private int mHttpResult; 18 | } 19 | -------------------------------------------------------------------------------- /project/swig/csharp/RetsHttpExceptionNative.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace librets 4 | { 5 | public class RetsHttpExceptionNative : RetsExceptionNative 6 | { 7 | public RetsHttpExceptionNative(int httpResult, string message) 8 | : base(message, "") 9 | { 10 | this.httpResult = httpResult; 11 | } 12 | private int httpResult; 13 | public int HttpResult 14 | { 15 | get { return httpResult; } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/logout: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 158 6 | Date: Tue, 26 Aug 2008 16:06:58 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | ConnectTime = 1 12 | Billing = 0.01 13 | SignOffMessage = Goodbye 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/search-response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ListingID ListPrice City ListDate 6 | LN000005 250000 Chicago 2004-07-04 7 | LN000004 380000 Buffalo Grove 2004-05-30 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/update-response-warning.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ListingID ListPrice City ListDate 5 | LN000005 250000 Chicago 2004-07-04 6 | 7 | ListPrice 202020 0 Raise it. 2 8 | 9 | 10 | -------------------------------------------------------------------------------- /project/swig/csharp/RetsReplyExceptionNative.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace librets 4 | { 5 | public class RetsReplyExceptionNative : RetsExceptionNative 6 | { 7 | public RetsReplyExceptionNative(int replyCode, string message, string extendedMessage) 8 | : base(message, extendedMessage) 9 | { 10 | this.replyCode = replyCode; 11 | } 12 | private int replyCode; 13 | public int ReplyCode 14 | { 15 | get { return replyCode; } 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /project/iRets/version.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildVersion 6 | 92 7 | CFBundleVersion 8 | 1.0 9 | ProductBuildVersion 10 | 7K571 11 | ProjectName 12 | NibPBTemplates 13 | SourceVersion 14 | 1200000 15 | 16 | 17 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-class.xml: -------------------------------------------------------------------------------- 1 | 2 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 3 | CON CommonInterest Condos Condos 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 4 | RES ResidentialProperty Single Family Single Family 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 5 | 6 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-unknown.xml: -------------------------------------------------------------------------------- 1 | 2 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 3 | CON CommonInterest Condos Condos 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 4 | RES ResidentialProperty Single Family Single Family 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 5 | 6 | -------------------------------------------------------------------------------- /project/swig/python/README.txt: -------------------------------------------------------------------------------- 1 | Example code in this directory requires Python 2.7. 2 | 3 | The actual libRETS extension module works on all Python versions supported by 4 | SWIG, however, which might even include versions as far back as 2.0. The SWIG 5 | documentation at http://www.swig.org/Doc2.0/Python.html states: 6 | 7 | """ 8 | SWIG is compatible with most recent Python versions including Python 3.0 and 9 | Python 2.6, as well as older versions dating back to Python 2.0. For the best 10 | results, consider using Python 2.3 or newer. 11 | """ 12 | 13 | # vim: set tw=79: 14 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | sinclude(project/build/ac-macros/ccache.m4) 2 | sinclude(project/build/ac-macros/darwin.m4) 3 | sinclude(project/build/ac-macros/depends.m4) 4 | sinclude(project/build/ac-macros/expat.m4) 5 | sinclude(project/build/ac-macros/boost.m4) 6 | sinclude(project/build/ac-macros/antlr.m4) 7 | sinclude(project/build/ac-macros/examples.m4) 8 | sinclude(project/build/ac-macros/cppunit.m4) 9 | sinclude(project/build/ac-macros/curl.m4) 10 | sinclude(project/build/ac-macros/sql-compiler.m4) 11 | sinclude(project/build/ac-macros/swig.m4) 12 | sinclude(project/build/ac-macros/mingw.m4) 13 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/server-response-property.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NONE 6 | 7 | 8 | 1234 9 | 10 | 11 | N 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/update-response-both.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ListingID ListPrice City ListDate 5 | LN000005 250000 Chicago 2004-07-04 6 | 7 | ListPrice 10101 0 Are you kidding me? 8 | City 10102 1 Well, maybe. 9 | 10 | 11 | ListPrice 202020 0 Raise it. 2 12 | ListDate 405060 6 Change date. 0 13 | 14 | 15 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-system: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 329 6 | Date: Tue, 26 Aug 2008 17:21:17 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | 13 | The reference implementation of a RETS Server 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/swig/python3/rets_logging.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | from argparse import ArgumentParser 3 | import sys 4 | 5 | import librets 6 | 7 | try: 8 | p = ArgumentParser() 9 | p.add_argument('log_file') 10 | args = p.parse_args() 11 | 12 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 13 | session.SetHttpLogName(args.log_file) 14 | 15 | if not session.Login("Joe", "Schmoe"): 16 | sys.exit("Invalid login") 17 | 18 | logout = session.Logout() 19 | session.Cleanup() 20 | 21 | except librets.RetsException as e: 22 | print("Caught:", e.GetMessage()) 23 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup.2: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 338 6 | Date: Tue, 26 Aug 2008 17:21:28 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LookupName VisibleName Version Date 13 | DESIGNATIONS DESIGNATIONS 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/swig/csharp/Sql2DMQL.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using librets; 3 | 4 | public class Sql2DMQL 5 | { 6 | static void Main(string[] args) 7 | { 8 | SqlMetadata md = new SimpleSqlMetadata(); 9 | SqlToDmqlCompiler compiler = new SqlToDmqlCompiler(md); 10 | compiler.sqlToDmql("select * from data:Property:RES where ListPrice >= 30000;"); 11 | 12 | DmqlQueryPtr query = compiler.GetDmqlQuery(); 13 | Console.WriteLine ("Resource: " + query.GetResource()); 14 | Console.WriteLine("Class: " + query.GetClass()); 15 | Console.WriteLine ("Query: " + query.GetCriterion().ToDmqlString()); 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /project/swig/java/RetsReplyException.java: -------------------------------------------------------------------------------- 1 | package librets; 2 | 3 | public class RetsReplyException 4 | extends RetsException 5 | { 6 | public RetsReplyException(int replyCode, String meaning) 7 | { 8 | super(meaning); 9 | mReplyCode = replyCode; 10 | } 11 | 12 | public RetsReplyException(int replyCode, String meaning, 13 | String extendedMeaning) 14 | { 15 | super(meaning, extendedMeaning); 16 | mReplyCode = replyCode; 17 | } 18 | 19 | public int getReplyCode() 20 | { 21 | return mReplyCode; 22 | } 23 | 24 | private int mReplyCode; 25 | } 26 | -------------------------------------------------------------------------------- /librets-build-freebsd.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This is a sample configuration script that I use on FreeBSD for 4 | # librets development. It can be customized for your own 5 | # environment. 6 | 7 | CPPFLAGS="-L/usr/local/lib -I/usr/local/include" \ 8 | ../configure --enable-examples \ 9 | --enable-debug \ 10 | --enable-depends \ 11 | --enable-maintainer-documentation \ 12 | --with-expat-prefix=/usr/local \ 13 | --with-boost-prefix=/usr/local \ 14 | --with-java-prefix=/usr/local/openjdk14/include \ 15 | --prefix=/tmp/librets 16 | 17 | -------------------------------------------------------------------------------- /project/swig/python/rets_logging.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | from argparse import ArgumentParser 4 | import sys 5 | 6 | import librets 7 | 8 | try: 9 | p = ArgumentParser() 10 | p.add_argument('log_file') 11 | args = p.parse_args() 12 | 13 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 14 | session.SetHttpLogName(args.log_file) 15 | 16 | if not session.Login("Joe", "Schmoe"): 17 | sys.exit("Invalid login") 18 | 19 | logout = session.Logout() 20 | session.Cleanup() 21 | 22 | except librets.RetsException as e: 23 | print("Caught:", e.GetMessage()) 24 | -------------------------------------------------------------------------------- /doc/build/mac-osx.txt: -------------------------------------------------------------------------------- 1 | 2 | Instructions for building on Mac OS X are nearly identical as the Unix 3 | instructions in unix.txt. MacPorts ports has many, if not all, of the 4 | prerequisites. Fink tends to be more out of date. 5 | 6 | If you choose to build Boost, the following shell script on OS X 10.3 7 | will install it into /usr/local: 8 | 9 | ----- 10 | #!/bin/sh 11 | 12 | export PYTHON_VERSION=2.3 13 | 14 | TOOLS="-sTOOLS=darwin" 15 | LIBS="--with-filesystem --with-date_time --with-program_options" 16 | STAGE=stage 17 | INSTALL="--prefix=/usr/local --layout=system install" 18 | 19 | bjam $TOOLS $LIBS $STAGE 20 | sudo bjam $TOOLS $LIBS $INSTALL 21 | ----- 22 | 23 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/search.3: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Vary: Accept-Encoding 3 | Cache-Control: private 4 | Date: Tue, 16 Feb 2010 02:23:51 GMT 5 | Transfer-Encoding: chunked 6 | X-AspNet-Version: 2.0.50727 7 | RETS-Version: RETS/1.5 8 | Server: Microsoft-IIS/6.0 9 | X-Powered-By: ASP.NET (N002) 10 | Content-Type: text/xml; charset=utf-8 11 | 12 | fb 13 | 14 | 15 | 16 | City 17 | Zanesville 18 | 19 | 20 | 21 | 22 | 0 23 | -------------------------------------------------------------------------------- /project/build/win_files.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use File::DosGlob 'glob'; 5 | use IO::Dir; 6 | 7 | my ($make_var, $match_pattern, $subst_match, $subst_replace) = @ARGV; 8 | 9 | my @files; 10 | foreach my $file (glob($match_pattern)) { 11 | $file =~ s/$subst_match/qq{"$subst_replace"}/ee if defined($subst_match); 12 | push (@files, $file); 13 | } 14 | 15 | my $separator = ""; 16 | my $last = ""; 17 | print "# Automatically generated file list. Edits will be overwritten.\n"; 18 | print "${make_var} = \\\n"; 19 | foreach my $file (sort @files) { 20 | print $separator . "\t$file"; 21 | $separator = " \\\n"; 22 | $last = "\n"; 23 | } 24 | print $last; 25 | -------------------------------------------------------------------------------- /project/swig/perl/logging.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use lib "blib/lib", "blib/arch"; 4 | use strict; 5 | use librets; 6 | 7 | my $rets = new librets::RetsSession( 8 | "http://demo.crt.realtors.org:6103/rets/login"); 9 | 10 | my $numArgs = $#ARGV + 1; 11 | 12 | if ($numArgs) 13 | { 14 | $rets->SetHttpLogName($ARGV[0]); 15 | } 16 | 17 | if (!$rets->Login("Joe", "Schmoe")) 18 | { 19 | print "Invalid login\n"; 20 | exit 1; 21 | } 22 | 23 | 24 | my $logout = $rets->Logout(); 25 | print "Billing info: " . $logout->GetBillingInfo() . "\n"; 26 | print "Logout message: " . $logout->GetLogoutMessage() . "\n"; 27 | print "Connect time: " . $logout->GetConnectTime() . "\n"; 28 | -------------------------------------------------------------------------------- /project/librets/src/config.h.in: -------------------------------------------------------------------------------- 1 | /* project/librets/src/config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Name of package */ 4 | #undef PACKAGE 5 | 6 | /* Define to the address where bug reports for this package should be sent. */ 7 | #undef PACKAGE_BUGREPORT 8 | 9 | /* Define to the full name of this package. */ 10 | #undef PACKAGE_NAME 11 | 12 | /* Define to the full name and version of this package. */ 13 | #undef PACKAGE_STRING 14 | 15 | /* Define to the one symbol short name of this package. */ 16 | #undef PACKAGE_TARNAME 17 | 18 | /* Define to the version of this package. */ 19 | #undef PACKAGE_VERSION 20 | 21 | /* Version number of package */ 22 | #undef VERSION 23 | -------------------------------------------------------------------------------- /project/swig/java/CppInputStream.java: -------------------------------------------------------------------------------- 1 | package librets; 2 | 3 | import librets.*; 4 | 5 | public class CppInputStream extends java.io.InputStream 6 | { 7 | private InputStreamBridge mBridge; 8 | 9 | public CppInputStream(InputStreamBridge bridge) 10 | { 11 | mBridge = bridge; 12 | } 13 | 14 | public void close() throws java.io.IOException 15 | { 16 | } 17 | 18 | public int read() throws java.io.IOException 19 | { 20 | return mBridge.readByte(); 21 | } 22 | 23 | public int read(byte[] buffer, int offset, int count) 24 | throws java.io.IOException 25 | { 26 | return mBridge.read(buffer, offset, count); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/login-valid10.xml: -------------------------------------------------------------------------------- 1 | 2 | MemberName=Elizabeth A Davis 3 | User=272, AGENT:BROKER OFFICE:OFFICE, 50, 272 4 | Broker=MRIS,1 5 | MetadataVersion=1.2.200 6 | MinMetadataVersion=1.1.1 7 | OfficeList=MRIS;1 8 | TimeoutSeconds=1800 9 | Search=http://cornerstone.mris.com:6103/platinum/search 10 | GetObject=http://cornerstone.mris.com:6103/platinum/getobject 11 | Login=http://cornerstone.mris.com:6103/platinum/login 12 | GetMetadata=http://cornerstone.mris.com:6103/platinum/getmetadata 13 | ChangePassword=http://cornerstone.mris.com:6103/platinum/changepassword 14 | Logout=http://cornerstone.mris.com:6103/platinum/logout 15 | 16 | -------------------------------------------------------------------------------- /librets-build-centos.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # This builds libRETS on CentOS 7 4 | 5 | sudo yum install --assumeyes antlr-tool autoconf boost-devel expat-devel libcurl-devel gcc-c++ swig python-devel 6 | 7 | # This is a sample configuration script that I use on FreeBSD for 8 | # librets development. It can be customized for your own 9 | # environment. 10 | 11 | ./autogen.sh 12 | 13 | CPPFLAGS="-L/usr/local/lib -I/usr/local/include" \ 14 | ./configure --enable-examples \ 15 | --enable-debug \ 16 | --enable-depends \ 17 | --enable-maintainer-documentation \ 18 | --enable-shared_dependencies 19 | 20 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-class.2: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 427 6 | Date: Tue, 26 Aug 2008 17:21:19 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 13 | AGT Agent Agent 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.8: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 405 6 | Date: Tue, 26 Aug 2008 17:21:35 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | INCOME INC INC 14 | RENT RENT RENT 15 | LAND LND LND 16 | RESIDENTIAL RES RES 17 | 18 | 19 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-class.3: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 433 6 | Date: Tue, 26 Aug 2008 17:21:22 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 13 | OFFICE Office Office 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/swig/node.js/binding.gyp.in: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'librets', 5 | 'sources': [ 'librets_wrap.cpp' ], 6 | 'product_prefix': 'lib', 7 | 'include_dirs': [ '@abs_top_srcdir@/project/librets/include', '@BOOST_INCLUDE_DIR@' ], 8 | 'libraries': [ '@abs_top_srcdir@/build/librets/lib/librets.a', '@LIBRETS_LDFLAGS@'], 9 | 'cflags!': [ '-fno-exceptions' ], 10 | 'cflags_cc!': [ '-fno-exceptions' ], 11 | 'conditions': [ 12 | ['OS=="mac"', { 13 | 'xcode_settings': { 14 | 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', 15 | 'MACOSX_DEPLOYMENT_TARGET': '10.9' 16 | } 17 | }] 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /project/swig/java/RetsException.java: -------------------------------------------------------------------------------- 1 | package librets; 2 | 3 | public class RetsException 4 | extends java.lang.Exception 5 | { 6 | public RetsException(String message) 7 | { 8 | mMessage = message; 9 | mExtendedMessage = ""; 10 | } 11 | 12 | public RetsException(String message, String extendedMessage) 13 | { 14 | mMessage = message; 15 | mExtendedMessage = extendedMessage; 16 | } 17 | 18 | public String getMessage() 19 | { 20 | return mMessage; 21 | } 22 | 23 | public String getExtendedMessage() 24 | { 25 | return mExtendedMessage; 26 | } 27 | 28 | private String mMessage; 29 | private String mExtendedMessage; 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # libRETS 2 | 3 | ## libRETS-Docker 4 | libRETS Docker is a RETS client library written in C++ (forked from the NAR library) built and packaged for Docker. This allows rapid development of RETS client applications by saving the developer from dealing with the RETS protocol details. The application writer can concentrate on their application thusly saving them time and money in the process. 5 | 6 | Platform : 7 | OS - Debian 9.5 8 | 9 | Configured Language Bindings: 10 | Python 3, 11 | Ruby 2.4 12 | 13 | Requirements: 14 | Docker 15 | 16 | Build and test image by running the librets-build-docker.sh script. 17 | 18 | ```bash 19 | docker build -t librets:latest . 20 | docker run -it librets:latest /bin/bash 21 | ``` 22 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/foreign_keys.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: Apache-Coyote/1.1 3 | RETS-Version: RETS/1.5 4 | RETS-Server: Variman/3.0.0trunk 5 | Cache-Control: private 6 | Content-ID: METADATA-FOREIGN_KEYS 7 | Content-Type: text/xml 8 | Content-Length: 380 9 | Date: Tue, 01 Sep 2009 16:31:51 GMT 10 | 11 | 12 | 13 | 14 | ForeignKeyID ParentResourceID ParentClassID ParentSystemName ChildResourceID ChildClassID ChildSystemName ConditionalParentField ConditionalParentValue 15 | ResPropertyAgent Agent AGT AgentID Property RES AgentID 16 | 17 | 18 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-class.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 448 6 | Date: Tue, 26 Aug 2008 17:21:20 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 13 | ACTAGT ActiveAgent ActiveAgent 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/iRets/English.lproj/MainMenu.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 97 58 454 253 0 0 1280 832 7 | IBEditorPositions 8 | 9 | 29 10 | 72 521 251 44 0 0 1280 832 11 | 12 | IBFramework Version 13 | 364.0 14 | IBOpenObjects 15 | 16 | 21 17 | 29 18 | 654 19 | 20 | IBSystem Version 21 | 7W98 22 | 23 | 24 | -------------------------------------------------------------------------------- /project/build/ac-macros/depends.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Enable dependency checking 3 | dnl 4 | dnl Variables: 5 | dnl my_use_depends=(yes|no) 6 | dnl 7 | AC_DEFUN([MY_TEST_DEPENDS], [ 8 | AC_ARG_ENABLE( 9 | depends, 10 | AC_HELP_STRING([--enable-depends], 11 | [enable dependency checking (default: disabled)]), 12 | test "X$enableval" != "Xno" && my_enable_depends=yes, 13 | my_enable_depends=no) 14 | 15 | my_use_depends=no 16 | USE_DEPENDS=0 17 | if test "$my_enable_depends" = "yes"; then 18 | if test "${PERL}" != "no"; then 19 | USE_DEPENDS=1 20 | my_use_depends=yes 21 | else 22 | AC_MSG_ERROR([*** Dependecy checking requires Perl ***]) 23 | fi 24 | fi 25 | AC_SUBST(USE_DEPENDS) 26 | ]) 27 | -------------------------------------------------------------------------------- /project/build/ac-macros/ccache.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Tests for ccache and modifies CC and CXX appropriately 3 | dnl 4 | dnl Variables: 5 | dnl my_use_ccache=(yes|no) 6 | dnl 7 | AC_DEFUN([MY_PROG_CCACHE], [ 8 | AC_ARG_ENABLE( 9 | ccache, 10 | AC_HELP_STRING([--enable-ccache], 11 | [enable ccache (default: disabled)]), 12 | test "X$enableval" != "Xno" && my_enable_ccache=yes, 13 | my_enable_ccache=no) 14 | 15 | my_use_ccache=no 16 | if test "$my_enable_ccache" = "yes"; then 17 | AC_CHECK_PROG(my_have_ccache, ccache, yes, no) 18 | if test "$my_have_ccache" = "yes"; then 19 | AR="ccache $AR" 20 | CC="ccache $CC" 21 | CXX="ccache $CXX" 22 | my_use_ccache=yes 23 | fi 24 | fi 25 | ]) 26 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.3: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 450 6 | Date: Tue, 26 Aug 2008 17:21:37 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | Batavia 306 300 300 14 | Aurora 306 306 306 15 | Geneva 304 304 304 16 | Elgin 42 42 42 17 | St. Charles 303 303 303 18 | 19 | 20 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.5: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 450 6 | Date: Tue, 26 Aug 2008 17:21:38 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | Elgin 42 42 42 14 | St. Charles 303 303 303 15 | Batavia 300 300 300 16 | Aurora 306 306 306 17 | Geneva 304 304 304 18 | 19 | 20 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.9: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 450 6 | Date: Tue, 26 Aug 2008 17:21:34 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | Elgin 42 42 42 14 | St. Charles 303 303 303 15 | Batavia 300 300 300 16 | Geneva 304 304 304 17 | Aurora 306 306 306 18 | 19 | 20 | -------------------------------------------------------------------------------- /project/build/dist-exclude: -------------------------------------------------------------------------------- 1 | /build 2 | /build-32 3 | /build-64 4 | /build-x86 5 | /build-x64 6 | /dist 7 | /scratch 8 | 9 | .* 10 | *~ 11 | .svn 12 | 13 | # autoconf stuff 14 | /Makefile 15 | /project/build/Doxyfile 16 | /autom4te.cache 17 | /config.log 18 | /config.status 19 | /librets-config 20 | /librets-config-inplace 21 | /project/librets/src/config.h 22 | 23 | # Xcode user files 24 | *.mode1 25 | *.pbxuser 26 | *.mode2 27 | *.perspective 28 | 29 | # SWIG C# 30 | /project/swig/csharp/lib/*.cs 31 | /project/swig/csharp/librets_wrap.cpp 32 | 33 | # SWIG Perl 34 | /project/swig/perl/librets.pm 35 | 36 | # SWIG Python 37 | /project/swig/python/librets.py 38 | /project/swig/python/librets_wrap.cpp 39 | 40 | # SWIG Ruby 41 | /project/swig/ruby/Makefile 42 | /project/swig/ruby/librets_wrap.cpp 43 | -------------------------------------------------------------------------------- /project/swig/ruby/logging.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'librets' 4 | 5 | # Here is where we start doing our RETS stuff 6 | begin 7 | session = 8 | Librets::RetsSession.new("http://demo.crt.realtors.org:6103/rets/login") 9 | 10 | log_file = ARGV[0] 11 | session.SetHttpLogName(log_file) 12 | 13 | if !session.login("Joe", "Schmoe") 14 | puts "Invalid login" 15 | exit 1 16 | end 17 | 18 | logout = session.logout 19 | 20 | # If we are using logging at ALL, we must call cleanup on session. 21 | # This will free any native resources that point to a ruby based 22 | # logging object. 23 | session.cleanup 24 | 25 | puts "See the logging in file #{log_file}" unless log_file.nil? 26 | rescue RetsException => e 27 | puts e 28 | end 29 | -------------------------------------------------------------------------------- /project/build/c-copyright.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/login: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 700 6 | Date: Tue, 26 Aug 2008 16:06:56 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | Broker = 12 | MemberName = Joe Schmoe 13 | MetadataVersion = 100.00.001 14 | MinMetadataVersion = 100.00.001 15 | MetadataTimestamp = 2008-03-13T12:51:00 16 | User = Joe,NULL,NULL,NULL 17 | Login = /rets/login 18 | Logout = /rets/logout 19 | Search = /rets/search 20 | GetMetadata = /rets/getMetadata 21 | ChangePassword = /rets/changePassword 22 | GetObject = /rets/getObject 23 | Update = /rets/Update 24 | Balance = 186,252.09 25 | TimeoutSeconds = 1800 26 | 27 | 28 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/login-cris.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Broker=9999999 4 | MemberName=WATCH1 MLS 5 | User=0207099998,,X 6 | MetadataVersion=1.0.3 7 | MinMetadataVersion=1.0.3 8 | TimeoutSeconds=900 9 | Login=http://rets.crisnetmls.com:6103/cgi-bin/WebObjects/RETS.woa/wa/RETSTransactionHandler/login 10 | Search=http://rets.crisnetmls.com:6103/cgi-bin/WebObjects/RETS.woa/12/wa/RETSTransactionHandler/search 11 | GetObject=http://rets.crisnetmls.com:6103/cgi-bin/WebObjects/RETS.woa/12/wa/RETSTransactionHandler/getObject 12 | GetMetadata=http://rets.crisnetmls.com:6103/cgi-bin/WebObjects/RETS.woa/12/wa/RETSTransactionHandler/getMetadata 13 | Logout=http://rets.crisnetmls.com:6103/cgi-bin/WebObjects/RETS.woa/12/wa/RETSTransactionHandler/logout 14 | 15 | 16 | -------------------------------------------------------------------------------- /project/build/ac-macros/examples.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Add examples option. Requires MY_TEST_BOOST to be run first. 3 | dnl 4 | AC_DEFUN([MY_CHECK_EXAMPLES], [ 5 | AC_ARG_ENABLE( 6 | examples, 7 | AC_HELP_STRING([--enable-examples], 8 | [build example programs (default: disabled)]), 9 | [test "$enableval" = "yes" && my_enable_examples=yes], 10 | [my_enable_examples=no]) 11 | 12 | my_use_examples=no 13 | USE_EXAMPLES=0 14 | if test "$my_enable_examples" = "yes"; then 15 | if test "x$BOOST_PROGRAM_OPTIONS" != "x"; then 16 | USE_EXAMPLES=1 17 | my_use_examples=yes 18 | else 19 | AC_MSG_WARN([*** Examples require Boost program options ***]) 20 | AC_MSG_WARN([*** Not compiling examples ***]) 21 | fi 22 | fi 23 | AC_SUBST(USE_EXAMPLES) 24 | ]) 25 | -------------------------------------------------------------------------------- /librets-build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # This is a sample configuration script that I use on OS X for 4 | # librets development. It can be customized for your own 5 | # environment. 6 | 7 | CPPFLAGS="-L/opt/local/lib -I/opt/local/include" \ 8 | ./configure --enable-examples \ 9 | --enable-debug \ 10 | --enable-depends \ 11 | --enable-maintainer-documentation \ 12 | --with-expat-prefix=/opt/local \ 13 | --with-java-prefix=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ \ 14 | --with-boost-prefix=/opt/local \ 15 | --with-snk-file=no \ 16 | --prefix=/tmp/librets 17 | 18 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/metadata-response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The reference implementation of a RETS Server 5 | 6 | 7 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 8 | CON CommonInterest Condos Condos 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 9 | RES ResidentialProperty Single Family Single Family 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 10 | 11 | 12 | -------------------------------------------------------------------------------- /project/swig/csharp/ObjectDescriptorEnumerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | 4 | namespace librets { 5 | 6 | public class ObjectDescriptorEnumerator : IEnumerator 7 | { 8 | public ObjectDescriptorEnumerator(GetObjectResponse response) 9 | { 10 | mResponse = response; 11 | mCurrent = null; 12 | 13 | } 14 | 15 | public object Current 16 | { 17 | get { return mCurrent; } 18 | } 19 | 20 | public bool MoveNext() 21 | { 22 | mCurrent = mResponse.NextObject(); 23 | return (mCurrent != null); 24 | } 25 | 26 | public void Reset() 27 | { 28 | throw new InvalidOperationException( 29 | "ObjectDescriptorEnumerators are not resetable"); 30 | } 31 | 32 | private GetObjectResponse mResponse; 33 | private ObjectDescriptor mCurrent; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /project/iRets/iRets_Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifdef __OBJC__ 19 | #import 20 | #endif 21 | #include "librets.h" 22 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-multi-malformed.txt: -------------------------------------------------------------------------------- 1 | 200 2 | Content-Type: multipart/parallel; boundary="59a068f72f533f61eead9a5d886690495ab039a0" 3 | 4 | --59a068f72f533f61eead9a5d886690495ab039a0 5 | Content-ID: abc123 6 | Object-ID: 1 7 | Content-Type: application/octet-stream 8 | Location: http://www.example.com/images/abc123/1 9 | Content-Description: Front view. 10 | 11 | 12 | --59a068f72f533f61eead9a5d886690495ab039a0 13 | Content-ID: abc123 14 | Object-ID: 2 15 | Content-type: application/octet-stream 16 | Location: http://www.example.com/images/abc123/2 17 | Content-Description: Rear view. 18 | 19 | 20 | --59a068f72f533f61eead9a5d886690495ab039a0 21 | Content-ID: abc123 22 | Object-ID: 3 23 | Content-Type: application/octet-stream 24 | Location: http://www.example.com/images/abc123/3 25 | 26 | 27 | --59a068f72f533f61eead9a5d886690495ab039a0-- 28 | -------------------------------------------------------------------------------- /project/iRets/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | iRets 9 | CFBundleIconFile 10 | iRets.icns 11 | CFBundleIdentifier 12 | org.realtors.crt.iRets 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | APPL 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSMainNibFile 22 | MainMenu 23 | NSPrincipalClass 24 | NSApplication 25 | 26 | 27 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.7: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 568 6 | Date: Tue, 26 Aug 2008 17:21:32 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | Expired X X 14 | Under Contract U U 15 | Active A A 16 | Off Market 0 O 17 | Temp Off Market T T 18 | Leased L L 19 | Withdrawn W W 20 | Closed C C 21 | Sold S S 22 | Pending P P 23 | 24 | 25 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/get-object-response-multi-location.txt: -------------------------------------------------------------------------------- 1 | 200 2 | Content-Type: multipart/parallel; boundary="59a068f72f533f61eead9a5d886690495ab039a0" 3 | 4 | 5 | --59a068f72f533f61eead9a5d886690495ab039a0 6 | Content-ID: abc123 7 | Object-ID: 1 8 | Content-Type: application/octet-stream 9 | Location: http://www.example.com/images/abc123/1 10 | Content-Description: Front view. 11 | 12 | 13 | --59a068f72f533f61eead9a5d886690495ab039a0 14 | Content-ID: abc123 15 | Object-ID: 2 16 | Content-type: application/octet-stream 17 | Location: http://www.example.com/images/abc123/2 18 | Content-Description: Rear view. 19 | 20 | 21 | --59a068f72f533f61eead9a5d886690495ab039a0 22 | Content-ID: abc123 23 | Object-ID: 3 24 | Content-Type: application/octet-stream 25 | Location: http://www.example.com/images/abc123/3 26 | 27 | 28 | --59a068f72f533f61eead9a5d886690495ab039a0-- 29 | -------------------------------------------------------------------------------- /project/swig/python3/login.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | import librets 5 | 6 | try: 7 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 8 | if not session.Login("Joe", "Schmoe"): 9 | sys.exit("Invalid login") 10 | 11 | print("Member name:", session.GetLoginResponse().GetMemberName()) 12 | print("Search URL:", session.GetCapabilityUrls().GetSearchUrl()) 13 | print("Action:", session.GetAction()) 14 | version = "1.0" 15 | if session.GetDetectedRetsVersion() == librets.RETS_1_5: 16 | version = "1.5" 17 | print("RETS Version:", version) 18 | 19 | logout = session.Logout() 20 | print("Billing info:", logout.GetBillingInfo()) 21 | print("Logout message:", logout.GetLogoutMessage()) 22 | print("Connect time:", logout.GetConnectTime()) 23 | except librets.RetsException as e: 24 | print("Caught:", e.GetMessage()) 25 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.2: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 598 6 | Date: Tue, 26 Aug 2008 17:21:37 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | St. Charles St Charls STC 14 | Aurora Aurora AUR 15 | Elburn Elburn ELBRN 16 | South Elgin S Elgin SELGN 17 | West Chicago W Chic WCHIC 18 | Elgin Elgin ELGN 19 | Geneva Geneva GENVA 20 | Wayne Wayne WYNE 21 | Batavia Batavia BATV 22 | 23 | 24 | -------------------------------------------------------------------------------- /project/iRets/main.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | 20 | int main(int argc, char *argv[]) 21 | { 22 | return NSApplicationMain(argc, (const char **) argv); 23 | } 24 | -------------------------------------------------------------------------------- /project/swig/python/login.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import sys 4 | 5 | import librets 6 | 7 | try: 8 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 9 | if not session.Login("Joe", "Schmoe"): 10 | sys.exit("Invalid login") 11 | 12 | print("Member name:", session.GetLoginResponse().GetMemberName()) 13 | print("Search URL:", session.GetCapabilityUrls().GetSearchUrl()) 14 | print("Action:", session.GetAction()) 15 | version = "1.0" 16 | if session.GetDetectedRetsVersion() == librets.RETS_1_5: 17 | version = "1.5" 18 | print("RETS Version:", version) 19 | 20 | logout = session.Logout() 21 | print("Billing info:", logout.GetBillingInfo()) 22 | print("Logout message:", logout.GetLogoutMessage()) 23 | print("Connect time:", logout.GetConnectTime()) 24 | except librets.RetsException as e: 25 | print("Caught:", e.GetMessage()) 26 | -------------------------------------------------------------------------------- /project/build/antlr_xcode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ANTLR=${ANTLR_DIR}/bin/antlr 4 | OUTPUT_DIR=${BUILD_DIR}/${CONFIGURATION}/antlr 5 | SRCDIR=${SRCROOT}/../librets/src 6 | 7 | GRAMMAR=${SRCDIR}/rets-sql.g 8 | DMQL_TREE=${SRCDIR}/dmql-tree.g 9 | GET_OBJECT_TREE=${SRCDIR}/get-object-tree.g 10 | LOOKUP_TREE=${SRCDIR}/lookup-tree.g 11 | LOOKUP_COLUMNS_TREE=${SRCDIR}/lookup-columns-tree.g 12 | TRIGGER=${OUTPUT_DIR}/up-to-date 13 | 14 | #if [ ${GRAMMAR} -nt ${TRIGGER} ] || 15 | # [ ${TREE} -nt ${TRIGGER} ] 16 | #then 17 | ${ANTLR} -o $OUTPUT_DIR ${GRAMMAR} 18 | ${ANTLR} -o $OUTPUT_DIR -glib ${GRAMMAR} ${DMQL_TREE} 19 | ${ANTLR} -o $OUTPUT_DIR -glib ${GRAMMAR} ${GET_OBJECT_TREE} 20 | ${ANTLR} -o $OUTPUT_DIR -glib ${GRAMMAR} ${LOOKUP_TREE} 21 | ${ANTLR} -o $OUTPUT_DIR -glib ${GRAMMAR} ${LOOKUP_COLUMNS_TREE} 22 | touch ${OUTPUT_DIR}/*.cpp 23 | touch ${OUTPUT_DIR}/*.hpp 24 | touch ${OUTPUT_DIR}/*.txt 25 | touch ${TRIGGER} 26 | #fi 27 | -------------------------------------------------------------------------------- /project/librets/include/librets/curl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_CURL_H 18 | #define LIBRETS_CURL_H 19 | 20 | #include "curl/curl.h" 21 | #include "librets/winundef.h" 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /project/librets/src/MetadataFinder.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataFinder.h" 19 | 20 | using namespace librets; 21 | 22 | MetadataFinder::~MetadataFinder() 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /project/swig/ruby/login.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'librets' 4 | require 'pp' 5 | 6 | include Librets 7 | 8 | begin 9 | session = RetsSession.new("http://demo.crt.realtors.org:6103/rets/login") 10 | 11 | puts "Logging into #{session.login_url}" 12 | 13 | if !session.login("Joe", "Schmoe") 14 | puts "Invalid login" 15 | exit 1 16 | end 17 | 18 | puts "Member name: " + session.login_response.member_name 19 | puts "Search URL: " + session.capability_urls.search_url 20 | 21 | puts "Action: " + session.action 22 | version = "1.0" 23 | version = "1.5" if (session.detected_rets_version == RETS_1_5) 24 | puts "RETS Version: " + version 25 | 26 | logout = session.logout() 27 | 28 | puts "Billing info: " + logout.billing_info 29 | puts "Logout message: " + logout.logout_message 30 | puts "Connect time: " + logout.connect_time.to_s 31 | rescue RetsException => e 32 | puts e 33 | end 34 | -------------------------------------------------------------------------------- /project/librets/src/MetadataLoader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataLoader.h" 19 | 20 | using namespace librets; 21 | 22 | #define CLASS MetadataLoader 23 | 24 | CLASS::~CLASS() 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-table.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 691 6 | Date: Tue, 26 Aug 2008 17:21:20 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | SystemName StandardName LongName DBName ShortName MaximumLength DataType Precision Searchable Interpretation Alignment UseSeparator EditMaskID LookupName MaxSelect Units Index Minimum Maximum Default Required SearchHelpID Unique 13 | OFFICE_ID ListOfficeOfficeID Office ID OFFICE_ID OFFICE_ID 7 Character 0 1 Left 0 0 0 0 0 0 0 0 14 | AGENT_ID ListAgentAgentID Agent ID AGENT_ID AGENT 6 Character 0 1 Left 0 0 0 0 0 1 1 1 15 | 16 | 17 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/update.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.7.2 3 | RETS-Server: Variman/3.0.0b4 4 | Cache-Control: private 5 | Content-Type: text/xml 6 | Content-Length: 4783 7 | Date: Fri, 20 Aug 2009 00:41:11 GMT 8 | Server: Apache-Coyote/1.1 9 | 10 | 11 | 12 | 13 | 14 | AgentID LivingArea Baths Beds Board City CloseDate ContractDate County ClosePrice Garage ListDate ListingID ListPrice ListingStatus Type ModificationTimestamp OfficeID TotalRooms StateOrProvince StreetName StreetNumber StreetDirPrefix UnitNumber YearBuilt PostalCode 15 | agent07 1100 3 4 Chicago 2004-09-01 Cook 233000 2 2004-07-04 LN000005 250000 Closed 9 IL Michigan 625 N 1978 60605 16 | 17 | CloseDate 12345 0 Invalid Closing Date 18 | 19 | 20 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.10: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 635 6 | Date: Tue, 26 Aug 2008 17:21:34 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | Lake LK 32 14 | Creek CR 2 15 | Desert DS 4 16 | River RV 1024 17 | Urban UB 2048 18 | Ravine RA 512 19 | Mountain MT 64 20 | Hills HL 16 21 | Woods WD 4096 22 | Ocean OC 128 23 | Alley AL 1 24 | Open Lot OL 256 25 | Farm FM 8 26 | 27 | 28 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/login-valid15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Broker = 4 | MemberName = Joe Schmoe 5 | MetadataVersion = 1.0.000 6 | MetadataTimestamp = 01 Jan 2000 01:02:00 GMT 7 | MinMetadataTimestamp = 01 Jan 2000 01:01:00 GMT 8 | User = Joe,NULL,NULL,NULL 9 | OfficeList = chi 10 | Expr = 01 Jan 2000 01:03:00 GMT, 5 11 | Action = action 12 | Login = http://example.com:6103/rets/login 13 | LoginComplete = http://example.com:6103/rets/loginComplete 14 | Logout = http://example.com:6103/rets/logout 15 | Search = /rets/search 16 | GetMetadata = http://example.com:6103/rets/getMetadata 17 | ChangePassword = http://example.com:6103/rets/changePassword 18 | GetObject = http://example.com:6103/rets/getObject 19 | ServerInformation = http://example.com:6103/rets/serverInfo 20 | Update = http://example.com:6103/rets/update 21 | Balance = 3,197.35 22 | TimeoutSeconds = 1800 23 | X-Field = Value 24 | 25 | 26 | -------------------------------------------------------------------------------- /project/librets/src/MetadataElementCollector.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataElementCollector.h" 19 | 20 | using namespace librets; 21 | 22 | MetadataElementCollector::~MetadataElementCollector() 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /project/librets/src/XmlMetadataElementFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/XmlMetadataElementFactory.h" 18 | 19 | using namespace librets; 20 | 21 | #define CLASS XmlMetadataElementFactory 22 | 23 | CLASS::~CLASS() 24 | { 25 | } 26 | -------------------------------------------------------------------------------- /project/swig/node.js/login.js: -------------------------------------------------------------------------------- 1 | var librets = require("./build/Release/librets.node"); 2 | 3 | try 4 | { 5 | var session = new librets.RetsSession("http://www.dis.com:6103/rets/login"); 6 | 7 | console.log("Logging into " + session.GetLoginUrl()); 8 | 9 | if (!session.Login("Joe", "Schmoe")) 10 | { 11 | console.log("Login failed"); 12 | process.exit(-1); 13 | } 14 | 15 | var loginResponse = session.GetLoginResponse(); 16 | var urls = session.GetCapabilityUrls(); 17 | 18 | console.log("Member name: " + loginResponse.GetMemberName()); 19 | console.log("Search URL: " + urls.GetSearchUrl()); 20 | console.log("Action:") 21 | console.log(session.GetAction()); 22 | 23 | var logout = session.Logout(); 24 | 25 | console.log("Billing info: " + logout.GetBillingInfo()); 26 | console.log("Connect time: " + logout.GetConnectTime()); 27 | console.log("Message: " + logout.GetLogoutMessage()); 28 | } 29 | catch(e) 30 | { 31 | console.log("Exception: " + e); 32 | } 33 | -------------------------------------------------------------------------------- /project/swig/php5/login.php: -------------------------------------------------------------------------------- 1 | \n"; 5 | $session = new RetsSession("http://demo.crt.realtors.org:6103/rets/login"); 6 | 7 | if (!$session->Login("Joe", "Schmoe")) 8 | { 9 | print "Invalid Login\n"; 10 | exit(1); 11 | } 12 | 13 | $loginResponse = $session->GetLoginResponse(); 14 | $capurls = $session->GetCapabilityUrls(); 15 | 16 | print "Member name: " . $loginResponse->GetMemberName() . "\n"; 17 | print "Search URL: " . $capurls->GetSearchUrl() . "\n"; 18 | 19 | print "Action: " . $session->GetAction() . "\n"; 20 | $version = "1.0"; 21 | if ($session->GetDetectedRetsVersion() == RETS_1_5) 22 | { 23 | $version = "1.5"; 24 | } 25 | 26 | print "RETS Version: " . $version . "\n"; 27 | 28 | $logout = $session->Logout(); 29 | 30 | print "Billing info: " . $logout->GetBillingInfo() . "\n"; 31 | print "Logout message: " . $logout->GetLogoutMessage() . "\n"; 32 | print "Connect time: " . $logout->GetConnectTime() . "\n"; 33 | print "\n"; 34 | 35 | ?> 36 | -------------------------------------------------------------------------------- /project/swig/php5/logging.php: -------------------------------------------------------------------------------- 1 | SetHttpLogName("logfile"); 7 | 8 | if (!$session->Login("Joe", "Schmoe")) 9 | { 10 | print "Invalid Login\n"; 11 | exit(1); 12 | } 13 | 14 | $loginResponse = $session->GetLoginResponse(); 15 | $capurls = $session->GetCapabilityUrls(); 16 | 17 | print "Member name: " . $loginResponse->GetMemberName() . "\n"; 18 | print "Search URL: " . $capurls->GetSearchUrl() . "\n"; 19 | 20 | print "Action: " . $session->GetAction() . "\n"; 21 | $version = "1.0"; 22 | if ($session->GetDetectedRetsVersion() == RETS_1_5) 23 | { 24 | $version = "1.5"; 25 | } 26 | 27 | print "RETS Version: " . $version . "\n"; 28 | 29 | $logout = $session->Logout(); 30 | 31 | print "Billing info: " . $logout->GetBillingInfo() . "\n"; 32 | print "Logout message: " . $logout->GetLogoutMessage() . "\n"; 33 | print "Connect time: " . $logout->GetConnectTime() . "\n"; 34 | 35 | ?> 36 | -------------------------------------------------------------------------------- /project/swig/ruby/librets_ruby.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_RUBY_H 19 | #define LIBRETS_RUBY_H 20 | 21 | #ifdef _WIN32 22 | # define BOOST_USE_WINDOWS_H 23 | # include 24 | # include "librets/winundef.h" 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /project/build/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_XXX_H 19 | #define LIBRETS_XXX_H 20 | 21 | namespace librets { 22 | 23 | class XXX 24 | { 25 | }; 26 | 27 | } 28 | 29 | #endif 30 | 31 | /* Local Variables: */ 32 | /* mode: c++ */ 33 | /* End: */ 34 | -------------------------------------------------------------------------------- /project/librets/test/src/librets_test_Prefix.pch: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include "testUtil.h" 26 | -------------------------------------------------------------------------------- /project/librets/test/src/resources/payloadlist-response.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PayloadName Resource Class Description URI MetadataEntryID 5 | DATADICTIONARY:1.0 Property 1 RESO Standard Data Dictionary 1.0 Payload http://www.reso.org/DataDictionary1.0/Property Datadictionary10_Property_1 6 | DATADICTIONARY:1.1 Property 1 RESO Standard Data Dictionary 1.1 Payload http://www.reso.org/DataDictionary1.1/Property Datadictionary11_Property_1 7 | DATADICTIONARY:1.0 Property 12 RESO Standard Data Dictionary 1.0 Payload http://www.reso.org/DataDictionary1.0/Property Datadictionary10_Property_12 8 | DATADICTIONARY:1.1 Property 12 RESO Standard Data Dictionary 1.1 Payload http://www.reso.org/DataDictionary1.1/Property Datadictionary11_Property_12 9 | 10 | 11 | -------------------------------------------------------------------------------- /project/build/ac-macros/mingw.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Configure MinGW builds on Windows. This is very kludgy. But, then again, windows ... 3 | dnl 4 | AC_DEFUN([MY_TEST_MINGW], [ 5 | AC_ARG_WITH(platform, 6 | AC_HELP_STRING([--with-platform=PLATFORM], 7 | [Set platform (x86 or x64 - primarily for MinGW on Windows)]), 8 | my_platform="$withval", 9 | my_platform="") 10 | 11 | if test "$my_platform" != "x86"; then 12 | 13 | if test "$my_platform" != "x64"; then 14 | my_platform="" 15 | fi 16 | fi 17 | 18 | if test "X$my_platform" != "X"; then 19 | ARCH="-$my_platform" 20 | CFLAGS=`echo ${CFLAGS} | sed -e 's/-fPIC//'` 21 | LIBRETS_CFLAGS=`echo ${LIBRETS_CFLAGS} | sed -e 's/-fPIC//'` 22 | LDFLAGS="${LDFLAGS} -static-libgcc -static-libstdc++" 23 | if test "$my_platform" == "x64"; then 24 | HAVE_RUBY=0 25 | my_have_ruby=no 26 | fi 27 | fi 28 | 29 | 30 | if test "X$MSYSTEM" != "X"; then 31 | LDFLAGS="$LDFLAGS -Wl,-Bstatic" 32 | fi 33 | ]) 34 | -------------------------------------------------------------------------------- /project/build/config.vc.dist: -------------------------------------------------------------------------------- 1 | # Point to vendor code, checked out from svn. Must be an absolute 2 | # path with backslashes. Do not use forward slashes. 3 | BASE_PATH = c:\librets\vendor\$(VS_VERSION)-$(TARGET_CPU) 4 | # 5 | # The path to the SWIG support files. This depends on the 6 | # SWIG version. 7 | SWIG_LIBRARY = $(BASE_PATH)\share\swig\3.0.12 8 | 9 | # The BOOST version currently being used. 10 | BOOST_VERSION = 1_71 11 | 12 | # [debug, release] 13 | BUILD = release 14 | 15 | # [dynamic, static] 16 | # 17 | # Static means compile with /MT and dynamic means compile with /MD. 18 | # 19 | # NOTE: ALL objects of a library or application must be compiled 20 | # with the same flag. Not doing so will cause errors at link time. 21 | RUNTIME_LIBS = static 22 | 23 | # [true, anything else is false] 24 | # 25 | # Allows a library user to not compile/include the SQL to DMQL compiler 26 | # if they are not going to use it. 27 | USE_SQL_COMPILER = true 28 | 29 | # Visual Studio version to use. 30 | # [vs2003, vs2005, vs2008, vs2010, vs2015, vs2017, vs2019] 31 | # 32 | VS_VERSION = vs2010 33 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup-type.1: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 723 6 | Date: Tue, 26 Aug 2008 17:21:29 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LongValue ShortValue Value 13 | CRS CRS CRS 14 | SIOR SIOR SIOR 15 | AMO AMO AMO 16 | LTG LTG LTG 17 | RAA RAA RAA 18 | CCIM CCIM CCIM 19 | GRI GRI GRI 20 | CRB CRB CRB 21 | ABRM ABRM ABRM 22 | ABR ABR ABR 23 | ALC ALC ALC 24 | RCE RCE RCE 25 | CIPS CIPS CIPS 26 | CPM CPM CPM 27 | GAA GAA GAA 28 | CRE CRE CRE 29 | 30 | 31 | -------------------------------------------------------------------------------- /project/librets/src/MetadataValidationLookup.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataValidationLookup.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataValidationLookup 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return VALIDATION_LOOKUP; 27 | } 28 | -------------------------------------------------------------------------------- /project/librets/src/RetsHttpResponse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/RetsHttpResponse.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | RetsHttpResponse::~RetsHttpResponse() 23 | { 24 | } 25 | 26 | string RetsHttpResponse::GetContentType() const 27 | { 28 | return GetHeader("Content-Type"); 29 | } 30 | -------------------------------------------------------------------------------- /project/build/node.js.mk: -------------------------------------------------------------------------------- 1 | 2 | NODE_BUILD = ${NODE_EXT} 3 | 4 | NODE_EXT = ${NODE_OBJ_DIR}/build/Release/librets.node 5 | 6 | NODE_OBJ_DIR = ${SWIG_OBJ_DIR}/node.js 7 | NODE_WRAP = ${NODE_OBJ_DIR}/librets_wrap.cpp 8 | NODE_SRC_DIR = ${SWIG_DIR}/node.js 9 | NODE_BINDING = ${NODE_OBJ_DIR}/binding.gyp 10 | NODE_MAKEFILE = ${NODE_OBJ_DIR}/build/Makefile 11 | 12 | NODE_EXAMPLES_SRC := $(wildcard ${NODE_SRC_DIR}/*.js) 13 | NODE_EXAMPLES := $(patsubst $(NODE_SRC_DIR)/%.js, $(NODE_OBJ_DIR)/%.js, $(NODE_EXAMPLES_SRC)) 14 | 15 | ${NODE_WRAP}: ${SWIG_FILES} 16 | ${SWIG} -c++ -javascript -node -DV8_VERSION=${NODE_V8_VERSION} \ 17 | -o ${NODE_WRAP} -outdir ${NODE_OBJ_DIR} ${SWIG_DIR}/librets.i 18 | 19 | ${NODE_BINDING}: ${NODE_SRC_DIR}/binding.gyp 20 | cp ${NODE_SRC_DIR}/binding.gyp ${NODE_OBJ_DIR} 21 | 22 | ${NODE_MAKEFILE}: ${NODE_BINDING} ${NODE_WRAP} 23 | cd ${NODE_OBJ_DIR} && ${NODEGYP} configure 24 | 25 | ${NODE_EXAMPLES}: \ 26 | $(NODE_OBJ_DIR)/%.js: ${NODE_SRC_DIR}/%.js 27 | cp $< $@ 28 | 29 | ${NODE_EXT}: ${NODE_MAKEFILE} ${NODE_EXAMPLES} 30 | cd ${NODE_OBJ_DIR} && ${NODEGYP} build -v 31 | 32 | -------------------------------------------------------------------------------- /project/librets/src/MetadataValidationExternal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataValidationExternal.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataValidationExternal 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return VALIDATION_EXTERNAL; 27 | } 28 | -------------------------------------------------------------------------------- /project/librets/src/MetadataValidationExpression.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataValidationExpression.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataValidationExpression 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return VALIDATION_EXPRESSION; 27 | } 28 | -------------------------------------------------------------------------------- /project/swig/perl/Makefile.PL: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | use Config; 3 | 4 | if (($Config{'osname'} !~ /cygwin/) && ($Config{'osname'} !~ /MSWin32/)) 5 | { 6 | $cflags = `../../../librets-config-inplace --cflags`; 7 | $libs = `../../../librets-config-inplace --libs`; 8 | } 9 | 10 | $cc = $Config{'cc'}; 11 | $ld = $Config{'ld'}; 12 | if (($Config{'osname'} =~ /darwin/) && ($Config{'osname'} =~ /darwin/)) 13 | { 14 | $cc =~ s/gcc/cc/; 15 | $ld =~ s/gcc/cc/; 16 | $cc =~ s/cc/c\+\+/; 17 | $ld =~ s/cc/c\+\+/; 18 | } 19 | elsif ($Config{'osname'} =~ /linux/) 20 | { 21 | $cc =~ s/gcc/g\+\+/; 22 | $ld =~ s/gcc/g\+\+/; 23 | } 24 | elsif ($Config{'osname'} =~ /freebsd/) 25 | { 26 | $cc =~ s/cc/g\+\+/; 27 | $ld =~ s/cc/g\+\+/; 28 | } 29 | 30 | WriteMakefile( 31 | NAME => 'librets', 32 | INC => $cflags, 33 | CC => $cc, 34 | LD => $ld, 35 | PM => {'librets.pm' => '$(INST_LIBDIR)/librets.pm'}, 36 | dynamic_lib => { OTHERLDFLAGS => $libs}, 37 | OBJECT => 'librets_wrap.o' 38 | ); 39 | -------------------------------------------------------------------------------- /project/build/ac-macros/sql-compiler.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Add sql-compiler option. Requires MY_TEST_ANTLR to be run first. 3 | dnl 4 | AC_DEFUN([MY_CHECK_SQL_COMPILER], [ 5 | AC_ARG_ENABLE( 6 | sql-compiler, 7 | AC_HELP_STRING([--enable-sql-compiler], 8 | [build SQL to DMQL compiler (default: enabled)]), 9 | test "X$enableval" = "Xyes" && my_enable_sql_compiler=yes, 10 | my_enable_sql_compiler=yes) 11 | 12 | my_use_sql_compiler=no 13 | USE_SQL_COMPILER= 14 | if test "$my_enable_sql_compiler" = "yes"; then 15 | MY_TEST_ANTLR 16 | if test "x$ANTLR" != "x"; then 17 | if test "x$ANTLR_LIBS" != "x"; then 18 | USE_SQL_COMPILER=1 19 | my_use_sql_compiler=yes 20 | else 21 | AC_MSG_WARN([*** Optional SQL compiler requires ANTLR ***]) 22 | AC_MSG_WARN([*** Not compiling SQL compiler ***]) 23 | fi 24 | else 25 | AC_MSG_WARN([*** Optional SQL compiler requires ANTLR ***]) 26 | AC_MSG_WARN([*** Not compiling SQL compiler ***]) 27 | fi 28 | fi 29 | AC_SUBST(USE_SQL_COMPILER) 30 | ]) 31 | -------------------------------------------------------------------------------- /project/librets/src/MetadataValidationLookupType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataValidationLookupType.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataValidationLookupType 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return VALIDATION_LOOKUP_TYPE; 27 | } 28 | -------------------------------------------------------------------------------- /project/librets/src/MetadataValidationExternalType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataValidationExternalType.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataValidationExternalType 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return VALIDATION_EXTERNAL_TYPE; 27 | } 28 | -------------------------------------------------------------------------------- /project/librets/src/RetsHttpClient.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/RetsHttpClient.h" 18 | #include "librets/CurlHttpClient.h" 19 | 20 | using namespace librets; 21 | 22 | RetsHttpClientPtr RetsHttpClient::CreateDefault() 23 | { 24 | RetsHttpClientPtr httpClient(new CurlHttpClient()); 25 | return httpClient; 26 | } 27 | 28 | RetsHttpClient::~RetsHttpClient() 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /project/iRets/AccountsArrayController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | 20 | 21 | /** 22 | * The sole purpose of this class is to make sure the account name 23 | * gets prepopulated when creating new accounts. 24 | */ 25 | @interface AccountsArrayController : NSArrayController 26 | { 27 | 28 | } 29 | 30 | - (id) init; 31 | 32 | - (void) prepareContent; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /project/librets/test/sql/TestSqlMetadata.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "TestSqlMetadata.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | bool TestSqlMetadata::IsLookupColumn(string tableName, string columnName) 24 | { 25 | if ((tableName == "data:Property:RES") && (columnName == "Status")) 26 | { 27 | return true; 28 | } 29 | return false; 30 | } 31 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-table.3: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 885 6 | Date: Tue, 26 Aug 2008 17:21:22 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | SystemName StandardName LongName DBName ShortName MaximumLength DataType Precision Searchable Interpretation Alignment UseSeparator EditMaskID LookupName MaxSelect Units Index Minimum Maximum Default Required SearchHelpID Unique 13 | NAME Broker Name NAME BROKER 20 Character 0 1 Left 0 0 0 0 0 0 0 0 14 | OFFICE_ID ListOfficeOfficeID Office ID OFFICE_ID OFFICE_ID 7 Character 0 1 Left 0 0 0 0 0 1 0 1 15 | URL ListOfficeWWW Broker URL URL BROKER_URL 40 Character 0 1 Left 0 0 0 0 0 3 0 0 16 | BROKER_ID ListOfficeBrokerID Broker ID BROKER_ID BROKER_ID 6 Character 0 1 Left 0 0 0 0 0 2 1 0 17 | 18 | 19 | -------------------------------------------------------------------------------- /project/swig/shared_ptr_release.i: -------------------------------------------------------------------------------- 1 | namespace boost { 2 | template class shared_ptr 3 | { 4 | public: 5 | shared_ptr(); 6 | shared_ptr(T * t); 7 | T * operator-> () const; 8 | void reset(T * t); 9 | }; 10 | } 11 | 12 | 13 | %define SWIG_SHARED_PTR_RELEASE_PROXY(TYPE, PROXYCLASS) 14 | 15 | #if defined(SWIGCSHARP) 16 | 17 | %typemap (ctype) boost::shared_ptr "void *" 18 | %typemap (imtype, out="System.IntPtr") boost::shared_ptr "HandleRef" 19 | %typemap (cstype) boost::shared_ptr "PROXYCLASS" 20 | %typemap (out) boost::shared_ptr %{ 21 | $result = (void *)&$1; 22 | %} 23 | %typemap(csout, excode=SWIGEXCODE) boost::shared_ptr { 24 | System.IntPtr cPtr = $imcall; 25 | PROXYCLASS ret = (cPtr == System.IntPtr.Zero) ? null : new PROXYCLASS(cPtr, true);$excode 26 | return ret; 27 | } 28 | 29 | #else 30 | #error "Unsupported SWIG language for shared_ptr_release" 31 | #endif 32 | 33 | %template() boost::shared_ptr; 34 | %enddef 35 | ; 36 | 37 | %define SWIG_SHARED_PTR_RELEASE(TYPE) 38 | SWIG_SHARED_PTR_RELEASE_PROXY(TYPE, TYPE) 39 | %enddef 40 | 41 | SWIG_SHARED_PTR_RELEASE(Foo) 42 | ; 43 | -------------------------------------------------------------------------------- /project/librets/sql/RetsSqlException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/RetsSqlException.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | RetsSqlException::RetsSqlException(string message) 23 | : RetsException(message) 24 | { 25 | } 26 | 27 | RetsSqlException::~RetsSqlException() throw() 28 | { 29 | } 30 | 31 | string RetsSqlException::GetName() const throw() 32 | { 33 | return "RetsSqlException"; 34 | } 35 | -------------------------------------------------------------------------------- /project/librets/src/DmqlCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include 18 | #include "librets/DmqlCriterion.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | using std::ostringstream; 23 | using std::ostream; 24 | 25 | DmqlCriterion::~DmqlCriterion() 26 | { 27 | } 28 | 29 | std::string DmqlCriterion::ToDmqlString() 30 | { 31 | ostringstream dmqlString; 32 | this->ToDmql(dmqlString); 33 | return dmqlString.str(); 34 | } 35 | -------------------------------------------------------------------------------- /project/librets/include/librets/template.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2008 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_METADATA_ELEMENT_H 18 | #define LIBRETS_METADATA_ELEMENT_H 19 | /** 20 | * @file template.h 21 | * (Internal) Contains the template that can be used when creating 22 | * new files within libRETS. 23 | */ 24 | /// @cond MAINTAINER 25 | 26 | namespace librets { 27 | 28 | 29 | 30 | }; 31 | 32 | /// @endcond 33 | #endif 34 | 35 | /* Local Variables: */ 36 | /* mode: c++ */ 37 | /* End: */ 38 | -------------------------------------------------------------------------------- /project/swig/csharp/librets_sharp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include 19 | #include "librets_sharp.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | 24 | #define CLASS RetsHttpLoggerBridge 25 | 26 | CLASS::CLASS(RetsHttpLoggerCallback loggerCallback) 27 | : mLoggerCallback(loggerCallback) 28 | { 29 | } 30 | 31 | void CLASS::logHttpData(Type type, string data) 32 | { 33 | mLoggerCallback(type, (void *) data.data(), data.length()); 34 | } 35 | -------------------------------------------------------------------------------- /project/swig/python/Makefile.vc: -------------------------------------------------------------------------------- 1 | !include <../../build/Makefile.vc> 2 | 3 | PYTHON2 = python2 4 | 5 | LIBRETS_LIB= ../../librets/src/$(BUILD_DIR)/$(LIBRETS_LIB_NAME) \ 6 | $(BOOST_LDFLAGS) $(WINLIBS) 7 | #CFLAGS = $(CFLAGS_STD) $(BOOST_CFLAGS) -I../../librets/include 8 | CFLAGS = /GR /EHsc $(BOOST_CFLAGS) $(CURL_CFLAGS) -I../../librets/include 9 | 10 | LIBRETS_EXT = build/lib.win32-2.5/_librets.pyd 11 | 12 | SETUP_CONFIG = setup.ini 13 | 14 | all: $(LIBRETS_EXT) 15 | 16 | librets_wrap.cpp: ../librets.i 17 | $(SWIG) -c++ -python -o librets_wrap.cpp \ 18 | -I$(SWIG_LIBRARY)/python -I$(SWIG_LIBRARY) \ 19 | -I.. ../librets.i 20 | 21 | $(LIBRETS_EXT): librets_wrap.cpp 22 | echo $(VERSION) > $(SETUP_CONFIG) 23 | echo $(LIBRETS_LIB) >> $(SETUP_CONFIG) 24 | echo $(CFLAGS) >> $(SETUP_CONFIG) 25 | echo ../librets_bridge.cpp >> $(SETUP_CONFIG) 26 | set DISTUTILS_USE_SDK=1 27 | set MSSdk=1 28 | $(PYTHON2) setup.py build --compiler=msvc 29 | 30 | install: 31 | $(PYTHON2) setup.py install 32 | 33 | dist: $(LIBRETS_EXT) 34 | $(PYTHON2) setup.py bdist_wininst 35 | 36 | clean: 37 | @-rmdir /q /s build 2> NUL 38 | @-rmdir /q /s dist 2> NUL 39 | 40 | distclean: clean 41 | @-erase librets.py* librets_wrap.* 2> NUL 42 | -------------------------------------------------------------------------------- /project/swig/python3/Makefile.vc: -------------------------------------------------------------------------------- 1 | !include <../../build/Makefile.vc> 2 | 3 | PYTHON3 = python3 4 | 5 | LIBRETS_LIB= ../../librets/src/$(BUILD_DIR)/$(LIBRETS_LIB_NAME) \ 6 | $(BOOST_LDFLAGS) $(WINLIBS) 7 | #CFLAGS = $(CFLAGS_STD) $(BOOST_CFLAGS) -I../../librets/include 8 | CFLAGS = /GR /EHsc $(BOOST_CFLAGS) $(CURL_CFLAGS) -I../../librets/include 9 | 10 | LIBRETS_EXT = build/lib.win64-3.3/_librets.pyd 11 | 12 | SETUP_CONFIG = setup.ini 13 | 14 | all: $(LIBRETS_EXT) 15 | 16 | librets_wrap.cpp: ../librets.i 17 | $(SWIG) -c++ -python -o librets_wrap.cpp \ 18 | -I$(SWIG_LIBRARY)/python -I$(SWIG_LIBRARY) \ 19 | -I.. ../librets.i 20 | 21 | $(LIBRETS_EXT): librets_wrap.cpp 22 | echo $(VERSION) > $(SETUP_CONFIG) 23 | echo $(LIBRETS_LIB) >> $(SETUP_CONFIG) 24 | echo $(CFLAGS) >> $(SETUP_CONFIG) 25 | echo ../librets_bridge.cpp >> $(SETUP_CONFIG) 26 | set DISTUTILS_USE_SDK=1 27 | set MSSdk=1 28 | $(PYTHON3) setup.py build --compiler=msvc 29 | 30 | install: 31 | $(PYTHON3) setup.py install 32 | 33 | dist: $(LIBRETS_EXT) 34 | $(PYTHON3) setup.py bdist_wininst 35 | 36 | clean: 37 | @-rmdir /q /s build 2> NUL 38 | @-rmdir /q /s dist 2> NUL 39 | 40 | distclean: clean 41 | @-erase librets.py* librets_wrap.* 2> NUL 42 | -------------------------------------------------------------------------------- /project/iRets/ResultListing.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | #import "MyController.h" 20 | 21 | @interface ResultListing : NSObject { 22 | NSMutableDictionary * mFields; 23 | NSMutableArray * mImages; 24 | MyController * mController; 25 | } 26 | 27 | -(id) initWithController: (MyController *) controller; 28 | 29 | - (NSDictionary *) fields; 30 | - (void) setField: (id) field forKey: (id) key; 31 | - (BOOL) hasListingId; 32 | - (NSArray *) images; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /project/librets/src/MetadataEditMask.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataEditMask.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | #define CLASS MetadataEditMask 24 | 25 | MetadataElement::MetadataType CLASS::GetType() const 26 | { 27 | return EDIT_MASK; 28 | } 29 | 30 | string CLASS::GetId() const 31 | { 32 | return GetEditMaskID(); 33 | } 34 | 35 | string CLASS::GetEditMaskID() const 36 | { 37 | return GetStringAttribute("EditMaskID"); 38 | } 39 | -------------------------------------------------------------------------------- /project/iRets/AccountsArrayController.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import "AccountsArrayController.h" 19 | 20 | 21 | @implementation AccountsArrayController 22 | 23 | - (id) init 24 | { 25 | return self; 26 | } 27 | 28 | - (void) awakeFromNib 29 | { 30 | } 31 | 32 | - (id) newObject 33 | { 34 | NSMutableDictionary * object = [super newObject]; 35 | [object setObject: @"Account Name" forKey: @"name"]; 36 | return object; 37 | } 38 | 39 | - (void) prepareContent 40 | { 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /project/librets/src/MetadataUpdateHelp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataUpdateHelp.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataUpdateHelp 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return UPDATE_HELP; 27 | } 28 | 29 | string CLASS::GetId() const 30 | { 31 | return GetUpdateHelpID(); 32 | } 33 | 34 | string CLASS::GetUpdateHelpID() const 35 | { 36 | return GetStringAttribute("UpdateHelpID"); 37 | } 38 | -------------------------------------------------------------------------------- /project/librets/test/src/TestMetadataElement.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "testUtil.h" 19 | #include "TestMetadataElement.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | 24 | string TestMetadataElement::GetTypeName() const 25 | { 26 | return mTypeName; 27 | } 28 | 29 | void TestMetadataElement::SetTypeName(string typeName) 30 | { 31 | mTypeName = typeName; 32 | } 33 | 34 | string TestMetadataElement::GetId() const 35 | { 36 | return GetStringAttribute("ID"); 37 | } 38 | -------------------------------------------------------------------------------- /project/build/php.mk: -------------------------------------------------------------------------------- 1 | ### 2 | # php of swig 3 | # 4 | 5 | PHP_BUILD = ${PHP_DLL} 6 | PHP_VERSION = `php-config --vernum` 7 | 8 | PHP_CXX_FLAGS = `${SWIG_LIBRETS_CONFIG} --cflags` 9 | PHP_DLL = ${PHP_OBJ_DIR}/librets.${DLL} 10 | PHP_INCLUDES = `php-config --includes` 11 | PHP_LDFLAGS = `php-config --ldflags` 12 | PHP_LIBS = `php-config --libs` 13 | PHP_OBJ_DIR = ${SWIG_OBJ_DIR}/php5 14 | PHP_SRC_DIR = ${SWIG_DIR}/php5 15 | PHP_WRAP = ${PHP_OBJ_DIR}/librets_wrap.cpp 16 | 17 | ${PHP_WRAP}: ${SWIG_FILES} 18 | if [ ${PHP_VERSION} -ge 70000 ]; then \ 19 | ${SWIG} -c++ -php7 -o ${PHP_WRAP} \ 20 | -outdir ${PHP_OBJ_DIR} ${SWIG_DIR}/librets.i; \ 21 | else \ 22 | ${SWIG} -c++ -php5 -o ${PHP_WRAP} \ 23 | -outdir ${PHP_OBJ_DIR} ${SWIG_DIR}/librets.i; \ 24 | fi 25 | 26 | ${PHP_DLL}: ${PHP_WRAP} ${PHP_OBJ_DIR}/librets_wrap.o ${SWIG_BRIDGE_OBJ} ${LIBRETS_LIB} 27 | ${SWIG_LINK_ALLOW_UNDEFINED} -o ${PHP_DLL} ${PHP_OBJ_DIR}/librets_wrap.o \ 28 | ${PHP_LDFLAGS} ${PHP_LIBS} ${SWIG_LIBRETS_LIBS} ${SWIG_BRIDGE_OBJ} 29 | 30 | ${PHP_OBJ_DIR}/librets_wrap.o: ${PHP_OBJ_DIR}/librets_wrap.cpp 31 | ${CXX} ${CXXFLAGS} ${PHP_CXX_FLAGS} -g -DLIBRETS_VERSION='"$(VERSION)"' -I${LIBRETS_INC_DIR} -I${PHP_SRC_DIR} \ 32 | -I${SWIG_DIR} ${BOOST_CFLAGS} ${PHP_INCLUDES} -c $< -o $@ 33 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-lookup.4: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 977 6 | Date: Tue, 26 Aug 2008 17:21:31 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | LookupName VisibleName Version Date 13 | LISTING_STATUS Listing Status 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | EFT Exerior Features 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 15 | M_SCHOOL Middle School District 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 16 | VEW View 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 17 | IFT Interior Features 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 18 | LISTING_TYPE Listing Type 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 19 | AR Area 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 20 | E_SCHOOL Elementary School District 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 21 | H_SCHOOL High School District 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 22 | 23 | 24 | -------------------------------------------------------------------------------- /project/librets/src/RetsHttpLogger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/RetsHttpLogger.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | RetsHttpLogger::~RetsHttpLogger() 24 | { 25 | } 26 | 27 | NullHttpLogger * NullHttpLogger::sInstance = 0; 28 | 29 | NullHttpLogger * NullHttpLogger::GetInstance() 30 | { 31 | if (sInstance == 0) 32 | { 33 | sInstance = new NullHttpLogger(); 34 | } 35 | return sInstance; 36 | } 37 | 38 | void NullHttpLogger::logHttpData(Type type, string data) 39 | { 40 | } 41 | -------------------------------------------------------------------------------- /project/librets/src/LookupOrCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include 19 | #include "librets/LookupOrCriterion.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | using std::ostream; 24 | 25 | LookupOrCriterion::LookupOrCriterion(string field, DmqlCriterionPtr value) 26 | : LookupCriterion(field) 27 | { 28 | add(value); 29 | } 30 | 31 | string LookupOrCriterion::Operator() const 32 | { 33 | return "=|"; 34 | } 35 | 36 | string LookupOrCriterion::OperationName() const 37 | { 38 | return "lookup or"; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /project/librets/src/EqCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include 18 | #include "librets/EqCriterion.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | using std::ostream; 23 | 24 | EqCriterion::EqCriterion(string field, DmqlCriterionPtr value) 25 | : FieldCriterion(field, value) 26 | { 27 | } 28 | 29 | ostream & EqCriterion::ToDmql(ostream & out) const 30 | { 31 | out << "(" << mField << "="; 32 | return mValue->ToDmql(out) << ")"; 33 | } 34 | 35 | string EqCriterion::OperationName() const 36 | { 37 | return "equals"; 38 | } 39 | -------------------------------------------------------------------------------- /project/librets/src/GtCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include 18 | #include "librets/GtCriterion.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | using std::ostream; 23 | 24 | GtCriterion::GtCriterion(string field, DmqlCriterionPtr value) 25 | : FieldCriterion(field, value) 26 | { 27 | } 28 | 29 | ostream & GtCriterion::ToDmql(ostream & out) const 30 | { 31 | out << "(" << mField << "="; 32 | return mValue->ToDmql(out) << "+)"; 33 | } 34 | 35 | string GtCriterion::OperationName() const 36 | { 37 | return "greater than"; 38 | } 39 | -------------------------------------------------------------------------------- /project/librets/src/LtCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include 19 | #include "librets/LtCriterion.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | using std::ostream; 24 | 25 | LtCriterion::LtCriterion(string field, DmqlCriterionPtr value) 26 | : FieldCriterion(field, value) 27 | { 28 | } 29 | 30 | ostream & LtCriterion::ToDmql(ostream & out) const 31 | { 32 | out << "(" << mField << "="; 33 | return mValue->ToDmql(out) << "-)"; 34 | } 35 | 36 | string LtCriterion::OperationName() const 37 | { 38 | return "less than"; 39 | } 40 | -------------------------------------------------------------------------------- /project/swig/python3/get_object.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | import librets 5 | 6 | try: 7 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 8 | if not session.Login("Joe", "Schmoe"): 9 | sys.exit("Invalid login") 10 | 11 | request = librets.GetObjectRequest("Property", "Photo") 12 | request.AddAllObjects("LN000001") 13 | 14 | content_type_suffixes = {'image/jpeg': 'jpg', 'image/gif': 'gif', 'text/xml': 'xml'} 15 | response = session.GetObject(request) 16 | object_descriptor = response.NextObject() 17 | while object_descriptor is not None: 18 | object_key = object_descriptor.GetObjectKey() 19 | object_id = object_descriptor.GetObjectId() 20 | content_type = object_descriptor.GetContentType() 21 | description = object_descriptor.GetDescription() 22 | print('{} object #{}'.format(object_key, object_id)) 23 | 24 | suffix = content_type_suffixes[content_type] 25 | output_file_name = '{}-{}.{}'.format(object_key, object_id, suffix) 26 | with open(output_file_name, 'wb') as f: 27 | f.write(object_descriptor.GetData()) 28 | 29 | object_descriptor = response.NextObject() 30 | 31 | session.Logout() 32 | except librets.RetsException as e: 33 | print("Caught:", e.GetMessage()) 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Mac OS X 2 | *.DS_Store 3 | 4 | # Xcode 5 | *.pbxuser 6 | *.mode1v3 7 | *.mode2v3 8 | *.perspectivev3 9 | *.xcuserstate 10 | project.xcworkspace/ 11 | xcuserdata/ 12 | 13 | # Windows build files 14 | vc*.idb 15 | vc*.pch 16 | vc*.pdb 17 | 18 | /build 19 | /dist 20 | /scratch 21 | /configure 22 | /config.log 23 | /config.status 24 | /config.cache 25 | /Makefile 26 | /autom4te*.cache 27 | /.gdb_history 28 | /librets-config 29 | /librets-config-inplace 30 | /.gdbinit 31 | 32 | project/build/config.vc 33 | project/build/Doxyfile 34 | 35 | project/examples/src/build 36 | project/examples/src/build-* 37 | 38 | project/librets/src/config.h 39 | project/librets/src/build 40 | project/librets/src/build-* 41 | 42 | project/librets/test/src/build 43 | project/librets/test/src/build-* 44 | 45 | project/swig/csharp/build-* 46 | project/swig/csharp/librets.* 47 | project/swig/csharp/librets_wrap.cpp 48 | project/swig/csharp/librets_wrap.h 49 | project/swig/csharp/*.dll 50 | project/swig/csharp/*.obj 51 | project/swig/csharp/*.exe 52 | project/swig/csharp/*.mdb 53 | project/swig/csharp/bin 54 | project/swig/csharp/lib 55 | 56 | project/swig/node.js/binding.gyp 57 | 58 | # vendor 59 | vendorsrc/antlr 60 | vendorsrc/boost 61 | vendorsrc/curl 62 | vendorsrc/expat 63 | vendorsrc/openssl 64 | vendorsrc/pcre 65 | vendorsrc/swigwin 66 | vendor/ 67 | -------------------------------------------------------------------------------- /project/librets/include/librets/error_forward.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_ERROR_FORWARD_H 19 | #define LIBRETS_ERROR_FORWARD_H 20 | /** 21 | * @file error_forward.h 22 | * (Internal) Contains the error classes forward declarations. 23 | */ 24 | /// @cond MAINTAINER 25 | 26 | #include 27 | 28 | namespace librets { 29 | 30 | class RetsErrorHandler; 31 | 32 | class NullErroHandler; 33 | 34 | class ExceptionErrorHandler; 35 | 36 | }; 37 | /// @endcond 38 | 39 | #endif 40 | 41 | /* Local Variables: */ 42 | /* mode: c++ */ 43 | /* End: */ 44 | -------------------------------------------------------------------------------- /project/librets/test/sql/TestSqlMetadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_TEST_SQL_METADATA_H 19 | #define LIBRETS_TEST_SQL_METADATA_H 20 | 21 | #include "librets/sql_forward.h" 22 | #include "librets/SqlMetadata.h" 23 | 24 | namespace librets { 25 | 26 | class TestSqlMetadata : public SqlMetadata 27 | { 28 | public: 29 | virtual bool IsLookupColumn(std::string tableName, std::string columnName); 30 | }; 31 | 32 | typedef boost::shared_ptr TestSqlMetadataPtr; 33 | 34 | } 35 | 36 | #endif 37 | 38 | /* Local Variables: */ 39 | /* mode: c++ */ 40 | /* End: */ 41 | -------------------------------------------------------------------------------- /project/swig/perl/Makefile.mingw: -------------------------------------------------------------------------------- 1 | use ExtUtils::MakeMaker; 2 | use Config; 3 | 4 | $Config{'osname'} =~ /MSWin32/ || die "This only works for MinGW"; 5 | 6 | sub sanitize($_) 7 | { 8 | @tokens = split(' ', shift); 9 | 10 | foreach (@tokens) 11 | { 12 | # Change drive letter format for Includes 13 | s/^-I\/([a-z])/-I$1:/; 14 | # Change drive letter format for libs 15 | s/^-L\/([a-z])/-L$1:/; 16 | # Change drive letter format for straight lines beginning /c/... 17 | s/^\/([a-z])/$1:/; 18 | # Change forward slashed to back slashes 19 | s/\//\\/g; 20 | } 21 | return join(" ", @tokens); 22 | } 23 | 24 | $cflags = `sh ../../../librets-config-inplace --cflags`; 25 | $libs = `sh ../../../librets-config-inplace --libs`; 26 | 27 | # Remove -fpic if it appears in cflags 28 | $cflags =~ s/-fpic//i; 29 | 30 | # Sanitize path names 31 | $cflags = sanitize($cflags); 32 | $libs = sanitize($libs); 33 | 34 | $cc = $Config{'cc'}; 35 | $ld = $Config{'ld'}; 36 | 37 | WriteMakefile( 38 | NAME => 'librets', 39 | INC => $cflags, 40 | CC => $cc, 41 | LD => $ld, 42 | PM => {'librets.pm' => '$(INST_LIBDIR)/librets.pm'}, 43 | dynamic_lib => { OTHERLDFLAGS => $libs}, 44 | OBJECT => 'librets_wrap.obj' 45 | ); 46 | -------------------------------------------------------------------------------- /project/librets/src/LookupQuery.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/LookupQuery.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | LookupQuery::LookupQuery() { } 24 | LookupQuery::~LookupQuery() { } 25 | 26 | string LookupQuery::GetResource() const 27 | { 28 | return mResource; 29 | } 30 | 31 | void LookupQuery::SetResource(std::string resource) 32 | { 33 | mResource = resource; 34 | } 35 | 36 | string LookupQuery::GetLookup() const 37 | { 38 | return mLookup; 39 | } 40 | 41 | void LookupQuery::SetLookup(std::string lookup) 42 | { 43 | mLookup = lookup; 44 | } 45 | -------------------------------------------------------------------------------- /project/librets/src/MetadataSearchHelp.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataSearchHelp.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | #define CLASS MetadataSearchHelp 24 | 25 | MetadataElement::MetadataType CLASS::GetType() const 26 | { 27 | return SEARCH_HELP; 28 | } 29 | 30 | string CLASS::GetId() const 31 | { 32 | return GetSearchHelpID(); 33 | } 34 | 35 | string CLASS::GetSearchHelpID() const 36 | { 37 | return GetStringAttribute("SearchHelpID"); 38 | } 39 | 40 | string CLASS::GetValue() const 41 | { 42 | return GetStringAttribute("Value"); 43 | } 44 | -------------------------------------------------------------------------------- /doc/build/windows.txt: -------------------------------------------------------------------------------- 1 | Install These (Required): 2 | * Perl5 in c:\Perl64 3 | * NASM in C:\NASM 4 | * Visual Studio 2017 5 | * Cygwin in c:\cygwin64 6 | 7 | Install these packages in cygwin: 8 | * automake 9 | * binutils 10 | * bison 11 | * flex 12 | * libtool 13 | * make 14 | 15 | Install These (To make your life easier): 16 | * 7-Zip 17 | 18 | Building: 19 | 1. Checkout libRETS to c:\libRETS 20 | 2. From c:\libRETS\vendorsrc, run vendor.ps1 (will not work without 7-zip) 21 | 3. Open the expat solution in c:\libRETS\vendorsrc\expat\current 22 | 1. Add new solution platform: x64 (copy settings from win32) 23 | 2. For each project, update the Windows SDK Version to your Windows 10 SDK version 24 | 4. Copy project\build\config.vc.dist to project\build\config.vc and modify for your needs 25 | 5. Launch x86 Native Tools Command Prompt for VS 2017 26 | 1. In c:\libRETS\vendorsrc, run nmake /f Makefile.vc TARGET_CPU=x86 build-all 27 | 2. In c:\libRETS, run nmake /f Makefile.vc TARGET_CPU=x86 all 28 | 3. In c:\libRETS, run nmake /f Makefile.vc TARGET_CPU=x86 swig 29 | 6. Launch x64 Native Tools Command Prompt for VS 2017 30 | 1. In c:\libRETS\vendorsrc, run nmake /f Makefile.vc TARGET_CPU=x64 build-all 31 | 2. In c:\libRETS, run nmake /f Makefile.vc TARGET_CPU=x64 all 32 | 3. In c:\libRETS, run nmake /f Makefile.vc TARGET_CPU=x64 swig 33 | -------------------------------------------------------------------------------- /project/librets/src/RetsUnknownMetadataException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/RetsUnknownMetadataException.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS RetsUnknownMetadataException 23 | 24 | CLASS::CLASS(string metadataName) 25 | : RetsException(metadataName), mMetadataName(metadataName) 26 | { 27 | } 28 | 29 | CLASS::~CLASS() throw() 30 | { 31 | } 32 | 33 | string CLASS::GetName() const throw() 34 | { 35 | return "RetsUnknownMetadataException"; 36 | } 37 | 38 | string CLASS::GetMetadataName() const throw() 39 | { 40 | return mMetadataName; 41 | } 42 | -------------------------------------------------------------------------------- /project/swig/python/get_object.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import sys 4 | 5 | import librets 6 | 7 | try: 8 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 9 | if not session.Login("Joe", "Schmoe"): 10 | sys.exit("Invalid login") 11 | 12 | request = librets.GetObjectRequest("Property", "Photo") 13 | request.AddAllObjects("LN000001") 14 | 15 | content_type_suffixes = {'image/jpeg': 'jpg', 'image/gif': 'gif', 'text/xml': 'xml'} 16 | response = session.GetObject(request) 17 | object_descriptor = response.NextObject() 18 | while object_descriptor is not None: 19 | object_key = object_descriptor.GetObjectKey() 20 | object_id = object_descriptor.GetObjectId() 21 | content_type = object_descriptor.GetContentType() 22 | description = object_descriptor.GetDescription() 23 | print('{} object #{}'.format(object_key, object_id)) 24 | 25 | suffix = content_type_suffixes[content_type] 26 | output_file_name = '{}-{}.{}'.format(object_key, object_id, suffix) 27 | with open(output_file_name, 'wb') as f: 28 | f.write(object_descriptor.GetData()) 29 | 30 | object_descriptor = response.NextObject() 31 | 32 | session.Logout() 33 | except librets.RetsException as e: 34 | print("Caught:", e.GetMessage()) 35 | -------------------------------------------------------------------------------- /project/librets/src/RetsErrorHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/RetsErrorHandler.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | #define CLASS RetsErrorHandler 24 | 25 | CLASS::~CLASS() 26 | { 27 | } 28 | 29 | #undef CLASS 30 | #define CLASS NullErrorHandler 31 | 32 | NullErrorHandler * CLASS::sInstance = 0; 33 | 34 | NullErrorHandler * CLASS::GetInstance() 35 | { 36 | if (sInstance == 0) 37 | { 38 | sInstance = new NullErrorHandler(); 39 | } 40 | return sInstance; 41 | } 42 | 43 | void CLASS::HandleUnknownMetadata(string name) const 44 | { 45 | } 46 | -------------------------------------------------------------------------------- /project/iRets/LogController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | #import "TextViewHttpLogger.h" 20 | 21 | class TextViewHttpLogger; 22 | 23 | @interface LogController : NSObject 24 | { 25 | IBOutlet NSPanel * mLogPanel; 26 | IBOutlet NSTextView * mLogText; 27 | TextViewHttpLogger * mLogger; 28 | BOOL mShowInformational; 29 | } 30 | 31 | - (IBAction) showLogWindow: (id) sender; 32 | 33 | - (IBAction) clearLog: (id) sender; 34 | 35 | - (librets::RetsHttpLogger *) logger; 36 | 37 | - (BOOL) showInformational; 38 | 39 | - (void) setShowInformational: (BOOL) showInformational; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /project/librets/test/src/TestObject.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include 18 | #include "TestObject.h" 19 | 20 | using namespace librets; 21 | using namespace std; 22 | 23 | TestObject::~TestObject() 24 | { 25 | } 26 | 27 | ostream & TestObject::Print(ostream & outputStream) const 28 | { 29 | return outputStream << "TestObject: " << mNumber; 30 | } 31 | 32 | bool TestObject::Equals(const RetsObject * object) const 33 | { 34 | const TestObject * rhs = dynamic_cast(object); 35 | if (rhs == 0) 36 | { 37 | return false; 38 | } 39 | return mNumber == rhs->mNumber; 40 | } 41 | -------------------------------------------------------------------------------- /project/librets/include/librets/forward.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_FORWARD_H 18 | #define LIBRETS_FORWARD_H 19 | /** 20 | * @file forward.h 21 | * (Internal) Includes the other forward declaration files. 22 | */ 23 | /// @cond MAINTAINER 24 | 25 | #include 26 | 27 | #include "librets/error_forward.h" 28 | #include "librets/protocol_forward.h" 29 | #include "librets/metadata_forward.h" 30 | #include "librets/xml_forward.h" 31 | #include "librets/sql_forward.h" 32 | #include "librets/std_forward.h" 33 | /// @endcond 34 | #endif 35 | 36 | /* Local Variables: */ 37 | /* mode: c++ */ 38 | /* End: */ 39 | -------------------------------------------------------------------------------- /project/librets/include/librets/SqlMetadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_SQL_METADATA_H 19 | #define LIBRETS_SQL_METADATA_H 20 | /** 21 | * @file SqlMetadata.h 22 | * (Internal) Contains the SqlMetadata class definition. 23 | */ 24 | /// @cond MAINTAINER 25 | #include 26 | 27 | namespace librets { 28 | 29 | class SqlMetadata 30 | { 31 | public: 32 | virtual ~SqlMetadata() { }; 33 | 34 | virtual bool IsLookupColumn(std::string tableName, std::string columnName) 35 | = 0; 36 | }; 37 | 38 | }; 39 | /// @endcond 40 | #endif 41 | 42 | /* Local Variables: */ 43 | /* mode: c++ */ 44 | /* End: */ 45 | -------------------------------------------------------------------------------- /project/librets/src/ExceptionErrorHandler.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/ExceptionErrorHandler.h" 19 | #include "librets/RetsUnknownMetadataException.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | 24 | #define CLASS ExceptionErrorHandler 25 | 26 | ExceptionErrorHandler * CLASS::sInstance = 0; 27 | 28 | ExceptionErrorHandler * CLASS::GetInstance() 29 | { 30 | if (sInstance == 0) 31 | { 32 | sInstance = new ExceptionErrorHandler(); 33 | } 34 | return sInstance; 35 | } 36 | 37 | void CLASS::HandleUnknownMetadata(string name) const 38 | { 39 | throw RetsUnknownMetadataException(name); 40 | } 41 | -------------------------------------------------------------------------------- /project/swig/ruby/get-object.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'librets' 4 | require 'pp' 5 | 6 | include Librets 7 | 8 | begin 9 | session = RetsSession.new("http://demo.crt.realtors.org:6103/rets/login") 10 | 11 | if !session.login("Joe", "Schmoe") 12 | puts "Invalid login" 13 | exit 1 14 | end 15 | 16 | get_object_request = GetObjectRequest.new("Property", "Photo") 17 | get_object_request.add_all_objects("LN000001") 18 | 19 | get_object_response = session.get_object(get_object_request) 20 | 21 | content_type_suffixes = { "image/jpeg" => "jpg", "image/gif" => "gif", "text/xml" => "xml"} 22 | get_object_response.each_object do |object_descriptor| 23 | object_key = object_descriptor.object_key 24 | object_id = object_descriptor.object_id 25 | content_type = object_descriptor.content_type 26 | description = object_descriptor.description 27 | print "#{object_key} object \##{object_id}" 28 | print ", description: #{description}" if !description.empty? 29 | puts 30 | 31 | suffix = content_type_suffixes[content_type] 32 | output_file_name = object_key + "-" + object_id.to_s + "." + suffix 33 | File.open(output_file_name, "wb") do |f| 34 | f << object_descriptor.data_as_string 35 | end 36 | end 37 | 38 | session.logout 39 | rescue RetsException => e 40 | puts e 41 | end 42 | 43 | -------------------------------------------------------------------------------- /project/librets/src/LookupColumnsQuery.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/LookupColumnsQuery.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | LookupColumnsQuery::LookupColumnsQuery() { } 24 | 25 | LookupColumnsQuery::~LookupColumnsQuery() { } 26 | 27 | string LookupColumnsQuery::GetResource() const 28 | { 29 | return mResource; 30 | } 31 | 32 | void LookupColumnsQuery::SetResource(string resource) 33 | { 34 | mResource = resource; 35 | } 36 | 37 | string LookupColumnsQuery::GetClass() const 38 | { 39 | return mClass; 40 | } 41 | 42 | void LookupColumnsQuery::SetClass(string aClass) 43 | { 44 | mClass = aClass; 45 | } 46 | -------------------------------------------------------------------------------- /project/iRets/TextViewHttpLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | #include 20 | #include "librets.h" 21 | 22 | class TextViewHttpLogger : public librets::RetsHttpLogger 23 | { 24 | public: 25 | TextViewHttpLogger(NSTextView * textView); 26 | ~TextViewHttpLogger(); 27 | 28 | virtual void logHttpData(Type type, std::string data); 29 | void setShowInformational(BOOL showInformational); 30 | 31 | private: 32 | NSTextView * mTextView; 33 | NSDictionary * mReceivedAttributes; 34 | NSDictionary * mSentAttributes; 35 | NSDictionary * mInformationalAttributes; 36 | BOOL mShowInformational; 37 | }; 38 | 39 | -------------------------------------------------------------------------------- /project/iRets/RetsImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #import 19 | #import "MyController.h" 20 | #include "librets.h" 21 | 22 | @interface RetsImage : NSObject { 23 | NSString * mDescription; 24 | NSString * mObjectKey; 25 | int mObjectId; 26 | NSURL * mLocation; 27 | NSImage * mImage; 28 | BOOL mImageNeedsLoading; 29 | MyController * mController; 30 | } 31 | 32 | - (id) initWithObjectDescriptor: (librets::ObjectDescriptor *) objectDescriptor 33 | controller: (MyController *) controller; 34 | 35 | - (NSString *) description; 36 | - (NSString *) objectKey; 37 | - (int) objectId; 38 | - (NSImage *) image; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /project/librets/src/MetadataColumnGroupControl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Real Estate Standards Organization 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataColumnGroupControl.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | MetadataElement::MetadataType MetadataColumnGroupControl::GetType() const 23 | { 24 | return COLUMN_GROUP_CONTROL; 25 | } 26 | 27 | std::string MetadataColumnGroupControl::GetId() const 28 | { 29 | return GetStringAttribute("ColumnGroup"); 30 | } 31 | 32 | int MetadataColumnGroupControl::GetLowValue() const 33 | { 34 | return GetIntAttribute("LowValue"); 35 | } 36 | 37 | int MetadataColumnGroupControl::GetHighValue() const 38 | { 39 | return GetIntAttribute("HighValue"); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /project/librets/test-network/src/resources/metadata-class.4: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | RETS-Version: RETS/1.5 3 | RETS-Server: Variman/2.1.7 4 | Content-Type: text/xml 5 | Content-Length: 1156 6 | Date: Tue, 26 Aug 2008 17:21:23 GMT 7 | Server: Apache-Coyote/1.1 8 | 9 | 10 | 11 | 12 | ClassName StandardName VisibleName Description TableVersion TableDate UpdateVersion UpdateDate 13 | MOB Mobile Home Mobile Home 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 14 | MUL MultiFamily Multi-Family Multi-Family 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 15 | LND LotsAndLand Lots and Land Lots and Land 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 16 | CommercialProperty Commercial Commercial 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 17 | ResidentialProperty ResidentialProperty Single Family Single Family 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 18 | CON CommonInterest Condos Condos 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 100.00.001 Mon, 18 Aug 2003 17:00:00 GMT 19 | 20 | 21 | -------------------------------------------------------------------------------- /project/librets/include/librets/DmqlCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_DMQL_CRITERION_H 18 | #define LIBRETS_DMQL_CRITERION_H 19 | /** 20 | * @file DmqlCriterion.h 21 | * (Internal) Contains the DmqlCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | 25 | #include "librets/RetsObject.h" 26 | 27 | namespace librets { 28 | 29 | class DmqlCriterion : public virtual RetsObject 30 | { 31 | public: 32 | virtual ~DmqlCriterion(); 33 | 34 | virtual std::ostream & ToDmql(std::ostream & outputStream) const = 0; 35 | 36 | std::string ToDmqlString(); 37 | }; 38 | 39 | }; 40 | /// @endcond 41 | #endif 42 | 43 | /* Local Variables: */ 44 | /* mode: c++ */ 45 | /* End: */ 46 | -------------------------------------------------------------------------------- /project/librets/include/librets/UserAgentAuthType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_RETS_USER_AGENT_AUTH_TYPE_H 19 | #define LIBRETS_RETS_USER_AGENT_AUTH_TYPE_H 20 | /** 21 | * @file UserAgentAuthType.h 22 | * Contains the UserAgentAuthType enum declaration. 23 | */ 24 | 25 | namespace librets { 26 | 27 | enum UserAgentAuthType 28 | { 29 | /** 30 | * RETS 1.7 user agent authorization. 31 | */ 32 | USER_AGENT_AUTH_RETS_1_7, 33 | 34 | /** 35 | * The Interealty variant of 1.7 user agent authorization. 36 | */ 37 | USER_AGENT_AUTH_INTEREALTY, 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | 44 | /* Local Variables: */ 45 | /* mode: c++ */ 46 | /* End: */ 47 | -------------------------------------------------------------------------------- /project/librets/src/MetadataLookupType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataLookupType.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | #define CLASS MetadataLookupType 24 | 25 | MetadataElement::MetadataType CLASS::GetType() const 26 | { 27 | return LOOKUP_TYPE; 28 | } 29 | 30 | string CLASS::GetId() const 31 | { 32 | return GetValue(); 33 | } 34 | 35 | string CLASS::GetValue() const 36 | { 37 | return GetStringAttribute("Value"); 38 | } 39 | 40 | string CLASS::GetLongValue() const 41 | { 42 | return GetStringAttribute("LongValue"); 43 | } 44 | 45 | string CLASS::GetShortValue() const 46 | { 47 | return GetStringAttribute("ShortValue"); 48 | } 49 | -------------------------------------------------------------------------------- /project/librets/src/MetadataResource.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/MetadataResource.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | #define CLASS MetadataResource 23 | 24 | MetadataElement::MetadataType CLASS::GetType() const 25 | { 26 | return RESOURCE; 27 | } 28 | 29 | string CLASS::GetId() const 30 | { 31 | return GetResourceID(); 32 | } 33 | 34 | string CLASS::GetResourceID() const 35 | { 36 | return GetStringAttribute("ResourceID"); 37 | } 38 | 39 | string CLASS::GetStandardName() const 40 | { 41 | return GetStringAttribute("StandardName"); 42 | } 43 | 44 | string CLASS::GetKeyField() const 45 | { 46 | return GetStringAttribute("KeyField"); 47 | } 48 | -------------------------------------------------------------------------------- /project/librets/test/src/TestObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_TEST_OBJECT_H 18 | #define LIBRETS_TEST_OBJECT_H 19 | 20 | #include 21 | #include "librets/RetsObject.h" 22 | 23 | namespace librets { 24 | 25 | class TestObject : public RetsObject 26 | { 27 | public: 28 | TestObject(int number) : mNumber(number) { }; 29 | virtual ~TestObject(); 30 | virtual std::ostream & Print(std::ostream & s) const; 31 | virtual bool Equals(const RetsObject * rhs) const; 32 | 33 | private: 34 | int mNumber; 35 | }; 36 | 37 | typedef boost::shared_ptr TestObjectPtr; 38 | 39 | }; 40 | 41 | #endif 42 | 43 | /* Local Variables: */ 44 | /* mode: c++ */ 45 | /* End: */ 46 | -------------------------------------------------------------------------------- /project/librets/test/src/Makefile.vc: -------------------------------------------------------------------------------- 1 | !include <../../../build/Makefile.vc> 2 | 3 | LIBRETS_PATH = ../.. 4 | 5 | LIBRETS_LIB = $(LIBRETS_PATH)/src/$(BUILD_DIR)/$(LIBRETS_LIB_NAME) 6 | LIBRETS_CFLAGS = /I$(LIBRETS_PATH)/include 7 | 8 | ######################################################################## 9 | # 10 | 11 | TARGET = $(DIROBJ)\test.exe 12 | CFLAGS = $(CFLAGS_STD) $(LIBRETS_CFLAGS) $(BOOST_CFLAGS) $(EXPAT_CFLAGS)\ 13 | $(CPPUNIT_CFLAGS) 14 | LDFLAGS = $(LDFLAGS_STD) $(LIBRETS_LIB) $(CPPUNIT_LDFLAGS) 15 | 16 | LINK = $(LINK_EXE) $(LDFLAGS) 17 | 18 | ######################################################################## 19 | # 20 | 21 | all: $(TARGET) 22 | 23 | # Use this to regenerate objects.vc 24 | win_files: 25 | perl ../../../build/win_files.pl X_OBJS '*.cpp' '(.*)\.cpp$$' '\$$(DIROBJ)\\\$$1.obj' > objects.vc 26 | 27 | !include 28 | 29 | $(TARGET): $(X_OBJS) $(LIBRETS_LIB) 30 | $(LINK) /out:$(TARGET) $(X_OBJS) $(WINLIBS) 31 | 32 | $(X_OBJS): $(DIROBJ) 33 | 34 | $(BUILD_DIR): 35 | @if not exist "$(BUILD_DIR)" mkdir $(BUILD_DIR) 36 | 37 | $(DIROBJ): $(BUILD_DIR) 38 | @if not exist "$(DIROBJ)" mkdir $(DIROBJ) 39 | 40 | clean: 41 | @-rmdir /q /s $(BUILD_DIR) 2> NUL 42 | @-erase /s vc*.pch 2> NUL 43 | @-erase /s vc*.idb 2> NUL 44 | @-erase /s vc*.pdb 2> NUL 45 | 46 | .SUFFIXES: .c .cpp .obj .res 47 | 48 | {.\}.c{$(DIROBJ)\}.obj: 49 | $(CC) $(CFLAGS) /Fo"$@" $< 50 | 51 | {.\}.cpp{$(DIROBJ)\}.obj: 52 | $(CXX) $(CFLAGS) /Fo"$@" $< 53 | -------------------------------------------------------------------------------- /project/librets/src/RetsHttpException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #include "librets/RetsHttpException.h" 18 | 19 | using namespace librets; 20 | using std::string; 21 | 22 | RetsHttpException::RetsHttpException(int httpResult, string meaning) 23 | : RetsException(meaning) 24 | { 25 | mHttpResult = httpResult; 26 | mMeaning = meaning; 27 | } 28 | 29 | RetsHttpException::~RetsHttpException() throw() 30 | { 31 | } 32 | 33 | int RetsHttpException::GetHttpResult() const throw() 34 | { 35 | return mHttpResult; 36 | } 37 | 38 | string RetsHttpException::GetMessage() const throw() 39 | { 40 | return mMeaning; 41 | } 42 | 43 | string RetsHttpException::GetName() const throw() 44 | { 45 | return "RetsHttpException"; 46 | } 47 | -------------------------------------------------------------------------------- /project/librets/src/OrCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include 19 | #include "librets/OrCriterion.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | using std::ostream; 24 | 25 | OrCriterion::OrCriterion(DmqlCriterionPtr first, DmqlCriterionPtr second) 26 | : JunctionCriterion() 27 | { 28 | // Note that virtual methods are disabled during constructors, so 29 | // it is important to call add() from within scope of OrCriterion 30 | // to ensure the proper methods get called. 31 | add(first); 32 | add(second); 33 | } 34 | 35 | string OrCriterion::Operator() const 36 | { 37 | return "|"; 38 | } 39 | 40 | string OrCriterion::OperationName() const 41 | { 42 | return "logical or"; 43 | } 44 | -------------------------------------------------------------------------------- /project/librets/src/AndCriterion.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include 19 | #include "librets/AndCriterion.h" 20 | 21 | using namespace librets; 22 | using std::string; 23 | using std::ostream; 24 | 25 | AndCriterion::AndCriterion(DmqlCriterionPtr first, DmqlCriterionPtr second) 26 | : JunctionCriterion() 27 | { 28 | // Note that virtual methods are disabled during constructors, so 29 | // it is important to call add() from within scope of AndCriterion 30 | // to ensure the proper methods get called. 31 | add(first); 32 | add(second); 33 | } 34 | 35 | string AndCriterion::Operator() const 36 | { 37 | return ","; 38 | } 39 | 40 | string AndCriterion::OperationName() const 41 | { 42 | return "logical and"; 43 | } 44 | -------------------------------------------------------------------------------- /project/swig/ruby/search.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'librets' 4 | 5 | include Librets 6 | 7 | begin 8 | session = RetsSession.new("http://www.dis.com:6103/rets/login") 9 | 10 | if !session.login("Joe", "Schmoe") 11 | puts "Invalid login" 12 | exit 1 13 | end 14 | 15 | puts "Action: " + session.action 16 | version = "1.0" 17 | version = "1.5" if (session.detected_rets_version == RETS_1_5) 18 | puts "RETS Version: " + version 19 | 20 | request = session.create_search_request("Property", "RES", 21 | "(ListPrice=300000-)") 22 | request.standard_names = true 23 | request.select = "ListingID,ListPrice,Beds,City" 24 | request.limit = SearchRequest::LIMIT_DEFAULT 25 | request.offset = SearchRequest::OFFSET_NONE 26 | request.count_type = SearchRequest::RECORD_COUNT_AND_RESULTS 27 | request.format_type = SearchRequest::COMPACT 28 | results = session.search(request) 29 | 30 | puts "Record count: " + results.count.to_s 31 | puts 32 | columns = results.columns 33 | results.each do |result| 34 | columns.each do |column| 35 | puts column + ": " + result.string(column) 36 | end 37 | puts 38 | end 39 | 40 | logout = session.logout 41 | 42 | puts "Billing info: " + logout.billing_info 43 | puts "Logout message: " + logout.logout_message 44 | puts "Connect time: " + logout.connect_time.to_s 45 | rescue RetsException => e 46 | puts e 47 | end 48 | -------------------------------------------------------------------------------- /project/librets/include/librets/OrCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_OR_CRITERION_H 18 | #define LIBRETS_OR_CRITERION_H 19 | /** 20 | * @file OrCriterion.h 21 | * (Internal) Contains the OrCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | #include 25 | #include "librets/sql_forward.h" 26 | #include "librets/JunctionCriterion.h" 27 | 28 | namespace librets { 29 | 30 | class OrCriterion : public JunctionCriterion 31 | { 32 | public: 33 | OrCriterion(DmqlCriterionPtr first, DmqlCriterionPtr second); 34 | 35 | protected: 36 | virtual std::string Operator() const; 37 | 38 | virtual std::string OperationName() const; 39 | }; 40 | 41 | }; 42 | /// @endcond 43 | #endif 44 | 45 | /* Local Variables: */ 46 | /* mode: c++ */ 47 | /* End: */ 48 | -------------------------------------------------------------------------------- /project/librets/include/librets/AndCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_AND_CRITERION_H 18 | #define LIBRETS_AND_CRITERION_H 19 | /** 20 | * @file AndCriterion.h 21 | * (Internal) Contains the AndCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | 25 | #include 26 | #include "librets/sql_forward.h" 27 | #include "librets/JunctionCriterion.h" 28 | 29 | namespace librets { 30 | 31 | class AndCriterion : public JunctionCriterion 32 | { 33 | public: 34 | AndCriterion(DmqlCriterionPtr first, DmqlCriterionPtr second); 35 | 36 | protected: 37 | virtual std::string Operator() const; 38 | virtual std::string OperationName() const; 39 | }; 40 | 41 | }; 42 | 43 | ///@endcond 44 | #endif 45 | 46 | /* Local Variables: */ 47 | /* mode: c++ */ 48 | /* End: */ 49 | -------------------------------------------------------------------------------- /project/swig/php5/search.php: -------------------------------------------------------------------------------- 1 | Login("Joe", "Schmoe")) 7 | { 8 | print "Invalid Login\n"; 9 | exit(1); 10 | } 11 | 12 | print "Action: " . $session->GetAction() . "\n"; 13 | $version = "1.0"; 14 | if ($session->GetDetectedRetsVersion() == RETS_1_5) 15 | { 16 | $version = "1.5"; 17 | } 18 | print "RETS Version: " . $version . "\n"; 19 | 20 | $request = $session->CreateSearchRequest("Property", "RES", 21 | "(ListPrice=300000-)"); 22 | $request->SetSelect("ListingID,ListPrice,Beds,City"); 23 | $request->SetLimit(SearchRequest_LIMIT_DEFAULT); 24 | $request->SetOffset(SearchRequest_OFFSET_NONE); 25 | $request->SetCountType(SearchRequest_RECORD_COUNT_AND_RESULTS); 26 | $request->SetFormatType(SearchRequest_COMPACT); 27 | $request->SetStandardNames(true); 28 | $results = $session->Search($request); 29 | 30 | print "Record Count: " . $results->GetCount() . "\n\n"; 31 | 32 | $columns = $results->GetColumns(); 33 | 34 | while ($results->HasNext()) 35 | { 36 | for ($i = 0; $i < $columns->size(); $i++) 37 | { 38 | print $columns->get($i) . ": " . $results->GetString($i) . "\n"; 39 | } 40 | print "\n"; 41 | } 42 | 43 | $logout = $session->Logout(); 44 | 45 | print "Billing info: " . $logout->GetBillingInfo() . "\n"; 46 | print "Logout message: " . $logout->GetLogoutMessage() . "\n"; 47 | print "Connect time: " . $logout->GetConnectTime() . "\n"; 48 | 49 | ?> 50 | -------------------------------------------------------------------------------- /project/librets/include/librets/LtCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_LT_CRITERION_H 18 | #define LIBRETS_LT_CRITERION_H 19 | /** 20 | * @file LtCriterion.h 21 | * (Internal) Contains the LtCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | #include 25 | #include "librets/sql_forward.h" 26 | #include "librets/FieldCriterion.h" 27 | 28 | namespace librets { 29 | 30 | class LtCriterion : public FieldCriterion 31 | { 32 | public: 33 | LtCriterion(std::string field, DmqlCriterionPtr value); 34 | 35 | virtual std::ostream & ToDmql(std::ostream & outputStream) const; 36 | 37 | protected: 38 | virtual std::string OperationName() const; 39 | }; 40 | 41 | }; 42 | /// @endcond 43 | #endif 44 | 45 | /* Local Variables: */ 46 | /* mode: c++ */ 47 | /* End: */ 48 | -------------------------------------------------------------------------------- /project/swig/node.js/search.js: -------------------------------------------------------------------------------- 1 | var librets = require("./build/Release/librets.node"); 2 | 3 | try 4 | { 5 | var session = new librets.RetsSession("http://www.dis.com:6103/rets/login"); 6 | 7 | if (!session.Login("Joe", "Schmoe")) 8 | { 9 | console.log("Invalid login"); 10 | process.exit(-1); 11 | } 12 | 13 | console.log("Action: " + session.GetAction()); 14 | console.log("Requested RETS version: " + session.RetsVersionToString(session.GetRetsVersion())); 15 | console.log("Actual RETS version: " + session.RetsVersionToString(session.GetDetectedRetsVersion())); 16 | 17 | var request = session.CreateSearchRequest("Property", "RES", "(ListPrice=300000-)"); 18 | request.SetStandardNames(false); 19 | request.SetSelect("ListingID,ListPrice,Bedrooms,City"); 20 | request.SetLimit(librets.SearchRequest.LIMIT_DEFAULT); 21 | request.SetOffset(librets.SearchRequest.OFFSET_NONE); 22 | request.SetCountType(librets.SearchRequest.RECORD_COUNT_AND_RESULTS); 23 | request.SetFormatType(librets.SearchRequest.COMPACT); 24 | results = session.Search(request); 25 | 26 | while (results.HasNext()) 27 | { 28 | console.log("ListingID: " + results.GetString("ListingID")); 29 | console.log("ListPrice: " + results.GetString("ListPrice")); 30 | console.log(" Bedrooms: " + results.GetString("Bedrooms")); 31 | console.log(" City: " + results.GetString("City")); 32 | console.log(); 33 | } 34 | } 35 | catch(e) 36 | { 37 | console.log("Exception: " + e); 38 | } 39 | finally 40 | { 41 | session.Logout(); 42 | } 43 | -------------------------------------------------------------------------------- /project/swig/python3/search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | import sys 3 | 4 | import librets 5 | 6 | try: 7 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 8 | if not session.Login("Joe", "Schmoe"): 9 | sys.exit("Invalid login") 10 | 11 | print("Action:", session.GetAction()) 12 | version = "1.0" 13 | if session.GetDetectedRetsVersion() == librets.RETS_1_5: 14 | version = "1.5" 15 | print("RETS Version:", version) 16 | 17 | request = session.CreateSearchRequest("Property", "RES", 18 | "(ListPrice=300000-)") 19 | 20 | request.SetStandardNames(True) 21 | request.SetSelect("ListingID,ListPrice,Beds,City") 22 | request.SetLimit(librets.SearchRequest.LIMIT_DEFAULT) 23 | request.SetOffset(librets.SearchRequest.OFFSET_NONE) 24 | request.SetCountType(librets.SearchRequest.RECORD_COUNT_AND_RESULTS) 25 | request.SetFormatType(librets.SearchRequest.COMPACT) 26 | results = session.Search(request) 27 | 28 | print("Record count: {!r}".format(results.GetCount())) 29 | print() 30 | columns = results.GetColumns() 31 | while results.HasNext(): 32 | for column in columns: 33 | print("{}: {}".format(column, results.GetString(column))) 34 | print() 35 | 36 | logout = session.Logout() 37 | print("Billing info:", logout.GetBillingInfo()) 38 | print("Logout message:", logout.GetLogoutMessage()) 39 | print("Connect time:", logout.GetConnectTime()) 40 | except librets.RetsException as e: 41 | print("Caught:", e.GetMessage()) 42 | -------------------------------------------------------------------------------- /project/librets/include/librets/EqCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_EQ_CRITERION_H 18 | #define LIBRETS_EQ_CRITERION_H 19 | /** 20 | * @file EqCriterion.h 21 | * (Internal) Contains the EqCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | 25 | #include 26 | #include "librets/sql_forward.h" 27 | #include "librets/FieldCriterion.h" 28 | 29 | namespace librets { 30 | 31 | class EqCriterion : public FieldCriterion 32 | { 33 | public: 34 | EqCriterion(std::string field, DmqlCriterionPtr value); 35 | 36 | virtual std::ostream & ToDmql(std::ostream & outputStream) const; 37 | 38 | protected: 39 | virtual std::string OperationName() const; 40 | }; 41 | 42 | }; 43 | /// @endcond 44 | #endif 45 | 46 | /* Local Variables: */ 47 | /* mode: c++ */ 48 | /* End: */ 49 | -------------------------------------------------------------------------------- /project/librets/include/librets/GtCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_GT_CRITERION_H 18 | #define LIBRETS_GT_CRITERION_H 19 | /** 20 | * @file GtCriterion.h 21 | * (Internal) Contains the AndCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | 25 | #include 26 | #include "librets/sql_forward.h" 27 | #include "librets/FieldCriterion.h" 28 | 29 | namespace librets { 30 | 31 | class GtCriterion : public FieldCriterion 32 | { 33 | public: 34 | GtCriterion(std::string field, DmqlCriterionPtr value); 35 | 36 | virtual std::ostream & ToDmql(std::ostream & outputStream) const; 37 | 38 | protected: 39 | virtual std::string OperationName() const; 40 | }; 41 | 42 | }; 43 | /// @endcond 44 | #endif 45 | 46 | /* Local Variables: */ 47 | /* mode: c++ */ 48 | /* End: */ 49 | -------------------------------------------------------------------------------- /project/librets/include/librets/LookupOrCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_IN_CRITERION_H 19 | #define LIBRETS_IN_CRITERION_H 20 | /** 21 | * @file LookupOrCriterion.h 22 | * (Internal) Contains the LookupOrCriterion parser class. 23 | */ 24 | /// @cond MAINTAINER 25 | #include 26 | #include "librets/sql_forward.h" 27 | #include "librets/LookupCriterion.h" 28 | 29 | namespace librets { 30 | 31 | class LookupOrCriterion : public LookupCriterion 32 | { 33 | public: 34 | LookupOrCriterion(std::string field, DmqlCriterionPtr value); 35 | 36 | protected: 37 | virtual std::string Operator() const; 38 | virtual std::string OperationName() const; 39 | }; 40 | 41 | } 42 | /// @endcond 43 | #endif 44 | 45 | /* Local Variables: */ 46 | /* mode: c++ */ 47 | /* End: */ 48 | -------------------------------------------------------------------------------- /project/librets/src/MetadataFilterType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Real Estate Standards Organization 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #include "librets/MetadataFilterType.h" 19 | 20 | using namespace librets; 21 | using std::string; 22 | 23 | MetadataFilterType::~MetadataFilterType() 24 | { 25 | } 26 | 27 | MetadataElement::MetadataType MetadataFilterType::GetType() const 28 | { 29 | return FILTER_TYPE; 30 | } 31 | 32 | string MetadataFilterType::GetID() const 33 | { 34 | return GetFilterTypeID(); 35 | } 36 | 37 | string MetadataFilterType::GetFilterTypeID() const 38 | { 39 | return GetStringAttribute("FilterTypeID"); 40 | } 41 | 42 | string MetadataFilterType::GetParentValue() const 43 | { 44 | return GetStringAttribute("ParenValue"); 45 | } 46 | 47 | string MetadataFilterType::GetChildValue() const 48 | { 49 | return GetStringAttribute("ChildValue"); 50 | } 51 | -------------------------------------------------------------------------------- /project/librets/test/src/objects.vc: -------------------------------------------------------------------------------- 1 | # Automatically generated file list. Edits will be overwritten. 2 | X_OBJS = \ 3 | $(DIROBJ)\AndCriterionTest.obj \ 4 | $(DIROBJ)\CapabilityUrlsTest.obj \ 5 | $(DIROBJ)\DefaultMetadataCollectorTest.obj \ 6 | $(DIROBJ)\DefaultMetadataElementFactoryTest.obj \ 7 | $(DIROBJ)\DmqlExpressionTest.obj \ 8 | $(DIROBJ)\EqCriterionTest.obj \ 9 | $(DIROBJ)\ExpatXmlParserTest.obj \ 10 | $(DIROBJ)\GetObjectRequestTest.obj \ 11 | $(DIROBJ)\GetObjectResponseTest.obj \ 12 | $(DIROBJ)\GtCriterionTest.obj \ 13 | $(DIROBJ)\IncrementalMetadataFinderTest.obj \ 14 | $(DIROBJ)\LiteralCriterionTest.obj \ 15 | $(DIROBJ)\LoginResponseTest.obj \ 16 | $(DIROBJ)\LogoutResponseTest.obj \ 17 | $(DIROBJ)\LookupOrCriterionTest.obj \ 18 | $(DIROBJ)\LtCriterionTest.obj \ 19 | $(DIROBJ)\MetadataElementTest.obj \ 20 | $(DIROBJ)\NotCriterionTest.obj \ 21 | $(DIROBJ)\OrCriterionTest.obj \ 22 | $(DIROBJ)\RetsHttpRequestTest.obj \ 23 | $(DIROBJ)\RetsMetadataTest.obj \ 24 | $(DIROBJ)\RetsObjectTest.obj \ 25 | $(DIROBJ)\RetsXmlAttributeTest.obj \ 26 | $(DIROBJ)\RetsXmlStartElementEventTest.obj \ 27 | $(DIROBJ)\SearchResultSetTest.obj \ 28 | $(DIROBJ)\TestHttpResponse.obj \ 29 | $(DIROBJ)\TestHttpResponseTest.obj \ 30 | $(DIROBJ)\TestMetadataElement.obj \ 31 | $(DIROBJ)\TestMetadataLoader.obj \ 32 | $(DIROBJ)\TestMetadataTree.obj \ 33 | $(DIROBJ)\TestObject.obj \ 34 | $(DIROBJ)\UriTest.obj \ 35 | $(DIROBJ)\UserAgentAuthCalculatorTest.obj \ 36 | $(DIROBJ)\XmlMetadataParserTest.obj \ 37 | $(DIROBJ)\main.obj \ 38 | $(DIROBJ)\testUtil.obj \ 39 | $(DIROBJ)\utilTest.obj 40 | -------------------------------------------------------------------------------- /project/swig/java/logging.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | import java.lang.*; 3 | import librets.*; 4 | 5 | public class logging 6 | { 7 | static 8 | { 9 | try 10 | { 11 | System.loadLibrary("librets"); 12 | } 13 | catch (UnsatisfiedLinkError e) 14 | { 15 | System.err.println("Unable to load the librets native library.\n" + e); 16 | System.exit(1); 17 | } 18 | } 19 | 20 | public static void main(String[] args) throws Exception 21 | { 22 | RetsSession session = new RetsSession("http://demo.crt.realtors.org:6103/rets/login"); 23 | 24 | if (args.length > 0) 25 | session.SetHttpLogName(args[0]); 26 | 27 | if (!session.Login("Joe", "Schmoe")) 28 | { 29 | System.out.println("Invalid login"); 30 | System.exit(2); 31 | } 32 | 33 | LoginResponse response = session.GetLoginResponse(); 34 | CapabilityUrls capurls = session.GetCapabilityUrls(); 35 | 36 | System.out.println("Member name: " + response.GetMemberName()); 37 | System.out.println("Search URL: " + capurls.GetSearchUrl()); 38 | 39 | String version = "1.0"; 40 | if (session.GetDetectedRetsVersion() == RetsVersion.RETS_1_5) 41 | { 42 | version = "1.5"; 43 | } 44 | 45 | System.out.println("RETS Version: " + version); 46 | 47 | LogoutResponse logout = session.Logout(); 48 | 49 | System.out.println("Billing info: " + logout.GetBillingInfo()); 50 | System.out.println("Logout Message: " + logout.GetLogoutMessage()); 51 | System.out.println("Connect time: " + logout.GetConnectTime()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /project/swig/perl/search.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | use lib "blib/lib", "blib/arch"; 4 | use strict; 5 | use librets; 6 | 7 | my $rets = new librets::RetsSession( 8 | "http://demo.crt.realtors.org:6103/rets/login"); 9 | 10 | if (!$rets->Login("Joe", "Schmoe")) 11 | { 12 | print "Invalid login\n"; 13 | exit 1; 14 | } 15 | 16 | print "Action: " . $rets->GetAction() . "\n"; 17 | my $version = "1.0"; 18 | $version = "1.5" if ($rets->GetDetectedRetsVersion() == $librets::RETS_1_5); 19 | print "RETS Version: $version\n"; 20 | 21 | my $request = $rets->CreateSearchRequest("Property", "RES", 22 | "(ListPrice=300000-)"); 23 | $request->SetSelect("ListingID,ListPrice,Beds,City"); 24 | $request->SetLimit($librets::SearchRequest::LIMIT_DEFAULT); 25 | $request->SetOffset($librets::SearchRequest::OFFSET_NONE); 26 | $request->SetStandardNames(1); 27 | $request->SetCountType($librets::SearchRequest::RECORD_COUNT_AND_RESULTS); 28 | $request->SetFormatType($librets::SearchRequest::COMPACT_DECODED); 29 | my $results = $rets->Search($request); 30 | 31 | print "Record count: " . $results->GetCount() . "\n\n"; 32 | while ($results->HasNext()) 33 | { 34 | my $columns = $results->GetColumns(); 35 | foreach my $column (@$columns) 36 | { 37 | print $column . ": " . $results->GetString($column) . "\n"; 38 | } 39 | print "\n"; 40 | } 41 | 42 | my $logout = $rets->Logout(); 43 | print "Billing info: " . $logout->GetBillingInfo() . "\n"; 44 | print "Logout message: " . $logout->GetLogoutMessage() . "\n"; 45 | print "Connect time: " . $logout->GetConnectTime() . "\n"; 46 | -------------------------------------------------------------------------------- /project/librets/test/src/TestMetadataElement.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_TEST_METADATA_ELEMENT_H 19 | #define LIBRETS_TEST_METADATA_ELEMENT_H 20 | 21 | #include "librets/MetadataElement.h" 22 | 23 | namespace librets { 24 | 25 | class TestMetadataElement : public MetadataElement 26 | { 27 | public: 28 | virtual MetadataType GetType() const { return SYSTEM; } 29 | std::string GetTypeName() const; 30 | void SetTypeName(std::string typeName); 31 | 32 | std::string GetId() const; 33 | 34 | private: 35 | std::string mTypeName; 36 | }; 37 | 38 | typedef boost::shared_ptr TestMetadataElementPtr; 39 | 40 | typedef std::vector TestMetadataElementList; 41 | 42 | } 43 | 44 | #endif 45 | 46 | /* Local Variables: */ 47 | /* mode: c++ */ 48 | /* End: */ 49 | -------------------------------------------------------------------------------- /project/swig/python/search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | import sys 4 | 5 | import librets 6 | 7 | try: 8 | session = librets.RetsSession("http://www.dis.com:6103/rets/login") 9 | if not session.Login("Joe", "Schmoe"): 10 | sys.exit("Invalid login") 11 | 12 | print("Action:", session.GetAction()) 13 | version = "1.0" 14 | if session.GetDetectedRetsVersion() == librets.RETS_1_5: 15 | version = "1.5" 16 | print("RETS Version:", version) 17 | 18 | request = session.CreateSearchRequest("Property", "RES", 19 | "(ListPrice=300000-)") 20 | 21 | request.SetStandardNames(True) 22 | request.SetSelect("ListingID,ListPrice,Beds,City") 23 | request.SetLimit(librets.SearchRequest.LIMIT_DEFAULT) 24 | request.SetOffset(librets.SearchRequest.OFFSET_NONE) 25 | request.SetCountType(librets.SearchRequest.RECORD_COUNT_AND_RESULTS) 26 | request.SetFormatType(librets.SearchRequest.COMPACT) 27 | results = session.Search(request) 28 | 29 | print("Record count: {!r}".format(results.GetCount())) 30 | print() 31 | columns = results.GetColumns() 32 | while results.HasNext(): 33 | for column in columns: 34 | print("{}: {}".format(column, results.GetString(column))) 35 | print() 36 | 37 | logout = session.Logout() 38 | print("Billing info:", logout.GetBillingInfo()) 39 | print("Logout message:", logout.GetLogoutMessage()) 40 | print("Connect time:", logout.GetConnectTime()) 41 | except librets.RetsException as e: 42 | print("Caught:", e.GetMessage()) 43 | -------------------------------------------------------------------------------- /project/librets/include/librets/LookupQuery.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_LOOKUP_QUERY_H 19 | #define LIBRETS_LOOKUP_QUERY_H 20 | /** 21 | * @file LookupQuery.h 22 | * (Internal) Contains the LookupCriterion class definition. 23 | */ 24 | /// @cond MAINTAINER 25 | #include "RetsObject.h" 26 | 27 | namespace librets { 28 | 29 | class LookupQuery : public RetsObject 30 | { 31 | public: 32 | LookupQuery(); 33 | virtual ~LookupQuery(); 34 | 35 | std::string GetResource() const; 36 | 37 | void SetResource(std::string resource); 38 | 39 | std::string GetLookup() const; 40 | 41 | void SetLookup(std::string lookup); 42 | 43 | private: 44 | std::string mResource; 45 | std::string mLookup; 46 | }; 47 | 48 | }; 49 | /// @endcond 50 | #endif /* LIBRETS_LOOKUP_QUERY_H */ 51 | 52 | /* Local Variables: */ 53 | /* mode: c++ */ 54 | /* End: */ 55 | 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | COPYRIGHT AND PERMISSION NOTICE 2 | 3 | Copyright (C) 2005-2010 National Association of REALTORS(R) 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, and/or sell copies of the Software, and to permit persons 12 | to whom the Software is furnished to do so, provided that the above 13 | copyright notice(s) and this permission notice appear in all copies of 14 | the Software and that both the above copyright notice(s) and this 15 | permission notice appear in supporting documentation. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 20 | OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 21 | HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY 22 | SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 23 | RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 24 | CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 25 | CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 26 | 27 | Except as contained in this notice, the name of a copyright holder 28 | shall not be used in advertising or otherwise to promote the sale, use 29 | or other dealings in this Software without prior written authorization 30 | of the copyright holder. 31 | -------------------------------------------------------------------------------- /project/swig/csharp/Login.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using librets; 4 | 5 | public class Login 6 | { 7 | static void Main(string[] args) 8 | { 9 | RetsSession session = null; 10 | try 11 | { 12 | session = new RetsSession( 13 | "http://demo.crt.realtors.org:6103/rets/login"); 14 | if (args.Length == 1) 15 | session.SetHttpLogName(args[0]); 16 | if (!session.Login("Joe", "Schmoe")) 17 | { 18 | Console.WriteLine("Invalid login"); 19 | Environment.Exit(1); 20 | } 21 | 22 | Console.WriteLine(".Net version: " + System.Environment.Version); 23 | 24 | LoginResponse login = session.GetLoginResponse(); 25 | Console.WriteLine("Member name: " + login.GetMemberName()); 26 | 27 | CapabilityUrls capabilityUrls = session.GetCapabilityUrls(); 28 | Console.WriteLine("Search URL: " + capabilityUrls.GetSearchUrl()); 29 | 30 | LogoutResponse logout = session.Logout(); 31 | Console.WriteLine("Billing info: " + logout.GetBillingInfo()); 32 | Console.WriteLine("Logout message: " + logout.GetLogoutMessage()); 33 | Console.WriteLine("Connect time: " + logout.GetConnectTime()); 34 | } 35 | finally 36 | { 37 | // Be sure to dispose RetsSession when finished, otherwise the 38 | // TextWriter Dispose() method may be called prior to RetsSession. 39 | if (session != null) 40 | session.Dispose(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /project/swig/csharp/TextWriterLogger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | 4 | namespace librets { 5 | 6 | public class TextWriterLogger 7 | { 8 | public TextWriterLogger(TextWriter writer) 9 | { 10 | mLastType = RetsHttpLogger.Type.INFORMATIONAL; 11 | mWriter = writer; 12 | mDelegate = new RetsHttpLogger.Delegate(this.LogData); 13 | } 14 | 15 | private void LogData(RetsHttpLogger.Type type, byte[] data) 16 | { 17 | if ((type == RetsHttpLogger.Type.RECEIVED) && 18 | (mLastType != RetsHttpLogger.Type.RECEIVED)) 19 | { 20 | mWriter.WriteLine("\n<<< Received"); 21 | } 22 | else if ((type == RetsHttpLogger.Type.SENT) && 23 | (mLastType != RetsHttpLogger.Type.SENT)) 24 | { 25 | mWriter.WriteLine("\n>>> Sent"); 26 | } 27 | else if (type == RetsHttpLogger.Type.INFORMATIONAL) 28 | { 29 | mWriter.Write("* "); 30 | } 31 | 32 | mWriter.Write(System.Text.Encoding.UTF8.GetString(data)); 33 | mWriter.Flush(); 34 | mLastType = type; 35 | } 36 | 37 | public RetsHttpLogger.Delegate LoggerDelegate 38 | { 39 | get { return mDelegate; } 40 | } 41 | 42 | public static RetsHttpLogger.Delegate CreateDelegate(TextWriter writer) 43 | { 44 | TextWriterLogger logger = new TextWriterLogger(writer); 45 | return logger.LoggerDelegate; 46 | } 47 | 48 | 49 | private RetsHttpLogger.Type mLastType; 50 | private TextWriter mWriter; 51 | private RetsHttpLogger.Delegate mDelegate; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /project/librets/include/librets/NotCriterion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_NOT_CRITERION_H 18 | #define LIBRETS_NOT_CRITERION_H 19 | /** 20 | * @file NotCriterion.h 21 | * (Internal) Contains the NotCriterion parser class. 22 | */ 23 | /// @cond MAINTAINER 24 | #include 25 | #include "librets/sql_forward.h" 26 | #include "librets/DmqlCriterion.h" 27 | 28 | namespace librets { 29 | 30 | class NotCriterion : public DmqlCriterion 31 | { 32 | public: 33 | NotCriterion(DmqlCriterionPtr criterion); 34 | 35 | virtual std::ostream & ToDmql(std::ostream & out) const; 36 | 37 | virtual std::ostream & Print(std::ostream & out) const; 38 | 39 | virtual bool Equals(const RetsObject * object) const; 40 | 41 | private: 42 | DmqlCriterionPtr mCriterion; 43 | }; 44 | 45 | }; 46 | /// @endcond 47 | #endif 48 | 49 | /* Local Variables: */ 50 | /* mode: c++ */ 51 | /* End: */ 52 | -------------------------------------------------------------------------------- /project/librets/include/librets/MetadataValidationExpression.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | #ifndef LIBRETS_METADATA_VALIDATION_EXPRESSION_H 18 | #define LIBRETS_METADATA_VALIDATION_EXPRESSION_H 19 | /** 20 | * @file MetadataValidationExpression.h 21 | * Contains the MetadataValidationExpression class declaration. 22 | */ 23 | 24 | #include "librets/MetadataElement.h" 25 | 26 | namespace librets { 27 | 28 | /** 29 | * MetadataValidationExpression is an implementation of MetadataElement that represents 30 | * Validation Expression metadata. 31 | */ 32 | class MetadataValidationExpression : public MetadataElement 33 | { 34 | public: 35 | /** 36 | * Always returns VALIDATION_EXPRESSION 37 | * 38 | * @return VALIDATION_EXPRESSION 39 | */ 40 | virtual MetadataType GetType() const; 41 | }; 42 | 43 | }; 44 | 45 | #endif 46 | 47 | /* Local Variables: */ 48 | /* mode: c++ */ 49 | /* End: */ 50 | -------------------------------------------------------------------------------- /project/build/ac-macros/cppunit.m4: -------------------------------------------------------------------------------- 1 | dnl 2 | dnl Test for cppunit 3 | dnl 4 | AC_DEFUN([MY_TEST_CPPUNIT], [ 5 | AC_CACHE_VAL(my_cv_cppunit_vers, [ 6 | my_cv_cppunit_vers=NONE 7 | dnl check is the plain-text version of the required version 8 | check="1.10.2" 9 | 10 | set `${PERL} -e "@v = split('\\.', '$check'); print \"@v\";"` 11 | check_major=$[1] 12 | check_minor=$[2] 13 | check_release=$[3] 14 | 15 | HAVE_CPPUNIT=0 16 | AC_CHECK_PROG(CPPUNIT_CONFIG, cppunit-config, cppunit-config, no) 17 | if test "$CPPUNIT_CONFIG" != "no"; then 18 | AC_MSG_CHECKING([for cppunit >= $check]) 19 | 20 | ver=`$CPPUNIT_CONFIG --version` 21 | set `${PERL} -e "@v = split('\\.', '$ver'); print \"@v\";"` 22 | ver_major=$[1] 23 | ver_minor=$[2] 24 | ver_release=$[3] 25 | ok=`expr \ 26 | $ver_major \> $check_major \| \ 27 | $ver_major \= $check_major \& \ 28 | $ver_minor \> $check_minor \| \ 29 | $ver_minor \= $check_minor \& \ 30 | $ver_release \= $check_release \& \ 31 | $ver_release \>= $check_release ` 32 | 33 | if test "$ok" = "1"; then 34 | my_cv_cppunit_vers="$ver" 35 | AC_MSG_RESULT([$my_cv_cppunit_vers]) 36 | 37 | HAVE_CPPUNIT=1 38 | CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags` 39 | CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs` 40 | else 41 | AC_MSG_RESULT(FAILED) 42 | AC_MSG_WARN([$ver is too old. Need version $check or higher.]) 43 | fi 44 | fi 45 | ]) 46 | 47 | AC_SUBST(HAVE_CPPUNIT) 48 | AC_SUBST(CPPUNIT_CFLAGS) 49 | AC_SUBST(CPPUNIT_LIBS) 50 | ]) 51 | -------------------------------------------------------------------------------- /project/swig/csharp/librets_sharp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2006 National Association of REALTORS(R) 3 | * 4 | * All rights reserved. 5 | * 6 | * Permission is hereby granted, free of charge, to any person 7 | * obtaining a copy of this software and associated documentation 8 | * files (the "Software"), to deal in the Software without 9 | * restriction, including without limitation the rights to use, copy, 10 | * modify, merge, publish, distribute, and/or sell copies of the 11 | * Software, and to permit persons to whom the Software is furnished 12 | * to do so, provided that the above copyright notice(s) and this 13 | * permission notice appear in all copies of the Software and that 14 | * both the above copyright notice(s) and this permission notice 15 | * appear in supporting documentation. 16 | */ 17 | 18 | #ifndef LIBRETS_SHARP_H 19 | #define LIBRETS_SHARP_H 20 | 21 | /* calling conventions for Windows */ 22 | #ifndef SWIGSTDCALL 23 | # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) 24 | # define SWIGSTDCALL __stdcall 25 | # else 26 | # define SWIGSTDCALL 27 | # endif 28 | #endif 29 | 30 | #include "librets/std_forward.h" 31 | #include "librets/RetsHttpLogger.h" 32 | 33 | namespace librets { 34 | 35 | typedef void (SWIGSTDCALL* RetsHttpLoggerCallback)(RetsHttpLogger::Type type, 36 | void * data, int length); 37 | 38 | class RetsHttpLoggerBridge : public RetsHttpLogger 39 | { 40 | public: 41 | RetsHttpLoggerBridge(RetsHttpLoggerCallback loggerCallback); 42 | virtual void logHttpData(Type type, std::string data); 43 | 44 | private: 45 | RetsHttpLoggerCallback mLoggerCallback; 46 | }; 47 | 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /doc/build/unix.txt: -------------------------------------------------------------------------------- 1 | 2 | Installing the Prequisites 3 | ========================== 4 | 5 | gcc 6 | --- 7 | 8 | Version: 3.3 or higher 9 | URL: http://gcc.gnu.org/ 10 | 11 | Earlier versions of gcc do not have good C++ support. 12 | 13 | Boost 14 | ----- 15 | 16 | Version: 1.44.0 or higher. 17 | URL: http://www.boost.org/ 18 | 19 | Boost has it's own build system, bjam. Read it's instructions for 20 | installation. You need to compile and install the filesystem and 21 | program options libraries. 22 | 23 | libcurl 24 | ------- 25 | 26 | Version: 7.18.2 or higher. 27 | URL: http://curl.haxx.se/libcurl/ 28 | 29 | Build as per its instructions. No special steps are needed. 30 | 31 | Expat 32 | ----- 33 | 34 | Version: 1.95.8 or higher. 35 | URL: http://expat.sourceforge.net/ 36 | 37 | Build as per its instructions. No special steps are needed. 38 | 39 | Java SDK 40 | -------- 41 | 42 | Version: 1.4.2 or higher. 43 | URL: http://java.sun.com/ 44 | 45 | Download, install, and setup the JAVA_HOME environment variable. 46 | 47 | 48 | ANTLR 49 | ----- 50 | 51 | Version: 2.7.5 or higher. 52 | URL: http://www.antlr.org/ 53 | 54 | Build as per its instructions. No special steps are needed. 55 | 56 | Building librets 57 | ================ 58 | 59 | Run the following commands: 60 | 61 | $ ./autogen.sh 62 | % ./configure 63 | % make 64 | % sudo make install 65 | 66 | If boost or expat can't be found, then you may need to override that with 67 | switches to the configure step. For example, if boost and expat were beneath 68 | /opt/local/, then you'd: 69 | 70 | % ./configure --with-boost-prefix=/opt/local --with-expat-prefix=/opt/local 71 | --------------------------------------------------------------------------------