You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by co...@apache.org on 2016/09/13 07:59:59 UTC

svn commit: r1760489 - in /zeppelin/site/contribution: contributions.html documentation.html webapplication.html zeppelinweb/goodPracticeGuide01.html zeppelinweb/goodPracticeGuide02.html

Author: corneadoug
Date: Tue Sep 13 07:59:58 2016
New Revision: 1760489

URL: http://svn.apache.org/viewvc?rev=1760489&view=rev
Log:
Add new good practice page

Added:
    zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html
Modified:
    zeppelin/site/contribution/contributions.html
    zeppelin/site/contribution/documentation.html
    zeppelin/site/contribution/webapplication.html
    zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html

Modified: zeppelin/site/contribution/contributions.html
URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/contributions.html?rev=1760489&r1=1760488&r2=1760489&view=diff
==============================================================================
--- zeppelin/site/contribution/contributions.html (original)
+++ zeppelin/site/contribution/contributions.html Tue Sep 13 07:59:58 2016
@@ -109,6 +109,12 @@
   
     
       
+        
+      
+    
+  
+    
+      
     
   
     
@@ -248,6 +254,12 @@
         
       
     
+  
+    
+      
+        
+      
+    
   
     
       

Modified: zeppelin/site/contribution/documentation.html
URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/documentation.html?rev=1760489&r1=1760488&r2=1760489&view=diff
==============================================================================
--- zeppelin/site/contribution/documentation.html (original)
+++ zeppelin/site/contribution/documentation.html Tue Sep 13 07:59:58 2016
@@ -1,4 +1,5 @@
 
+
 <!DOCTYPE html>
 <html lang="en">
   <head>
@@ -93,7 +94,9 @@
     
       
         
-      
+          
+            <li><a href="/download.html">Download</a></li>
+          
         
       
     
@@ -107,10 +110,6 @@
     
       
         
-          
-            <li><a href="/download.html">Download</a></li>
-          
-        
       
     
   
@@ -120,13 +119,13 @@
   
     
       
-        
-      
     
   
     
       
-        
+    
+  
+    
       
     
   
@@ -134,6 +133,8 @@
       
         
       
+        
+      
     
   
     
@@ -150,14 +151,20 @@
   
     
       
+        
+      
     
   
     
       
+        
+      
     
   
     
       
+        
+      
     
   
 
@@ -204,6 +211,7 @@
 
     <div class="content">
       
+
 <div class="row">
   
     <div class="sideMenu col-sm-3">
@@ -250,12 +258,6 @@
     
       
         
-          
-            <li><a href="/contribution/webapplication.html">Web Application</a></li>
-          
-        
-      
-        
       
     
   
@@ -277,19 +279,25 @@
   
     
       
-        
-      
     
   
     
       
-        
+    
+  
+    
       
     
   
     
       
         
+          
+            <li><a href="/contribution/webapplication.html">Web Application</a></li>
+          
+        
+      
+        
       
     
   
@@ -307,14 +315,20 @@
   
     
       
+        
+      
     
   
     
       
+        
+      
     
   
     
       
+        
+      
     
   
 
@@ -346,32 +360,33 @@ limitations under the License.
 <p>For the more details, see <a href="https://help.github.com/articles/about-github-pages-and-jekyll/">help.github.com/articles/about-github-pages-and-jekyll/</a>.</p>
 
 <h3>Requirements</h3>
-<div class="highlight"><pre><code class="text language-text" data-lang="text"># ruby --version &gt;= 2.0.0
+<figure class="highlight"><pre><code class="language-text" data-lang="text"># ruby --version &gt;= 2.0.0
 # Install Bundler using gem
 gem install bundler
 
 cd $ZEPPELIN_HOME/docs
 # Install all dependencies declared in the Gemfile
 bundle install
-</code></pre></div>
+</code></pre></figure>
 <p>For the further information about requirements, please see <a href="https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/#requirements">here</a>.</p>
 
 <p>On OS X 10.9, you may need to do</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">xcode-select --install
-</code></pre></div>
+<figure class="highlight"><pre><code class="language-text" data-lang="text">xcode-select --install
+
+</code></pre></figure>
 <h3>Run the website locally</h3>
 
 <p>If you don&#39;t want to encounter uglily rendered pages, run the documentation site in your local first.</p>
 
 <p>In <code>$ZEPPELIN_HOME/docs</code> folder, run</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">bundle exec jekyll serve --watch
