{"id":1031,"date":"2010-07-03T13:48:50","date_gmt":"2010-07-03T17:48:50","guid":{"rendered":"http:\/\/www.dr-chuck.com\/csev-blog\/?p=1031"},"modified":"2011-12-17T12:33:47","modified_gmt":"2011-12-17T16:33:47","slug":"getting-oriented-with-shindig-i-e-shindig-hacking-for-dummies","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2010\/07\/getting-oriented-with-shindig-i-e-shindig-hacking-for-dummies\/","title":{"rendered":"Getting Oriented with Shindig (i.e. Shindig Hacking for Dummies)"},"content":{"rendered":"<p>First check out a copy of Shindig from Apache.<\/p>\n<pre>\r\nsvn checkout http:\/\/svn.apache.org\/repos\/asf\/shindig\/trunk\/ shindig\r\n<\/pre>\n<p>Then compile it.  The first compile will take a long time and will download a lot of artifacts.  You will want to be on a quick network connection <\/p>\n<pre>\r\nmvn\r\n<\/pre>\n<p>If your compile fails a unit test, try <b>mvn -Dmaven.test.skip=true<\/b><\/p>\n<p>You can also take a look at the <b>BUILD-JAVA<\/b> file in the main directory if you are having problems getting it to compile.  <\/p>\n<p>Then start the Jetty server:<\/p>\n<pre>\r\nmvn -Prun\r\n<\/pre>\n<p>You best friend will be the <a href=\"http:\/\/shindig.apache.org\/getting-started.html\" target=\"_new\">Shindig Getting Started<\/a>  page &#8211; it has lots of hints on what to do to explore your container.<\/p>\n<p>We will just hack a single bit of a gadget running in the sample container so click here:<\/p>\n<p><a href=\"http:\/\/localhost:8080\/samplecontainer\/samplecontainer.html\" target=\"_new\">http:\/\/localhost:8080\/samplecontainer\/samplecontainer.html<\/a><\/p>\n<p>You should see the &#8220;Social Hello World&#8221; gadget.   Now lets edit this file:<\/p>\n<pre>\r\nvi .\/target\/work\/webapp\/samplecontainer\/examples\/SocialHelloWorld.xml\r\n<\/pre>\n<p>And make the following change:<\/p>\n<pre>\r\n   gadgets.window.setTitle('Social Hello World');\r\n   <b>alert('Hello Chuck');<\/b>\r\n     var hellos = new Array('Hello World', 'Hallo Welt', 'Ciao a tutti',\r\n<\/pre>\n<p><a href=\"http:\/\/www.dr-chuck.com\/img\/2010\/shindig-dummies-01.png\" target=\"_new\"><img decoding=\"async\" src=\"http:\/\/www.dr-chuck.com\/img\/2010\/shindig-dummies-01.png\" width=\"300\" border=\"0\" align=\"right\"\/><\/a>You should see your little alert box when the page refreshes.  That is the end of &#8220;getting started&#8221;.<\/p>\n<p>Note that the <b>SocialHelloWorld.xml<\/b> file gets overwritten each time you recompile Shindig &#8211; so keep your modifications handy elsewhere to reapply after each <b>mvn install<\/b> &#8211; I like editing the gadget in target because then I just keep doing a refresh.<\/p>\n<p>To shut down the Jetty server, simply kill it (i.e. press CTRL-C in the command window on Mac\/Linux).<\/p>\n<p>Now here is a little weirdness when you change the gadget code.   I am never sure what exactly is needed to really do a full refresh.   Here are the things I generally try:<\/p>\n<ul>\n<li>Press Refresh in the Browser\n<li>Press the &#8220;Reset All&#8221; button\n<li>Clear the browser history if all else fails and your changes don&#8217;t seem to be getting reloaded\n<\/ul>\n<p>It seems as though there is *lots* of caching going on at several levels and you have to take increasingly drastic measures to get past it as you drop your code bits in.<\/p>\n<p><a href=\"http:\/\/www.dr-chuck.com\/csev-blog\/2010\/07\/adding-a-new-feature-to-shiding-for-learning\/\">Next post in the series.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>First check out a copy of Shindig from Apache. svn checkout http:\/\/svn.apache.org\/repos\/asf\/shindig\/trunk\/ shindig Then compile it. The first compile will take a long time and will download a lot of artifacts. You will want to be on a quick network connection mvn If your compile fails a unit test, try mvn -Dmaven.test.skip=true You can also [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1031","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/1031","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=1031"}],"version-history":[{"count":18,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/1031\/revisions"}],"predecessor-version":[{"id":2843,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/1031\/revisions\/2843"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=1031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=1031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=1031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}