{"id":959,"date":"2016-10-13T19:31:49","date_gmt":"2016-10-13T18:31:49","guid":{"rendered":"http:\/\/elstarit.nl\/?p=959"},"modified":"2016-10-13T19:31:49","modified_gmt":"2016-10-13T18:31:49","slug":"cloudant-connector-plugin-update-manage-design-documents","status":"publish","type":"post","link":"https:\/\/elstarit.nl\/?p=959","title":{"rendered":"Cloudant connector plugin update: manage Design documents"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium\" src=\"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png\" alt=\"CloudantIBM\" width=\"150\" height=\"150\" \/><\/p>\n<p>Yesterday I was helping out\u00a0<a href=\"https:\/\/se.linkedin.com\/in\/patrickkwinten\" target=\"_blank\">Patrick Kwinten<\/a> with some he had with my Cloudant Connector plugin\u00a0on Slack. He asked also about the possibility to add or modify Design Documents, I found there foundation was already there.<\/p>\n<p>&nbsp;<\/p>\n<h3>Design Documents<\/h3>\n<p>Design documents can be seen as\u00a0the schema in your Cloudant database, which specify what is in the view and how the ftSearch index is build.<\/p>\n<p>Below is an example of a Design Document. As everything in Cloudant the syntax is JSON.<\/p>\n<p>[dropshadowbox align=&#8221;none&#8221; effect=&#8221;lifted-both&#8221; width=&#8221;auto&#8221; height=&#8221;&#8221; background_color=&#8221;#ffffff&#8221; border_width=&#8221;1&#8243; border_color=&#8221;#dddddd&#8221; ]<a href=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-960\" src=\"http:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments-300x140.png\" alt=\"Cloudant Design Document\" width=\"300\" height=\"140\" srcset=\"https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments-300x140.png 300w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments-768x360.png 768w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments-1024x479.png 1024w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments-534x250.png 534w, https:\/\/elstarit.nl\/wp-content\/uploads\/2016\/10\/Cloudant_DesignDocuments.png 1179w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>[\/dropshadowbox]<\/p>\n<p>&nbsp;<\/p>\n<h3>New methods<\/h3>\n<p>As I wrote before, the foundation was already laid in the plugin, the only I had to do was to expose them to the outside world. With this new methods you can programmatically create or update Design Documents.<\/p>\n<ul>\n<li>connector.getDocumentConnector().createDesignDocument(final Map&lt;String, String&gt; updates, final String designDocument)<\/li>\n<li>connector.getDocumentConnector().updateDesignDocument(final Map&lt;String, String&gt; updates, final String designDocument)<\/li>\n<\/ul>\n<p>updates, map of updates, where the value of the map is the javascript of the selection designDocument:<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nupdates.put(&quot;newUpdateHandler&quot;, &quot;function (doc, req) { ... }&quot;);\r\n<\/pre>\n<p>the name of the designDocument to create or update<\/p>\n<p>&nbsp;<\/p>\n<h3>Closing<\/h3>\n<p>Everything, including an updated ReadMe is in the <a href=\"https:\/\/bitbucket.org\/flinden68\/cloudant-connector\" target=\"_blank\">BitBucket repository<\/a>.<\/p>\n<p>Thanks to Patrick for the great <a href=\"https:\/\/quintessens.wordpress.com\/2016\/10\/13\/using-ibm-cloudant-with-xpages\/\" target=\"_blank\">blogpost<\/a> with boilerplate, where you can see the plugin in action.<\/p>\n<p>When you need help with the plugin, let me know or reach out to me on Slack as Patrick did.<\/p>\n<p>When you have feature request, please create an issue in the BitBucket Repository and I will have look if it will make it to the plugin.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday I was helping out\u00a0Patrick Kwinten with some he had with my Cloudant Connector plugin\u00a0on Slack. He asked also about the possibility to add or modify Design Documents, I found there foundation was already there. &nbsp; Design Documents Design documents can be seen as\u00a0the schema in your Cloudant database, which specify what is in the <a class=\"read-more\" href=\"https:\/\/elstarit.nl\/?p=959\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[22,2],"tags":[77,10,3,15,12],"class_list":["post-959","post","type-post","status-publish","format-standard","hentry","category-community","category-development","tag-cloudant","tag-developement","tag-java","tag-osgi","tag-xpages"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Cloudant connector plugin update: manage Design documents - elstar IT<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elstarit.nl\/?p=959\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cloudant connector plugin update: manage Design documents - elstar IT\" \/>\n<meta property=\"og:description\" content=\"Yesterday I was helping out\u00a0Patrick Kwinten with some he had with my Cloudant Connector plugin\u00a0on Slack. He asked also about the possibility to add or modify Design Documents, I found there foundation was already there. &nbsp; Design Documents Design documents can be seen as\u00a0the schema in your Cloudant database, which specify what is in the Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elstarit.nl\/?p=959\" \/>\n<meta property=\"og:site_name\" content=\"elstar IT\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-13T18:31:49+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png\" \/>\n<meta name=\"author\" content=\"flinden68\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"flinden68\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959\"},\"author\":{\"name\":\"flinden68\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\"},\"headline\":\"Cloudant connector plugin update: manage Design documents\",\"datePublished\":\"2016-10-13T18:31:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959\"},\"wordCount\":286,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.ibm.com\\\/analytics\\\/us\\\/en\\\/technology\\\/cloud-data-services\\\/cloudant\\\/images\\\/ibmcloudant-icon2.png\",\"keywords\":[\"cloudant\",\"developement\",\"java\",\"OSGi\",\"xpages\"],\"articleSection\":[\"community\",\"development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/elstarit.nl\\\/?p=959#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959\",\"url\":\"https:\\\/\\\/elstarit.nl\\\/?p=959\",\"name\":\"Cloudant connector plugin update: manage Design documents - elstar IT\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.ibm.com\\\/analytics\\\/us\\\/en\\\/technology\\\/cloud-data-services\\\/cloudant\\\/images\\\/ibmcloudant-icon2.png\",\"datePublished\":\"2016-10-13T18:31:49+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/elstarit.nl\\\/?p=959\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#primaryimage\",\"url\":\"http:\\\/\\\/www.ibm.com\\\/analytics\\\/us\\\/en\\\/technology\\\/cloud-data-services\\\/cloudant\\\/images\\\/ibmcloudant-icon2.png\",\"contentUrl\":\"http:\\\/\\\/www.ibm.com\\\/analytics\\\/us\\\/en\\\/technology\\\/cloud-data-services\\\/cloudant\\\/images\\\/ibmcloudant-icon2.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/?p=959#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/elstarit.nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"community\",\"item\":\"https:\\\/\\\/elstarit.nl\\\/?cat=22\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cloudant connector plugin update: manage Design documents\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#website\",\"url\":\"https:\\\/\\\/elstarit.nl\\\/\",\"name\":\"elstar IT\",\"description\":\"Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/elstarit.nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/elstarit.nl\\\/#\\\/schema\\\/person\\\/426456e816ad57bf411d5d2bb9768935\",\"name\":\"flinden68\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g\",\"caption\":\"flinden68\"},\"sameAs\":[\"http:\\\/\\\/www.elstarit.nl\",\"https:\\\/\\\/x.com\\\/elstarit\"],\"url\":\"https:\\\/\\\/elstarit.nl\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cloudant connector plugin update: manage Design documents - elstar IT","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elstarit.nl\/?p=959","og_locale":"en_US","og_type":"article","og_title":"Cloudant connector plugin update: manage Design documents - elstar IT","og_description":"Yesterday I was helping out\u00a0Patrick Kwinten with some he had with my Cloudant Connector plugin\u00a0on Slack. He asked also about the possibility to add or modify Design Documents, I found there foundation was already there. &nbsp; Design Documents Design documents can be seen as\u00a0the schema in your Cloudant database, which specify what is in the Read More","og_url":"https:\/\/elstarit.nl\/?p=959","og_site_name":"elstar IT","article_published_time":"2016-10-13T18:31:49+00:00","og_image":[{"url":"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png","type":"","width":"","height":""}],"author":"flinden68","twitter_misc":{"Written by":"flinden68","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elstarit.nl\/?p=959#article","isPartOf":{"@id":"https:\/\/elstarit.nl\/?p=959"},"author":{"name":"flinden68","@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935"},"headline":"Cloudant connector plugin update: manage Design documents","datePublished":"2016-10-13T18:31:49+00:00","mainEntityOfPage":{"@id":"https:\/\/elstarit.nl\/?p=959"},"wordCount":286,"commentCount":1,"image":{"@id":"https:\/\/elstarit.nl\/?p=959#primaryimage"},"thumbnailUrl":"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png","keywords":["cloudant","developement","java","OSGi","xpages"],"articleSection":["community","development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/elstarit.nl\/?p=959#respond"]}]},{"@type":"WebPage","@id":"https:\/\/elstarit.nl\/?p=959","url":"https:\/\/elstarit.nl\/?p=959","name":"Cloudant connector plugin update: manage Design documents - elstar IT","isPartOf":{"@id":"https:\/\/elstarit.nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/elstarit.nl\/?p=959#primaryimage"},"image":{"@id":"https:\/\/elstarit.nl\/?p=959#primaryimage"},"thumbnailUrl":"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png","datePublished":"2016-10-13T18:31:49+00:00","author":{"@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935"},"breadcrumb":{"@id":"https:\/\/elstarit.nl\/?p=959#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elstarit.nl\/?p=959"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/elstarit.nl\/?p=959#primaryimage","url":"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png","contentUrl":"http:\/\/www.ibm.com\/analytics\/us\/en\/technology\/cloud-data-services\/cloudant\/images\/ibmcloudant-icon2.png"},{"@type":"BreadcrumbList","@id":"https:\/\/elstarit.nl\/?p=959#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elstarit.nl\/"},{"@type":"ListItem","position":2,"name":"community","item":"https:\/\/elstarit.nl\/?cat=22"},{"@type":"ListItem","position":3,"name":"Cloudant connector plugin update: manage Design documents"}]},{"@type":"WebSite","@id":"https:\/\/elstarit.nl\/#website","url":"https:\/\/elstarit.nl\/","name":"elstar IT","description":"Fullstack | Java | Tech Speaker | Tech Coach | Frank van der Linden","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elstarit.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elstarit.nl\/#\/schema\/person\/426456e816ad57bf411d5d2bb9768935","name":"flinden68","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b915e82bbf3665adb6f7cef5acc5292b5958aec259f763ccde322ec72c643ec0?s=96&d=mm&r=g","caption":"flinden68"},"sameAs":["http:\/\/www.elstarit.nl","https:\/\/x.com\/elstarit"],"url":"https:\/\/elstarit.nl\/?author=1"}]}},"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=959"}],"version-history":[{"count":2,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions"}],"predecessor-version":[{"id":962,"href":"https:\/\/elstarit.nl\/index.php?rest_route=\/wp\/v2\/posts\/959\/revisions\/962"}],"wp:attachment":[{"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elstarit.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}