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://tobysamples.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>Next Generation XPages</title>
  13. <atom:link href="https://tobysamples.wordpress.com/feed/" rel="self" type="application/rss+xml" />
  14. <link>https://tobysamples.wordpress.com</link>
  15. <description>Taking the XPages community by Storm</description>
  16. <lastBuildDate>Thu, 11 Feb 2016 14:06:54 +0000</lastBuildDate>
  17. <language>en</language>
  18. <sy:updatePeriod>
  19. hourly </sy:updatePeriod>
  20. <sy:updateFrequency>
  21. 1 </sy:updateFrequency>
  22. <generator>http://wordpress.com/</generator>
  23. <cloud domain='tobysamples.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
  24. <image>
  25. <url>https://s0.wp.com/i/buttonw-com.png</url>
  26. <title>Next Generation XPages</title>
  27. <link>https://tobysamples.wordpress.com</link>
  28. </image>
  29. <atom:link rel="search" type="application/opensearchdescription+xml" href="https://tobysamples.wordpress.com/osd.xml" title="Next Generation XPages" />
  30. <atom:link rel='hub' href='https://tobysamples.wordpress.com/?pushpress=hub'/>
  31. <item>
  32. <title>Node.js with Domino a Tutorial</title>
  33. <link>https://tobysamples.wordpress.com/2016/02/11/node-js-with-domino-a-tutorial/</link>
  34. <comments>https://tobysamples.wordpress.com/2016/02/11/node-js-with-domino-a-tutorial/#respond</comments>
  35. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  36. <pubDate>Thu, 11 Feb 2016 14:06:54 +0000</pubDate>
  37. <category><![CDATA[Uncategorized]]></category>
  38. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=127</guid>
  39.  
  40. <description><![CDATA[In my last blog I mentioned that I have been working with Node.js for a little while and wanted to share some of my education on the blog.  I thought a good way to do that would be to take an already existing tutorial application written for the MEAN stack(Mongo, Express, Angular, Node) and make it [&#8230;]]]></description>
  41. <content:encoded><![CDATA[<p>In my last blog I mentioned that I have been working with Node.js for a little while and wanted to share some of my education on the blog.  I thought a good way to do that would be to take an already existing tutorial application written for the MEAN stack(Mongo, Express, Angular, Node) and make it work with a Domino Database.</p>
  42. <p>We are going to be looking at this</p>
  43. <p><a href="https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular" rel="nofollow">https://scotch.io/tutorials/creating-a-single-page-todo-app-with-node-and-angular</a></p>
  44. <p>This is a great little tutorial that helps you write the obligatory todo app using node and Angular.  If you have little to no experience with Node or Angular, I highly recommend going through this tutorial.  But we are going to look at a couple parts of it and with very few modifications bind it to a Domino Database for its data instead of Mongo DB.</p>
  45. <p>The first step in this process is to install Node,  I won&#8217;t go through the instructions as they are platform specific and are mentioned in detail in many places on the web.</p>
  46. <p>Next we need to get the app in question, you can do that either by building out the tutorial or cloning down the git repository for the tutorial here:</p>
  47. <p>git clone <a href="https://github.com/scotch-io/node-todo.git" rel="nofollow">https://github.com/scotch-io/node-todo.git</a></p>
  48. <p>This will put the app in the node-todo folder.</p>
  49. <p>The next step is to connect it to a MongoDB which again you can get installation instructions all over the place.  Another option is to use a cloud hosted instance of Mongo.</p>
  50. <p>The last step is to modify the config/database.js with your mongodb URL.</p>
  51. <p>Once this is done you should be able to use the command line and in the node-todo folder call node server and your app will be up and running on port 3000.</p>
  52. <p>I know I went over a lot very quickly in this post, but the goal is to get to creating a new component to bind this app to Domino.  If you have any questions about how any of this works or are having problems going through the tutorial, let me know and I&#8217;ll see if I can lend a hand.</p>
  53. <p>In the next post I&#8217;ll describe a few of the working components so we have a good grasp of how they will interact with your Domino Database.</p>
  54. <p>&nbsp;</p>
  55. ]]></content:encoded>
  56. <wfw:commentRss>https://tobysamples.wordpress.com/2016/02/11/node-js-with-domino-a-tutorial/feed/</wfw:commentRss>
  57. <slash:comments>0</slash:comments>
  58. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  59. <media:title type="html">tsamples23</media:title>
  60. </media:content>
  61. </item>
  62. <item>
  63. <title>All the things&#8230;.</title>
  64. <link>https://tobysamples.wordpress.com/2016/02/09/all-the-things/</link>
  65. <comments>https://tobysamples.wordpress.com/2016/02/09/all-the-things/#respond</comments>
  66. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  67. <pubDate>Tue, 09 Feb 2016 13:48:30 +0000</pubDate>
  68. <category><![CDATA[Uncategorized]]></category>
  69. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=119</guid>
  70.  
  71. <description><![CDATA[I have not posted in way too long, thought I would dust off the blog and write a little.  I&#8217;ve been head down focusing on many new things since I last wrote, very few however have to do with XPages directly.  That being said I want to share all the things that I have been [&#8230;]]]></description>
  72. <content:encoded><![CDATA[<p>I have not posted in way too long, thought I would dust off the blog and write a little.  I&#8217;ve been head down focusing on many new things since I last wrote, very few however have to do with XPages directly.  That being said I want to share all the things that I have been learning through this blog.  I have plans to put together a few posts on node.js as both a transition from being a Domino Developer and many of the best practices for development using this platform.  I also have been doing quite a bit of Native IOS development with Swift.  This is an amazing language that I hope gets used in other platforms now that it is open sourced.  I&#8217;d like to share some of my thoughts on server-side dev vs client side dev.  Oh and Docker, how Docker can make your life easier as a developer and an admin and a user, pretty much anyone.  Soon I hope to share all the things&#8230;</p>
  73. ]]></content:encoded>
  74. <wfw:commentRss>https://tobysamples.wordpress.com/2016/02/09/all-the-things/feed/</wfw:commentRss>
  75. <slash:comments>0</slash:comments>
  76. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  77. <media:title type="html">tsamples23</media:title>
  78. </media:content>
  79. </item>
  80. <item>
  81. <title>XPages on Bluemix is Live!</title>
  82. <link>https://tobysamples.wordpress.com/2015/07/10/xpages-on-bluemix-is-live/</link>
  83. <comments>https://tobysamples.wordpress.com/2015/07/10/xpages-on-bluemix-is-live/#comments</comments>
  84. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  85. <pubDate>Fri, 10 Jul 2015 11:06:06 +0000</pubDate>
  86. <category><![CDATA[Uncategorized]]></category>
  87. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=113</guid>
  88.  
  89. <description><![CDATA[Its Live!  This morning after a long wait the XSP Buildpack and Domino Datasource became available on IBM Bluemix.  I&#8217;m so excited for this opportunity to use Domino on IBMs new PAAS.  I have many questions about how it is setup and how thing work.  I&#8217;m curious about how to deal with OSGI plugins and [&#8230;]]]></description>
  90. <content:encoded><![CDATA[<p>Its Live!  This morning after a long wait the XSP Buildpack and Domino Datasource became available on IBM Bluemix.  I&#8217;m so excited for this opportunity to use Domino on IBMs new PAAS.  I have many questions about how it is setup and how thing work.  I&#8217;m curious about how to deal with OSGI plugins and code outside of an NSF. I&#8217;m interested to find out how we can change the policy settings for the Security Manager on the JVM.  I have lots of questions but for now happy playing!</p>
  91. <p><strong>UPDATE</strong></p>
  92. <p>It doesn&#8217;t appear that the new extension library that will contain the Designer tools has been released yet.  I&#8217;ll let you know as soon as I know.  However you should be able to update your apps using the CF Command line tools.</p>
  93. <p><a href="https://tobysamples.files.wordpress.com/2015/07/capture.jpg"><img data-attachment-id="114" data-permalink="https://tobysamples.wordpress.com/2015/07/10/xpages-on-bluemix-is-live/capture/" data-orig-file="https://tobysamples.files.wordpress.com/2015/07/capture.jpg" data-orig-size="139,196" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Toby Samples&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1436508165&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="Capture" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/07/capture.jpg?w=139" data-large-file="https://tobysamples.files.wordpress.com/2015/07/capture.jpg?w=139" class="alignnone size-full wp-image-114" src="https://tobysamples.files.wordpress.com/2015/07/capture.jpg?w=634" alt="Capture"   /></a></p>
  94. ]]></content:encoded>
  95. <wfw:commentRss>https://tobysamples.wordpress.com/2015/07/10/xpages-on-bluemix-is-live/feed/</wfw:commentRss>
  96. <slash:comments>1</slash:comments>
  97. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  98. <media:title type="html">tsamples23</media:title>
  99. </media:content>
  100.  
  101. <media:content url="https://tobysamples.files.wordpress.com/2015/07/capture.jpg" medium="image">
  102. <media:title type="html">Capture</media:title>
  103. </media:content>
  104. </item>
  105. <item>
  106. <title>JAX-RS or THE way to do REST in Domino Part 4</title>
  107. <link>https://tobysamples.wordpress.com/2015/07/09/jax-rs-or-the-way-to-do-rest-in-domino-part-4/</link>
  108. <comments>https://tobysamples.wordpress.com/2015/07/09/jax-rs-or-the-way-to-do-rest-in-domino-part-4/#comments</comments>
  109. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  110. <pubDate>Thu, 09 Jul 2015 03:29:24 +0000</pubDate>
  111. <category><![CDATA[Uncategorized]]></category>
  112. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=111</guid>
  113.  
  114. <description><![CDATA[If you&#8217;ve ever created a REST service you know one of the first problems you&#8217;ll run into is that you can only call that service from the same domain that it lives on.  Because of Cross Origin Resource Sharing security issues, The browser will not allow it unless the service includes certain HTTP headers, namely headers [&#8230;]]]></description>
  115. <content:encoded><![CDATA[<p>If you&#8217;ve ever created a REST service you know one of the first problems you&#8217;ll run into is that you can only call that service from the same domain that it lives on.  Because of Cross Origin Resource Sharing security issues, The browser will not allow it unless the service includes certain HTTP headers, namely headers that start &#8220;Access-Control-Allow&#8221; This information is explained in great detail on the Mozilla Developer Network site <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS">here</a>.  In Domino adding these http headers to the response can be done differently based on what service you are using.  In XPages or in an NSF it can be done directly via a Phase Listener.  In DAS it can be sort of done by adding custom headers on the Domino Server Config.  It can also be done when writing a custom OSGI plugin.</p>
  116. <p>In plugins you could write to the headers for each method that is specified in your resource, but most likely you want to write out the headers for everything that comes into your service.  The best way to handle it is with a Servlet Filter.  A Servlet Filter is some code that runs before the servlet that can manipulate the request/response and it runs on every request.</p>
  117. <p>In our example we add this simple Servlet Filter</p>
  118. <pre class="brush: java; title: ; notranslate">
  119.  
  120. import java.io.*;
  121. import javax.servlet.*;
  122. import javax.servlet.http.*;
  123.  
  124. public class CORSFilter implements Filter {
  125.  
  126. public CORSFilter() { }
  127.  
  128. public void init(FilterConfig fConfig) throws ServletException { }
  129.  
  130. public void destroy() { }
  131.  
  132. public void doFilter(
  133. ServletRequest request, ServletResponse response,
  134. FilterChain chain) throws IOException, ServletException {
  135.  
  136. ((HttpServletResponse)response).addHeader(&quot;Access-Control-Allow-Origin&quot;, &quot;*&quot;);
  137. ((HttpServletResponse)response).addHeader(&quot;Access-Control-Allow-Credentials&quot;, &quot;true&quot;);
  138. ((HttpServletResponse)response).addHeader(&quot;Access-Control-Allow-Methods&quot;, &quot;POST&quot;);
  139. ((HttpServletResponse)response).addHeader(&quot;Access-Control-Allow-Headers&quot;, &quot;Content-Type&quot;);
  140. ((HttpServletResponse)response).addHeader(&quot;Access-Control-Max-Age&quot;, &quot;86400&quot;);
  141.  
  142. chain.doFilter(request, response);
  143. }
  144. }
  145.  
  146. </pre>
  147. <p>It adds to the appropriate headers to every request that comes in and then delegates the request/response to the servlet.</p>
  148. <p>The only other config change that needs to be made is to specify the filter in the web.xml</p>
  149. <pre class="brush: xml; title: ; notranslate">
  150.  
  151. &lt;filter&gt;
  152. &lt;filter-name&gt;CORSFilter&lt;/filter-name&gt;
  153. &lt;filter-class&gt;com.tobysamples.demo.wink.CORSFilter&lt;/filter-class&gt;
  154. &lt;/filter&gt;
  155. &lt;filter-mapping&gt;
  156. &lt;filter-name&gt;CORSFilter&lt;/filter-name&gt;
  157. &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
  158. &lt;/filter-mapping&gt;
  159.  
  160. </pre>
  161. <p>This puts a pattern on which urls will have the filter applied.  So as you can see this technique is simple and allows for complete flexibility as to what headers are sent down to the client.  So now you can build out your Domino Service and call it from other web apps.</p>
  162. ]]></content:encoded>
  163. <wfw:commentRss>https://tobysamples.wordpress.com/2015/07/09/jax-rs-or-the-way-to-do-rest-in-domino-part-4/feed/</wfw:commentRss>
  164. <slash:comments>2</slash:comments>
  165. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  166. <media:title type="html">tsamples23</media:title>
  167. </media:content>
  168. </item>
  169. <item>
  170. <title>JAX-RS or THE way to do REST in Domino Part 3.5</title>
  171. <link>https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/</link>
  172. <comments>https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/#respond</comments>
  173. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  174. <pubDate>Wed, 01 Jul 2015 04:30:00 +0000</pubDate>
  175. <category><![CDATA[Uncategorized]]></category>
  176. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=102</guid>
  177.  
  178. <description><![CDATA[Soooo, I know I said the last segment was my last on this, but I thought I could share one other really cool thing about using JAX-RS.  Using JAX-RS allows you as a developer to avoid not only parsing JSON but also having intermediary objects like JsonJavaObject from IBM Commons.  It does this by allowing [&#8230;]]]></description>
  179. <content:encoded><![CDATA[<p>Soooo, I know I said the last segment was my last on this, but I thought I could share one other really cool thing about using JAX-RS.  Using JAX-RS allows you as a developer to avoid not only parsing JSON but also having intermediary objects like JsonJavaObject from IBM Commons.  It does this by allowing you to add in a mapper for both XML and JSON.  Which means you can have a model object that you develop and it will know how to translate it to and from JSON.</p>
  180. <p>The basic tip is that you have to add one more method to your Wink Application Class, getSingleton.  This method basically lets you setup the mapper and add it to the framework.</p>
  181. <p>The code to add this is as follows:</p>
  182. <pre class="brush: java; title: ; notranslate">
  183.  
  184. @Override
  185. public Set&lt;Object&gt; getSingletons() {
  186. Set&lt;Object&gt; s = new HashSet&lt;Object&gt;();
  187. ObjectMapper mapper = new ObjectMapper();
  188. AnnotationIntrospector primary = new JaxbAnnotationIntrospector();
  189. AnnotationIntrospector secondary = new JacksonAnnotationIntrospector();
  190. AnnotationIntrospector pair = new AnnotationIntrospector.Pair(primary,     secondary);
  191. mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
  192. mapper.getSerializationConfig().setAnnotationIntrospector(pair);
  193. JacksonJaxbJsonProvider jaxbProvider = new   JacksonJaxbJsonProvider();
  194. jaxbProvider.setMapper(mapper);
  195. s.add(jaxbProvider);
  196. return s;
  197.  
  198. }
  199.  
  200. </pre>
  201. <p>For this code to work, you have to have in your classpath the jackson jar file.</p>
  202. <p>Once you have added the jar file to your WebContent\Web-INF\lib\ folder</p>
  203. <p><a href="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg"><img data-attachment-id="105" data-permalink="https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/jackson/" data-orig-file="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg" data-orig-size="277,120" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Toby Samples&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1435779711&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="jackson" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg?w=277" data-large-file="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg?w=277" class="alignnone size-full wp-image-105" src="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg?w=634" alt="jackson"   srcset="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg 277w, https://tobysamples.files.wordpress.com/2015/07/jackson.jpg?w=150&amp;h=65 150w" sizes="(max-width: 277px) 100vw, 277px" /></a></p>
  204. <p>added it to the libaries tab in your Build Configuration</p>
  205. <p><a href="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg"><img data-attachment-id="107" data-permalink="https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/jackson3/" data-orig-file="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg" data-orig-size="804,175" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Toby Samples&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1435779860&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="jackson3" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=300" data-large-file="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=634" class="alignnone size-full wp-image-107" src="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=634&#038;h=138" alt="jackson3" width="634" height="138" srcset="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=634&amp;h=138 634w, https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=150&amp;h=33 150w, https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=300&amp;h=65 300w, https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg?w=768&amp;h=167 768w, https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg 804w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
  206. <p>you also need to add it to the Classpath Section in the plugin.xml under the runtime tab.</p>
  207. <p><img loading="lazy" data-attachment-id="106" data-permalink="https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/jackson2/" data-orig-file="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg" data-orig-size="1190,605" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;Toby Samples&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1435779736&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="jackson2" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=300" data-large-file="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=634" class="alignnone size-full wp-image-106" src="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=634&#038;h=322" alt="jackson2" width="634" height="322" srcset="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=634&amp;h=322 634w, https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=150&amp;h=76 150w, https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=300&amp;h=153 300w, https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=768&amp;h=390 768w, https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg?w=1024&amp;h=521 1024w, https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg 1190w" sizes="(max-width: 634px) 100vw, 634px" /></p>
  208. <p>Once you have that added to your class, now you can create Java classes and the framework will let you POST something like this:</p>
  209. <pre class="brush: plain; title: ; notranslate">
  210.  
  211. {&quot;fname&quot;:&quot;Joe&quot;,&quot;lname&quot;:&quot;User&quot;,&quot;email&quot;:&quot;test@test.com&quot;,&quot;phone&quot;:&quot;123.456.7841&quot;,&quot;birthdate&quot;:54544444}
  212.  
  213. </pre>
  214. <p>at this method</p>
  215. <pre class="brush: java; title: ; notranslate">
  216.  
  217. @Path(&quot;/toby&quot;)
  218. @POST
  219. @Consumes(MediaType.APPLICATION_JSON)
  220. @Produces(MediaType.APPLICATION_JSON)
  221. public MyBean postMessage(MyBean mybean) {
  222. mybean.setFname(&quot;Toby&quot;);
  223. return mybean;
  224. }
  225.  
  226. </pre>
  227. <p>The method gets the data and converts it to a MyBean object automatically then I change it and send it back to the client and it comes down as JSON all without me adding anything to handle the JSON, except for the annotations.</p>
  228. <p>It&#8217;s pretty magical really.</p>
  229. <p>Hope you get some mileage out of this info.</p>
  230. ]]></content:encoded>
  231. <wfw:commentRss>https://tobysamples.wordpress.com/2015/07/01/jax-rs-or-the-way-to-do-rest-in-domino-part-3-5/feed/</wfw:commentRss>
  232. <slash:comments>0</slash:comments>
  233. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  234. <media:title type="html">tsamples23</media:title>
  235. </media:content>
  236.  
  237. <media:content url="https://tobysamples.files.wordpress.com/2015/07/jackson.jpg" medium="image">
  238. <media:title type="html">jackson</media:title>
  239. </media:content>
  240.  
  241. <media:content url="https://tobysamples.files.wordpress.com/2015/07/jackson3.jpg" medium="image">
  242. <media:title type="html">jackson3</media:title>
  243. </media:content>
  244.  
  245. <media:content url="https://tobysamples.files.wordpress.com/2015/07/jackson2.jpg" medium="image">
  246. <media:title type="html">jackson2</media:title>
  247. </media:content>
  248. </item>
  249. <item>
  250. <title>JAX-RS or THE way to do REST in Domino Part 3</title>
  251. <link>https://tobysamples.wordpress.com/2015/06/29/jax-rs-or-the-way-to-do-rest-in-domino-part-3/</link>
  252. <comments>https://tobysamples.wordpress.com/2015/06/29/jax-rs-or-the-way-to-do-rest-in-domino-part-3/#comments</comments>
  253. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  254. <pubDate>Mon, 29 Jun 2015 03:11:54 +0000</pubDate>
  255. <category><![CDATA[Uncategorized]]></category>
  256. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=100</guid>
  257.  
  258. <description><![CDATA[In the last segment of this series I pointed you to use a couple of resources from  my github as templates, but didn&#8217;t really specify how those work or how to add your own services.  I hope to finish the series today with some explanation of those resources. Web.xml The Web.xml is the configuration in [&#8230;]]]></description>
  259. <content:encoded><![CDATA[<p>In the last segment of this series I pointed you to use a couple of resources from  my github as templates, but didn&#8217;t really specify how those work or how to add your own services.  I hope to finish the series today with some explanation of those resources.</p>
  260. <p>Web.xml</p>
  261. <p>The Web.xml is the configuration in all Java EE apps.  It basically sets up the configuration for the application.  The application I have specified has a single servlet, which is defined by the wink framework.</p>
  262. <p>org.apache.wink.server.internal.servlet.RestServlet</p>
  263. <p>This servlet looks for a class of type &#8220;<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax">javax</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws">ws</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws.rs">rs</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws.rs.core">core</a>.Application&#8221;</p>
  264. <p>So your application will need a class that extends it.  In the web.xml its specified in the init-param</p>
  265. <p>&lt;init-param&gt;<br />
  266. &lt;param-name&gt;javax.ws.rs.Application&lt;/param-name&gt;<br />
  267. &lt;param-value&gt;com.tobysamples.demo.wink.HelloWorldApplication&lt;/param-value&gt;<br />
  268. &lt;/init-param&gt;</p>
  269. <p>The web.xml also has a servlet mapping basically specifies what url the servlet will live at.  In the example it is &#8220;/rest*/  which basically means if the url has that pattern in it it will call the servlet and pass in the rest of the url for routing.</p>
  270. <p>HelloWorldApplication.java</p>
  271. <p>This is the aforementioned class that is referenced in the web.xml.  The only thing it really does is overrides the getClasses Method and returns back a Set of classes that contain Resources which are basically the rest services that are defined.</p>
  272. <p>HelloWorldResource.java</p>
  273. <p>This is basically the meat of the service.  It specifies two methods one for a GET request annotated by the @GET above it and one for a POST request, annotated by the @POST above it.  So in this class we specify what URL it will live at with the annotation above the class declaration</p>
  274. <p>@Path(&#8220;/helloworld&#8221;)</p>
  275. <p>JAX-RS methods need to return a &#8220;<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax">javax</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws">ws</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws.rs">rs</a>.<a class="header" href="%5C/Program%20Files%5C/IBM%5C/Domino%5C/osgi%5C/shared%5C/eclipse%5C/plugins%5C/org.apache.wink_1.1.2.20131004-1200%5C/lib%5C/jsr311-api-1.1.1.jar%3Cjavax.ws.rs.core">core</a>.Response&#8221; object.  We are creating and returning this object in both of these methods, JAX-RS has some nifty functionality for sending back different http codes and http headers.  For instance you can see in the getMessage method I am returning back a 200 http status code with a content-type http header of application/json</p>
  276. <p>ResponseBuilder builder = Response.ok(jjo.toString(), MediaType.APPLICATION_JSON);</p>
  277. <p>JAX-RS is the standard way of doing REST services in the Java EE world, so there are all kinds of plugins and documentation/blogs out there with tips and tricks of how to use it once you have it setup.  I would recommend the <a href="https://jsr311.java.net/nonav/releases/1.0/index.html">java doc</a> and the <a href="http://docs.oracle.com/javaee/6/tutorial/doc/giepu.html">tutorial </a>from Oracle on how to get started for some beginner lessons.  I know sometimes writing a xAgent or even a plain old agent is quicker, but to ensure that your code is decoupled and will even work outside of an XPages context this is probably your best way of creating a rest service.  Even IBM realized this as this is how DAS services is built in Domino.</p>
  278. ]]></content:encoded>
  279. <wfw:commentRss>https://tobysamples.wordpress.com/2015/06/29/jax-rs-or-the-way-to-do-rest-in-domino-part-3/feed/</wfw:commentRss>
  280. <slash:comments>2</slash:comments>
  281. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  282. <media:title type="html">tsamples23</media:title>
  283. </media:content>
  284. </item>
  285. <item>
  286. <title>JAX-RS or THE way to do REST in Domino Part 2</title>
  287. <link>https://tobysamples.wordpress.com/2015/06/23/jax-rs-or-the-way-to-do-rest-in-domino-part-2/</link>
  288. <comments>https://tobysamples.wordpress.com/2015/06/23/jax-rs-or-the-way-to-do-rest-in-domino-part-2/#comments</comments>
  289. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  290. <pubDate>Tue, 23 Jun 2015 07:55:45 +0000</pubDate>
  291. <category><![CDATA[Uncategorized]]></category>
  292. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=95</guid>
  293.  
  294. <description><![CDATA[In part 1 of this series you learned how to setup Eclispe to write OSGi plugins.  Next we get to create a plugin. 1.  On the menu click File -&#62; New -&#62; Plugin Project 2.  Add your Project name and use Eclipse 3.4 Click Next 3.  Make sure Generate an Activator is checked, change Execution [&#8230;]]]></description>
  295. <content:encoded><![CDATA[<p>In part 1 of this series you learned how to setup Eclispe to write OSGi plugins.  Next we get to create a plugin.</p>
  296. <p>1.  On the menu click File -&gt; New -&gt; Plugin Project</p>
  297. <p>2.  Add your Project name and use Eclipse 3.4 Click Next</p>
  298. <p>3.  Make sure Generate an Activator is checked, change Execution Environment to JavaSE 1.6, then Click Finish</p>
  299. <p>4.  Your on the Overview Page of the Plugin, were going to start going through all the tabs on the Plugin, next click the Dependencies Plugin</p>
  300. <p>5.  you&#8217;ll already have org.eclipse.core.runtime as a required plugin.  Go ahead and add com.ibm.pvc.webcontainer and org.apache.wink</p>
  301. <p>6.  On the right side of the page add all the packages that use *org.apache.wink* and lotus.domino and javax.servlet.http, javax.servet, and javax.servlet.jsp. Next click on the Extensions tab at the bottom.</p>
  302. <p>7.  Here you will add com.ibm.pvc.webcontainer.application</p>
  303. <p>7a.  Change the contextRoot Details on the right to /myurlpath</p>
  304. <p>7b.  Right-Click on com.ibm.pvc.webcontainer.application in the left window and add a new contentLocation, change it in the right window to &#8220;WebContent&#8221;</p>
  305. <p>8.  In the package explorer add a new toplevel folder called WebContent, inside that folder add another folder called WEB-INF, and finally inside of that folder add a file called web.xml.</p>
  306. <p>9.  Go back to the plugin.xml by double clicking on it.  then click on the Build Tab.  Check WebContent and bin folders to ensure they get included in the build.</p>
  307. <p>10.  Next we can start updating the web.xml,  I have an example one in my project on my github here:</p>
  308. <p><a href="https://github.com/tsamples/jaxrsondomino/blob/master/WebContent/WEB-INF/web.xml" rel="nofollow">https://github.com/tsamples/jaxrsondomino/blob/master/WebContent/WEB-INF/web.xml</a></p>
  309. <p>The web.xml points to the JAX-RS application we haven&#8217;t created yet, so you will also need to get the 2 Java files from the project here:</p>
  310. <p><a href="https://github.com/tsamples/jaxrsondomino/tree/master/src/com/tobysamples/demo/wink" rel="nofollow">https://github.com/tsamples/jaxrsondomino/tree/master/src/com/tobysamples/demo/wink</a></p>
  311. <p>Once you have added those 2 Java files and make sure the namespace matches what the web.xml has for it, you can fix the Activator.</p>
  312. <p>In the previous Java folder there is also an Activator.  if you Overwrite the Activator you have in your project with that one, it will start up wink without any issues.  Consequently this was the strangest part of getting this working, Apparently wink needs this small bit of code in the start method of the activator to ensure that it runs in the right Thread context.  With all of that done you now should have a working Plugin, now you just need to deploy it.  Lots of ways to do this, you can use hot deploy PDE if you have it installed. or you can Right-Click and Export as a Deploy-able Plugin and Fragment, then drop the created jar in &#8220;C:\Program Files\IBM\Domino\data\domino\workspace\applications\eclipse\plugins&#8221; and restart the http task on your server.  The last and more production efficent way of deploying these is by using the updatesite.nsf.  But first you will have to create a Feature and UpdateSite project.  There are great directions to do all of the General OSGi stuff here:</p>
  313. <p><a href="http://www-10.lotus.com/ldd/ddwiki.nsf/dx/creating_an_xpages_library#Create+the+library+class" rel="nofollow">http://www-10.lotus.com/ldd/ddwiki.nsf/dx/creating_an_xpages_library#Create+the+library+class</a></p>
  314. <p>Once deployed the URL will be <a href="http://servername/myurlpath/rest/helloworld" rel="nofollow">http://servername/myurlpath/rest/helloworld</a></p>
  315. <p>If you have any questions please let me know.  I know there are a lot of steps here and sometimes things can get lost in translation.  But once you do a couple of these most of it is just muscle memory.  I hope to create a video outlying how to do this in an easier follow along manner.  If that would be useful to you please comment and let me know.</p>
  316. ]]></content:encoded>
  317. <wfw:commentRss>https://tobysamples.wordpress.com/2015/06/23/jax-rs-or-the-way-to-do-rest-in-domino-part-2/feed/</wfw:commentRss>
  318. <slash:comments>7</slash:comments>
  319. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  320. <media:title type="html">tsamples23</media:title>
  321. </media:content>
  322. </item>
  323. <item>
  324. <title>JavaScript sugar of the day</title>
  325. <link>https://tobysamples.wordpress.com/2015/05/01/javascript-sugar-of-the-day/</link>
  326. <comments>https://tobysamples.wordpress.com/2015/05/01/javascript-sugar-of-the-day/#comments</comments>
  327. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  328. <pubDate>Fri, 01 May 2015 01:20:46 +0000</pubDate>
  329. <category><![CDATA[Uncategorized]]></category>
  330. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=90</guid>
  331.  
  332. <description><![CDATA[So I needed to use the slice function in the result of a getElementsByClassName() call.  Something like: var elements = document.getElementsByClassName(&#8216;MyClassName&#8217;); var copyOfElements = elements.slice(0); However this fails on the second line because slice is not a function on the elements objects.  The elements object is of type HTMLCollection, even though HTMLCollection appears very much like [&#8230;]]]></description>
  333. <content:encoded><![CDATA[<p>So I needed to use the slice function in the result of a getElementsByClassName() call.  Something like:</p>
  334. <p>var elements = document.getElementsByClassName(&#8216;MyClassName&#8217;);</p>
  335. <p>var copyOfElements = elements.slice(0);</p>
  336. <p>However this fails on the second line because slice is not a function on the elements objects.  The elements object is of type HTMLCollection, even though HTMLCollection appears very much like an array it isn&#8217;t exactly one, however there is a solution to be able to use slice with my object.</p>
  337. <p>It comes in the form of using the call method on the Function Type.  JavaScript unlike other languages allows you to get a handle on a Function just like its any other type.  So for instance if I return &#8216;MyString&#8217;.indexOf it literally gives me the Function Object.  Now once you understand that, you can see that maybe the Function Object has methods of its own.  One of these methods is &#8216;call&#8217;  what call allows you to do is basically inject your own object for the &#8216;this&#8217; of a Function.  In my example I can use the call method to use Array&#8217;s slice method on an object of another type, very easily.  Like so:</p>
  338. <p>var elements = document.getElementsByClassName(&#8216;MyClassName&#8217;);</p>
  339. <p>var copyOfElements = [].slice.call(elements, 0);</p>
  340. <p>However be careful of doing this as obviously not all objects are equal and therefore could cause you issues down the road if the structures and methods don&#8217;t line up.</p>
  341. ]]></content:encoded>
  342. <wfw:commentRss>https://tobysamples.wordpress.com/2015/05/01/javascript-sugar-of-the-day/feed/</wfw:commentRss>
  343. <slash:comments>1</slash:comments>
  344. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  345. <media:title type="html">tsamples23</media:title>
  346. </media:content>
  347. </item>
  348. <item>
  349. <title>JAX-RS or THE way to do REST in Domino Part 1</title>
  350. <link>https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/</link>
  351. <comments>https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/#comments</comments>
  352. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  353. <pubDate>Tue, 28 Apr 2015 03:00:50 +0000</pubDate>
  354. <category><![CDATA[Uncategorized]]></category>
  355. <category><![CDATA[IBM Domino]]></category>
  356. <category><![CDATA[Java]]></category>
  357. <category><![CDATA[JAX-RS]]></category>
  358. <category><![CDATA[REST Service]]></category>
  359. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=77</guid>
  360.  
  361. <description><![CDATA[The IBM Domino community has had servlets on its mind lately, and XAgents, and Rest Services.  These are all great advances to using IBM Domino in a modern world.  However to bring IBM Domino into a more modern age of Java Development we must go beyond just writing servlets like it was 1999.  The next [&#8230;]]]></description>
  362. <content:encoded><![CDATA[<p>The IBM Domino community has had servlets on its mind lately, and XAgents, and Rest Services.  These are all great advances to using IBM Domino in a modern world.  However to bring IBM Domino into a more modern age of Java Development we must go beyond just writing servlets like it was 1999.  The next few blog posts will show you how to setup a REST Service that uses JAX-RS and runs on Domino.  This will require creating an OSGi plugin.  I am going to assume you have never written such and will try to explain all of the pieces that need to be done and why.</p>
  363. <p>Below are the first few steps to create the plugin.</p>
  364. <p>1.  Download Vanilla Eclipse.  Any version should work, but I would recommend getting the latest, which is Eclispe Luna SR2.  Specifically the one for Java EE Developers.  Its available here:</p>
  365. <p><a href="http://eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr2" rel="nofollow">http://eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/lunasr2</a></p>
  366. <p>After its downloaded unzip it somewhere, There isn&#8217;t an install just a bunch of files that need to be on your hard drive somewhere.</p>
  367. <p>Once that done you can go about running it by executing &#8220;eclipse.exe&#8221; There are a few welcome screens that you can skip to get to the screen that is somewhat similar to Domino Designer Workspace.</p>
  368. <p>2a.  I&#8217;m making an assumption here that you are either running a local full Domino Server or you have File Access to an install.  If you don&#8217;t have either of these, you really should consider it as it will make all of your development work a lot easier, even your normal XPages work.</p>
  369. <p>To give you a little more understanding of how OSGi works, it helps to know that you are creating a bundle (plugin) and that it will interact with other bundles all within a container.  When dealing with Java in our XPages context we tend to think of Java as either source &#8220;.java&#8221; or libraries &#8220;.jar&#8221; files.  We need to add a third category of a bundle to create a plugin that does much.  So with that said we have to create whats called a &#8220;Target Platform&#8221;  inside of eclipse.  This is a profile of what environment will your bundle run in.  For our limited example all we need to add is the directories of where the Domino Bundles live.  There is a couple of them and its really just so our new Bundle can see those.</p>
  370. <p>From the Eclipse menu go to Window-&gt; Preferences.  This will open a dialog.  On the left side of the Dialog you should see Plug-in Development</p>
  371. <p><a href="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png"><img loading="lazy" data-attachment-id="80" data-permalink="https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/prefpane1/" data-orig-file="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png" data-orig-size="776,853" 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="prefpane1" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=273" data-large-file="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=634" class="alignnone size-full wp-image-80" src="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=634&#038;h=697" alt="prefpane1" width="634" height="697" srcset="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=634&amp;h=697 634w, https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=136&amp;h=150 136w, https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=273&amp;h=300 273w, https://tobysamples.files.wordpress.com/2015/04/prefpane1.png?w=768&amp;h=844 768w, https://tobysamples.files.wordpress.com/2015/04/prefpane1.png 776w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
  372. <p>Expand that section and you will see a new area called &#8220;Target Platform&#8221; Click on it and you should see a single platform called &#8220;Running Platform&#8221;, we will be creating a new one, so click &#8220;Add&#8221;</p>
  373. <p><img loading="lazy" data-attachment-id="81" data-permalink="https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/prefpane2/" data-orig-file="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png" data-orig-size="632,861" 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="prefpane2" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png?w=220" data-large-file="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png?w=632" class="alignnone  wp-image-81" src="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png?w=705&#038;h=960" alt="prefpane2" width="705" height="960" srcset="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png 632w, https://tobysamples.files.wordpress.com/2015/04/prefpane2.png?w=110&amp;h=150 110w, https://tobysamples.files.wordpress.com/2015/04/prefpane2.png?w=220&amp;h=300 220w" sizes="(max-width: 705px) 100vw, 705px" /></p>
  374. <p>From there it will prompt if you want to start from an old one or from scratch.   We will be creating one from scratch. So leave it on</p>
  375. <p>&#8220;Nothing: Start with an empty target definition&#8221;</p>
  376. <p><a href="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png"><img loading="lazy" data-attachment-id="83" data-permalink="https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/targetdef1/" data-orig-file="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png" data-orig-size="870,789" 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="targetdef1" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=300" data-large-file="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=634" class="alignnone size-full wp-image-83" src="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=634&#038;h=575" alt="targetdef1" width="634" height="575" srcset="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=634&amp;h=575 634w, https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=150&amp;h=136 150w, https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=300&amp;h=272 300w, https://tobysamples.files.wordpress.com/2015/04/targetdef1.png?w=768&amp;h=696 768w, https://tobysamples.files.wordpress.com/2015/04/targetdef1.png 870w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
  377. <p>In the Locations Tab you will Add 4 Directories</p>
  378. <p><a href="https://tobysamples.files.wordpress.com/2015/04/target1.png"><img loading="lazy" data-attachment-id="82" data-permalink="https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/target1/" data-orig-file="https://tobysamples.files.wordpress.com/2015/04/target1.png" data-orig-size="867,793" 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="target1" data-image-description="" data-image-caption="" data-medium-file="https://tobysamples.files.wordpress.com/2015/04/target1.png?w=300" data-large-file="https://tobysamples.files.wordpress.com/2015/04/target1.png?w=634" class="alignnone size-full wp-image-82" src="https://tobysamples.files.wordpress.com/2015/04/target1.png?w=634&#038;h=580" alt="target1" width="634" height="580" srcset="https://tobysamples.files.wordpress.com/2015/04/target1.png?w=634&amp;h=580 634w, https://tobysamples.files.wordpress.com/2015/04/target1.png?w=150&amp;h=137 150w, https://tobysamples.files.wordpress.com/2015/04/target1.png?w=300&amp;h=274 300w, https://tobysamples.files.wordpress.com/2015/04/target1.png?w=768&amp;h=702 768w, https://tobysamples.files.wordpress.com/2015/04/target1.png 867w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
  379. <p>C:\Program Files\IBM\Domino\data\domino\workspace\applications\eclipse\plugins\</p>
  380. <p>C:\Program Files\IBM\Domino\jvm\lib\ext\</p>
  381. <p>C:\Program Files\IBM\Domino\osgi\rcp\eclipse\plugins\</p>
  382. <p>C:\Program Files\IBM\Domino\osgi\shared\eclipse\plugins\</p>
  383. <p>Once you have completed these steps you now have setup Eclipse to be able to develop OSGi Bundles for Domino.  In the next part we will create the bundle and discuss each part of the plugin.xml that needs to be setup to create a JAX-RS Service.</p>
  384. ]]></content:encoded>
  385. <wfw:commentRss>https://tobysamples.wordpress.com/2015/04/28/jax-rs-or-the-way-to-do-rest-in-domino-part-1/feed/</wfw:commentRss>
  386. <slash:comments>6</slash:comments>
  387. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  388. <media:title type="html">tsamples23</media:title>
  389. </media:content>
  390.  
  391. <media:content url="https://tobysamples.files.wordpress.com/2015/04/prefpane1.png" medium="image">
  392. <media:title type="html">prefpane1</media:title>
  393. </media:content>
  394.  
  395. <media:content url="https://tobysamples.files.wordpress.com/2015/04/prefpane2.png" medium="image">
  396. <media:title type="html">prefpane2</media:title>
  397. </media:content>
  398.  
  399. <media:content url="https://tobysamples.files.wordpress.com/2015/04/targetdef1.png" medium="image">
  400. <media:title type="html">targetdef1</media:title>
  401. </media:content>
  402.  
  403. <media:content url="https://tobysamples.files.wordpress.com/2015/04/target1.png" medium="image">
  404. <media:title type="html">target1</media:title>
  405. </media:content>
  406. </item>
  407. <item>
  408. <title>Maven, and an easy way to use it with XPages</title>
  409. <link>https://tobysamples.wordpress.com/2015/04/13/maven-and-an-easy-way-to-use-it-with-xpages/</link>
  410. <comments>https://tobysamples.wordpress.com/2015/04/13/maven-and-an-easy-way-to-use-it-with-xpages/#comments</comments>
  411. <dc:creator><![CDATA[tsamples23]]></dc:creator>
  412. <pubDate>Mon, 13 Apr 2015 01:15:18 +0000</pubDate>
  413. <category><![CDATA[Uncategorized]]></category>
  414. <guid isPermaLink="false">http://tobysamples.wordpress.com/?p=73</guid>
  415.  
  416. <description><![CDATA[For some time now the Domino community, with good reason, has been very focused on using Java inside of Domino, specifically with XPages.  There are some great reasons to use Java, but one of the foremost reasons is support from the Java community in both word (Stackoverflow) and deed (Third party libraries).   These third [&#8230;]]]></description>
  417. <content:encoded><![CDATA[<p>For some time now the Domino community, with good reason, has been very focused on using Java inside of Domino, specifically with XPages.  There are some great reasons to use Java, but one of the foremost reasons is support from the Java community in both word (Stackoverflow) and deed (Third party libraries).   These third party libraries are a huge reason to be a Java developer.  They come in all shapes and sizes but in the end it means less code that you have to write that you can trust.  I&#8217;m sure that if you have been using Java for any length of time, you have probably searched for a library to do something, found it, and went to the download page, only to be presented with some XML tags instead of a download link.  These XML Tags might look like this:</p>
  418. <p>&lt;dependency&gt;<br />
  419. &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;<br />
  420. &lt;artifactId&gt;httpclient&lt;/artifactId&gt;<br />
  421. &lt;version&gt;4.1.1&lt;/version&gt;<br />
  422. &lt;/dependency&gt;</p>
  423. <p>This is the typical structure to add a Maven dependency to your project.</p>
  424. <p>Maven is an application that can do many things as listed below, however in this case we are using Maven as a package tool so that you when you go to build your project it will download any dependencies and (here is the key) any dependencies the dependencies have.  For Instance I might add the Social Business Toolkit as a dependency to my project.  When maven runs on my project it will download the apache http client library because its a dependency for the sbt.  I don&#8217;t have to mention the apache http client anywhere, Maven looks at the projects configuration and figure out its dependencies.</p>
  425. <ul>
  426. <li>Making the build process easy</li>
  427. <li>Providing a uniform build system</li>
  428. <li>Providing quality project information</li>
  429. <li>Providing guidelines for best practices development</li>
  430. <li>Allowing transparent migration to new features</li>
  431. </ul>
  432. <p>So with Domino we are use to having dependencies as JAR files instead of as a list in an XML file.  There is a way to make Maven build all of the Dependencies you have as a single JAR file.  Basically this will allow you to work inside of your project as you always have without adding a dependency on Maven and hopefully will make your life easier.</p>
  433. <p>Its really pretty simple also.</p>
  434. <p>Maven is an install-able executable that you can get from here:</p>
  435. <p><a href="https://maven.apache.org" rel="nofollow">https://maven.apache.org</a></p>
  436. <p>Once installed on your PC, you just have to make sure the mvn.exe is in your PATH environment variable</p>
  437. <p>So every project that is to be build with Maven requires a pom.xml this file describes what dependencies the project has among other things.</p>
  438. <p>So if you add a dependency like the apache http client above, when maven builds your project it will download the appropriate version for you.</p>
  439. <p>If you use the maven-assembly-plugin it will then build put all of the jars together into a single jar that you can add to an agent or an xpages project.</p>
  440. <p>So How do you do this you might be wondering. First you need a pom.xml file inside of an empty directory.  It needs some basic information about your project, Below is the a sample</p>
  441. <p>&nbsp;</p>
  442. <p>&lt;project xmlns=&#8221;<a href="http://maven.apache.org/POM/4.0.0&#038;#8243" rel="nofollow">http://maven.apache.org/POM/4.0.0&#038;#8243</a>; xmlns:xsi=&#8221;<a href="http://www.w3.org/2001/XMLSchema-instance&#038;#8221" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance&#038;#8221</a>;<br />
  443. xsi:schemaLocation=&#8221;<a href="http://maven.apache.org/POM/4.0.0" rel="nofollow">http://maven.apache.org/POM/4.0.0</a> <a href="http://maven.apache.org/xsd/maven-4.0.0.xsd&#8221;&#038;gt" rel="nofollow">http://maven.apache.org/xsd/maven-4.0.0.xsd&#8221;&#038;gt</a>;<br />
  444. &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br />
  445. &lt;groupId&gt;com.tobysamples.test&lt;/groupId&gt;<br />
  446. &lt;artifactId&gt;tsamples&lt;/artifactId&gt;<br />
  447. &lt;version&gt;0.1.0&lt;/version&gt;<br />
  448. &lt;packaging&gt;jar&lt;/packaging&gt;<br />
  449. &lt;name&gt;test&lt;/name&gt;<br />
  450. &lt;dependencies&gt;<br />
  451. &lt;dependency&gt;<br />
  452. &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;<br />
  453. &lt;artifactId&gt;httpclient&lt;/artifactId&gt;<br />
  454. &lt;version&gt;4.1.1&lt;/version&gt;<br />
  455. &lt;/dependency&gt;<br />
  456. &lt;/dependencies&gt;<br />
  457. &lt;build&gt;<br />
  458. &lt;plugins&gt;<br />
  459. &lt;plugin&gt;<br />
  460. &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;<br />
  461. &lt;executions&gt;<br />
  462. &lt;execution&gt;<br />
  463. &lt;phase&gt;package&lt;/phase&gt;<br />
  464. &lt;goals&gt;<br />
  465. &lt;goal&gt;single&lt;/goal&gt;<br />
  466. &lt;/goals&gt;<br />
  467. &lt;/execution&gt;<br />
  468. &lt;/executions&gt;<br />
  469. &lt;configuration&gt;<br />
  470. &lt;descriptorRefs&gt;<br />
  471. &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;<br />
  472. &lt;/descriptorRefs&gt;<br />
  473. &lt;/configuration&gt;<br />
  474. &lt;/plugin&gt;<br />
  475. &lt;/plugins&gt;<br />
  476. &lt;/build&gt;<br />
  477. &lt;/project&gt;</p>
  478. <p>&nbsp;</p>
  479. <p>So you can create a new pom.xml file with the above in it in an otherwise empty directory.</p>
  480. <p>Then all you have to do is change to that directory using the command line then run &#8220;mvn package&#8221;</p>
  481. <p>This will try to package all of the dependencies together as a single jar and save them in your directory.</p>
  482. <p>If you look in you will now see a Target directory that holds the jar that you can attach to your project.  Hopefully this will help some of you not get stuck in dependency hell that Java can be sometimes.</p>
  483. <p>Maven can get a little complex and is a whole new set of skills to learn, but they can and will make your life easier if you get your head wrapped around it.</p>
  484. ]]></content:encoded>
  485. <wfw:commentRss>https://tobysamples.wordpress.com/2015/04/13/maven-and-an-easy-way-to-use-it-with-xpages/feed/</wfw:commentRss>
  486. <slash:comments>1</slash:comments>
  487. <media:content url="https://1.gravatar.com/avatar/d196bef8368833e81b5987f0fe0caa3c8086ecc5c177c7820e02419b97e2a7fe?s=96&#38;d=identicon&#38;r=G" medium="image">
  488. <media:title type="html">tsamples23</media:title>
  489. </media:content>
  490. </item>
  491. </channel>
  492. </rss>
  493.  

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//tobysamples.wordpress.com/feed/

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