-</code></pre></div>
+<figure class="highlight"><pre><code class="language-text" data-lang="text">bundle exec jekyll serve --watch
+</code></pre></figure>
 <p>Using the above command, Jekyll will start a web server at <code>http://localhost:4000</code> and watch the <code>/docs</code> directory to update.</p>
 
 <h2>Folder Structure &amp; Components</h2>
 
 <p><code>docs/</code> folder is organized like below:</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">docs/
+<figure class="highlight"><pre><code class="language-text" data-lang="text">docs/
  ├── _includes/themes/zeppelin
  │   ├── _navigation.html
  │   └── default.html
@@ -396,7 +411,7 @@ bundle install
  ├── _config.yml
  ├── index.md
  └── ...
-</code></pre></div>
+</code></pre></figure>
 <ul>
 <li><code>_navigation.html</code>: the dropdown menu in navbar</li>
 <li><code>default.html</code> &amp; <code>_layouts/</code>: define default HTML layout</li>
@@ -419,35 +434,34 @@ bundle install
 
 <p>Every page contains <a href="https://jekyllrb.com/docs/frontmatter/">YAML front matter</a> block in their header. Don&#39;t forget to wrap the front matter list with triple-dashed lines(<code>---</code>) like below.
 The document page should start this triple-dashed lines. Or you will face 404 error, since Jekyll can&#39;t find the page.</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">---
+<figure class="highlight"><pre><code class="language-text" data-lang="text">---
 layout: page
 title: &quot;Apache Zeppelin Tutorial&quot;
 description: &quot;This tutorial page contains a short walk-through tutorial that uses Apache Spark backend. Please note that this tutorial is valid for Spark 1.3 and higher.&quot;
 group: quickstart
 ---
-</code></pre></div>
+</code></pre></figure>
 <ul>
 <li><code>layout</code>: the default layout is <code>page</code> which is defined in <code>_layout/page.html</code>.</li>
 <li><code>title</code>: the title for the document. Please note that if it needs to include <code>Zeppelin</code>, it should be <code>Apache Zeppelin</code>, not <code>Zeppelin</code>.</li>
 <li><code>description</code>: a short description for the document. One or two sentences would be enough. This description also will be shown as an extract sentence when people search pages.</li>
-<li><p><code>group</code>: a category for the document page, more than on group can be applied by using this syntax:</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">group:
-- group1
-- group2
-</code></pre></div></li>
+<li><code>group</code>: a category for the document page, more than on group can be applied by using this syntax:</li>
 </ul>
-
+<figure class="highlight"><pre><code class="language-text" data-lang="text"> group:
+ - group1
+ - group2
+</code></pre></figure>
 <h3>Headings</h3>
 
 <p>All documents are structured with headings. From these headings, you can automatically generate a <strong>Table of Contents</strong>. There is a simple rule for Zeppelin docs headings.</p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">#    Level-1 heading &lt;- used only for the main title
+<figure class="highlight"><pre><code class="language-text" data-lang="text">#    Level-1 heading &lt;- used only for the main title
 ##   Level-2 heading &lt;- start with this
 ###  Level-3 heading
 #### Level-4 heading &lt;- won&#39;t be converted in TOC from this level
-</code></pre></div>
+</code></pre></figure>
 <h3>Table of contents (TOC)</h3>
-<div class="highlight"><pre><code class="text language-text" data-lang="text">&lt;div id=&quot;toc&quot;&gt;&lt;/div&gt;
-</code></pre></div>
+<figure class="highlight"><pre><code class="language-text" data-lang="text">&lt;div id=&quot;toc&quot;&gt;&lt;/div&gt;
+</code></pre></figure>
 <p>Add this line below  <code># main title</code> in order to generate a <strong>Table of Contents</strong>.</p>
 
 <p>Headings until <code>### (Level-3 heading)</code> are included to TOC.</p>
@@ -473,9 +487,9 @@ group: quickstart
 
 <ol>
 <li><p>generate static website in <code>./_site</code></p>
-<div class="highlight"><pre><code class="text language-text" data-lang="text"># go to /docs under Zeppelin source
+<figure class="highlight"><pre><code class="language-text" data-lang="text"># go to /docs under Zeppelin source
 JEKYLL_ENV=production bundle exec jekyll build
-</code></pre></div></li>
+</code></pre></figure></li>
 <li><p>checkout ASF repo
 <code>
 svn co https://svn.apache.org/repos/asf/zeppelin asf-zeppelin
@@ -496,6 +510,24 @@ svn co https://svn.apache.org/repos/asf/
     </div>
 
     
