Changes between Version 5 and Version 6 of MapGuideRfc66
- Timestamp:
- 06/25/09 19:59:45 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc66
v5 v6 40 40 2. Refine the code handling the exceptions like "connection broken" to provide more friendly messages. 41 41 42 43 == Implications == 44 42 Detail implementation:[[BR]] 45 43 1. Keep alive[[BR]] 46 44 a. Fusion already pings server periodically by calling "Common.php", so there is no plan to change Fusion's behavior.[[BR]] 47 45 b. Ajax viewer doesn’t ping server to keep-alive so far. If open an Ajax viewer and leave it open for a while more than the timeout interval, it can’t continue work. To keep Ajax viewer alive, the approach is:[[BR]] 48 46 1). Create a server API GetSessionTimeout(), return the timeout setting from server side. [[BR]] 47 The API is in MgSiteConnection class, declare as[[BR]] 48 {{{ 49 class MG_MAPGUIDE_API MgSiteConnection : public MgGuardDisposable 50 { 51 ///////////////////////////////////////////////////////////////////////////////// 52 /// \brief 53 /// Gets the session time out value. 54 /// 55 /// \remarks 56 /// Resources placed into the session repository will exist until 57 /// the session expires or the session is destroyed by using 58 /// DestroySession. The session timeout value is the lifttime of session 59 /// repository. 60 /// 61 /// <!-- Syntax in .Net, Java, and PHP --> 62 /// \htmlinclude DotNetSyntaxTop.html 63 /// string GetSessionTimeout(); 64 /// \htmlinclude SyntaxBottom.html 65 /// \htmlinclude JavaSyntaxTop.html 66 /// String GetSessionTimeout(); 67 /// \htmlinclude SyntaxBottom.html 68 /// \htmlinclude PHPSyntaxTop.html 69 /// string GetSessionTimeout(); 70 /// \htmlinclude SyntaxBottom.html 71 /// 72 /// \return 73 /// The timeout value of session measured in second, for example 74 /// "300". 75 /// 76 /// \exception [[To be documented]] 77 /// 78 /// \todo 79 /// [[What are the exceptions?]] 80 /// 81 /// \see 82 /// CreateSession 83 /// \see 84 /// DestroySession 85 /// \see 86 /// GetCurrentSession 87 /// 88 INT32 GetSessionTimeout(); 89 } 90 }}} 91 [[BR]] 92 93 MapAgent.fcgi operation sample is:[[BR]] 94 {{{ 95 [MapAgent URL]\MapAgent.fcgi?OPERATION=GETSESSIONTIMEOUT&VERSION=1.0.0&SESSION=[session Id]&LOCALE=[locale]&CLIENTAGENT=[client]; 96 }}}[[BR]] 97 98 49 99 2). Call GetSessionTimeout() from mainframe.templ periodically.[[BR]] 50 100 User doesn’t need to set the time interval of pinging. It’s read from server timeout setting and divided by 5. User can turn the ping on/off by setting <EnablePingServer>=1/0 of basic web layout. [[BR]] 101 102 Web Layout schema should be updated from 1.0.0 to 1.1.0 for adding <EnablePingServer> tag. [[BR]] 103 {{{ 104 <xs:complexType name="WebLayoutType"> 105 <xs:sequence> 106 <xs:element name="Title" type="xs:string"/> 107 <xs:element name="Map" type="MapType"/> 108 <xs:element name="EnablePingServer" type="xs:boolean" /> 109 <xs:element name="ToolBar" type="ToolBarType"/> 110 <xs:element name="InformationPane" type="InformationPaneType"/> 111 <xs:element name="ContextMenu" type="ContextMenuType"/> 112 <xs:element name="TaskPane" type="TaskPaneType"/> 113 <xs:element name="StatusBar" type="StatusBarType"/> 114 <xs:element name="ZoomControl" type="ZoomControlType"/> 115 <xs:element name="CommandSet" type="CommandSetType"/> 116 </xs:sequence> 117 </xs:complexType> 118 }}} 119 51 120 52 121 2. Refine exception handling such as “connection broken”[[BR]] 53 122 a. Fusion does not handle exception message well. It shows long unreadable message when exception happens. For example if connection broken the error message is "FATAL: xml2json: invalid XML document: MgConnectionFailedException : http://127.0.0.1/mapguide2010/mapagent/mapagent.fcgi?version=1.0.0&locale=en&clientagent=Fusion%20Viewer&operation=QUERYMAPFEATURES&session=40d3e074-3ee5-102c-8000-005056c00008_en_7F0000010AFC0AFB0AFA&mapname=Sheboygan4a3b609791c82&geometry=POLYGON((-87.730254250931%2043.73763292302%2C%20-87.730254250931%2043.737069942268%2C%20-87.729691270179%2043.737069942268%2C%20-87.729691270179%2043.73763292302%2C%20-87.730254250931%2043.73763292302))&maxFeatures=1&persist=0&selectionVariant=INTERSECTS&layerNames=&layerAttributeFilter=5 type=0". This is no user-friendly. The error message should show exception message such as "Fussion error: Cannot establish connection".[[BR]] 54 123 b. Ajax viewer shows exception messages and they are user-friendly. No improvements needed for Ajax viewer. 124 125 126 == Implications == 127 55 128 56 129 == Test Plan ==