510 likes | 736 Views
Templates for Business Inc. Cornerstone Update Transaction. Building a Fully Metadata Driven and Localized Application. Prepared by: Sergio Del Rio Date: June 7 th , 2006. Agenda. Introduction Process Flow RETS Resources Update Transaction Extensions Metadata Extensions
E N D
Templates for Business Inc. Cornerstone Update Transaction Building a Fully Metadata Driven and Localized Application Prepared by: Sergio Del Rio Date: June 7th, 2006
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Agenda – Time Permitting • Sort • Distinct • Aggregate Functions • Cross Resource Joins
Introduction • RETS Update Transaction • Existing Implementations • Process Flow Overview • Login • Get Metadata • General Search • Update • New Listing • Existing Listing
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Process Flow - Login • Standard RETS Login • Not currently updated to RETS 1.5/1.7 • Cornerstone Role Restrictions • Contact MRIS for additional privileges • Interactive Update • Must login as Agent • Bulk Update • Will require special Login • Change tracking based on Login
Process Flow – Get Metadata • Recommend Daily Updates • Basic Metadata • Presentation Metadata • Localization Metadata
Process Flow – General Search • Select Existing Listings in System • Edit Existing Listing • Copy Existing Listing • Update Metadata - Copy on Cloning Flag • External Validation • Agent Lookup • School Lookup • Tax Lookup • Streets / Zip Code Lookup
Process Flow – Existing Listing • Select with ForUpdate=1 • Use ListingKey for Search • Limit Number of Checked Out Listings • Role Based
Process Flow – New Listings • Update – Auto Populate Step • Use validate-flag = 1 • Mandatory Fields • Identified by - Update Metadata AutopopRequired • Currently: • County • Property Type
Process Flow – Validate Step • Update – validate-flag = 2 • Execute after all Mandatory Fields identified in the Update Metadata are filled in by user • Execute after all Validation Expressions are executed by the client • Returns Error/Warning Block • Data Not Saved in Database • If not already done, automatically executes Update Auto Populate Step
Process Flow – Save Step • Update – validate-flag=0 • Data Saved in Database if: • No Error block is returned • No Un-Answered Warnings are returned • If not already done, automatically executes Update Validate Step • Listing Number Generated • Listing Date Generated • Listing immediately visible to users
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
RETS Resources • Updateable Resources • Property – Class=ALL • OpenHouse – Class=OPEN_HOUSE • External Validation Resources • MRIS_ALL_ACTIVE_LIST_AGENT • MRIS_ALL_ACTIVE_ALT_AGENT • MRIS_ALL_ACTIVE_SALE_AGENT • MRIS_ALL_SCHOOL_ELEM • MRIS_ALL_SCHOOL_HIGH • MRIS_ALL_SCHOOL_MIDDLE • MRIS_ALL_CITY_ZIP_CODE • MRIS_ALL_MRIS_TAX • Images • At this time we do not support the addition of Images
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Update Transaction Extensions • Errors in Warning Block Definition Fixed • Return Data Sizes Increased • Transaction ID Defined
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Metadata Extensions • Existing Metadata • METADATA-CLASS • METADATA-TABLE • METADATA-LOOKUP_TYPE
Metadata Extensions • Newly Implemented Metadata • METADATA-UPDATE (Extended) • METADATA-UPDATE_TYPE (Extended) • METADATA-EDITMASK • METADATA-FOREIGNKEYS (Extended) • METADATA-VALIDATION_LOOKUP • METADATA-VALIDATION_LOOKUP_TYPE (Extended) • METADATA-VALIDATION_EXTERNAL (Extended) • METADATA-VALIDATION_EXTERNAL_TYPE (Extended) • METADATA-SEARCH_HELP • METADATA-UPDATE_HELP • METADATA-VALIDATION_EXPRESSION (Extended)
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Validation Expressions • Additional Special Operand Token • .RECORDSTATUS. NEW, UPDATE • Validation Expression BNF Grammar • Makes Validation Expressions implementable • Extended Metadata • Event Types • Validation Expression Types
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Presentation Metadata • Allows for 100% Metadata Driven Client • Grouping of Related Fields • New Metadata • METADATA-COLUMN_GROUP_SET • METADATA-COLUMN_GROUPS • METADATA-COLUMN_GROUP_CONTROL • METADATA-COLUMN_GROUP_TABLE • METADATA-COLUMN_GROUP_NORMALIZATION
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
Localization • Allows for the Development of Dynamic Regionalized Applications • What can be Localized? • Columns can be Hidden • Picklist Items can be Hidden • Column Labels can be Changed • Picklist Labels can be Changed • New Metadata • METADATA-LOCALE_LOOKUP • METADATA-LOCALE • METADATA-LOCALE_TABLE_SUPPRESSION • METADATA-LOCALE_TABLE_TRANSLATION • METADATA-LOCALE_LOOKUP_INFORMATION • METADATA-LOCALE_LOOKUP_TYPE_SUPPRESSION • METADATA-LOCALE_LOOKUP_TYPE_TRANSLATION
Localization - Future • Validation Expressions • Can currently localize rules using the Expression Language • Will allow a cleaner implementation in the near future
Agenda • Introduction • Process Flow • RETS Resources • Update Transaction Extensions • Metadata Extensions • Validation Expressions • Presentation Metadata • Keystone Implementation Overview • Localization • JRETSC
JRETSC • Java RETS Client Library • Completely Abstracts all RETS Transactions • Higher Developer Productivity • Similar Interface than JDBC • Abstract API Design • Allows for Multiple Implementations • Will support RETS 2.0 in future with no API changes
JRETSC RetsConnection • Instantiate RetsConnection Object: Class driverClass; String className = ”com.mris.platinum.client.direct.DirectConnection”; try { driverClass = Class.forName(className); this.retsConnection = (RetsConnection) driverClass.newInstance(); }
JRETSC Login • Execute the RetsConnection login() Method RetsOffice[] retsOffices; retsOffices = this.retsConnection.logIn(this.serverUrl, this.userAgent, this.agentLogin, this.agentPassword); // If more than one office returned, user should pick one. if (retsOffices.length > 1) { this.retsConnection.setOffice(retsOffices[0]); }
JRETSC Search • Using SearchHandler RetsSearch retsSearch; retsSearch = this.retsConnection.getSearchHandler(); retsSearch.initSearch(“Property”, “ALL”, true, true); // retsSearch.executeSearch(“(ListingKey=1234567890)”); retsSearch.executeSearchForUpdate(“(ListingKey=1234567890)”);
JRETSC Search • Retrieving Results RetsResultSet retsResultSet; RetsResultRow retsResultRow; while (retsSearch.hasMoreSets()) { retsResultSet = retsSearch.getNextSet(); while (retsResultSet.hasMore()) { retsResultRow = retsResultSet.next(); System.out.println(retsResultRow.getString(“ListingKey”)); } }
JRETSC Update • Using UpdateHandler RetsUpdate retsUpdate; RetsUpdateResult retsUpdateResult; retsUpdate = this.retsConnection.getUpdateHandler(); retsUpdate.initUpdate("Property", "ALL", "Change"); retsUpdate.addUpdateField("ListingKey", retsResultRow.getString("ListingKey")); retsUpdate.addUpdateField(“ListPrice”, “1500000.00”); retsUpdateResult = retsUpdate.executeUpdate(RetsValidateFlag.SAVE);
JRETSC Update • Retrieving Update Results RetsUpdateError[] retsUpdateErrors; retsUpdateErrors = retsUpdateResult.getRetsUpdateErrors(); if ((retsUpdateErrors != null) && (retsUpdateErrors.length > 0)) { for (int i = 0; i < retsUpdateErrors.length; i++) { if (retsUpdateErrors[i].isWarning()) { System.out.println("WARNING: " + retsUpdateErrors[i].toString()); } else { System.out.println("ERROR: " + retsUpdateErrors[i].toString()); } } } else { if (retsUpdateResult.getRetsResultRow() != null) { retsResultRow = retsUpdateResult.getRetsResultRow(); } }
JRETSC Logout • Simple Method Call • this.retsConnection.logOut();
Agenda • Sort • Distinct • Aggregate Functions • Cross Resource Joins
Sort • New Search Option • Sort ::= field-name:sort-dir *(,field-name:sort-dir) • Valid sort-dir Values • ASC • DES • Role Based Sorting Limits • Necessary for Performance and Memory Usage • Example: • Sort=ListPrice:ASC
Agenda • Sort • Distinct • Aggregate Functions • Cross Resource Joins
Distinct • New Search Option • Distinct ::= 0 | 1 • Default is 0 – All Records • When set to 1 – Only Returns Distinct Records • Uses Sort Extension • Example: • Distinct=1
Agenda • Sort • Distinct • Aggregate Functions • Cross Resource Joins
Aggregate Functions • Extension to Select Clause • Sort Extension becomes Group By • Columns in Select that are not Aggregated are automatically added to Sort • Supported Functions • SUM • AVG • COUNT • MIN • MAX • MEDIAN • STDDEV
Aggregate Functions • Example: • Select=County,AVG(ListPrice) • Returns the Average ListPrice grouped by County • Select=AVG(ListPrice)&Sort=County:ASC • Returns the Average ListPrice grouped by County • Return Data Format - COMPACT • Functional Results are Always at End of standard RETS Data Row • Column Name will be Function(Field) • Example: • <COLUMNS>\tCol1\tCol2\tAVG(Col3)\t</COLUMNS> • <DATA>\tData1\tData2\tData3\t</DATA>
Aggregate Functions • Return Data Format – XML • New Element: <AggregateFunctions> • Returned immediately after top level XML Node • Columns returned with Function Attribute • Example: <REDATA> <MRISProperties> <ResidentialProperty> … </ResidentialProperty> </MRISProperties> <AggregateFunctions> <Col3 Function=AVG> … </Col3> </AggregateFunctions> </REDATA>
Agenda • Sort • Distinct • Aggregate Functions • Cross Resource Joins
Cross Resource Joins • Based on Foreign Key Metadata • Two kinds of Joins • Normal Join • Exists Only Join • METADATA-FOREIGNKEYS • X-MRIS_OneToManyFlag • TRUE – Only for Exists Only Joins • FALSE – Exists for Normal Joins • Driving Resource and Class specified as normal Search Options
Cross Resource Joins • New Search Option • Join ::= ForeignKeyID:Tag *(,ForeignKeyID:Tag) • Tag Use • Becomes a Label used to identify Fields in the Select and DMQL Options • Example: • Join=1234567890:ListingAgent • DMQL=(ListingAgent.LastName=Smith) • Select=ListingID,ListPrice,ListingAgent.FirstName
Cross Resource JoinsReturn Data Format • COMPACT • Uses additional <DATA> groupings for each Join used after driving Resource </DATA> • Each Join identified by ForeignKey=Tag Attribute • Example: • <COLUMNS>\tCol1\tCol2\tCol3\t</COLUMNS><COLUMNS ForeignKey=”ListingAgent”>\tCol1\tCol2\t</COLUMNS> • <DATA>\tData1\tData2\tData3\t</DATA><DATA ForeignKey=”ListingAgent”>\tData1\tData2\t</DATA>
Cross Resource JoinsReturn Data Format • XML • New Element: <Join> • Returned immediately after top level XML Node • Each Join identified by ForeignKey=Tag Attribute • If no data exists for Join, only returns begin and end <Join> XML Attributes • Example: <REDATA> <MRISProperties> <ResidentialProperty> … </ResidentialProperty> </MRISProperties> <Join> <ActiveAgent ForeignKey=”ListingAgent”> … </ActiveAgent> </Join> </REDATA>
Testing & Support • Test Server • http://ptest.mris.com:6103/ptest/login • Contact MRIS for User ID and Password • E-Mail: rets@mris.net • Provide MRIS with UserAgent for Update application • RETS Forum • http://forums.mris.com/forums/index.cfm?forumID=3 • Also Accessible through http://www.mris.com • MRIS Update Transaction