+
+
+
+
+  <script type="text/javascript">
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-45176241-5', 'zeppelin.apache.org');
+  ga('require', 'linkid', 'linkid.js');
+  ga('send', 'pageview');
+
+</script>
+
+
+
   </body>
 </html>
 

Modified: zeppelin/site/contribution/webapplication.html
URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/webapplication.html?rev=1760489&r1=1760488&r2=1760489&view=diff
==============================================================================
--- zeppelin/site/contribution/webapplication.html (original)
+++ zeppelin/site/contribution/webapplication.html Tue Sep 13 07:59:58 2016
@@ -109,6 +109,12 @@
   
     
       
+        
+      
+    
+  
+    
+      
     
   
     
@@ -251,7 +257,17 @@
       
         
           
-            <li><a href="/contribution/zeppelinweb/goodPracticeGuide01.html">Defining Components</a></li>
+            <li><a href="/contribution/zeppelinweb/goodPracticeGuide01.html">1 - Defining Components</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+          
+            <li><a href="/contribution/zeppelinweb/goodPracticeGuide02.html">2 - Event Dispatching</a></li>
           
         
       

Modified: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html
URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html?rev=1760489&r1=1760488&r2=1760489&view=diff
==============================================================================
--- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html (original)
+++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide01.html Tue Sep 13 07:59:58 2016
@@ -4,7 +4,7 @@
 <html lang="en">
   <head>
     <meta charset="utf-8">
-    <title>Defining Components</title>
+    <title>1 - Defining Components</title>
     <meta name="description" content="">
     <meta name="author" content="The Apache Software Foundation">
 
@@ -109,6 +109,12 @@
   
     
       
+        
+      
+    
+  
+    
+      
     
   
     
@@ -251,7 +257,17 @@
       
         
           
-            <li class="active"><a href="/contribution/zeppelinweb/goodPracticeGuide01.html" class="active">Defining Components</a></li>
+            <li class="active"><a href="/contribution/zeppelinweb/goodPracticeGuide01.html" class="active">1 - Defining Components</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+          
+            <li><a href="/contribution/zeppelinweb/goodPracticeGuide02.html">2 - Event Dispatching</a></li>
           
         
       

Added: zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html
URL: http://svn.apache.org/viewvc/zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html?rev=1760489&view=auto
==============================================================================
--- zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html (added)
+++ zeppelin/site/contribution/zeppelinweb/goodPracticeGuide02.html Tue Sep 13 07:59:58 2016
@@ -0,0 +1,431 @@
+
+
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8">
+    <title>2 - Event Dispatching</title>
+    <meta name="description" content="">
+    <meta name="author" content="The Apache Software Foundation">
+
+    <!-- Enable responsive viewport -->
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+    <!--[if lt IE 9]>
+      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+
+    <!-- Le styles -->
+    <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet">
+    <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css">
+    <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet"  type="text/css" media="screen" /> 
+    <!-- Le fav and touch icons -->
+    <!-- Update these with your own images
+    <link rel="shortcut icon" href="images/favicon.ico">
+    <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+    -->
+
+    <!-- Js -->
+    <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
+    <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script>
+
+    <!-- atom & rss feed -->
+    <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
+    <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
+  </head>
+
+  <body>
+    
+        <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+      <div class="container">
+        <div class="navbar-header">
+          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+            <span class="sr-only">Toggle navigation</span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+          </button>
+          <a class="navbar-brand" href="/">
+            <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
+            Apache Zeppelin
+          </a>
+        </div>
+        <nav class="navbar-collapse collapse" role="navigation">
+          <ul class="nav navbar-nav navbar-right">
+            
+            
+            
+
+
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+        
+          
+            <li><a href="/community.html">Community</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+          
+            <li><a href="/download.html">Download</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+        
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+
+
+
+
+
+            <!-- Docs -->
+            <li id="docs">
+              <a href="#" data-toggle="dropdown" class="dropdown-toggle">Docs<b class="caret"></b></a>
+              <ul class="dropdown-menu">
+                <li><span><b>Release</b><span></li>
+                <li><a href="/docs/0.6.1">0.6.1</a></li>
+                <li><a href="/docs/0.6.0">0.6.0</a></li>
+                <li><a href="/docs/0.5.6-incubating">0.5.6-incubating</a></li>
+                <li><a href="/docs/0.5.5-incubating">0.5.5-incubating</a></li>
+                <li><a href="/docs/0.5.0-incubating">0.5.0-incubating</a></li>
+                <li role="separator" class="divider"></li>
+                <li><span><b>Snapshot</b>&nbsp;(development)<span></li>
+                <li><a href="/docs/0.7.0-SNAPSHOT">0.7.0-SNAPSHOT</a></li>
+              </ul>
+            </li>
+
+            <li><a href="https://github.com/apache/incubator-zeppelin">GitHub</a></li>
+
+            <!-- Apache -->
+            <li id="apache">
+              <a href="#" data-toggle="dropdown" class="dropdown-toggle">Apache<b class="caret"></b></a>
+               <ul class="dropdown-menu">
+                <li><a href="http://www.apache.org/foundation/how-it-works.html">Apache Software Foundation</a></li>
+                <li><a href="http://www.apache.org/licenses/">Apache License</a></li>
+                <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
+                <li><a href="/assets.html">Assets</a></li>
+                <li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+              </ul>
+            </li>
+          </ul>
+        </nav><!--/.navbar-collapse -->
+      </div>
+    </div>
+
+
+
+
+    <div class="content">
+      
+
+<div class="row">
+  
+    <div class="sideMenu col-sm-3">
+      
+      
+      
+
+
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+          
+            <li><a href="/contribution/zeppelinweb/goodPracticeGuide01.html">1 - Defining Components</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+          
+            <li class="active"><a href="/contribution/zeppelinweb/goodPracticeGuide02.html" class="active">2 - Event Dispatching</a></li>
+          
+        
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+    
+  
+    
+      
+        
+      
+        
+          
+            <li><a href="/contribution/webapplication.html">Web Application</a></li>
+          
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+    
+      
+        
+      
+    
+  
+
+
+
+
+    </div>
+    <div class="col-sm-9">
+      <!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+<h1>Event Dispatching in Angular</h1>
+
+<p><br/>
+AngularJS provides an Event dispatching system allowing the communication between controllers or services and controllers.</p>
+
+<p><code>$broadcast</code> dispatches the event downwards through the child scopes</p>
+
+<p><code>$emit</code> dispatches the event upwards through the scope hierarchy</p>
+
+<p><code>$on</code> catches the event passing by that scope</p>
+
+<p><br/>
+You can usually see it being used from <code>$rootScope</code> or <code>$scope</code></p>
+<figure class="highlight"><pre><code class="language-text" data-lang="text">$scope.$broadcast(&#39;eventName&#39;, arg);
+$rootScope.$broadcast(&#39;eventName&#39;, arg);
+
+$scope.$emit(&#39;eventName&#39;, arg);
+$rootScope.$emit(&#39;eventName&#39;, arg);
+
+$scope.$on(&#39;eventToCatch&#39;, function);
+$rootScope.$on(&#39;eventToCatch&#39;, function);
+</code></pre></figure>
+<p>Now, there are a few things to know about using it from <code>$rootScope</code>:</p>
+
+<ul>
+<li>Both <code>$rootScope.$emit</code> and <code>$rootScope.$broadcast</code> go through child scopes since <code>$rootScope</code> doesn&#39;t have a parent</li>
+<li><code>$rootScope.$emit</code> can only be received by <code>$rootScope.$on</code></li>
+<li><code>$rootScope.$broadcast</code> can be received by <code>$rootScope.$on</code> and <code>$scope.$on</code></li>
+<li><code>$rootScope.$on</code> listener needs to be removed by hand (Memory leak if forgotten)</li>
+</ul>
+
+<h4>How we are using it in the project</h4>
+
+<ul>
+<li>Usage of event dispatching should be limited if possible</li>
+<li>We only use <code>$rootScope.$broadcast</code> and <code>$scope.$on</code> for event dispatching/catching</li>
+</ul>
+
+<h4>Performances</h4>
+
+<p>Using <code>$broadcast</code> might not seem optimum if we consider the description we have above.</p>
+
+<p>However, it is optimized to only go through branches that have a matching event binding.
+(cf. <a href="http://www.bennadel.com/blog/2724-scope-broadcast-is-surprisingly-efficient-in-angularjs.htm">this post</a>)</p>
+
+    </div>
+  
+</div>
+
+
+      <hr>
+      <footer>
+        <!-- <p>&copy; 2016 The Apache Software Foundation</p>-->
+      </footer>
+    </div>
+
+    
+
+
+
+
+  <script type="text/javascript">
+  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+  ga('create', 'UA-45176241-5', 'zeppelin.apache.org');
+  ga('require', 'linkid', 'linkid.js');
+  ga('send', 'pageview');
+
+</script>
+
+
+
+  </body>
+</html>
+