5. Running the Open RETS Client

This section describes how to actually use the ORC to retrieve data. In addition, this section provides some information on a few of the more commonly used command-line options. NOTE: That all commands are reflective of the Linux OS and must be run at the console. To use a similar command on Windows, simply replace orc.sh with orc.bat.

5.1. Getting Help

If in doubt as to the available command-line options offered, simply type the following command: orc.sh -h. This returns each available option, along with a brief description.

5.2. Running ORC Without an MLSID

This section briefly covers executing the ORC without providing an MLSID. In most cases, you will want to run the ORC by providing an MLSID. However, for those instances when the MLS Identifier may have been forgotten or misplaced, simply type the following command: orc.sh. This will present you with a list of identifiers to choose from.

5.3. Running ORC With an MLSID

By providing an MLSID at the command-line, one can avoid the use of the User Interface. This allows for the possibility of running multiple downloads in a batch, as well as setting up a schedular to automatically handle data retrieval. Simply type the following command: orc.sh mlsid. This command can also be extended to include multiple MLSIDs: orc.sh mlsid-1, mlsid-2...mlsid-n.

5.4. Retrieving Specific Resource Data

In some cases, you may want to only download Property related information. In other cases, you may want to download both Agent and Property related information. Each scenario can be handelled by the ORC. The first scenario can be achieved by typing the following command: orc.sh -P mlsid. The second scenario is achieved using: orc.sh -A -P mlsid. Again, this can be extended to include multiple MLSIDs: orc.sh -A -P mlsid-1, mlsid-2...mlsid-n.

5.5. Retrieving Specific Resource Data With a Command-line Query

Although the mlsrecords.dat file maintains the necessary Search Transaction queries, there may be times when you would like to override a pre-defined query. For example, suppose the Property Resource Query contained in the mlsrecords.dat file looked like, PropertyQuery=(ListingStatus=A) -- which returns all active records regardless of the date. However, you wanted just those active records from yesterday's date. Instead of updating the mlsrecords.dat file, simply type the following command: orc.sh -P"(ListingStatus=A), (ListDate=2003-03-30)". The additional syntax following the -P option must be a legitimate query.

5.6. Retrieving Media Data

In addition to Resource data, some RETS Servers offer what is known as Media data (i.e., photos, sound and video files). This type of data can be retrieved using the -m option. For example, let's say you were interested in downloading several images related to some known listings. Given that you have the appropriate KeyField (e.g., in most cases this is the ML Number, or Listing Number for Property listings), you can construct the option as follows: orc.sh -m"Property|1234:*,2222:1,3333:*". This reads as download all the media objects associated with the 1234 listing, then get the first object associated with the 2222 listing, and then grab all the media objects associated with the 3333 listing. The asterisk represents a wildcard character and is interpreted as asking the server for all media objects associated with the given identifier.

Since any valid resource can be used within the -m option, the command can be extended to include resources like Agent, and Office. For example, adding the Agent and Office resources to the previous example, leads to the following: orc.sh -m"Property|1234:*,2222:1,3333:*&Agent|samwise:3&Office|coldwell:*". This reads as give me a set of Property listings as before, then get the third object associated with the agent samwise, and then retrieve all objects associated with the coldwell office. The -m option can also be combined with the -P, -A, and -O options to retrieve all the necessary resource and media data. An example of this would look like

Although the syntax for the -m option has been designed to be quite flexible, some limitations do exist. In its most general form, the syntax is as follows:
	 orc.sh -m"[Resource[|ID[,ID]* &] ]*"
	 
         where ID = resource-entity[ : object-id]*
		 
         resource-entity: a value (e.g., MLS Number, Agent ID, Office ID) 
                          that represents the object to be retrieved.
		
               object-id: the particular object to be retrieved.
	
To better illustrate this, a few examples are shown below. The list is ordered in such a way that the most complex example is the last to be shown.

-m Option Examples

Resource Only

-m"Property"

Resource Plus Identifier (without object-id)

-m"Property|84756"

Resource Plus Identifier (with object-id)

-m"Property|84756:1"

Resource Plus Identifier (with multiple object-ids)

-m"Property|84756:1:4:3"

Resource Plus Multiple Identifiers (with multiple object-ids)

-m"Property|84756:1:4:3,234356:1:3,123847:*"

Multiple Resources Plus Multiple Identifiers (with multiple object-ids)

-m"Property|84756:1:4:3,234356:1:3,123847:*&Agent|samwise:1,bilbo:*"