Congratulations!

[Valid RSS] This is a valid RSS feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://xcellerant.wordpress.com/feed/

  1. <?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
  2. xmlns:content="http://purl.org/rss/1.0/modules/content/"
  3. xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  4. xmlns:dc="http://purl.org/dc/elements/1.1/"
  5. xmlns:atom="http://www.w3.org/2005/Atom"
  6. xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  7. xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  8. xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
  9. >
  10.  
  11. <channel>
  12. <title>Xcellerant</title>
  13. <atom:link href="http://xcellerant.net/feed/" rel="self" type="application/rss+xml" />
  14. <link>http://xcellerant.net</link>
  15. <description>Accelerating XPages Development</description>
  16. <lastBuildDate>Fri, 28 Apr 2017 07:20:33 +0000</lastBuildDate>
  17. <language>en</language>
  18. <sy:updatePeriod>hourly</sy:updatePeriod>
  19. <sy:updateFrequency>1</sy:updateFrequency>
  20. <generator>http://wordpress.com/</generator>
  21. <cloud domain='xcellerant.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
  22. <image>
  23. <url>http://0.gravatar.com/blavatar/e5d1b87787ff073ecffe94452befee9a?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
  24. <title>Xcellerant</title>
  25. <link>http://xcellerant.net</link>
  26. </image>
  27. <atom:link rel="search" type="application/opensearchdescription+xml" href="http://xcellerant.net/osd.xml" title="Xcellerant" />
  28. <atom:link rel='hub' href='http://xcellerant.net/?pushpress=hub'/>
  29. <item>
  30. <title>XPages Tip: Adding a Bootstrap Class to All Labels via the Theme (Redux)</title>
  31. <link>http://xcellerant.net/2016/07/20/xpages-tip-adding-a-bootstrap-class-to-all-labels-via-the-theme-redux/</link>
  32. <comments>http://xcellerant.net/2016/07/20/xpages-tip-adding-a-bootstrap-class-to-all-labels-via-the-theme-redux/#comments</comments>
  33. <pubDate>Wed, 20 Jul 2016 11:08:50 +0000</pubDate>
  34. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  35. <category><![CDATA[Bootstrap]]></category>
  36. <category><![CDATA[Theme]]></category>
  37. <category><![CDATA[XPages]]></category>
  38. <category><![CDATA[XPages Tip]]></category>
  39.  
  40. <guid isPermaLink="false">http://xcellerant.net/?p=2893</guid>
  41. <description><![CDATA[In this post, I showed how to set all labels in an application to include a class to pick up Bootstrap styling so it could be applied application-wide and not require touching every label control individually. However, there&#8217;s a quirk with label rendering that may make it not apply universally as desired. In this post, [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2893&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  42. <content:encoded><![CDATA[<p>In this post, I showed how to <a href="https://xcellerant.net/2013/12/04/set-the-bootstrap-class-for-all-multiline-text-fields-and-labels-in-xpages-with-a-theme/"> set all labels in an application to include a class to pick up Bootstrap styling</a> so it could be applied application-wide and not require touching every label control individually. However, there&#8217;s a quirk with label rendering that may make it not apply universally as desired. In this post, I&#8217;ll explain the issue and how to use another theme setting to easily fix it.</p>
  43. <h4>Updating all Labels via the Theme</h4>
  44. <p>This code in the theme will apply the <code>control-label</code> class to all label components in the application. This allows me to apply a Bootstrap style class to all labels without having to update each label control individually on every XPage and custom control. </p>
  45. <pre class="brush: plain; title: ; notranslate">
  46. &lt;control&gt;
  47.  &lt;name&gt;Text.Label&lt;/name&gt;
  48.  &lt;property mode=&quot;concat&quot;&gt;
  49.    &lt;name&gt;styleClass&lt;/name&gt;
  50.    &lt;value&gt;control-label&lt;/value&gt;
  51.  &lt;/property&gt;
  52. &lt;/control&gt;
  53. </pre>
  54. <p>The Bootstrap styling will be applied to <code>label </code>tags that have the <code>control-label</code> class.</p>
  55. <h4>The Problem with Label Rendering</h4>
  56. <p>However, there&#8217;s an issue with the way labels are rendered that may not make it work consistently.</p>
  57. <p>Any labels that do not have a <code>for </code>attribute specified will actually be rendered as <code>span </code>tags and the styling will not be picked up. (Labels that have the <code>for </code>attribute specified will be rendered as <code>label </code>tags and work as expected.)</p>
  58. <p>In another post, I described <a href="https://xcellerant.net/xpages-tip-overriding-concatenating-and-conditionally-adding-control-properties-via-a-theme/">the effects of different modes on theme property application</a>. In this post, we&#8217;ll see a practical example of the effects.</p>
  59. <h4> Theme to the Rescue (Again)</h4>
  60. <p>Fortunately, there&#8217;s an easy way to add another property setting to the theme to handle this. </p>
  61. <p>There isn&#8217;t a <code>tagName </code>attribute on a label, so you can&#8217;t directly modify the output tag this way, but <code>for </code>is a property of the control, so you can use the theme to add it to all labels.</p>
  62. <h4> 1. Overriding the Property</h4>
  63. <p>One option is to override the <code>for </code>property on all labels. Lines 7-10 were added below to do so.</p>
  64. <pre class="brush: plain; title: ; notranslate">
  65. &lt;control&gt;
  66.  &lt;name&gt;Text.Label&lt;/name&gt;
  67.  &lt;property mode=&quot;concat&quot;&gt;
  68.    &lt;name&gt;styleClass&lt;/name&gt;
  69.    &lt;value&gt;control-label&lt;/value&gt;
  70.  &lt;/property&gt;
  71.  &lt;property mode=&quot;override&quot;&gt;
  72.    &lt;name&gt;for&lt;/name&gt;
  73.    &lt;value&gt;dummyTarget&lt;/value&gt;
  74.  &lt;/property&gt;
  75. &lt;/control&gt;
  76. </pre>
  77. <p>This puts the <code>for </code>property in place and assumes it needs to figure out the client-side ID of the element that&#8217;s been specified. This is a dummy value, but it does the job.</p>
  78. <pre class="brush: plain; title: ; notranslate">
  79. &lt;label id=&quot;view:_id1:_id3:_id51:office_Label1&quot; class=&quot;control-label&quot; for=&quot;view:_id1:_id3:_id51:dummyTarget&quot;&gt;Office&lt;/label&gt;
  80. </pre>
  81. <p>However, it does the job too ambitiously. It removes any existing <code>for </code>property, so it would break the association with the specified input control, which may cause other issues with the application and most certainly would cause issues with a screen reader.</p>
  82. <h4> 2. Concatenating the Value</h4>
  83. <p>Changing line 7 to concatenate instead of overriding the value gives us a bit better behavior.</p>
  84. <pre class="brush: plain; title: ; notranslate">
  85. &lt;property mode=&quot;concat&quot;&gt;
  86. </pre>
  87. <p>This mode will append the property value to any value that currently exists for the attribute. It will also add the attribute and value if it doesn&#8217;t exist.</p>
  88. <pre class="brush: plain; title: ; notranslate">
  89. &lt;label id=&quot;view:_id1:_id3:_id51:label17&quot; class=&quot;control-label&quot; for=&quot;view:_id1:_id3:_id51:dummyTarget&quot;&gt;Payment #&lt;/label&gt;
  90. </pre>
  91. <p>This also does the job, but it causes two values to be in the for property if one already existed (although it doesn&#8217;t try to generate a client-side ID when it&#8217;s appended).</p>
  92. <pre class="brush: plain; title: ; notranslate">
  93. &lt;label id=&quot;view:_id1:_id3:_id51:office_Label1&quot; class=&quot;control-label&quot; for=&quot;view:_id1:_id3:_id51:office1 dummyTarget&quot;&gt;Office&lt;/label&gt;
  94. </pre>
  95. <p>This is better than the override method, but still may cause problems.</p>
  96. <h4> 3. Mode not specified</h4>
  97. <p>You can also just not specify the mode.</p>
  98. <pre class="brush: plain; title: ; notranslate">
  99. &lt;property&gt;
  100. </pre>
  101. <p>In this case it only adds the property and value if the property doesn&#8217;t already exist, so it&#8217;s the cleanest solution.</p>
  102. <p>This is an example of a label that already had the <code>for </code>attribute specified. It does not get the new dummy value.</p>
  103. <pre class="brush: plain; title: ; notranslate">
  104. &lt;label id=&quot;view:_id1:_id3:_id51:office_Label1&quot; class=&quot;control-label&quot; for=&quot;view:_id1:_id3:_id51:office1&quot;&gt;Office&lt;/label&gt;
  105. </pre>
  106. <p>This is an example of a label that did not have the <code>for </code>attribute specified:</p>
  107. <pre class="brush: plain; title: ; notranslate">
  108. &lt;label id=&quot;view:_id1:_id3:_id51:requisitionLabel&quot; class=&quot;control-label&quot; for=&quot;view:_id1:_id3:_id51:dummyTarget&quot;&gt;Requisition #&lt;/label&gt;
  109. </pre><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2893/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2893/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2893&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  110. <wfw:commentRss>http://xcellerant.net/2016/07/20/xpages-tip-adding-a-bootstrap-class-to-all-labels-via-the-theme-redux/feed/</wfw:commentRss>
  111. <slash:comments>1</slash:comments>
  112. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  113. <media:title type="html">xcellerant</media:title>
  114. </media:content>
  115. </item>
  116. <item>
  117. <title>XPages Tip: Overriding, Concatenating, and Conditionally Adding Control Properties via a Theme</title>
  118. <link>http://xcellerant.net/2016/07/20/overriding-concatenating-conditionally-adding-control-properties-via-a-theme/</link>
  119. <comments>http://xcellerant.net/2016/07/20/overriding-concatenating-conditionally-adding-control-properties-via-a-theme/#respond</comments>
  120. <pubDate>Wed, 20 Jul 2016 11:07:26 +0000</pubDate>
  121. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  122. <category><![CDATA[PSC]]></category>
  123. <category><![CDATA[Theme]]></category>
  124. <category><![CDATA[XPages]]></category>
  125. <category><![CDATA[XPages Tip]]></category>
  126.  
  127. <guid isPermaLink="false">http://xcellerant.net/?p=2892</guid>
  128. <description><![CDATA[Themes are commonly-used in XPages applications to include resources needed throughout an application, but they can also be a powerful tool for consistently applying application-wide control settings. In this post, I&#8217;ll explain the difference between different modes for applying a control property and link to a corresponding post with a practical example. 1. Overriding a [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2892&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  129. <content:encoded><![CDATA[<p>Themes are commonly-used in XPages applications to include resources needed throughout an application, but they can also be a powerful tool for consistently applying application-wide control settings. In this post, I&#8217;ll explain the difference between different modes for applying a control property and link to a corresponding post with a practical example.</p>
  130. <h4>1. Overriding a Control Property</h4>
  131. <p>In this post, I showed how to use the theme to <a href="https://xcellerant.net/2013/12/04/set-the-bootstrap-class-for-all-multiline-text-fields-and-labels-in-xpages-with-a-theme/">add a class to all labels in an application</a> to pick up Bootstrap styling without having to set the class on each individual label.</p>
  132. <p>Here&#8217;s an example of the theme code to make it happen:</p>
  133. <pre class="brush: plain; title: ; notranslate">
  134. &lt;control&gt;
  135.  &lt;name&gt;Text.Label&lt;/name&gt;
  136.  &lt;property mode=&quot;override&quot;&gt;
  137.    &lt;name&gt;styleClass&lt;/name&gt;
  138.    &lt;value&gt;control-label&lt;/value&gt;
  139.  &lt;/property&gt;
  140. &lt;/control&gt;
  141. </pre>
  142. <p>When a page loads, the theme is applied to the page and all label controls are updated as the page is rendered.</p>
  143. <ul>
  144. <li>Line 2 is directing it to apply to all Label controls throughout the application. (This is using a theme ID that&#8217;s predefined for the label control, as noted in the Mastering XPages book.)</li>
  145. <li>Line 4 specifies that it&#8217;s updating the <code>styleClass </code>property of the controls.</li>
  146. <li>Line 5 specifies the <code>control-label</code> class to add to each label. (This is the class name that Bootstrap styling looks for.)</li>
  147. <li>Line 3 is the variable for this post. This example starts with the setting the override mode. This mode will set the class to the specified value on all label controls, overriding anything that may have been set when the control was added on an XPage or custom control. </li>
  148. </ul>
  149. <h4>2. Concatenating a Control Property</h4>
  150. <p>Instead of overriding the property on all controls, another option is to concatenate the specified value to any existing value specified on each instance of the control.</p>
  151. <pre class="brush: plain; title: ; notranslate">
  152. &lt;property mode=&quot;concat&quot;&gt;
  153. </pre>
  154. <p>In this case, if there was a label control that already had a class specified, the <code>control-label</code> class would be added to it (after a space) so the label would have both classes.</p>
  155. <p>If the label control did not have a class, then the specified class would be added.</p>
  156. <h4>3. Conditionally Applying a Control Property</h4>
  157. <p>The last option is not to specify a mode at all.</p>
  158. <pre class="brush: plain; title: ; notranslate">
  159. &lt;property&gt;
  160. </pre>
  161. <p>In this case, it will not do anything to a label control that already has a class specified, but it will add the specified class to any label control that does not have one.</p>
  162. <p>Take a look at <a href="https://xcellerant.net/2016/07/20/xpages-tip-adding-a-bootstrap-class-to-all-labels-via-the-theme-redux/"></a> for a practical example of each of these methods and how the distinction between these methods matters.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2892/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2892/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2892&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  163. <wfw:commentRss>http://xcellerant.net/2016/07/20/overriding-concatenating-conditionally-adding-control-properties-via-a-theme/feed/</wfw:commentRss>
  164. <slash:comments>0</slash:comments>
  165. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  166. <media:title type="html">xcellerant</media:title>
  167. </media:content>
  168. </item>
  169. <item>
  170. <title>XPages Tip: Displaying Bootstrap Applications Properly on Mobile Devices</title>
  171. <link>http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/</link>
  172. <comments>http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/#comments</comments>
  173. <pubDate>Tue, 31 May 2016 11:07:54 +0000</pubDate>
  174. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  175. <category><![CDATA[Bootstrap]]></category>
  176. <category><![CDATA[Responsive Design]]></category>
  177. <category><![CDATA[Theme]]></category>
  178. <category><![CDATA[XPages]]></category>
  179. <category><![CDATA[XPages Tip]]></category>
  180. <category><![CDATA[PSC]]></category>
  181.  
  182. <guid isPermaLink="false">http://xcellerant.net/?p=2880</guid>
  183. <description><![CDATA[Do you have a Bootstrap navigation menu in XPages that collapses properly in a full browser but not on a mobile device? You may need to set a meta tag to force it to display properly. In this post, I&#8217;ll show the effects with and without the tag on a mobile device. Navbar Collapsing One [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2880&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  184. <content:encoded><![CDATA[<p>Do you have a Bootstrap navigation menu in XPages that collapses properly in a full browser but not on a mobile device? You may need to set a meta tag to force it to display properly. In this post, I&#8217;ll show the effects with and without the tag on a mobile device.</p>
  185. <h4>Navbar Collapsing</h4>
  186. <p>One of the great features of Bootstrap is its built-in responsive UI that scales well to work on screens of varying sizes. The navigation bars collapse nicely into the hamburger menus to make better use of available space on smaller devices.</p>
  187. <p>However, in recent testing of an XPages application with a Bootstrap UI, it was noted that the navigation menus did not collapse properly when viewed on a phone. It was a little confusing because it collapsed as expected on a full browser.</p>
  188. <p>When the navigation bar is set up properly, it should collapse properly on its own when the screen width is below 768 px. I verified that there are no CSS rules overruling that cutoff and that 768px is, in fact, the point where the menu collapses on the full browser.</p>
  189. <h4>Bootstrap Navbar Test Page</h4>
  190. <p>To test it out, I tried out the <a href="https://getbootstrap.com/examples/navbar/">Bootstrap Navbar test page</a></p>
  191. <p>On my laptop with a full browser, it showed the navigation normally.</p>
  192. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png"><img data-attachment-id="2886" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-1a-full-browser-over-768px/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png" data-orig-size="1949,628" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 1A &#8211; Full Browser Over 768px" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=800&#038;h=258" class="aligncenter wp-image-2886 size-large" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=800&#038;h=258" alt="Nav Collapse 1A - Full Browser Over 768px" width="800" height="258" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=800&amp;h=258 800w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=1600&amp;h=516 1600w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=150&amp;h=48 150w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=300&amp;h=97 300w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=768&amp;h=247 768w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=1024&amp;h=330 1024w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  193. <p>When I shrunk the screen to be less than 768px wide, it collapsed the navigation properly.</p>
  194. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png"><img data-attachment-id="2885" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-1b-full-browser-under-768px/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=500&#038;h=379" data-orig-size="774,587" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 1B &#8211; Full Browser Under 768px" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=500&#038;h=379?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=500&#038;h=379?w=774" class="aligncenter wp-image-2885" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=500&#038;h=379" alt="Nav Collapse 1B - Full Browser Under 768px" width="500" height="379" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=500&amp;h=379 500w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=150&amp;h=114 150w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=300&amp;h=228 300w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png?w=768&amp;h=582 768w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png 774w" sizes="(max-width: 500px) 100vw, 500px" /></a></p>
  195. <p>When I checked it on my phone, it was collapsed properly.</p>
  196. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png"><img data-attachment-id="2884" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-1c-phone-collapsed/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 1C &#8211; Phone &#8211; Collapsed" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=169" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=400&#038;h=711" class="aligncenter wp-image-2884" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=400&#038;h=711" alt="Nav Collapse 1C - Phone - Collapsed" width="400" height="711" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=400&amp;h=711 400w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=84&amp;h=150 84w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=169&amp;h=300 169w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png 720w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
  197. <h4>Test Page in XPages</h4>
  198. <p>I copied the div that contains the navigation from that test page and pasted into an XPage in my application to see how it worked.</p>
  199. <p>It collapsed as expected in a full browser but not on the phone.</p>
  200. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png"><img data-attachment-id="2883" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-2a-phone-not-collapsed-in-xpages/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=400&#038;h=711" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 2A &#8211; Phone &#8211; NOT Collapsed in XPages" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=400&#038;h=711?w=169" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=400&#038;h=711?w=576" class="aligncenter wp-image-2883" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=400&#038;h=711" alt="Nav Collapse 2A - Phone - NOT Collapsed in XPages" width="400" height="711" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=400&amp;h=711 400w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=84&amp;h=150 84w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png?w=169&amp;h=300 169w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png 720w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
  201. <p>It is also apparent that the page has been scaled so that it fits fully on the phone.</p>
  202. <p>To verify this, I put a button on the page to tell me the screen width. As expected, it showed a width &gt; 768 px, which is why it did not collapse the menus. It scaled the entire page to fit on the screen, so it did not fall below the threshold of the responsive design media queries.</p>
  203. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png"><img data-attachment-id="2882" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-2b-phone-screen-width/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=400&#038;h=711" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 2B &#8211; Phone &#8211; Screen Width" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=400&#038;h=711?w=169" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=400&#038;h=711?w=576" class="aligncenter wp-image-2882" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=400&#038;h=711" alt="Nav Collapse 2B - Phone - Screen Width" width="400" height="711" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=400&amp;h=711 400w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=84&amp;h=150 84w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png?w=169&amp;h=300 169w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png 720w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
  204. <p>(This is on a Samsung Galaxy. An iPhone showed it to be roughly 900px.)</p>
  205. <p>And this is just a simple page. Imagine how that looks with a much bigger XPage!</p>
  206. <h4>The Difference</h4>
  207. <p>Ultimately, the main difference is that the Bootstrap test page contains a meta tag to make sure the device doesn&#8217;t shrink to fit the entire page on the screen.</p>
  208. <pre class="brush: plain; title: ; notranslate">
  209. &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;
  210. </pre>
  211. <p>In XPages, this can be set at the page level, but it&#8217;s easiest to do it application-wide via a theme, within a resources tag.</p>
  212. <pre class="brush: plain; title: ; notranslate">
  213. &lt;resources&gt;
  214.  &lt;metaData&gt;
  215.    &lt;name&gt;viewport&lt;/name&gt;
  216.    &lt;content&gt;width=device-width, initial-scale=1.0&lt;/content&gt;
  217.  &lt;/metaData&gt;
  218. &lt;/resources&gt;
  219. </pre>
  220. <p>Now, when I reload the Bootstrap test page, it is displayed properly on the phone.</p>
  221. <p><a href="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png"><img data-attachment-id="2881" data-permalink="http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/nav-collapse-3-phone-collapsed-in-xpages/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=400&#038;h=711" data-orig-size="720,1280" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Nav Collapse 3 &#8211; Phone &#8211; Collapsed in XPages" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=400&#038;h=711?w=169" data-large-file="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=400&#038;h=711?w=576" class="aligncenter wp-image-2881" src="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=400&#038;h=711" alt="Nav Collapse 3 - Phone - Collapsed in XPages" width="400" height="711" srcset="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=400&amp;h=711 400w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=84&amp;h=150 84w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png?w=169&amp;h=300 169w, https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png 720w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
  222. <p>The button showing the screen with on the phone now shows it to be 360px wide.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2880/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2880/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2880&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  223. <wfw:commentRss>http://xcellerant.net/2016/05/31/display-bootstrap-applications-properly-on-mobile-devices/feed/</wfw:commentRss>
  224. <slash:comments>2</slash:comments>
  225. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  226. <media:title type="html">xcellerant</media:title>
  227. </media:content>
  228.  
  229. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1a-full-browser-over-768px.png?w=800" medium="image">
  230. <media:title type="html">Nav Collapse 1A - Full Browser Over 768px</media:title>
  231. </media:content>
  232.  
  233. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1b-full-browser-under-768px.png" medium="image">
  234. <media:title type="html">Nav Collapse 1B - Full Browser Under 768px</media:title>
  235. </media:content>
  236.  
  237. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-1c-phone-collapsed.png?w=576" medium="image">
  238. <media:title type="html">Nav Collapse 1C - Phone - Collapsed</media:title>
  239. </media:content>
  240.  
  241. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2a-phone-not-collapsed-in-xpages.png" medium="image">
  242. <media:title type="html">Nav Collapse 2A - Phone - NOT Collapsed in XPages</media:title>
  243. </media:content>
  244.  
  245. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-2b-phone-screen-width.png" medium="image">
  246. <media:title type="html">Nav Collapse 2B - Phone - Screen Width</media:title>
  247. </media:content>
  248.  
  249. <media:content url="https://xcellerant.files.wordpress.com/2016/05/nav-collapse-3-phone-collapsed-in-xpages.png" medium="image">
  250. <media:title type="html">Nav Collapse 3 - Phone - Collapsed in XPages</media:title>
  251. </media:content>
  252. </item>
  253. <item>
  254. <title>Efficiently Keeping an XPages Session Alive with JSON RPC</title>
  255. <link>http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/</link>
  256. <comments>http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/#comments</comments>
  257. <pubDate>Wed, 25 May 2016 11:07:07 +0000</pubDate>
  258. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  259. <category><![CDATA[Browser Session]]></category>
  260. <category><![CDATA[JSON RPC]]></category>
  261. <category><![CDATA[XPages]]></category>
  262. <category><![CDATA[XPages Tip]]></category>
  263.  
  264. <guid isPermaLink="false">http://xcellerant.net/?p=2862</guid>
  265. <description><![CDATA[In my last post, I talked about the difference between two reasons that a user may be prompted to login again while using an XPages application: idle session timeouts and LTPA token expiration. There are a variety of ways to programmatically prevent an browser session from timing out due to inactivity. In this post, I&#8217;ll [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2862&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  266. <content:encoded><![CDATA[<p>In my <a href="http://xcellerant.net/browser-session-lifespan/">last post</a>, I talked about the difference between two reasons that a user may be prompted to login again while using an XPages application: idle session timeouts and LTPA token expiration. There are a variety of ways to programmatically prevent an browser session from timing out due to inactivity. In this post, I&#8217;ll show how to do it with JSON-RPC and why I prefer it to the standard methods.</p>
  267. <h4>Keeping the Session Alive</h4>
  268. <p>The Keep Session Alive control (<code>xe:keepSessionAlive</code>) in the extension library was designed to make it easy to prevent idle session timeouts; all you have to do is drop the control onto a page and optionally set the refresh period and it will send requests to keep the session alive.</p>
  269. <p>In earlier versions of Notes/Domino, this would not be available without the extension library, which was a limiting factor in many situations. It&#8217;s built into version 9+, so it&#8217;s more readily available.</p>
  270. <p>Other solutions popped up for those without the extension library (and to work around an <a href="https://xomino.com/2012/09/13/keeping-your-xpage-session-alive-without-keepsessionalive/">earlier bug in the control</a>, including <a href="https://openntf.org/XSnippets.nsf/snippet.xsp?id=keeping-your-xpage-session-alive-%E2%80%93-without-keepsessionalive">Mark Roden&#8217;s XSnippet</a>. In this solution, a timer is set to periodically trigger a partial refresh of an empty div in order to send a request to the server and keep the session alive.</p>
  271. <p>This works well and is easy to add to any application.</p>
  272. <p>However, while it can be set to run very infrequently, the partial refresh is more overhead than necessary. It only refreshes a single empty DIV tag, but it&#8217;s still posting the entire form and causing the entire component tree to go through most of the life JSF lifecycle. If the user happens to be viewing the page, the responsiveness may lag due to the synchronous processing and refresh.</p>
  273. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png"><img data-attachment-id="2874" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-alive-2a-keep-session-alive-xsp-partial-refresh/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png" data-orig-size="390,326" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Alive 2A &#8211; Keep Session Alive XSP partial refresh" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=300&#038;h=251" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=390" class="aligncenter wp-image-2874 size-medium" src="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=300&#038;h=251" alt="Keep Alive 2A - Keep Session Alive XSP partial refresh" width="300" height="251" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=300&amp;h=251 300w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=150&amp;h=125 150w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png 390w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
  274. <p>(In contrast, the Keep Session Alive control appears to be efficient, sending a GET request and getting a minimal response.)</p>
  275. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png"><img data-attachment-id="2875" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-alive-2b-keep-session-alive-control/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=800&#038;h=89" data-orig-size="835,93" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Alive 2B &#8211; Keep Session Alive control" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=800&#038;h=89?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=800&#038;h=89?w=800" class="aligncenter size-full wp-image-2875" src="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=800&#038;h=89" alt="Keep Alive 2B - Keep Session Alive control" width="800" height="89" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=800&amp;h=89 800w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=150&amp;h=17 150w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=300&amp;h=33 300w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png?w=768&amp;h=86 768w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png 835w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  276. <h4>RPC Efficiency</h4>
  277. <p>My first thought when looking for a more efficient solution was, at minimum, to use the code to trigger an even that for which I could also enable partial execution <a href="http://www.intec.co.uk/understanding-partial-execution-part-three-jsf-lifecycle/">(explained really well here by Paul Withers)</a> to limit the scope of the processing to make it much more efficient.</p>
  278. <p>However, in thinking through it further, I realized that it would be even more efficient to use JSON RPC, because the amount of information sent is minimal, the response is minimal, and the request is asynchronous, so it doesn&#8217;t have any of the aforementioned issues. (If you&#8217;re not familiar with JSON RPC &#8212; take a look at <a href="http://www.slideshare.net/balassaitis/mwlug-2015-ad114-take-your-xpages-development-to-the-next-level">the first section of this presentation</a> for more information.)</p>
  279. <p>Without further adieu, here is a solution using JSON RPC.</p>
  280. <pre class="brush: plain; title: ; notranslate">
  281. &lt;xe:jsonRpcService id=&quot;jsonRpcService1&quot; serviceName=&quot;rpcUserSession&quot;&gt;
  282.  &lt;xe:this.methods&gt;
  283.    &lt;xe:remoteMethod name=&quot;keepAlive&quot;&gt;
  284.      &lt;xe:this.script&gt;&lt;![CDATA[return '';]]&gt;&lt;/xe:this.script&gt;
  285.    &lt;/xe:remoteMethod&gt;
  286.  &lt;/xe:this.methods&gt;
  287. &lt;/xe:jsonRpcService&gt;
  288. &lt;xp:eventHandler event=&quot;onClientLoad&quot; submit=&quot;false&quot;&gt;
  289.  &lt;xp:this.script&gt;&lt;![CDATA[ setInterval(function(){ console.log('keeping session alive (rpc): ' + new Date()); rpcUserSession.keepAlive(); }, 1500000) ]]&gt;&lt;/xp:this.script&gt;
  290. &lt;/xp:eventHandler&gt;
  291. </pre>
  292. <p>The first 8 lines simply define an rpc service that has a single method that just returns an empty string.</p>
  293. <p>The last 8 lines are an onClientLoad event handler that set a timer to write a message to the browser console and call the RPC method every 25 minutes.</p>
  294. <p>The request sent to the server is minimal&#8230;</p>
  295. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png"><img data-attachment-id="2873" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2f-rpc-post/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png" data-orig-size="890,332" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2F &#8211; RPC Post" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=700&#038;h=261" class="aligncenter wp-image-2873" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=700&#038;h=261" alt="Keep Session Alive 2F - RPC Post" width="700" height="261" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=700&amp;h=261 700w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=150&amp;h=56 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=300&amp;h=112 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=768&amp;h=286 768w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png 890w" sizes="(max-width: 700px) 100vw, 700px" /></a></p>
  296. <p>&#8230; as is the response.</p>
  297. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png"><img data-attachment-id="2872" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2f-rpc-response/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=700&#038;h=188" data-orig-size="889,239" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2F &#8211; RPC Response" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=700&#038;h=188?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=700&#038;h=188?w=800" class="aligncenter wp-image-2872" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=700&#038;h=188" alt="Keep Session Alive 2F - RPC Response" width="700" height="188" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=700&amp;h=188 700w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=150&amp;h=40 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=300&amp;h=81 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png?w=768&amp;h=206 768w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png 889w" sizes="(max-width: 700px) 100vw, 700px" /></a></p>
  298. <p>No page processing occurs and the request is asynchronous, so it cannot affect the user.</p>
  299. <p>This can be added to it&#8217;s own custom control and then added to your application&#8217;s page layout control so it&#8217;s available throughout. All you have to do is set the refresh duration, which should be slightly less than the idle session timeout.</p>
  300. <h4>Timeout Handling</h4>
  301. <p>In addition to being more efficient, this method also has the benefit of failing much more gracefully and also providing the ability to handle the timeout.</p>
  302. <p>In my testing the Keep Session Alive control doesn&#8217;t show any error to the user or to the browser console.</p>
  303. <p>The partial refresh method first shows this message&#8230;</p>
  304. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png"><img data-attachment-id="2871" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2c-partial-refresh-failure/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=401&#038;h=184" data-orig-size="566,260" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2C &#8211; Partial Refresh Failure" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=401&#038;h=184?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=401&#038;h=184?w=566" class="aligncenter wp-image-2871" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=401&#038;h=184" alt="Keep Session Alive 2C - Partial Refresh Failure" width="401" height="184" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=401&amp;h=184 401w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=150&amp;h=69 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png?w=300&amp;h=138 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png 566w" sizes="(max-width: 401px) 100vw, 401px" /></a></p>
  305. <p>&#8230;and then pops up a second error message, saying that there&#8217;s no element to submit, along with the client-side ID of the &lt;div&gt; that&#8217;s the target of the partial refresh.</p>
  306. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png"><img data-attachment-id="2870" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=400&#038;h=167" data-orig-size="526,220" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2C2- Partial Refresh Failure 2 &#8211; No Element to Submit" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=400&#038;h=167?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=400&#038;h=167?w=526" class="aligncenter wp-image-2870" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=400&#038;h=167" alt="Keep Session Alive 2C2- Partial Refresh Failure 2 - No Element to Submit" width="400" height="167" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=400&amp;h=167 400w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=150&amp;h=63 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png?w=300&amp;h=125 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png 526w" sizes="(max-width: 400px) 100vw, 400px" /></a></p>
  307. <p>This is an ugly way to fail.</p>
  308. <p>One of the benefits of the RPC method is that it fails more gracefully AND you can trap the error and handle it however you&#8217;d like.</p>
  309. <p>Here&#8217;s the error message that is displayed in the browser console when the session ends due to the machine going to sleep:</p>
  310. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png"><img data-attachment-id="2868" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=800&#038;h=15" data-orig-size="1208,23" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2D &#8211; RPC Post Failure Due to Machine Going to Sleep" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=800&#038;h=15?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=800&#038;h=15?w=800" class="aligncenter size-full wp-image-2868" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=800&#038;h=15" alt="Keep Session Alive 2D - RPC Post Failure Due to Machine Going to Sleep" width="800" height="15" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=800&amp;h=15 800w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=150&amp;h=3 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=300&amp;h=6 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=768&amp;h=15 768w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png?w=1024&amp;h=19 1024w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png 1208w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  311. <p>A different message is returned when it times out due to the expiration of the LTPA token:</p>
  312. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png"><img data-attachment-id="2867" data-permalink="http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/keep-session-alive-2d2-rpc-post-failure-when-timed-out/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=800&#038;h=13" data-orig-size="1212,19" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Session Alive 2D2 &#8211; RPC Post Failure When Timed Out" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=800&#038;h=13?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=800&#038;h=13?w=800" class="aligncenter size-full wp-image-2867" src="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=800&#038;h=13" alt="Keep Session Alive 2D2 - RPC Post Failure When Timed Out" width="800" height="13" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=800&amp;h=13 800w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=150&amp;h=2 150w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=300&amp;h=5 300w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=768&amp;h=12 768w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png?w=1024&amp;h=16 1024w, https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png 1212w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  313. <p>The user never gets a message. They would just be prompted to login the next time they tried to run any action on the page that required server interaction.</p>
  314. <p>However, as I described in a previous post, you can <a href="https://xcellerant.net/handling-errors-in-an-xpages-rpc-method/">handle errors within an RPC call</a>. You could use this to either display a nicer message to the user or redirect to a login page, either of which allows you to handle it much more gracefully.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2862/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2862/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2862&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  315. <wfw:commentRss>http://xcellerant.net/2016/05/25/efficiently-keeping-session-alive-json-rpc/feed/</wfw:commentRss>
  316. <slash:comments>1</slash:comments>
  317. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  318. <media:title type="html">xcellerant</media:title>
  319. </media:content>
  320.  
  321. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2a-keep-session-alive-xsp-partial-refresh.png?w=300" medium="image">
  322. <media:title type="html">Keep Alive 2A - Keep Session Alive XSP partial refresh</media:title>
  323. </media:content>
  324.  
  325. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-alive-2b-keep-session-alive-control.png" medium="image">
  326. <media:title type="html">Keep Alive 2B - Keep Session Alive control</media:title>
  327. </media:content>
  328.  
  329. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-post.png?w=800" medium="image">
  330. <media:title type="html">Keep Session Alive 2F - RPC Post</media:title>
  331. </media:content>
  332.  
  333. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2f-rpc-response.png" medium="image">
  334. <media:title type="html">Keep Session Alive 2F - RPC Response</media:title>
  335. </media:content>
  336.  
  337. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c-partial-refresh-failure.png" medium="image">
  338. <media:title type="html">Keep Session Alive 2C - Partial Refresh Failure</media:title>
  339. </media:content>
  340.  
  341. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2c2-partial-refresh-failure-2-no-element-to-submit.png" medium="image">
  342. <media:title type="html">Keep Session Alive 2C2- Partial Refresh Failure 2 - No Element to Submit</media:title>
  343. </media:content>
  344.  
  345. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d-rpc-post-failure-due-to-machine-going-to-sleep.png" medium="image">
  346. <media:title type="html">Keep Session Alive 2D - RPC Post Failure Due to Machine Going to Sleep</media:title>
  347. </media:content>
  348.  
  349. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-session-alive-2d2-rpc-post-failure-when-timed-out.png" medium="image">
  350. <media:title type="html">Keep Session Alive 2D2 - RPC Post Failure When Timed Out</media:title>
  351. </media:content>
  352. </item>
  353. <item>
  354. <title>Browser Session Lifespan &#8211; Idle Session Timeout vs LTPA Token Expiration</title>
  355. <link>http://xcellerant.net/2016/05/24/browser-session-lifespan/</link>
  356. <comments>http://xcellerant.net/2016/05/24/browser-session-lifespan/#respond</comments>
  357. <pubDate>Tue, 24 May 2016 11:07:25 +0000</pubDate>
  358. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  359. <category><![CDATA[Browser Session]]></category>
  360. <category><![CDATA[XPages]]></category>
  361. <category><![CDATA[xsp.properties]]></category>
  362. <category><![CDATA[PSC]]></category>
  363.  
  364. <guid isPermaLink="false">http://xcellerant.net/?p=2852</guid>
  365. <description><![CDATA[I recently spent some time investigating a client&#8217;s reports of unexpected behavior with the duration of browser sessions while testing an application on a test server. From time to time, they were required to login even while actively using an application. In this post, I&#8217;ll highlight the difference between an idle session timeout and an [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2852&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  366. <content:encoded><![CDATA[<p>I recently spent some time investigating a client&#8217;s reports of unexpected behavior with the duration of browser sessions while testing an application on a test server. From time to time, they were required to login even while actively using an application. In this post, I&#8217;ll highlight the difference between an idle session timeout and an LTPA token expiration, which serve different purposes and, in the latter case, may cause frustration if not understood.</p>
  367. <h4>User Expectations</h4>
  368. <p>Most users are familiar with the concept of a browser session timing out if left idle for too long. In this case, websites will generally inform the user that a session has expired and require the user to login again in order to continue.</p>
  369. <p>But users will generally not expect to be required to login again while actively using an application, so it&#8217;s important to understand why it might happen and what you can do about it.</p>
  370. <h4>Idle Session Timeout &#8211; Server</h4>
  371. <p>The Domino server document has a setting to define how long it will take for the session to be automatically logged out due to inactivity. This is configured on the server document: <code>Internet Protocols... &gt; Domino Web Engine &gt; Idle session time-out </code></p>
  372. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png"><img data-attachment-id="2855" data-permalink="http://xcellerant.net/2016/05/24/browser-session-lifespan/keep-alive-1a-server-idle-session-timeout/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png" data-orig-size="1137,417" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Alive 1A &#8211; Server &#8211; Idle Session Timeout" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=800&#038;h=293" class="aligncenter size-large wp-image-2855" src="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=800&#038;h=293" alt="Keep Alive 1A - Server - Idle Session Timeout" width="800" height="293" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=800&amp;h=293 800w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=150&amp;h=55 150w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=300&amp;h=110 300w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=768&amp;h=282 768w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=1024&amp;h=376 1024w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png 1137w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  373. <p>The default is 30 minutes.</p>
  374. <h4>Idle Session Timeout &#8211; Application</h4>
  375. <p>There is also an application-level setting for the session timeout, which can be found on the <code>General </code>tab of <code>Xsp Properties</code>.</p>
  376. <p>&nbsp;</p>
  377. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png"><img data-attachment-id="2853" data-permalink="http://xcellerant.net/2016/05/24/browser-session-lifespan/keep-alive-1b-application-idle-session-timeout/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=400&#038;h=454" data-orig-size="579,657" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Alive 1B &#8211; Application &#8211; Idle Session Timeout" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=400&#038;h=454?w=264" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=400&#038;h=454?w=579" class="aligncenter wp-image-2853" src="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=400&#038;h=454" alt="Keep Alive 1B - Application - Idle Session Timeout" width="400" height="454" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=400&amp;h=454 400w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=132&amp;h=150 132w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png?w=264&amp;h=300 264w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png 579w" sizes="(max-width: 400px) 100vw, 400px" /></a>This sets the <code>xsp.session.timeout</code> property.</p>
  378. <pre class="brush: plain; title: ; notranslate">
  379. xsp.session.timeout=30
  380. </pre>
  381. <h4>LTPA Token Timeout</h4>
  382. <p>If single sign-on is configured to share the session between multiple servers, a Web Configuration document will define the SSO parameters.</p>
  383. <p>The key setting in this case is the <code>Expiration (minutes)</code> field on the <code>Basics </code>tab of the document. This defines the lifespan of the LTPA token that is issued when the user logs in.</p>
  384. <p><a href="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png"><img data-attachment-id="2854" data-permalink="http://xcellerant.net/2016/05/24/browser-session-lifespan/keep-alive-1c-sso-token-expiration/" data-orig-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=450&#038;h=228" data-orig-size="657,333" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Keep Alive 1C &#8211; SSO Token Expiration" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=450&#038;h=228?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=450&#038;h=228?w=657" class="aligncenter wp-image-2854" src="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=450&#038;h=228" alt="Keep Alive 1C - SSO Token Expiration" width="450" height="228" srcset="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=450&amp;h=228 450w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=150&amp;h=76 150w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png?w=300&amp;h=152 300w, https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png 657w" sizes="(max-width: 450px) 100vw, 450px" /></a></p>
  385. <p><em>The important thing to understand is that this has nothing to do with how active or idle the session is. </em></p>
  386. <p>This is a fixed length of time for which the key will be valid. Once it expires, the user will be prompted to login again. This can be very confusing to a user who is actively using the application!</p>
  387. <h4>Improving the Experience</h4>
  388. <p>There are a number of ways to implement controls to keep a session from timing out due to inactivity, but they will have no effect on the expiration of the LTPA token.</p>
  389. <p>In order to prevent users from being frustrated with frequent logouts, some very smart people including <a href="http://stackoverflow.com/questions/13286756/lotus-domino-server-with-kerberos-authentication-and-xpages/13287124#13287124">Per Lausten</a> and <a href="https://www.focul.net/users-losing-authenticated-access-to-xpage-apps-when-using-sso-ltpa-tokens-solved/">Sean Cull</a>, have written about this in years past and have recommended setting the token expiration to a much larger number in order to prevent unexpected behavior. The idle session timeout can still do it&#8217;s job dealing with inactive sessions (and you as a developer can programmatically work to keep them alive if desired).</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2852/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2852/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2852&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  390. <wfw:commentRss>http://xcellerant.net/2016/05/24/browser-session-lifespan/feed/</wfw:commentRss>
  391. <slash:comments>0</slash:comments>
  392. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  393. <media:title type="html">xcellerant</media:title>
  394. </media:content>
  395.  
  396. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1a-server-idle-session-timeout.png?w=800" medium="image">
  397. <media:title type="html">Keep Alive 1A - Server - Idle Session Timeout</media:title>
  398. </media:content>
  399.  
  400. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1b-application-idle-session-timeout.png" medium="image">
  401. <media:title type="html">Keep Alive 1B - Application - Idle Session Timeout</media:title>
  402. </media:content>
  403.  
  404. <media:content url="https://xcellerant.files.wordpress.com/2016/05/keep-alive-1c-sso-token-expiration.png" medium="image">
  405. <media:title type="html">Keep Alive 1C - SSO Token Expiration</media:title>
  406. </media:content>
  407. </item>
  408. <item>
  409. <title>XPages Tip: Passing an Array to a Custom Control Property</title>
  410. <link>http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/</link>
  411. <comments>http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/#comments</comments>
  412. <pubDate>Tue, 12 Apr 2016 10:06:20 +0000</pubDate>
  413. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  414. <category><![CDATA[Custom Controls]]></category>
  415. <category><![CDATA[SSJS]]></category>
  416. <category><![CDATA[XPages]]></category>
  417. <category><![CDATA[XPages Tip]]></category>
  418. <category><![CDATA[PSC]]></category>
  419.  
  420. <guid isPermaLink="false">http://xcellerant.net/?p=2842</guid>
  421. <description><![CDATA[Custom properties are extremely useful for modular design and reuse by sending custom values into each instance. There are a number of data types that can be selected, but no obvious way to pass an array value. In this post, I&#8217;ll describe the issue and how to work around it. Custom Property Data Types The [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2842&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  422. <content:encoded><![CDATA[<p>Custom properties are extremely useful for modular design and reuse by sending custom values into each instance. There are a number of data types that can be selected, but no obvious way to pass an array value. In this post, I&#8217;ll describe the issue and how to work around it.</p>
  423. <h4>Custom Property Data Types</h4>
  424. <p>The default data type for a custom property is <code>string</code>.</p>
  425. <p>There are a number of primitive data types available in the dropdown:</p>
  426. <p><a href="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png" rel="attachment wp-att-2847"><img data-attachment-id="2847" data-permalink="http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/custom-property-primitive-types/" data-orig-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=800" data-orig-size="538,327" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Custom Property &#8211; Primitive Types" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=800?w=538" class="aligncenter wp-image-2847 size-full" src="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=800" alt="Custom Property - Primitive Types" srcset="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png 538w, https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=150 150w, https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png?w=300 300w" sizes="(max-width: 538px) 100vw, 538px"   /></a></p>
  427. <p>If you click the folder icons, there are a number of additional options, including Converters, Validators, and other types, but there are no data types for arrays (or vectors or JavaScript objects).</p>
  428. <p><a href="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png" rel="attachment wp-att-2848"><img data-attachment-id="2848" data-permalink="http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/custom-property-property-types/" data-orig-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=800" data-orig-size="525,643" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Custom Property &#8211; Property Types" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=800?w=245" data-large-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=800?w=525" class="aligncenter wp-image-2848 size-full" src="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=800" alt="Custom Property - Property Types" srcset="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png 525w, https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=122 122w, https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png?w=245 245w" sizes="(max-width: 525px) 100vw, 525px"   /></a></p>
  429. <h4>String Data Type</h4>
  430. <p>In this case, I want a property that can accept an array of values.</p>
  431. <p>To test this, I created a simple custom control with two properties, <code>stringProperty </code>and <code>objectProperty</code>, to test how they handle arrays. They both default to <code>string </code>as the data type.</p>
  432. <p><a href="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png" rel="attachment wp-att-2845"><img data-attachment-id="2845" data-permalink="http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/custom-property-1-custom-property/" data-orig-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=800" data-orig-size="632,298" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Custom Property &#8211; 1 Custom Property" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=800?w=632" class="aligncenter wp-image-2845 size-full" src="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=800" alt="Custom Property - 1 Custom Property" srcset="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png 632w, https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=150 150w, https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png?w=300 300w" sizes="(max-width: 632px) 100vw, 632px"   /></a></p>
  433. <pre class="brush: plain; title: ; notranslate">
  434. &lt;xc:ccTest&gt;
  435.  &lt;xc:this.stringProperty&gt;&lt;![CDATA[#{javascript:return ['1', '2', '3', '4', '5'];}]]&gt;&lt;/xc:this.stringProperty&gt;
  436.  &lt;xc:this.objectProperty&gt;&lt;![CDATA[#{javascript:return ['1', '2', '3', '4', '5'];}]]&gt;&lt;/xc:this.objectProperty&gt;
  437. &lt;/xc:ccTest&gt;
  438. </pre>
  439. <p>You can leave the data type as <code>string</code>, but compute an array to return. It won&#8217;t throw an error, but it will treat it like a single string.</p>
  440. <h4>No Data Type</h4>
  441. <p>You can remove the data type from the property definition and it won&#8217;t throw an error on the custom control. However, that is not a valid property, so its treated as though that property doesn&#8217;t exist.</p>
  442. <p>If you&#8217;ve already set up an instance of the custom control and passed a value to it, it will throw an error on the custom control instance: <em>Unknown property this.. It is not defined on tag .</em></p>
  443. <p><a href="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png" rel="attachment wp-att-2846"><img data-attachment-id="2846" data-permalink="http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/custom-property-error-no-property-type-defined/" data-orig-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png" data-orig-size="964,277" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Custom Property &#8211; Error &#8211; No Property Type Defined" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=800&#038;h=230" class="aligncenter wp-image-2846 size-large" src="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=800&#038;h=230" alt="Custom Property - Error - No Property Type Defined" width="800" height="230" srcset="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=800&amp;h=230 800w, https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=150&amp;h=43 150w, https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=300&amp;h=86 300w, https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=768&amp;h=221 768w, https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png 964w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  444. <h4>Custom Data Type</h4>
  445. <p>Fortunately, there&#8217;s a really simple solution &#8212; you can manually type in a property type.</p>
  446. <p>If you type in <code>object </code>as the type, it does the trick. (It effectively works as desired, although it actually accepts the data as <code>java.util.Vector</code>.)</p>
  447. <p><a href="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png" rel="attachment wp-att-2844"><img data-attachment-id="2844" data-permalink="http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/custom-property-object-type/" data-orig-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=800" data-orig-size="489,301" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Custom Property &#8211; Object Type" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=800?w=489" class="aligncenter wp-image-2844 size-full" src="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=800" alt="Custom Property - Object Type" srcset="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png 489w, https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=150 150w, https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png?w=300 300w" sizes="(max-width: 489px) 100vw, 489px"   /></a></p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2842/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2842/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2842&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  448. <wfw:commentRss>http://xcellerant.net/2016/04/12/xpages-tip-passing-an-array-to-a-custom-control-property/feed/</wfw:commentRss>
  449. <slash:comments>2</slash:comments>
  450. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  451. <media:title type="html">xcellerant</media:title>
  452. </media:content>
  453.  
  454. <media:content url="https://xcellerant.files.wordpress.com/2016/04/custom-property-primitive-types.png" medium="image">
  455. <media:title type="html">Custom Property - Primitive Types</media:title>
  456. </media:content>
  457.  
  458. <media:content url="https://xcellerant.files.wordpress.com/2016/04/custom-property-property-types.png" medium="image">
  459. <media:title type="html">Custom Property - Property Types</media:title>
  460. </media:content>
  461.  
  462. <media:content url="https://xcellerant.files.wordpress.com/2016/04/custom-property-1-custom-property.png" medium="image">
  463. <media:title type="html">Custom Property - 1 Custom Property</media:title>
  464. </media:content>
  465.  
  466. <media:content url="https://xcellerant.files.wordpress.com/2016/04/custom-property-error-no-property-type-defined.png?w=800" medium="image">
  467. <media:title type="html">Custom Property - Error - No Property Type Defined</media:title>
  468. </media:content>
  469.  
  470. <media:content url="https://xcellerant.files.wordpress.com/2016/04/custom-property-object-type.png" medium="image">
  471. <media:title type="html">Custom Property - Object Type</media:title>
  472. </media:content>
  473. </item>
  474. <item>
  475. <title>XPages Tip: Beware Server-Side code in Multiple onClientLoad Events</title>
  476. <link>http://xcellerant.net/2016/04/07/xpages-tip-beware-server-side-code-in-multiple-onclientload-events/</link>
  477. <comments>http://xcellerant.net/2016/04/07/xpages-tip-beware-server-side-code-in-multiple-onclientload-events/#comments</comments>
  478. <pubDate>Thu, 07 Apr 2016 10:06:12 +0000</pubDate>
  479. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  480. <category><![CDATA[JavaScript]]></category>
  481. <category><![CDATA[SSJS]]></category>
  482. <category><![CDATA[XPages]]></category>
  483. <category><![CDATA[XPages Tip]]></category>
  484. <category><![CDATA[PSC]]></category>
  485.  
  486. <guid isPermaLink="false">http://xcellerant.net/?p=2838</guid>
  487. <description><![CDATA[TL;DR &#8211; Server-side code in onClientLoad causes a page refresh and prevents additional onClientLoad events with server-side code from running. In this post, I&#8217;ll show an example and describe how it behaves. Page Ready Events It is extremely useful to have an event trigger that executes when the page is fully loaded; many JavaScript plugins [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2838&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  488. <content:encoded><![CDATA[<p>TL;DR &#8211; Server-side code in onClientLoad causes a page refresh and prevents additional onClientLoad events with server-side code from running. In this post, I&#8217;ll show an example and describe how it behaves.</p>
  489. <h4>Page Ready Events</h4>
  490. <p>It is extremely useful to have an event trigger that executes when the page is fully loaded; many JavaScript plugins wait for the page to finish loading and then run to activate widgets on the page. Because of its importance, jQuery has <code>$(document).ready()</code> and Dojo has <code>dojo/domReady</code> and <code>dojo.addOnLoad()</code> to make this checking easy.</p>
  491. <h4>The Problem with onClientLoad in XPages</h4>
  492. <p>XPages provides the <code>onClientLoad </code>event on pages, custom controls, and panels. XPages allows you to run client-side and/or server-side code in the event. However, running server-side code can cause a tough-to-troubleshoot side effect.</p>
  493. <p>Take, for example, this XPage, which has two panels. Both panels and the page itself have client-side and server-side <code>onClientLoad </code>code to write a message to the browser console and server console, respectively.</p>
  494. <pre class="brush: plain; title: ; notranslate">
  495. &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  496. &lt;xp:view xmlns:xp=&quot;http://www.ibm.com/xsp/core&quot;&gt;
  497.  
  498.  onClientLoad Event Testing
  499.  
  500.  &lt;xp:eventHandler event=&quot;onClientLoad&quot; submit=&quot;true&quot; refreshMode=&quot;norefresh&quot;&gt;
  501.    &lt;xp:this.script&gt;&lt;![CDATA[console.log('Page - onClientLoad');]]&gt;&lt;/xp:this.script&gt;
  502.    &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:print('Page - onClientLoad');}]]&gt;&lt;/xp:this.action&gt;
  503.  &lt;/xp:eventHandler&gt;
  504.  
  505.  &lt;xp:panel id=&quot;panel1&quot;&gt;
  506.    &lt;xp:eventHandler event=&quot;onClientLoad&quot; submit=&quot;true&quot; refreshMode=&quot;norefresh&quot;&gt;
  507.      &lt;xp:this.script&gt;&lt;![CDATA[console.log('Panel 1 - onClientLoad');]]&gt;&lt;/xp:this.script&gt;
  508.      &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:print('Panel 1 - onClientLoad');}]]&gt;&lt;/xp:this.action&gt;
  509.    &lt;/xp:eventHandler&gt;
  510.  &lt;/xp:panel&gt;
  511.  
  512.  &lt;xp:panel id=&quot;panel2&quot;&gt;
  513.    &lt;xp:eventHandler event=&quot;onClientLoad&quot; submit=&quot;true&quot; refreshMode=&quot;norefresh&quot;&gt;
  514.      &lt;xp:this.script&gt;&lt;![CDATA[console.log('Panel 2 - onClientLoad');]]&gt;&lt;/xp:this.script&gt;
  515.      &lt;xp:this.action&gt;&lt;![CDATA[#{javascript:print('Panel 2 - onClientLoad');}]]&gt;&lt;/xp:this.action&gt;
  516.    &lt;/xp:eventHandler&gt;
  517.  &lt;/xp:panel&gt;
  518.  
  519. &lt;/xp:view&gt;
  520. </pre>
  521. <p>Here&#8217;s what happens when the page loads:</p>
  522. <ol>
  523. <li>The page-level client-side code runs to write the message to the browser console</li>
  524. <li>The page-level server-side code runs to write the message to the server console</li>
  525. </ol>
  526. <p>That&#8217;s it. </p>
  527. <p><strong>Execution on <code>onClientLoad </code>handlers stops at this point because the page has posted to the server because of the server-side code; the <code>onClientLoad </code>event handlers for the panels do not execute at all.</strong></p>
  528. <p>You can look in the browser&#8217;s developer tools and see the POST that is sent. It doesn&#8217;t try to update anything on the page, so there&#8217;s no response, but it&#8217;s still enough to interrupt everything else.</p>
  529. <p>More details on the behavior:</p>
  530. <ul>
  531. <li>You can run multiple client-side <code>onClientLoad </code>event scripts without issue &#8212; as long as they&#8217;re not triggering partial refreshes</li>
  532. <li>If the event handlers are rearranged on the page, the one that comes first in the source is the one that will run</li>
  533. <li>If there is only one <code>onClientLoad </code>event with server-side code, it will run (based on it&#8217;s order in the source), then POST, then let the rest of the <code>onClientLoad </code>events on the page <em>that only have client-side code</em> run. (Any with server-side code will not execute &#8212; even the client-side event code on handlers that also have server-side code will not run.)</li>
  534. </ul>
  535. <h4>Mitigating the Problem</h4>
  536. <p>This may sound like an easy thing to keep in check, but if you have <code>onClientLoad </code>code on multiple custom controls, it may be hard to make sure that there won&#8217;t be a conflict, especially because there won&#8217;t be any error thrown.</p>
  537. <p>The strong recommendation is to just not put server-side code in the <code>onClientLoad </code>event, period.</p>
  538. <p>If you absolutely need it, then you may need a standard of putting any necessary <code>onClientLoad </code>code in the common layout control that&#8217;s loaded on every page, but it still has the potential to interrupt anything else going on the page or annoy the user by causing a delay immediately after the page is loaded waiting for the post and response. I would try to put code in the <code>afterPageLoad </code>event or use client-side code to trigger an RPC method or custom REST service if server-side code needs to run in that event.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2838/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2838/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2838&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  539. <wfw:commentRss>http://xcellerant.net/2016/04/07/xpages-tip-beware-server-side-code-in-multiple-onclientload-events/feed/</wfw:commentRss>
  540. <slash:comments>1</slash:comments>
  541. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  542. <media:title type="html">xcellerant</media:title>
  543. </media:content>
  544. </item>
  545. <item>
  546. <title>getFragment() Doesn&#8217;t</title>
  547. <link>http://xcellerant.net/2016/03/24/getfragment-doesnt/</link>
  548. <comments>http://xcellerant.net/2016/03/24/getfragment-doesnt/#respond</comments>
  549. <pubDate>Thu, 24 Mar 2016 11:07:38 +0000</pubDate>
  550. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  551. <category><![CDATA[XPages]]></category>
  552. <category><![CDATA[XPages Tip]]></category>
  553. <category><![CDATA[XSPUrl]]></category>
  554.  
  555. <guid isPermaLink="false">http://xcellerant.net/?p=2815</guid>
  556. <description><![CDATA[The XSPUrl object that you can access via the XPages context has a lot of handy methods. getFragement() isn&#8217;t one of them. I was looking through the help documentation for XSPUrl recently and noticed that the object includes a method for getting the url fragment (i.e. the part of the URL after the hash). It [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2815&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  557. <content:encoded><![CDATA[<p>The XSPUrl object that you can access via the XPages <code>context</code> has a lot of handy methods. <code>getFragement()</code> isn&#8217;t one of them.</p>
  558. <p>I was looking through the help documentation for XSPUrl recently and noticed that the object includes a method for getting the url fragment (i.e. the part of the URL after the hash). It was unexpected, but I figured it could be handy since I was working with some (non-XPages) tabs on pages in a recent application.</p>
  559. <p>However, as shown on Dave Leedy&#8217;s helpful <a href="http://xpagescheatsheet.com/cheatsheet.nsf/url.xsp">XPages URL Cheatsheet</a>, <code>getFragment()</code> doesn&#8217;t return anything when referring to the URL gleaned from the current context!</p>
  560. <p>This makes sense, as the hash is a client-side redirect and is not even sent to the server, so a server-side method wouldn&#8217;t be able to see it. But it&#8217;s included in the <a href="http://www.ibm.com/support/knowledgecenter/SSVRGU_9.0.1/com.ibm.designer.domino.api.doc/r_wpdr_xsp_xspurl_getfragment_r.html?cp=SSVRGU_9.0.1">XPages Documentation</a> which, hilariously, references <a href="http://www.dominoguru.com/pages/xspurl_full_url_xpages_85.html">Chris Toohey&#8217;s post</a> about this from several years ago.</p>
  561. <p>Fortunately, if you need to work with the hash, you can use client-side Javascript&#8217;s <a href="http://www.w3schools.com/jsref/prop_loc_hash.asp">location.hash</a> property and pass it to server-side code as needed.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2815/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2815/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2815&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  562. <wfw:commentRss>http://xcellerant.net/2016/03/24/getfragment-doesnt/feed/</wfw:commentRss>
  563. <slash:comments>0</slash:comments>
  564. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  565. <media:title type="html">xcellerant</media:title>
  566. </media:content>
  567. </item>
  568. <item>
  569. <title>Transferring a Bitbucket Repository</title>
  570. <link>http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/</link>
  571. <comments>http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/#respond</comments>
  572. <pubDate>Tue, 22 Mar 2016 11:07:18 +0000</pubDate>
  573. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  574. <category><![CDATA[Bitbucket]]></category>
  575. <category><![CDATA[Source Control]]></category>
  576. <category><![CDATA[SourceTree]]></category>
  577. <category><![CDATA[XPages]]></category>
  578. <category><![CDATA[PSC]]></category>
  579.  
  580. <guid isPermaLink="false">http://xcellerant.net/?p=2821</guid>
  581. <description><![CDATA[I recently needed to move control of a source control repository on Bitbucket from a personal account to a company account. Fortunately, there&#8217;s a relatively easy built-in process to transfer it between accounts. In this post, I&#8217;ll show how it&#8217;s done. Open the repository in Bitbucket Click on Settings at the bottom of the left [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2821&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  582. <content:encoded><![CDATA[<p>I recently needed to move control of a source control repository on Bitbucket from a personal account to a company account. Fortunately, there&#8217;s a relatively easy built-in process to transfer it between accounts. In this post, I&#8217;ll show how it&#8217;s done.</p>
  583. <ol>
  584. <li>Open the repository in Bitbucket</li>
  585. <li>Click on Settings at the bottom of the left navigation</li>
  586. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg" rel="attachment wp-att-2829"><img data-attachment-id="2829" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket1/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=112&#038;h=400" data-orig-size="210,750" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket1" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=112&#038;h=400?w=84" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=112&#038;h=400?w=210" class="aligncenter wp-image-2829" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=112&#038;h=400" alt="TransferBitbucket1" width="112" height="400" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=112&amp;h=400 112w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg?w=42&amp;h=150 42w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg 210w" sizes="(max-width: 112px) 100vw, 112px" /></a></p>
  587. <li>Click on Transfer repository under General</li>
  588. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png" rel="attachment wp-att-2832"><img data-attachment-id="2832" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket2/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png" data-orig-size="291,497" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket2" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=176&#038;h=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=291" class="aligncenter wp-image-2832 size-medium" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=176&#038;h=300" alt="TransferBitbucket2" width="176" height="300" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=176&amp;h=300 176w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=88&amp;h=150 88w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png 291w" sizes="(max-width: 176px) 100vw, 176px" /></a></p>
  589. <li>Choose the new owner and click the Transfer Ownership button</li>
  590. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png" rel="attachment wp-att-2831"><img data-attachment-id="2831" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket3/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png" data-orig-size="1022,333" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket3" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=598&#038;h=195" class="aligncenter wp-image-2831" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=598&#038;h=195" alt="TransferBitbucket3" width="598" height="195" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=598&amp;h=195 598w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=150&amp;h=49 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=300&amp;h=98 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=768&amp;h=250 768w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png 1022w" sizes="(max-width: 598px) 100vw, 598px" /></a></p>
  591. <li>Login to Bitbucket as with the account of the new owner</li>
  592. <li>Click on the user icon in the upper right and select “Inbox”</li>
  593. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png" rel="attachment wp-att-2830"><img data-attachment-id="2830" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket4/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png" data-orig-size="338,264" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket4" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=338" class="aligncenter wp-image-2830" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=200&#038;h=156" alt="TransferBitbucket4" width="200" height="156" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=200&amp;h=156 200w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=150&amp;h=117 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=300&amp;h=234 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png 338w" sizes="(max-width: 200px) 100vw, 200px" /></a></p>
  594. <li>You’ll see a message with the transfer request. (It will also be e-mailed to the account owner.)</li>
  595. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg" rel="attachment wp-att-2828"><img data-attachment-id="2828" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket5/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg" data-orig-size="1180,140" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket5" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=800&#038;h=95" class="aligncenter wp-image-2828 size-large" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=800&#038;h=95" alt="TransferBitbucket5" width="800" height="95" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=800&amp;h=95 800w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=150&amp;h=18 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=300&amp;h=36 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=768&amp;h=91 768w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=1024&amp;h=121 1024w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg 1180w" sizes="(max-width: 800px) 100vw, 800px" /></a></p>
  596. <li>Open the message and click the link that it contains</li>
  597. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg" rel="attachment wp-att-2825"><img data-attachment-id="2825" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket6/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg" data-orig-size="1030,300" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket6" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=601&#038;h=175" class="aligncenter wp-image-2825" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=601&#038;h=175" alt="TransferBitbucket6" width="601" height="175" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=601&amp;h=175 601w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=150&amp;h=44 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=300&amp;h=87 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=768&amp;h=224 768w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=1024&amp;h=298 1024w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg 1030w" sizes="(max-width: 601px) 100vw, 601px" /></a></p>
  598. <li>Click the Accept button to transfer the repository</li>
  599. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg" rel="attachment wp-att-2824"><img data-attachment-id="2824" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket7/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=450&#038;h=210" data-orig-size="750,350" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket7" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=450&#038;h=210?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=450&#038;h=210?w=750" class="aligncenter wp-image-2824" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=450&#038;h=210" alt="TransferBitbucket7" width="450" height="210" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=450&amp;h=210 450w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=150&amp;h=70 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg?w=300&amp;h=140 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg 750w" sizes="(max-width: 450px) 100vw, 450px" /></a></p>
  600. <li>Now that the repository has been transferred, it takes you to the Access management screen so you can add users to the repository as needed.</li>
  601. <li>If anyone already had Source Tree set up to use the repository, they will need to update the repository settings to point to the new location.
  602. <ul>
  603. <li>If you try to commit to the original repo url, you get a 404 error when trying to push:</li>
  604. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg" rel="attachment wp-att-2827"><img data-attachment-id="2827" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket8/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg" data-orig-size="600,300" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket8" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=300&#038;h=150" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=600" class="aligncenter wp-image-2827 size-medium" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=300&#038;h=150" alt="TransferBitbucket8" width="300" height="150" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=300&amp;h=150 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=150&amp;h=75 150w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg 600w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
  605. <li>Open the repository in Source Tree</li>
  606. <li>Click on the Settings button in the upper right hand corner (or select Repository &gt; Repository Settings)</li>
  607. <li>Click on the default repository to select it</li>
  608. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg" rel="attachment wp-att-2826"><img data-attachment-id="2826" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket11/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg" data-orig-size="750,400" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket11" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=300&#038;h=160" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=750" class="aligncenter size-medium wp-image-2826" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=300&#038;h=160" alt="TransferBitbucket11" width="300" height="160" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=300&amp;h=160 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=600&amp;h=320 600w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=150&amp;h=80 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
  609. <li>Click the Edit button</li>
  610. <li>Update the URL to replace the previous Bitbucket account name to the new one in two places in the URL</li>
  611. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg" rel="attachment wp-att-2823"><img data-attachment-id="2823" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket12/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg" data-orig-size="750,430" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket12" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=300&#038;h=172" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=750" class="aligncenter size-medium wp-image-2823" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=300&#038;h=172" alt="TransferBitbucket12" width="300" height="172" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=300&amp;h=172 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=600&amp;h=344 600w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=150&amp;h=86 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
  612. <p><a href="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg" rel="attachment wp-att-2822"><img data-attachment-id="2822" data-permalink="http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/transferbitbucket13/" data-orig-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg" data-orig-size="750,400" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="TransferBitbucket13" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=300&#038;h=160" data-large-file="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=750" class="aligncenter size-medium wp-image-2822" src="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=300&#038;h=160" alt="TransferBitbucket13" width="300" height="160" srcset="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=300&amp;h=160 300w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=600&amp;h=320 600w, https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=150&amp;h=80 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></li>
  613. </ul>
  614. </li>
  615. </ol><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2821/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2821/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2821&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  616. <wfw:commentRss>http://xcellerant.net/2016/03/22/transferring-a-bitbucket-repository/feed/</wfw:commentRss>
  617. <slash:comments>0</slash:comments>
  618. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  619. <media:title type="html">xcellerant</media:title>
  620. </media:content>
  621.  
  622. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket1.jpg" medium="image">
  623. <media:title type="html">TransferBitbucket1</media:title>
  624. </media:content>
  625.  
  626. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket2.png?w=176" medium="image">
  627. <media:title type="html">TransferBitbucket2</media:title>
  628. </media:content>
  629.  
  630. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket3.png?w=800" medium="image">
  631. <media:title type="html">TransferBitbucket3</media:title>
  632. </media:content>
  633.  
  634. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket4.png?w=150" medium="image">
  635. <media:title type="html">TransferBitbucket4</media:title>
  636. </media:content>
  637.  
  638. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket5.jpg?w=800" medium="image">
  639. <media:title type="html">TransferBitbucket5</media:title>
  640. </media:content>
  641.  
  642. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket6.jpg?w=800" medium="image">
  643. <media:title type="html">TransferBitbucket6</media:title>
  644. </media:content>
  645.  
  646. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket7.jpg" medium="image">
  647. <media:title type="html">TransferBitbucket7</media:title>
  648. </media:content>
  649.  
  650. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket8.jpg?w=300" medium="image">
  651. <media:title type="html">TransferBitbucket8</media:title>
  652. </media:content>
  653.  
  654. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket11.jpg?w=300" medium="image">
  655. <media:title type="html">TransferBitbucket11</media:title>
  656. </media:content>
  657.  
  658. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket12.jpg?w=300" medium="image">
  659. <media:title type="html">TransferBitbucket12</media:title>
  660. </media:content>
  661.  
  662. <media:content url="https://xcellerant.files.wordpress.com/2016/03/transferbitbucket13.jpg?w=300" medium="image">
  663. <media:title type="html">TransferBitbucket13</media:title>
  664. </media:content>
  665. </item>
  666. <item>
  667. <title>Handling Errors in an XPages RPC Method</title>
  668. <link>http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/</link>
  669. <comments>http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/#comments</comments>
  670. <pubDate>Wed, 17 Feb 2016 12:07:26 +0000</pubDate>
  671. <dc:creator><![CDATA[Brad Balassaitis]]></dc:creator>
  672. <category><![CDATA[JavaScript]]></category>
  673. <category><![CDATA[JSON RPC]]></category>
  674. <category><![CDATA[SSJS]]></category>
  675. <category><![CDATA[Uncategorized]]></category>
  676. <category><![CDATA[XPages]]></category>
  677.  
  678. <guid isPermaLink="false">http://xcellerant.net/?p=2770</guid>
  679. <description><![CDATA[The Remote Service (aka xe:jsonRPCService) is an extremely useful control in XPages because it examples client- and server-side code interaction, runs asynchronously, performs well, and is easy to use. But if you don&#8217;t handle errors well, it can fail quietly and the user may never know. In this post, I&#8217;ll show how to handle client- [&#8230;]<img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2770&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
  680. <content:encoded><![CDATA[<p>The Remote Service (aka xe:jsonRPCService) is an extremely useful control in XPages because it examples client- and server-side code interaction, runs asynchronously, performs well, and is easy to use. But if you don&#8217;t handle errors well, it can fail quietly and the user may never know. In this post, I&#8217;ll show how to handle client- and server-side JavaScript errors with an RPC method.</p>
  681. <h4>Remote Procecure Example</h4>
  682. <p>As a starting point, let&#8217;s look at an example of a simple RPC method that returns the date and time and displays it for the user.</p>
  683. <h5>RPC Control</h5>
  684. <p>Here&#8217;s the XPages component source:</p>
  685. <pre class="brush: plain; title: ; notranslate">
  686. &lt;xe:jsonRpcService id=&quot;jsonRpcService1&quot; serviceName=&quot;myRPCService&quot;&gt;
  687.  &lt;xe:this.methods&gt;
  688.    &lt;xe:remoteMethod name=&quot;myMethod&quot; script=&quot;return myLibraryFunction();&quot;&gt;
  689.    &lt;/xe:remoteMethod&gt;
  690.  &lt;/xe:this.methods&gt;
  691. &lt;/xe:jsonRpcService&gt;
  692. </pre>
  693. <p>The service name is <strong>myRPCService</strong>. The method, <strong>myMethod</strong> takes no parameters and just calls an SSJS library function named <strong>myLibraryFunction()</strong>.</p>
  694. <h5>SSJS Library Function</h5>
  695. <p>Here&#8217;s the SSJS function that it calls:</p>
  696. <pre class="brush: plain; title: ; notranslate">
  697. function myLibraryFunction() {
  698.  var d = new Date();
  699.  return d.toLocaleString();
  700. }
  701. </pre>
  702. <h5>Client-Side JavaScript</h5>
  703. <p>Here&#8217;s the code that calls the RPC method:</p>
  704. <pre class="brush: plain; title: ; notranslate">
  705. myRPCService.myMethod().addCallback(function (response) {
  706.  alert('response: ' + response);
  707. })
  708. </pre>
  709. <p>It calls the method in the RPC service and attaches a callback function to wait for the response. It then displays the response to the user in an alert.</p>
  710. <p><img data-attachment-id="2796" data-permalink="http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/rpc-error-handling-a/" data-orig-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-a.gif?w=800" data-orig-size="419,185" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RPC Error Handling &#8211; A" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-a.gif?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-a.gif?w=800?w=419" class="aligncenter size-full wp-image-2796" src="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-a.gif?w=800" alt="RPC Error Handling - A"   /></p>
  711. <h4>Handling Client-Side Errors</h4>
  712. <p>This works well and RPC functionality is awesome, but you have to be careful about how you handle errors.</p>
  713. <p>Take for example, this problematic update. This code ignores the response, but tries to display an invalid value (an undeclared variable) in an alert.</p>
  714. <pre class="brush: plain; title: ; notranslate">
  715. myRPCService.myMethod().addCallback(function (response) {
  716.  console.log('before');
  717.  alert ('Invalid variable: ' + myUndeclaredVariable);
  718.  console.log('after');
  719. })
  720. </pre>
  721. <p>When you run the code, it appears that nothing happens. The console shows the &#8216;before&#8217; statement, but it then fails quietly.</p>
  722. <p>Putting a try-catch block around it like this doesn&#8217;t help at all.</p>
  723. <pre class="brush: plain; title: ; notranslate">
  724. try {
  725.  myRPCService.myMethod().addCallback(function (response) {
  726.    console.log('before');
  727.    alert ('Invalid variable: ' + myUndeclaredVariable);
  728.    console.log('after');
  729.  })
  730. } catch (e) {
  731. alert('Error: ' + e.toString());
  732. }
  733. </pre>
  734. <p>This may seem a bit confusing, but it actually makes sense. The callback effectively runs in its own scope, so <strong><em>the error handling needs to be within the callback</em></strong> in order to fire when dealing with an RPC call.</p>
  735. <p>This code does the trick:</p>
  736. <pre class="brush: plain; title: ; notranslate">
  737. myRPCService.myMethod().addCallback(function (response) {
  738.  try {
  739.    console.log('before');
  740.    alert ('Invalid variable: ' + myUndeclaredVariable);
  741.    console.log('after');
  742.  } catch (e) {
  743.    alert('Error: ' + e.toString());
  744.  }
  745. })
  746. </pre>
  747. <p><img data-attachment-id="2795" data-permalink="http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/rpc-error-handling-b/" data-orig-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-b.gif?w=800" data-orig-size="437,181" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RPC Error Handling &#8211; B" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-b.gif?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-b.gif?w=800?w=437" class="aligncenter size-full wp-image-2795" src="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-b.gif?w=800" alt="RPC Error Handling - B"   /></p>
  748. <h4>Handling Server-Side Errors</h4>
  749. <p>If there&#8217;s an unhandled exception on the server-side code that runs (such as an error or forgetting to return a response), it also fails quietly, although it will show a few errors in the browser console.</p>
  750. <p><img data-attachment-id="2794" data-permalink="http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/rpc-error-handling-c/" data-orig-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-c.gif?w=800" data-orig-size="1556,101" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RPC Error Handling &#8211; C" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-c.gif?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-c.gif?w=800?w=800" class="alignnone size-full wp-image-2794" src="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-c.gif?w=800" alt="RPC Error Handling - C"   /></p>
  751. <p>If you expand the POST, you&#8217;ll see that it returns a stack trace for an RPC error.</p>
  752. <p>In this case, error handling in the client-side callback function doesn&#8217;t help at all, so it&#8217;s important to handle the error in the server-side code and return something that the callback can deal with.</p>
  753. <pre class="brush: plain; title: ; notranslate">
  754. function myLibraryFunction() {
  755.  try {
  756.    print (myUndeclaredVariable);
  757.    var d = new Date();
  758.    return d.toLocaleString();
  759.  } catch (e) {
  760.    return 'Error: ' + e.toString();
  761.  }
  762. }
  763. </pre>
  764. <p><img data-attachment-id="2793" data-permalink="http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/rpc-error-handling-d/" data-orig-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-d.gif?w=800" data-orig-size="385,187" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="RPC Error Handling &#8211; D" data-image-description="" data-medium-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-d.gif?w=800?w=300" data-large-file="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-d.gif?w=800?w=385" class="aligncenter size-full wp-image-2793" src="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-d.gif?w=800" alt="RPC Error Handling - D"   /></p>
  765. <p>Now, I&#8217;m returning a more informative message to the user about what went wrong.</p>
  766. <p>I generally like to set up my server-side methods to return an object to the callback function, because that way I can add as many properties as I want in order to return all of the information that I need. I generally include a property for a boolean value for whether the method was successful and another value that contains a success or error message. In the callback, those values can be checked and appropriate action can be taken accordingly.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/xcellerant.wordpress.com/2770/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/xcellerant.wordpress.com/2770/" /></a> <img alt="" border="0" src="http://pixel.wp.com/b.gif?host=xcellerant.net&#038;blog=41738142&#038;post=2770&#038;subd=xcellerant&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
  767. <wfw:commentRss>http://xcellerant.net/2016/02/17/handling-errors-in-an-xpages-rpc-method/feed/</wfw:commentRss>
  768. <slash:comments>4</slash:comments>
  769. <media:content url="http://1.gravatar.com/avatar/13a450ed3ef4221930c66adde4d2a7ef?s=96&#38;d=identicon&#38;r=G" medium="image">
  770. <media:title type="html">xcellerant</media:title>
  771. </media:content>
  772.  
  773. <media:content url="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-a.gif" medium="image">
  774. <media:title type="html">RPC Error Handling - A</media:title>
  775. </media:content>
  776.  
  777. <media:content url="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-b.gif" medium="image">
  778. <media:title type="html">RPC Error Handling - B</media:title>
  779. </media:content>
  780.  
  781. <media:content url="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-c.gif" medium="image">
  782. <media:title type="html">RPC Error Handling - C</media:title>
  783. </media:content>
  784.  
  785. <media:content url="https://xcellerant.files.wordpress.com/2016/02/rpc-error-handling-d.gif" medium="image">
  786. <media:title type="html">RPC Error Handling - D</media:title>
  787. </media:content>
  788. </item>
  789. </channel>
  790. </rss>
  791.  

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid RSS" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//xcellerant.wordpress.com/feed/

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda