<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2520666207174376438</id><updated>2024-09-04T19:45:59.508+05:30</updated><category term="GSoC 2012"/><category term="Technical"/><category term="Azure Media Stream"/><category term="Connector"/><category term="JWT"/><category term="OAuth2"/><category term="WSO2 ESB"/><title type='text'>Chanaka Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-718403729140436836</id><published>2016-01-21T10:23:00.000+05:30</published><updated>2016-01-21T13:03:00.242+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Azure Media Stream"/><category scheme="http://www.blogger.com/atom/ns#" term="JWT"/><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Stream Encrypted Video with Windows Azure Media Services</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
After a massive break I thought to write on the topic since there are lack of resources. I&#39;m streaming my AES encrypted video with JWT authentication and generating the auth token with Java. If you have &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/amq0&quot; target=&quot;_blank&quot;&gt;Azure Media Service enabled account&lt;/a&gt; you are welcome to try this out :).&lt;br /&gt;
&lt;br /&gt;
Following are couple of useful resources in the web for testing this process.&lt;br /&gt;
&lt;br /&gt;
JWT official site and token verification tool - &lt;a href=&quot;https://jwt.io/&quot;&gt;https://jwt.io/&lt;/a&gt;&lt;br /&gt;
Azure media player - &lt;a href=&quot;http://amsplayer.azurewebsites.net/azuremediaplayer.html&quot;&gt;http://amsplayer.azurewebsites.net/azuremediaplayer.html&lt;/a&gt;&lt;br /&gt;
Base64URL encoder - &lt;a href=&quot;http://kjur.github.io/jsjws/tool_b64uenc.html&quot;&gt;http://kjur.github.io/jsjws/tool_b64uenc.html&lt;/a&gt;&lt;br /&gt;
HMAC generator - &lt;a href=&quot;http://www.freeformatter.com/hmac-generator.html&quot;&gt;http://www.freeformatter.com/hmac-generator.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
At first we need to have encrypted videos uploaded to our Azure account. Following are the steps to doing that.&lt;br /&gt;
1. Login to &lt;a href=&quot;http://manage.windowsazure.com/&quot; rel=&quot;noreferrer&quot; target=&quot;_blank&quot;&gt;manage.windowsazure.com&lt;/a&gt;&lt;br /&gt;
2. Go inside your media service account&lt;br /&gt;
3. Click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Upload a video file&lt;/span&gt; link under &lt;span style=&quot;font-size: x-small;&quot;&gt;Managemant Tasks&lt;/span&gt; section (or else click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Content &lt;/span&gt;tab and then click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Upload Content&lt;/span&gt; link) and upload a video file.&lt;br /&gt;
4. Click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Process&lt;/span&gt; icon at the bottom, and click OK with default values.&lt;br /&gt;
5. Click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Sync Metadata&lt;span style=&quot;font-size: small;&quot;&gt; icon at the bottom (Probably this will take some time)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
6. Click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Encryption &amp;gt; Enable AES Encryption&lt;span style=&quot;font-size: small;&quot;&gt; (If the &lt;span style=&quot;font-size: x-small;&quot;&gt;Encryption&lt;/span&gt; icon not yet enable, logout and login again and try. It may take some time to enable that)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
7. Click on &lt;span style=&quot;font-size: x-small;&quot;&gt;Publish&lt;/span&gt; icon (SS for 4-7 &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/wdb1&quot;&gt;https://www.diigo.com/item/image/5j6wi/wdb1&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
Now you can copy the encrypted video publish URL which will be like : &lt;a href=&quot;http://chanaka.streaming.mediaservices.windows.net/481ea237-7f1f-48b8-a4c1-096f34c10cd6/Best%20Sweet%20Minions%20Video%20-%20Let%20The%20UFO%20Go%20Home.ism/Manifest&quot;&gt;http://chanaka.streaming.mediaservices.windows.net/481ea237-7f1f-48b8-a4c1-096f34c10cd6/Best%20Sweet%20Minions%20Video%20-%20Let%20The%20UFO%20Go%20Home.ism/Manifest&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Then go to &lt;span style=&quot;font-size: x-small;&quot;&gt;Content Protection&lt;/span&gt; tab and set up the necessary attributes like &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/sdh3&quot; target=&quot;_blank&quot;&gt;this SS&lt;/a&gt; and click on &lt;span style=&quot;font-size: x-small;&quot;&gt;manage verification keys&lt;/span&gt; button and &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/986t&quot; target=&quot;_blank&quot;&gt;regenerate primary key&lt;/a&gt;. And don&#39;t forget to save :)&lt;br /&gt;
&lt;br /&gt;
For streaming the above encrypted video, we need to create a JWT auth token which is the tricky part. Following is sample java code to generate the token.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;package azurejwttoken;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;

/**
 *
 * @author chanaka
 */
public class AzureJWTToken
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        // Use the Primary Verification Key which you regenerated
        String          secret              = &quot;YEAIfGy6cIXy1xhcIdgEoBfiWNoI3zq2FCKVQhdZXMcHGN+BAwicafgbRscsVZj1Us3RlWihphY1XMBuQOhlBg==&quot;;
        
        long            validitymillis      = 15 * 60 * 1000; // 15 minutes
        long            nowMillis           = System.currentTimeMillis();
        long            expireSeconds       = (nowMillis + validitymillis) / 1000; // Use seconds instead milli seconds
        
        String          jsonHeaderString    = &quot;{\&quot;typ\&quot;:\&quot;JWT\&quot;,\&quot;alg\&quot;:\&quot;HS256\&quot;}&quot;;
        
        // Use your ISSUER and SCOPE attributes properly here
        String          jsonBodyString      = &quot;{\&quot;iss\&quot;:\&quot;http://mytest.com/\&quot;,\&quot;aud\&quot;:\&quot;urn:jwttest\&quot;,\&quot;exp\&quot;:&quot; + expireSeconds + &quot;}&quot;;
        
        String          token               = getAuthToken(secret, jsonHeaderString, jsonBodyString);
        
        System.out.println(&quot;Token : &quot; + token);
    }
    
    public static String getAuthToken(String secret, String jsonHeaderString, String jsonBodyString)
    {
        String          token       = null;
        
        try
        {
            Mac             sha256_HMAC         = Mac.getInstance(&quot;HmacSHA256&quot;);
            SecretKeySpec   secret_key          = new SecretKeySpec(Base64.decodeBase64(secret), &quot;HmacSHA256&quot;);
            
            sha256_HMAC.init(secret_key);
            
            String          content             = Base64.encodeBase64URLSafeString(jsonHeaderString.getBytes()) + &quot;.&quot; + Base64.encodeBase64URLSafeString(jsonBodyString.getBytes());
            String          hash                = Base64.encodeBase64URLSafeString(sha256_HMAC.doFinal(content.getBytes()));
            
            token           = &quot;Bearer%3D&quot; + content + &quot;.&quot; + hash;
        }
        catch (NoSuchAlgorithmException ex)
        {
            Logger.getLogger(AzureJWTToken.class.getName()).log(Level.SEVERE, &quot;Error occured while generating AuthToken : NoSuchAlgorithmException&quot;, ex);
        }
        catch (InvalidKeyException ex)
        {
            Logger.getLogger(AzureJWTToken.class.getName()).log(Level.SEVERE, &quot;Error occured while generating AuthToken : InvalidKeyException&quot;, ex);
        }
        catch (Exception ex)
        {
            Logger.getLogger(AzureJWTToken.class.getName()).log(Level.SEVERE, &quot;Error occured while generating AuthToken&quot;, ex);
        }
        
        return token;
    }
    
    /**
     * In case you need to convert base64 string to URL safe manually ()
     * 
     * @param base64EncodedString
     * @return 
     */
    public static String replaceUrlSafeChars(String base64EncodedString)
    {
        base64EncodedString = base64EncodedString.replace(&#39;+&#39;, &#39;-&#39;);
        base64EncodedString = base64EncodedString.replace(&#39;/&#39;, &#39;_&#39;);
        base64EncodedString = base64EncodedString.replace(&quot;=&quot;, &quot;&quot;);
        
        return base64EncodedString;
    }
    
}&lt;/pre&gt;
&lt;br /&gt;
Using the &lt;a href=&quot;https://jwt.io/&quot; target=&quot;_blank&quot;&gt;JWT&lt;/a&gt; site we can verify the generated auth token. Just paste your token to JWT Debugger without the &lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&quot;Bearer%3D&quot;&lt;/b&gt;&lt;span style=&quot;font-size: small;&quot;&gt; part like &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/h1rv&quot; target=&quot;_blank&quot;&gt;this SS&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If it&#39;s correct you should be able to play it with &lt;a href=&quot;http://amsplayer.azurewebsites.net/azuremediaplayer.html&quot; target=&quot;_blank&quot;&gt;Azure media player&lt;/a&gt; like &lt;a href=&quot;https://www.diigo.com/item/image/5j6wi/b5aj&quot; target=&quot;_blank&quot;&gt;this SS&lt;/a&gt;. Note that token will expire after 15 minutes according to our code. You can increase that accordingly.&lt;br /&gt;
&lt;br /&gt;
Finally you can stream your video with following hard coded HTML source. Make sure you open the HTML with web server.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
  &amp;lt;iframe src=&quot;//aka.ms/azuremediaplayeriframe?url=http%3A%2F%2Fchanaka.streaming.mediaservices.windows.net%2F481ea237-7f1f-48b8-a4c1-096f34c10cd6%2FBest%2520Sweet%2520Minions%2520Video%2520-%2520Let%2520The%2520UFO%2520Go%2520Home.ism%2FManifest&amp;amp;protection=aes&amp;amp;token=Bearer%3DeyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbXl0ZXN0LmNvbS8iLCJhdWQiOiJ1cm46and0dGVzdCIsImV4cCI6MTQ1MzM1MjE2MH0.j6pe2Ej9aJJy0AvaqR7OI9FCcNTS1qI8y_EGzNYKT4g&amp;amp;autoplay=false&quot; name=&quot;azuremediaplayer&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; align=&quot;center&quot; height=&quot;280px&quot; width=&quot;500px&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&amp;lt;!--
Iframe src dynamic url parameter :
    url : URL encoded encrypted video URL - java.net.URLEncoder.encode(encryptedVedioURL, &quot;UTF-8&quot;)
    token : The token generated from the java code
--&amp;gt; &lt;/pre&gt;
&lt;br /&gt;
Hope you enjoy. Happy coding... :)&lt;br /&gt;
&lt;br /&gt;
I like to thank &lt;a href=&quot;https://www.linkedin.com/in/saliyar&quot; target=&quot;_blank&quot;&gt;Saliya Randunu&lt;/a&gt; for providing me lots of resources :)&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/718403729140436836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2016/01/stream-encrypted-video-with-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/718403729140436836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/718403729140436836'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2016/01/stream-encrypted-video-with-windows.html' title='Stream Encrypted Video with Windows Azure Media Services'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-7917141632640862082</id><published>2014-04-09T12:21:00.001+05:30</published><updated>2014-04-09T12:46:20.437+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Connector"/><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><category scheme="http://www.blogger.com/atom/ns#" term="WSO2 ESB"/><title type='text'>Getting Started with WSO2 ESB Connectors</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Enterprise Service Bus (ESB) is the infrastructure which provides the implementation of the concept of Service Oriented Architecture (SOA). The connectors are the new concept coming with the wso2 ESB version 4.8.0 and above. Connector is an intermediate API layer, which will represent a real world developer API, while being in the ESB itself. With this post, the initial steps to create a connector will be described.&lt;br /&gt;
&lt;br /&gt;
Download Maven&amp;nbsp;Dependencies:&lt;br /&gt;
You need to checkout the source code from &lt;a href=&quot;https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/mediation/mediation-library/connector-template-utils/org.wso2.carbon.mediation.library.connectors.connector-archetype/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&amp;nbsp;and run maven install command on it. It will download set of required dependencies&amp;nbsp;to your local maven repository. Following are the commands if you have a command line SVN and maven client.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$svn co&amp;nbsp;https://svn.wso2.org/repos/wso2/carbon/platform/branches/turing/components/mediation/mediation-library/connector-template-utils/org.wso2.carbon.mediation.library.connectors.connector-archetype/
$cd&amp;nbsp;org.wso2.carbon.connector/
$mvn clean install

&lt;/pre&gt;
Generate Connector Folder Structure:&lt;br /&gt;
Run the following maven command to generate maven project sample connector code.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$mvn archetype:generate -DarchetypeGroupId=org.wso2.carbon -DarchetypeArtifactId=org.wso2.carbon.mediation.library.connectors.connector-archetype -DarchetypeVersion=4.2.0 -DgroupId=org.wso2.carbon.connector -DartifactId=org.wso2.carbon.connector -Dversion=4.2.0&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
You may need give a name for the connector while processing the above process. (Let&#39;s proceed with entering &lt;b&gt;googlebooks&lt;/b&gt; as connector name.) If the project creation success, you are ready to develop a connector with the following directory structure.&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXFTFt54B8LO1oFffFjkbXtYP2P-CylzJtrdeQY1sVL8Wn61U7ziJJWrfIj-5scVpQUJ5poUGXe8iGMXvKuVvONRN2Q7W-4gdcPAJujAa4wwYTj1AXY10Xwt5RR2dZi5NTy27Rnkx7GU/s1600/tree.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXFTFt54B8LO1oFffFjkbXtYP2P-CylzJtrdeQY1sVL8Wn61U7ziJJWrfIj-5scVpQUJ5poUGXe8iGMXvKuVvONRN2Q7W-4gdcPAJujAa4wwYTj1AXY10Xwt5RR2dZi5NTy27Rnkx7GU/s1600/tree.PNG&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Fig. 1 : Connector Directory Structure&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Before developing, there are some main components which you need to know.&lt;br /&gt;
&lt;br /&gt;
Synapse Template : This is the component which calling to actual end point with the given request data. This will be placed in resources directory.&lt;br /&gt;
&lt;br /&gt;
Proxy : This will handle the request coming inside to the ESB and response coming from the actual end point. This is not a part of connector, but need to invoke the connector.&lt;br /&gt;
&lt;br /&gt;
Request : The request which follows the API published from the connector. This request can be REST or SOAP.&lt;br /&gt;
&lt;br /&gt;
Connector for which API ?&lt;br /&gt;
There are large number of services which is provide in the world wide web to do a specific functions. In order to use these for developers, there will be one or several web service APIs&amp;nbsp; like REST, SOAP or a client libraries in one or several languages are provided by the service provider. Out of these, REST will be the simplest one that others since it has less work. Here we are using Google Book REST API which does not need authentication for some of services like volume search.&lt;br /&gt;
&lt;br /&gt;
First we&#39;ll go the &lt;a href=&quot;https://developers.google.com/books/docs/v1/reference/&quot; target=&quot;_blank&quot;&gt;Google Books REST API documentation&lt;/a&gt;&amp;nbsp;and identify the categorization of the services in GoogleBooks API. The services are categories like Bookshelf, Volume, Bookshelf.volumes etc. So we&#39;ll create new&amp;nbsp;directory&amp;nbsp;&quot;volume&quot; under resources directory, to place services in the Volume category.&lt;br /&gt;
&lt;br /&gt;
Writing Synapse Template :&lt;br /&gt;
You can have a look on the sample Synapse template generated at helloWorld directory. Following synapse template is providing the service at&amp;nbsp;&lt;a href=&quot;https://developers.google.com/books/docs/v1/reference/volumes/list&quot; target=&quot;_blank&quot;&gt;list volume&lt;/a&gt;. This should be placed under &quot;volume&quot; directory as listVolume.xml.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;template name=&quot;listVolume&quot; xmlns=&quot;http://ws.apache.org/ns/synapse&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;parameter name=&quot;searchQuery&quot; description=&quot;Full-text search query string.&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;sequence&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name=&quot;uri.var.searchQuery&quot; expression=&quot;$func:searchQuery&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;call&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;endpoint&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;http method=&quot;get&quot;
uri-template=&quot;https://www.googleapis.com/books/v1/volumes?q={uri.var.searchQuery}&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/endpoint&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/call&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/sequence&amp;gt;
&amp;lt;/template&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
Create a component.xml file in &quot;volume&quot; directory, with following content.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;component name=&quot;googlebooks_volume&quot; type=&quot;synapse/template&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;subComponents&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;component name=&quot;listVolume&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;file&amp;gt;listVolume.xml&amp;lt;/file&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;description&amp;gt;List volumes matching for the given query.&amp;lt;/description&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/component&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/subComponents&amp;gt;
&amp;lt;/component&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Modify the conector.xml file by adding new dependency as below,&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;connector&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;component name=&quot;googlebooks&quot; package=&quot;org.wso2.carbon.connector&quot; &amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency component=&quot;helloWorld&quot;/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;dependency component=&quot;googlebooks_volume&quot;/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;description&amp;gt;wso2 sample connector library&amp;lt;/description&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/component&amp;gt;
&amp;lt;/connector&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Now you can build the connector code and test the implemented service foe volume search method. To build the connector, run maven clean install command from the org.wso2.carbon.connector directory.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$mvn clean install&lt;/pre&gt;
&lt;br /&gt;
This will generate googlebooks.zip file in the target directory. You can upload this zip file through the ESB interface under connector category. Make sure you enabled the connector after uploading.&lt;br /&gt;
&lt;br /&gt;
Writing Proxy :&lt;br /&gt;
Now you can invoke the implemented service for search volumes, by writing a proxy through ESB server interface. (Home&amp;gt;Manage&amp;gt;Services&amp;gt;Add&amp;gt;Proxy Service&amp;gt;Custom Proxy&amp;gt;switch to source view)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
&amp;lt;proxy xmlns=&quot;http://ws.apache.org/ns/synapse&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name=&quot;googlebooks_listVolume&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;transports=&quot;https,http&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;statistics=&quot;disable&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trace=&quot;disable&quot;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;startOnLoad=&quot;true&quot;&amp;gt;
&amp;nbsp; &amp;nbsp;&amp;lt;target&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;inSequence&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;property name=&quot;searchQuery&quot; expression=&quot;json-eval($.searchQuery)&quot;/&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;googlebooks.listVolume&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;searchQuery&amp;gt;{$ctx:searchQuery}&amp;lt;/searchQuery&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/googlebooks.listVolume&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;respond/&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/inSequence&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;outSequence&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;log/&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;send/&amp;gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/outSequence&amp;gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/target&amp;gt;
&amp;nbsp; &amp;nbsp;&amp;lt;description/&amp;gt;
&amp;lt;/proxy&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Request :&lt;br /&gt;
Using a REST client, send following request, (you can use &lt;a href=&quot;https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en&quot; target=&quot;_blank&quot;&gt;POSTMAN&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;POST /services/googlebooks_listVolume&amp;nbsp;HTTP/1.1
{
&amp;nbsp; &amp;nbsp; &quot;searchQuery&quot;:&quot;aladin&quot;
}&lt;/pre&gt;
&lt;br /&gt;
Hope you get the correct response ;)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/7917141632640862082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2014/04/getting-started-with-wso2-esb-connectors.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7917141632640862082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7917141632640862082'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2014/04/getting-started-with-wso2-esb-connectors.html' title='Getting Started with WSO2 ESB Connectors'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXFTFt54B8LO1oFffFjkbXtYP2P-CylzJtrdeQY1sVL8Wn61U7ziJJWrfIj-5scVpQUJ5poUGXe8iGMXvKuVvONRN2Q7W-4gdcPAJujAa4wwYTj1AXY10Xwt5RR2dZi5NTy27Rnkx7GU/s72-c/tree.PNG" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-4997457684740742771</id><published>2013-11-21T23:16:00.000+05:30</published><updated>2013-11-21T23:49:01.499+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="OAuth2"/><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>OAuth2 with LinkedIn</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
OAuth2 basically allows third party application, to access protected resource of a specific user. You may have seen some web applications/sites allows you to login through your Google, Facebook, LinkedIn etc accounts. As an exa&lt;span style=&quot;font-family: inherit;&quot;&gt;mple just try&amp;nbsp;&lt;a href=&quot;http://meta.stackoverflow.com/users/login?returnurl=%2fusers%2fauthenticate%2f%26dnoa.usersuppliedidentifier%3dhttps%253a%252f%252fwww.google.com%252faccounts%252fo8%252fid%26openid.mode%3dcancel%26openid.ns%3dhttp%253a%252f%252fspecs.openid.net%252fauth%252f2.0&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;with any mentioned account (Google, Facebook, Yahoo etc.). After giving your username password &lt;/span&gt;credentials you will be notified the authorities which the third party application will get if you agreed to proceed.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Some important term definitions in OAuth2:&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Resource Owner - The person/entity which capable of granting the access to a protected resource. &lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Resource Server - The server which contains the protected resources, and capable of deal with access tokens in protected resource requests.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Client - The application which requests for protected resources on behalf of resource owner.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;Authorization Server - The server which authorize resource owner, and issue access tokens to the client&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Following figure shows basic flow of OAuth2 authentication process.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl7vAdI8BMOnTnQmv18CDFXkV4LnenmBhzrhLEnwse9uARHO5ljr_HSS8SvDn2WX-0L-28bKrIFNrROzEp1uLY5cm2Hb7oYNRsgzJNLhIpSVfxblPPpgW_c1ruK7KuD2wK4FceKAPUkeM/s1600/OAuth2_Basic_Flow.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl7vAdI8BMOnTnQmv18CDFXkV4LnenmBhzrhLEnwse9uARHO5ljr_HSS8SvDn2WX-0L-28bKrIFNrROzEp1uLY5cm2Hb7oYNRsgzJNLhIpSVfxblPPpgW_c1ruK7KuD2wK4FceKAPUkeM/s1600/OAuth2_Basic_Flow.JPG&quot; height=&quot;240&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
If you are really interested in digging more details,&amp;nbsp;&lt;a href=&quot;http://tools.ietf.org/html/rfc6749&quot; target=&quot;_blank&quot;&gt;OAuth2 RFC&lt;/a&gt; will be the best resource. I strongly recommend you to go through at least up to 1.6 section in the RFC.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
With this blog post, I show you how&amp;nbsp;third party java application&amp;nbsp;can access protected LinkedIn resources.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. &lt;a href=&quot;https://www.linkedin.com/secure/developer&quot; target=&quot;_blank&quot;&gt;Register&lt;/a&gt; an application on LinkedIn. - This basically helps to create a link between LinkedIn and your application (third party application).&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
2. Get an access token - The access token represent the credentials to access protected resources. So your application does not need to store resource owner&#39;s credentials, but the access token.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
3. Make &lt;a href=&quot;https://developer.linkedin.com/apis&quot; target=&quot;_blank&quot;&gt;API calls&lt;/a&gt; - Yes, after obtaining access token you are free to call API methods with that, until it expires.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;https://developer.linkedin.com/documents/authentication&quot; target=&quot;_blank&quot;&gt;LinkedIn official documentation&lt;/a&gt; contains detailed description on the above steps. You can follow those and familiar with this matter. Make sure you tried both Authorization code request and Access token request.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now we need our application to store access token. For this we have to do some coding in the application. We can easily get authorization code with a GET request. Then we need a POST request to get access token using the authorization code and other required parameters.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
So, we can get the authorization code from request parameters in the redirect uri, and make server side code request to get the access token. For this we have to use a HTTP client library. You can use Apache HTTP client library components to approach this. For process the responce you can use XML parser like DOM or SAX. Try out the sample application yourself after reaing README file. Happy coding !&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;https://drive.google.com/file/d/0B5WvajuUkJNZZTN2SU1CbUhzeTg/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Download Source Code &lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Thanks to mkyong for making me comfortable with his &lt;a href=&quot;http://www.mkyong.com/spring-mvc/spring-mvc-hello-world-example/&quot; target=&quot;_blank&quot;&gt;SpingMVC example&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/4997457684740742771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2013/11/oauth2-with-linkedin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4997457684740742771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4997457684740742771'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2013/11/oauth2-with-linkedin.html' title='OAuth2 with LinkedIn'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl7vAdI8BMOnTnQmv18CDFXkV4LnenmBhzrhLEnwse9uARHO5ljr_HSS8SvDn2WX-0L-28bKrIFNrROzEp1uLY5cm2Hb7oYNRsgzJNLhIpSVfxblPPpgW_c1ruK7KuD2wK4FceKAPUkeM/s72-c/OAuth2_Basic_Flow.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-7658099764738115085</id><published>2013-01-08T01:13:00.000+05:30</published><updated>2017-07-18T23:09:36.688+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Limit textarea character count in IE8</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp; After long time I&#39;m going to start blogging again. Yes, it&#39;s on your &lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:DontVertAlignCellWithSp/&gt;
   &lt;w:DontBreakConstrainedForcedTables/&gt;
   &lt;w:DontVertAlignInTxbx/&gt;
   &lt;w:Word11KerningPairs/&gt;
   &lt;w:CachedColBalance/&gt;
  &lt;/w:Compatibility&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;
   &lt;m:brkBin m:val=&quot;before&quot;/&gt;
   &lt;m:brkBinSub m:val=&quot;--&quot;/&gt;
   &lt;m:smallFrac m:val=&quot;off&quot;/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val=&quot;0&quot;/&gt;
   &lt;m:rMargin m:val=&quot;0&quot;/&gt;
   &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;
   &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;
   &lt;m:intLim m:val=&quot;subSup&quot;/&gt;
   &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;favorite
&lt;/span&gt;browser IE :). As you know, with HTML 5 there is lots of additional features support for major browsers except IE. However it&#39;s nice to hear that IE10 is having more support for HTML 5.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With the HTML 5, maxlength attribute was introduced for textarea HTML element. But IE 8 does not have support for this. I did some work around to find a simple solution for this and seems I found it.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;text-center&quot; style=&quot;margin: 0 auto; text-align: center; width: 100%;&quot;&gt;
&lt;iframe align=&quot;middle&quot; border=&quot;0&quot; frameborder=&quot;0&quot; height=&quot;250&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;//rcm-na.amazon-adsystem.com/e/cm?o=1&amp;amp;p=12&amp;amp;l=ur1&amp;amp;category=wireless&amp;amp;banner=02HND5YJK5NEFPBWFS02&amp;amp;f=ifr&amp;amp;linkID=f23053137e8ae2c4416d3db3b6028e26&amp;amp;t=indro7-20&amp;amp;tracking_id=indro7-20&quot; style=&quot;border: none;&quot; width=&quot;300&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Make sure you are using HTML 5 doctype. Note that I have target only IE here, but not the already support browser for maxlength attribute in teaxtarea elements.&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;!DOCTYPE HTML&amp;gt;
&amp;lt;html&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
      function getCaret(el) {
        if (el.selectionStart) {
          return el.selectionStart;
        } else if (document.selection) {
          el.focus();
          var r = document.selection.createRange();
    
          if (r == null) {
            return 0;
          }
    
          var re = el.createTextRange(),
          rc = re.duplicate();
          re.moveToBookmark(r.getBookmark());
          rc.setEndPoint(&#39;EndToStart&#39;, re);
          return rc.text.length;
        }
        return 0;
      }
 
      function limitPasteData(obj, limit) {
        // Do it with Internet Explorer
        if (window.clipboardData) {
          if (document.selection &amp;amp;&amp;amp; document.selection.createRange) {
            obj.focus();
            var modifiedTxtLen;
            // If text has been selected
            if (document.selection.createRange().text.length &amp;gt; 0) {
              modifiedTxtLen = obj.value.length - document.selection.createRange().text.length + window.clipboardData.getData(&quot;Text&quot;).length;
    
              if (modifiedTxtLen &amp;gt; limit) {
                var neededLen = limit - (obj.value.length - document.selection.createRange().text.length);
                document.selection.createRange().text = window.clipboardData.getData(&quot;Text&quot;).substring(0, neededLen);
                return false;
              }
            } else {
              modifiedTxtLen = obj.value.length + window.clipboardData.getData(&quot;Text&quot;).length;
              if (modifiedTxtLen &amp;gt; limit) {
                var neededLen = limit - obj.value.length;
                var neededTxt = window.clipboardData.getData(&quot;Text&quot;).substring(0, neededLen);
                var mofifiedText = obj.value.substring(0, getCaret(obj)) + neededTxt + obj.value.substring(getCaret(obj), obj.value.length);
                obj.value = mofifiedText;
                return false;
              }
            }
            // If not exceed limit just paste it
            return true;
          }
        }
      }
    
      function limitTypingData(obj, limit) {
        // Other browsers may have support for maxlength attribute
        if (navigator.appName == &#39;Microsoft Internet Explorer&#39;) {
          if (obj.value.length &amp;gt; (limit - 1)) {
   
            if (document.selection &amp;amp;&amp;amp; document.selection.createRange) {
              obj.focus();
              // If only text has been selected, allow to type once
              if (document.selection.createRange().text.length &amp;gt; 0) {
                return true;
              }
            }
            return false;
          }
        }
      }
    &amp;lt;/script&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;textarea id=&quot;txtArea&quot; cols=&quot;20&quot; rows=&quot;5&quot; maxlength=&quot;15&quot;
        onpaste=&quot;return limitPasteData(this, 15);&quot;
        onkeypress=&quot;return limitTypingData(this, 15);&quot; &amp;gt;&amp;lt;/textarea&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; But remember that the behavior of these functions in IE8 will not 100% equal to default maxlength behavior of supporting browsers. But we can still do the work with this.&lt;br /&gt;
&lt;br /&gt;
Apart from that I would like to notice you that, new line character(s) may be changed in IE than others. IE always take it as &#39;\n\r&#39; and other browsers may take it as &#39;\n&#39;. So that, either you have to handle that or use additional space from the back end database fields.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Have a fun with IE 8 :D&lt;/div&gt;
&lt;link href=&quot;https://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;https://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;https://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/7658099764738115085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2013/01/limit-textarea-character-count-in-ie8.html#comment-form' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7658099764738115085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7658099764738115085'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2013/01/limit-textarea-character-count-in-ie8.html' title='Limit textarea character count in IE8'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-5680126935393433267</id><published>2012-09-06T19:43:00.000+05:30</published><updated>2012-09-06T19:47:26.936+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Code to interfaces, not to implementations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; In object oriented programming, interfaces are commonly used to implement more flexible software. Interfaces are very useful to extend and improve&amp;nbsp; a software application. While designing a software its a good practice to use interfaces where applicable.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Lets think about a simple CricketPlayer class (&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;Figure 1&lt;/i&gt;&lt;/span&gt;) with a method play(). There can be several classes and methods using CricketPlayer class. Think we need to give the support for Football player as well within this software. Then we need to repeat the wheel for new purpose(&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;Figure 2&lt;/i&gt;&lt;/span&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiusp1U-dvrMCzJUmdJSligYrK50dlxUzBCOIPsvOmG6Ub6omBBJS6JgFdhkUuG4raVdcPT7bEBymSIqt1PgeayfOlzxhvnTaLOJ8mykCR3TbWrR4d3pNT-Vmyd26ZGToLwOp0Ot69q4HQ/s1600/cricket_player(1).jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiusp1U-dvrMCzJUmdJSligYrK50dlxUzBCOIPsvOmG6Ub6omBBJS6JgFdhkUuG4raVdcPT7bEBymSIqt1PgeayfOlzxhvnTaLOJ8mykCR3TbWrR4d3pNT-Vmyd26ZGToLwOp0Ot69q4HQ/s1600/cricket_player(1).jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Figure 1 : Initial cricket class&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY00idg8UncoLEAitJcMCjxNHodh8LdtUYwTXagM9edMHderilHzo3Gf294cpHEL3iQBlyFlVx9OjqGa6tJ9NRFJaFmJITcakL5QSi3lr946NtnPBBJ9L16IBtingLaL7Wvvbg9CLKdGo/s1600/cricket_n_football_player.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY00idg8UncoLEAitJcMCjxNHodh8LdtUYwTXagM9edMHderilHzo3Gf294cpHEL3iQBlyFlVx9OjqGa6tJ9NRFJaFmJITcakL5QSi3lr946NtnPBBJ9L16IBtingLaL7Wvvbg9CLKdGo/s1600/cricket_n_football_player.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Figure 2 :Modification for support football player&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; But just think if we use common interface (&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;Figure 3&lt;/i&gt;&lt;/span&gt;) for any type of player, we can easily get rid of the problem. Player interface will have play() method which may be different behaviour for different players and getSport() method which represent the type of the player (sport). CricketPlayer and FootballPlayer subclasses can implement their own behaviours according to related declarations in the Player interface. Coding to this interface will save us with very limited changes, while any kind of player class is going to use in our software. Using an interface software can be extend easily and will be more generic.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQUz-x5s6ifbVEazj_t-11f6IW_LKUbm6VsXru0hgxMFnE5jtC_Qi8hjooAVkUOxaABRPWbzCfEH7car2wzlFVJnwu4Xdt2bGDRiYsDXJ1TuarOVB8fs0il5Nf75k2V0O2vOBh_tXjJk/s1600/player_interface(1).jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpQUz-x5s6ifbVEazj_t-11f6IW_LKUbm6VsXru0hgxMFnE5jtC_Qi8hjooAVkUOxaABRPWbzCfEH7car2wzlFVJnwu4Xdt2bGDRiYsDXJ1TuarOVB8fs0il5Nf75k2V0O2vOBh_tXjJk/s1600/player_interface(1).jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Figure 3 : Player interface&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Recently I saw practically very useful place where interfaces are using. Most of the industry applications are using the MVC architecture to better maintainability of the code. There may have requirements to use the same applications with different DBMS for different clients. Using an interface with n-tier architecture, this support can be easily implemented.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Following diagram (&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;Figure 4&lt;/i&gt;&lt;/span&gt;) shows the way of using this stratergy in n-tier architectural application. From the Controller classes which deals with request and responses while dealing with the business logic of the application, calls to the service classes to do specific data manipulation, transaction etc. Service classes calls to Dao classes which deals with data transactions. Service class doesn&#39;t directly use either MySqlUserDoa which has MySQL support or XQueryUserDoa which has XQuery support. It only care about BaseUserDao interface, and doesn&#39;t care about real object underling the BaseUserDao interface.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEL39JeGKgFgntW_xjZA-1mQvAh1kQRsC8v3RwHWRSAfJNwMKaMVDf3jhKsvxLtcNK4B5a8yjTJoKd36nyTEPd_DCDYNdHH6TkgMgs1Tr-5bI-KSUjbHtVQe0nSt4r9h4Rv0MWB53Aqus/s1600/dao_interface.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEL39JeGKgFgntW_xjZA-1mQvAh1kQRsC8v3RwHWRSAfJNwMKaMVDf3jhKsvxLtcNK4B5a8yjTJoKd36nyTEPd_DCDYNdHH6TkgMgs1Tr-5bI-KSUjbHtVQe0nSt4r9h4Rv0MWB53Aqus/s1600/dao_interface.jpg&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;i&gt;Figure 4 : Dao interface&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Implementaion under this process is quite simple.&amp;nbsp;Control class read configuration file (or from any other way) and get the Query Language supposed to use according to the requierments. Then create an object of supported Dao class and assigned to a variable of&amp;nbsp;BaseUserDao (interface) type. After this initializing process of&amp;nbsp;BaseUserDao&amp;nbsp;type&amp;nbsp;variable, it can be used by the service classes inside their functions.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;BaseUserDao userDao;
if (queryLanguage == &#39;MySQL&#39;) {
    userDao = new MySqlUserDao();
} else if (queryLanguage == &#39;XQuery&#39;) {
    userDao = new XQueryUserDao();
}
&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Since application is not creating concrete classes (objects are dynamically created in run time and will not directly creating objects for any case), it will not be limited. And since it uses an interface, switching for a new DBMS can be achieved by only adding new file which inherit the interface and modify the object creating process(modify above code) and giving the new DBMS as parameter, using a configuration file or any other way.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; Coding to interfaces, not to implementations principle is a good practice for a good software and it make our work more easy. If you are thinkng of creating extendable software application, this practice will very helpful. So, its time to play with interfaces. :)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/5680126935393433267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/09/code-to-interfaces-not-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5680126935393433267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5680126935393433267'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/09/code-to-interfaces-not-to.html' title='Code to interfaces, not to implementations'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiusp1U-dvrMCzJUmdJSligYrK50dlxUzBCOIPsvOmG6Ub6omBBJS6JgFdhkUuG4raVdcPT7bEBymSIqt1PgeayfOlzxhvnTaLOJ8mykCR3TbWrR4d3pNT-Vmyd26ZGToLwOp0Ot69q4HQ/s72-c/cricket_player(1).jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-4978298325598049432</id><published>2012-08-28T18:04:00.000+05:30</published><updated>2014-04-10T11:55:33.554+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Singleton with PHP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Singleton pattern is under creational design patterns which deals with mechanisms of creating objects according to the situation. I recently used this pattern with PHP. It&#39;s very important to get to know use of this pattern.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Singleton pattern can be used for always keep one object of a specific class while an application is running. It save the memory which is going to allocate for new objects of the class in every where inside the application. Singleton practically used for logger classes which provide global logging access point whithout logging each and every application after the main loggin operation, configuration classes which consist configuration data of an application, access resources which are in shared mode like multi threading applications, Factory design pattern which dynamically create the objects etc.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It&#39;s very easy to implement singleton with PHP (as well as other languages). What we need to do is make a private constructor and control the creating object of this class by a public method. Following code snippet shows how to do this.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;class MySingleton {

&amp;nbsp; &amp;nbsp; private static $instance = null;

&amp;nbsp; &amp;nbsp; public static function getInstance() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(is_null($this-&amp;gt;instance)) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;$this-&amp;gt;instance = new&amp;nbsp;MySingleton($params);
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&amp;nbsp;$this-&amp;gt;instance;
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; private function __construct($params) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // set parameters
&amp;nbsp; &amp;nbsp; }

&amp;nbsp; &amp;nbsp; public function doSomething() {
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // some code
&amp;nbsp; &amp;nbsp; }

}&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since the constructor is private only the class itself can be access the constructor. getInstance method is accessible for anywhere and since that is a static method it can be used anywhere without creating an object of this class. This function handles the situations of the need of a new instance of&amp;nbsp;MySingleton&amp;nbsp;class by calling the private constructor if needed. Static variable is used because of the restriction of using non-static fields inside static functions.&lt;br /&gt;
&lt;br /&gt;
In the places where needs to call doSomething method in MySingleton class, we call as,&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;MySingleton::getInstance()-&amp;gt;doSomething()&lt;/pre&gt;
or, if the functions inside the class is frequently used,&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot; style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;&quot;&gt;$my_singleton = MySingleton::getInstance();
$my_singleton -&amp;gt;doSomething()&lt;/pre&gt;
&lt;br /&gt;
It&#39;s very simple. Hope this helpful. Have a fun with singleton. :)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 


&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/4978298325598049432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/singleton-with-php.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4978298325598049432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4978298325598049432'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/singleton-with-php.html' title='Singleton with PHP'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-1891635776816471915</id><published>2012-08-25T00:30:00.000+05:30</published><updated>2012-08-25T00:30:23.554+05:30</updated><title type='text'>සැරයටියෙනුත් යනෙනා තුරා.....</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
කෙලිලොලෙන් ගතකරපු අපේ ඒ අතීතය.....&lt;br /&gt;මතකයක් පමණක්ම කර,&lt;br /&gt;
ඇයිද නුඹ අපව තනිකර ගිලිහුණේ.....&lt;br /&gt;&lt;br /&gt;ඒ අතීතය,&lt;br /&gt;හැමදාමත් අද ඊයේ වගේ දැනේවි,&lt;br /&gt;නුඹේ කතා කනට ඇසේවි,&lt;br /&gt;නුඹේ සිනහව හිතේ මැවේවි,&lt;br /&gt;&lt;br /&gt;ඒත්.....&lt;br /&gt;
නුඹේ කතාව, ඒ සිනහව&lt;br /&gt;මතු කිසිදිනෙක අප හැබැහින්ම නොවිදීවි.....&lt;br /&gt;&lt;br /&gt;නුඹ දමා ගියත් අපව,&lt;br /&gt;මිතුරෙකුව හදේ රැදී සිටී හැම දිනෙක.....&lt;br /&gt;&lt;br /&gt;මතු භවයෙදිත් අප මිතුදමින් බැදෙමු&lt;br /&gt;ඒත්.....&lt;br /&gt;මෙලෙස අකාලයේ ලොවම හැර දමා යන්නට නොව,&lt;br /&gt;සැරයටියෙනුත් ගමන් කරනා තෙක්ම.....&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/1891635776816471915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1891635776816471915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1891635776816471915'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/blog-post.html' title='සැරයටියෙනුත් යනෙනා තුරා.....'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-8494526501788634566</id><published>2012-08-20T21:31:00.000+05:30</published><updated>2012-08-20T21:34:03.166+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 13th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is the last week we interact with the coding and documenting under GSoC 2012 official time line. In my last week I implemented the feature request simple sort for process list. And improved some tests for PMA_DisplayResults class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week I did some improvements in tests of PMA_DisplayResults class. As the documentation, there were not much things to mention as details in Documentation.html. I only mentioned about the feature of displaying multiple results for queries as well as stored procedures. While I&#39;m implementing the functions phpdoc comments and block comments were improved. So those things make me easy in documenting session. A feature request I proposed to do at the end of the last week was already fixed (My patch has been accepted for that). So I didn&#39;t involve with that.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; Dieter has suggested to change the class structure for PMA_CommomFunctions class. After discussing in mailing list I decided to make any change after the GSoC 2012 session. I will be stop my further work related to code and documentation improvements under GSoC 2012 session by today.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week I&#39;ll submit my evaluation form. I wish all GSoCers who passed the mid evaluations to get success this Great event GSoC 2012 with Open source :)&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/8494526501788634566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-13th-week-progress.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/8494526501788634566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/8494526501788634566'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-13th-week-progress.html' title='GSoC 2012 - 13th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-8592864670845605350</id><published>2012-08-13T18:32:00.000+05:30</published><updated>2012-08-13T18:32:03.119+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 12th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Its more one week to do the remaining work of GSoC 2012 project. Last week I introduced new links inside information_schema database with modifying a previous code for showing links inside mysql database. As well support for MIME transformations in query results and VIEWs were implemented. More improvements related to VIEWs were done.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week I implement the feature request simple sort for process list. That was little older feature request and the description of the feature request itself suggested the fix. But with the time those files were changed and renamed. So I improve the behavior of server_status.php file to do the required thing. Since the sorting needs to specify the table, I used prcesslist table of information_schema database. Apart from these I did some test implementations for the functions in PMA_DisplayResults class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In my next week I&#39;m intending to improve some tests for PMA_DisplayResults classwhile doing any remaining minor improvements in my codes.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/8592864670845605350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-12th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/8592864670845605350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/8592864670845605350'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-12th-week-progress.html' title='GSoC 2012 - 12th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-3424109657509402355</id><published>2012-08-06T22:04:00.003+05:30</published><updated>2012-08-06T22:10:34.516+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 11th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is my 11th week of GSoC 2012 project. Its one more week to active work in code level. Last week I did some improvements on showing syntax highlighted SQL statement in PROCESSLIST table in information_schema database and introduce some links inside mysql database related to displaying data fields.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This week as the first task I introduce some links inside information_schema database. In previous week I implement same kind of thing but in more specific way to that task. So I change the previous implementation where it can be used to my new task. I changed the structure of the global variable $GLOBALS[&#39;mysql_schema_relation&#39;] and renamed it as $GLOBALS[&#39;special_schema_links&#39;] and renamed the file as special_schema_links.lib.php. The new structure of the array can be represented by following snippet.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$GLOBALS[&#39;special_schema_links&#39;] = array( 
    // Database name is the major element
    &#39;mysql&#39; =&amp;gt; array(
        // Table name
        &#39;db&#39; =&amp;gt; array(
            // Column name
            &#39;user&#39; =&amp;gt; array(
                // Main url param (can be an array where represent sql)
                &#39;link_param&#39; =&amp;gt; &#39;username&#39;,
                // Other url params
                &#39;link_dependancy_params&#39; =&amp;gt; array(
                    0 =&amp;gt; array(
                        // URL parameter name
                        // (can be array where url param has static value)
                        &#39;param_info&#39; =&amp;gt; &#39;hostname&#39;,
                        // Column name related to url param
                        &#39;column_name&#39; =&amp;gt; &#39;host&#39;                        
                    )
                ),
                // Page to link
                &#39;default_page&#39; =&amp;gt; &#39;server_privileges.php&#39;
            )
        )
    )
);
&lt;/pre&gt;
&lt;br /&gt;
By using this array, links can be generated where needed specially inside schema like mysql, information_schema etc.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next I moved into implement feature request for support MIME transformations in query results. Some of the query results which show only field with transformation and large data (blob fields etc) were not displayed their expected transformation in results. PMA has avoided that kind large data comparisons for SQL queries. So that, $where_clause parameter is not generating properly. So, assuming the length of the data fields will not same, I used the length of the data field to generate proper $where_clause and compare inside SQL query. Now query results display the expected out put with their transformations if any.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then I moved into give the support for transformed data for VIEWs. In PMA the columns with any transformation are stored inside column_info table of phpmyadmin database. But the problem was these information were not stored in column_info table while creating VIEWs. So I did some changes to store needed details of transformations in VIEWs whie creating them by the link (create view) in browse mode of a result set. A new file called tbl_views.lib.php was introduce to place related functions. &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As well when deleting a column, table, view or database the related information on transformations were not deleted from the column_info table. So I implement a function to delete relevant entries and placed the necessary places to do the work.&lt;br /&gt;
&lt;br /&gt;
In my next week I intend to implement the feature request on simple sort for server_processlist.php.&lt;br /&gt;
&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/3424109657509402355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-11th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/3424109657509402355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/3424109657509402355'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/08/gsoc-2012-11th-week-progress.html' title='GSoC 2012 - 11th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-1793225929220653153</id><published>2012-07-30T22:29:00.001+05:30</published><updated>2012-07-31T09:40:23.251+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 10th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is my 10th week of GSoC 2012 
project. In last week I implemented support for displaying results for 
multiple SQL query statements and stored routines with multiple queries.
 SQL query window can be used to both cases above.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; There
 were some issues in my previous code. So I first moved into fix one 
issue. It takes bit more time to fix it than I thought.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Then I moved into next feature implementation. Mainly there were two parts in this feature.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. Syntax highlighting for SQL in PROCESSLIST table in information_schema database&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
2. Relations inside mysql database&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For
 the first task, I used a new public property inside PMA_DisplayResults 
class which contains all the details of columns which need to be apply 
syntax&amp;nbsp;highlight effect. So 
that any other table field also can use this feature. Now the SQL field 
is syntax highlighted in PROCESSLIST table.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Second
 task is not related to actual relations with foreign keys, it means 
just link data rows to corresponding pages where possible. As an 
example, User column of db table in mysql database, can be linked to 
edit user privileges of corresponding user according to the User column 
value. A new file called mysql_schema_relation.lib.php has introduced 
which have a global variable with all the column information of tables 
which needs to be display as links where possible. From each element of 
this variable (array), one link can be generated.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$GLOBALS[&#39;mysql_schema_relation&#39;] = array(
    &#39;db&#39; =&amp;gt; array(        // db table in mysql schema
       &amp;nbsp;&#39;db&#39; =&amp;gt; array(    // Db column in db table
            // link_params array contains the get params,
            // if array element is string, value of parameter is set as column value
            // if any of array element is array, url param is the first data of the array and value is second data of the array
            &#39;link_params&#39; =&amp;gt; array(&#39;db&#39;),
            // This represent the page to link
            &#39;default_page&#39; =&amp;gt; &#39;index.php&#39;
        ),

        &#39;user&#39; =&amp;gt; array(    // User column of db table
            &#39;link_params&#39; =&amp;gt; array(&#39;username&#39;),
            &#39;default_page&#39; =&amp;gt; &#39;server_privileges.php&#39;
        )
    ),

    &#39;proc&#39; =&amp;gt; array(
        &#39;db&#39; =&amp;gt; array(
            &#39;link_params&#39; =&amp;gt; array(&#39;db&#39;),
            &#39;default_page&#39; =&amp;gt; &#39;index.php&#39;
        )
    ),

);
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Above
 array is represented as lowercase string array. So when comparing the 
strings those need to be convert to lowercase. (strtolower() function 
can be used.)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now
 there can be see several links inside mysql schema. In my next week 
I&#39;ll implement the feature, linking from information_schema to phpmyadmin
 schema.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/1793225929220653153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-10th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1793225929220653153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1793225929220653153'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-10th-week-progress.html' title='GSoC 2012 - 10th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-7353540474307538879</id><published>2012-07-23T23:11:00.000+05:30</published><updated>2012-07-23T23:17:05.759+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 9th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In last week I did some improvements in PMA_DisplayResults class and in test cases. This week I moved into implementation of a feature request. Its on display results for the multiple queries.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Multiple query execution can be done by using routines ( stored procedures and stored functions) or just executing SQL statement with multiple queries at once. In PMA those could be done by using SQL query window or using routines tab under any table.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PMA was not supported for executing multiple queries using the SQL query window. While executing it shows the results for the last single query in the multiple SQL statement. That was due to use of mysql_query() function for any case. Since mysql extension is currently not support for the multiple query execution I used mysqli_multi_query() function under mysqli extension. It returns multiple result sets depending on the executed SQL statement. By iterating through the results I displayed this resulted tables in the same page in top to bottom manner. And I made it with very limited operations on the results in same page. Unless it becomes more complex and hard to handle the code. Currently there are two known issue.&lt;br /&gt;
&lt;br /&gt;
1. After executing insert/ edit/ delete query using the query window, page does not show the query window back.&lt;br /&gt;
2. After executing multi query SQL statement, browse any table gives notices and some errors.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After those modifications I moved into routines. That was very cool feature in PMA. But it was not complete. For any routine it shows only one row from only one table. So I improve the behaviour of that feature to return expected outcome according to the routine. Now it shows even multiple results sets with all the needed rows.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week I try to fix those issues in SQL execution mode. And I&#39;ll implement new inline transformations for PMA as the next feature implementation.&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/7353540474307538879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-9th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7353540474307538879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7353540474307538879'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-9th-week-progress.html' title='GSoC 2012 - 9th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-4241093425260339697</id><published>2012-07-16T13:46:00.000+05:30</published><updated>2012-07-26T14:15:02.614+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 8th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I&#39;m pretty sure that most of the GSoCers are very happy in the 8th week of their GSoC project. Because of the happiness of gone through the mid evaluation. In last week I break some functions into more sub functions and introduce global variables (class variables) and __get, __set magic methods for PMA_DisplayResults class with the suggestion of Michal. As well some improvements in tests also done.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; According to last week modifications in PMA_DisplayResults class, initialization of the global variables in that class were done inside getTable() method. But as suggested from Michal, I did that initialization part in a separate method called setProperties() and call that function from the sql.php file just before call the getTable() method.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As well I found a issue with my code with the print view screen. I fix those issues both in vertical display mode and horizontal display mode. Then I move into improve unit tests. There were several errors in tests related to PMA_DisplayResults class due to my recent changes. The problem was, needed property values were not set at the run time of tests. I modified those tests to set those properties using magic __set() method. But that was not worked. After searching this issue, I found that, there is a problem with using php property_exists() method is not properly working with the magic methods. So that I introduce a new property $_property_array which contains all the previous properties except $_common_functions. Then I remove previous properties which represent in $_property_array and use php array_key_exists() method inside magic methods.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; It takes lot of time to run the all tests in PMA. So that I try to run tests with individual file by giving arguments in command line. But it gives errors again and again due to missing required files and undefined variables, constants etc. After that, I edit phpunit.xml.dist file in order to just run the needed file. With that modification I could run those tests quickly. At the moment previous errors in tests related to PMA_DisplayResults class were fixed.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week I&#39;ll move into start the work I suggested after mid evaluation. I&#39;ll start implementation of display multiple query results.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/4241093425260339697/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-8th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4241093425260339697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/4241093425260339697'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-8th-week-progress.html' title='GSoC 2012 - 8th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-1085601390398653034</id><published>2012-07-09T20:05:00.002+05:30</published><updated>2012-07-09T20:05:27.081+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 7th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is seventh week of the GSoC 2012 projects. As well this week we need to submit our mid evaluation. So this is a key point of GSoC 2012. Last week I merge the code with master which had Alex&#39;s major changes related to his project. And did some modifications regarding mime default function. As well I started to write tests for PMA_DisplayResults class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week I continued writing tests for PMA_DisplayResults class. While those improvements Michal assign me another two tasks.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. Reduce the large number of parameters passing to functions in PMA_DisplayResults class by storing the variable states inside the class itself&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
2. Break some functions to more small functions&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; So, first I did the 2nd task. With that I introduce several sub functions by breaking _getTableHeaders(), _getTableBody() and getTable() functions.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then I moved into 1st task. I stored the commonly used fields as private properties of the class. There are around 25 private fields in that class now. Since those properties are not initialized when creating the object of this class, most of them were initialized inside the getTable() function.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After I again moved into improving tests. At this point most of the existed tests were failed with the new changes. So I introduce __get() and __set() method for access any private field in PMA_DisplayResult class by out side. Then I use those functions to set private properties while improving tests. But still the failures are remaining in some tests. Apart from that setCommonFunctions() function was removed from PMA_DisplayResults class due not use of that method.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week I&#39;ll continue test cases as much a possible. But before that I&#39;ll do some modifications to PMA_DisplayResults class which was suggested by Michal recently.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/1085601390398653034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-7th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1085601390398653034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/1085601390398653034'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-7th-week-progress.html' title='GSoC 2012 - 7th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-2160060389502963067</id><published>2012-07-02T10:17:00.000+05:30</published><updated>2012-07-02T10:24:09.440+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 6th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In last week I almost finish the implementing class behavior of PMA_CommonFunctions.class.php but not committed due to some conflicts while merging the code to with master branch.&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week also I got lots of conflicts while merging the code. Since the functions inside PMA_CommonFunctions class (in master common.lib.php file)&amp;nbsp; were used in many places over the PMA the possibility of occurring a conflict is high. With the merge of Alex&#39;s code I again got many conflicts. As well I had to do more modifications because Alex has introduced several new files and they have used the functions in common.lib.php . After did those modifications I committed the code with 4 known issues in master. At the moment two are already fixed in master branch. Others are,&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;&lt;br/&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. When the session expires, after click logout I get following notice,&lt;br /&gt;
&lt;div id=&quot;:10b&quot;&gt;
Notice in ./libraries/relation.lib.php#&lt;wbr&gt;&lt;/wbr&gt;35&lt;br /&gt;
Undefined index: controllink&lt;br /&gt;
&lt;br /&gt;
2. When incorrect login, following warning raised,&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Warning&lt;/span&gt;&lt;/b&gt; in ./libraries/dbi/mysqli.dbi.&lt;wbr&gt;&lt;/wbr&gt;lib.php#97&lt;br /&gt;
mysqli_real_connect(): (28000/1045): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After that I moved into finding the possibility of using PMA_mimeDefaultFunction() function which is currently inside the core.lib.php file as a global function, inside the PMA_DisplayaResults class. This function is only used by the functions in PMA_DisplayResults class indirectly with the help of a variable. I moved the PMA_mimeDefaultFunction() function from core.lib.php file to PMA_DisplayResults class and renamed as _mimeDefaultFunction(). The places where calls this function indirectly were modified by adding &#39;$this-&amp;gt;&#39; suffix ($default_function = &#39;_mimeDefaultFunction&#39;; $this-&amp;gt;$default_function()).&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; After those improvements I moved into implement tests for the functions in PMA_DisplayResults class. Yasitha has already implemented some tests for some functions. I started to continue that work and finished some tests.&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week as the major task I&#39;m intending to implement tests for remaining functions in PMA_DisplayResults class. If possible I&#39;ll be do some minor improvements in PMA_CommonFunction.class.php&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;:10b&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/2160060389502963067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-6th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2160060389502963067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2160060389502963067'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/07/gsoc-2012-6th-week-progress.html' title='GSoC 2012 - 6th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-7236442315902236159</id><published>2012-06-25T23:54:00.001+05:30</published><updated>2012-06-25T23:57:16.426+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 5th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is the 5th week of my GSoC 2012 project. In last week I started to implement class behavior in common.lib.php file.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This week I finish remaining part of the implementing class behavior in common.lib.php file. Now the class is named as PMA_CommonFunctions and file is appeared as CommonFunctions.class.php. This class is used singleton pattern to avoid the creation of many objects by several places, which needs more memory. If any function or file with procedural codes contain more than one function inside PMA_CommonFunctions class the class object is assigned to a variable called $common_functions and used that variable to call needed functions inside that class. The classes which use the functions in PMA_CommonFunctions class, were modified by adding getter setter methods to get/set PMA_CommonFunctions class object.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I faced several problems while implementing this part. Some functions 
were used more than 400 times in many files. All of those cannot be just
 replaced due to some JS functions also appeared with same name. After completing those modifications, I could only see login screen on my browser. After login nothing displayed in my browser. Then according to guidance of Michal, I enabled write error log to file. So that I could debug the code. Then I found that the error was due to calling non-static methods in side static functions in some classes. Those were replaced by direct calling using the static method (PMA_CommonFunctions::getInstance()-&amp;gt;someFunction()) instead of get the use of variable for store class instance.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then the code was seems work fine. At the moment code is not committed yet due to some conflicts while merging the original PMA code. I&#39;ll be able to commit those changes as soon as after resolving them.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In next week I&#39;ll start to looking at the possibility of using PMA_mimeDefaultFunction() function (at the moment this is inside core.lib.php file) inside PMA_DisplayResults class as suggested by Marc. If possible unit tests were implement for the functions inside PMA_DisplayResults class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/7236442315902236159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-5th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7236442315902236159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/7236442315902236159'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-5th-week-progress.html' title='GSoC 2012 - 5th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-2798570274276765346</id><published>2012-06-18T18:45:00.000+05:30</published><updated>2012-06-18T18:49:45.211+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 4th Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In my third week I introduce a class behavior for display_tbl.lib.php
 file. Now that file has appeared as DisplayResults.class.php and the 
class inside it is named as PMA_DisplayResults.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Since 
there was a task not completed in last week, I first completed that. It 
is removing imported super globals from the functions. There were 
several functions which used local variables which are imported from 
$GLOBALS super global array. I removed them and directly used super 
globals where needed. As well for the super globals which were not 
change during one execution cycle of the PMA code, I assign them to 
global variables in the PMA_DisplayResults class (local for that class).
 That global variables are initialized inside constructor.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As
 next task, I was moved into fix the bug which was occurred due to 
breaking _getTableBody() function into subfunctions. It was very helpful
 for me that Marc had already mentioned the bug is about breaking the 
feature, which display a link for foreign table value. When I going 
through the code I saw that was occurred due to incorrect method calling
 of _getDataCellForNumericFeilds() function (not according to the 
signature). Now the bug is fixed.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Then I moved into refactoring common.lib.php file. First I remove the HTML renderings inside the function it selves and return a string instead of that. As well some conventions are used according to my proposal. And the all functions names were modified by removing phrase &#39;PMA_&#39;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Within next week I&#39;m intending to complete implementing class behavior of common.lib.php file. While refactoring DisplayResults.class.php file I have moved a function (PMA_mimeDefaultFunction) to common.lib.php file and now again move it to core.lib.php file for keep it as global function. I intend to again look at the possibility of get that function back to DisplayResults.class.php file.&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/2798570274276765346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-4th-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2798570274276765346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2798570274276765346'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-4th-week-progress.html' title='GSoC 2012 - 4th Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-6536375440887231520</id><published>2012-06-12T01:42:00.005+05:30</published><updated>2012-06-12T01:42:59.036+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 3rd Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In my 2nd week, I did some improvements relating to readability and usability of the code including breaking large functions into sub functions. After that step, display_tbl.lib.php file contained many sub functions.&lt;br /&gt;
&lt;br /&gt;
In this week, I mainly focused on applying class behavior to the display_tbl.lib.php file. After getting the confirmation from Michal Čihař for the &lt;a href=&quot;http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma.html&quot; target=&quot;_blank&quot;&gt;rough design of that PMA_DisplayResults class&lt;/a&gt;, I started my work.&lt;br /&gt;
&lt;br /&gt;
First I search for the functions which are used by the outsiders. There were only two functions (PMA_getTable(), PMA_setConfigParamsForDisplayTable()) were used by sql.php file. Excepting those two functions, private key word was used as access modifier for all other existed functions. For constructor and the above two functions were appeared as public so that any outsider can access those. All existed function names were modified by removing &#39;PMA_&#39; since they becomes to local functions. The file display_tbl.lib.php was renamed as DisplayResults.class.php .&lt;br /&gt;
&lt;br /&gt;
Then I looked into, remove strings used for conditions in comparisons and introduce constants instead of that. There were many constants after doing this step. If there is any need for change the value of those strings, we can do it by just changing in one place. That is an advantage of using constant.&lt;br /&gt;
&lt;br /&gt;
With these processes there were lots of code violations had been occurred. Most of them were fixed excluding some warnings which were due to very long comparisons inside if conditions.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;RwNCVd&quot;&gt;
&lt;div class=&quot;c5 CR e&quot; tabindex=&quot;0&quot;&gt;
Introducing global variables for the PMA_DisplayResults class is not finished yet. It will be done in next week. Unexpectedly there was a bug due to one of my previous commits which was pointed by Marc Densile. I am going to fix it in the next week. As well, I&#39;ll start to look into refactoring other files related to display query results. Mainly I&#39;ll focus on common.lib.php file.&lt;/div&gt;
&lt;div class=&quot;c5 CR e&quot; tabindex=&quot;0&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/6536375440887231520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-3rd-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/6536375440887231520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/6536375440887231520'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/06/gsoc-2012-3rd-week-progress.html' title='GSoC 2012 - 3rd Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-2711974644240604016</id><published>2012-05-22T17:14:00.000+05:30</published><updated>2012-05-23T15:39:36.576+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>Design for the PMA_DisplayResults class of PMA</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
PMA_DisplayResults class will contain the functions specific to the displaying 
query results and handling special tables like `PROCESSLIST` which provides informations on current threads running in PMA. At the current code base, these functions are 
appeared as global functions inside display_tbl.lib.php file. After 
introducing PMA_DisplayResults class instead of this set of functions, the file 
will be renamed as DisplayResults.class.php .&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Class diagram (not the completed one) for the PMA_DisplayResults class&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yNgtU4o-Ec7aSb3rHQ7NQJalWczPEXzddJmwEr3tb33byS7n1FQhI9FGrQx0UE7xRWB0Fs_p5bGAw9jHUPOB8eYzHu_N1YOBPCyI04nTzyH84Rqn8RAxyOwz33MQK2SuBvxMrhyphenhyphenYSEc/s1600/Design.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yNgtU4o-Ec7aSb3rHQ7NQJalWczPEXzddJmwEr3tb33byS7n1FQhI9FGrQx0UE7xRWB0Fs_p5bGAw9jHUPOB8eYzHu_N1YOBPCyI04nTzyH84Rqn8RAxyOwz33MQK2SuBvxMrhyphenhyphenYSEc/s1600/Design.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Following code snippet represent some rough implementation of the PMA_DisplayResults class,&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;brush:html&quot;&gt;class PMA_DisplayResults {
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; const DIRECTION_LEFT = &#39;left&#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; const DIRECTION_VERTICAL = &#39;vertical&#39;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; private $_db;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private $_table;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function __construct($db, $table) {
        $this-&amp;gt;_db = $db;
        $this-&amp;gt;_table = $table;
    }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; public function getTable() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Related code for getTable function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $str .= $this-&amp;gt;_getTableHeaders();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // end of the related code
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; private function _getTableHeaders() {
        //code...
        $msg = PMA_getMessage($this-&amp;gt;_db, $this-&amp;gt;_table);
        //code...
    }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
}
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
As the only outsider accessed Display class, the sql.php file will be use,&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;// inside sql.php file
$displayResultsObj = new PMA_DisplayResults($GLOBALS[&#39;db&#39;], $GLOBALS[&#39;table&#39;]);
echo $displayResultsObj-&amp;gt;getTable();&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 

&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/2711974644240604016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2711974644240604016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2711974644240604016'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/design-for-display-class-of-pma.html' title='Design for the PMA_DisplayResults class of PMA'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_yNgtU4o-Ec7aSb3rHQ7NQJalWczPEXzddJmwEr3tb33byS7n1FQhI9FGrQx0UE7xRWB0Fs_p5bGAw9jHUPOB8eYzHu_N1YOBPCyI04nTzyH84Rqn8RAxyOwz33MQK2SuBvxMrhyphenhyphenYSEc/s72-c/Design.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-5842068225554388247</id><published>2012-05-22T00:38:00.002+05:30</published><updated>2012-05-22T00:42:14.593+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 2nd Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is my second week of GSoC 2012 project since I have started my coding before the official day. I have started to refactoring the file display_tbl.lib.php in PMA. Last week I remove the HTML rendering inside the functions it selves in this file. Some readability improvements also done.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week, I mainly focused on improving the readability of the code inside display_tbl.lib.php file. There were several function which having more than 200 code lines in this file. I broke those functions into sub functions in a way that each sub function do a specific portion for the bigger function. As well the sub functions were not having very large code blocks and those functions were placed just after the referring function.&amp;nbsp; The names of these sub functions were little longer sometimes, because of they express valuable details for the developer at the first time.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In some places there were used similar code segments again and again 
even in the same functions. Those similar code segments were moved into 
new sub functions with the help of some additional parameters to 
separate out the small differences. (PMA_getOperationLinksForVerticleTable, PMA_getColumnParams etc.)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I have mentioned those larger functions which were broken into sub functions with there names below.&lt;/div&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PMA_getTableNavigation&lt;ul&gt;
&lt;li&gt;PMA_getMoveBackwardButtonsForTableNavigation&lt;/li&gt;
&lt;li&gt;PMA_getShowAllButtonForTableNavigation&lt;/li&gt;
&lt;li&gt;PMA_getMoveFarwardButtonsForTableNavigation&lt;/li&gt;
&lt;li&gt;PMA_getAdditionalFieldsForTableNavigation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PMA_getTableHeaders&lt;ul&gt;
&lt;li&gt;PMA_getSortByKeyDropDown&lt;/li&gt;
&lt;li&gt;PMA_getDataForResettingColumnOrder&lt;/li&gt;
&lt;li&gt;PMA_getOptionsBlock&lt;/li&gt;
&lt;li&gt;PMA_getFullOrPartialTextButtonOrLink&lt;/li&gt;
&lt;li&gt;PMA_getFormForMultiRowOperations&lt;/li&gt;
&lt;li&gt;PMA_getCommentForRow&lt;/li&gt;
&lt;li&gt;PMA_isInSorted&lt;/li&gt;
&lt;li&gt;PMA_getSortingUrlParams&lt;/li&gt;
&lt;li&gt;PMA_getSortOrderLink&lt;/li&gt;
&lt;li&gt;PMA_getDraggableClassForSortableColumns&lt;/li&gt;
&lt;li&gt;PMA_getDraggableClassForNonSortableColumns&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PMA_getTableBody&lt;ul&gt;
&lt;li&gt;PMA_getUrlSqlQuery&lt;/li&gt;
&lt;li&gt;PMA_getColumnParams&lt;/li&gt;
&lt;li&gt;PMA_getVerticalDisplaySupportSegments&lt;/li&gt;
&lt;li&gt;PMA_getModifiedLinks&lt;/li&gt;
&lt;li&gt;PMA_getDeleteAndKillLinks&lt;/li&gt;
&lt;li&gt;PMA_getPlacedLinks&lt;/li&gt;
&lt;li&gt;PMA_getResettedClassForInlineEdit&lt;/li&gt;
&lt;li&gt;PMA_getClassForDateTimeRelatedFields&lt;/li&gt;
&lt;li&gt;PMA_getDataCellForNumericFeilds&lt;/li&gt;
&lt;li&gt;PMA_getDataCellForBlobField&lt;/li&gt;
&lt;li&gt;PMA_getDataCellForGeometryFields&lt;/li&gt;
&lt;li&gt;PMA_getDataCellForNonNumericAndNonBlobFields &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PMA_getVerticalTable&lt;ul&gt;
&lt;li&gt;PMA_getOperationLinksForVerticleTable&lt;/li&gt;
&lt;li&gt;PMA_getCheckBoxesForMultipleRowOperations &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;PMA_getTable&lt;ul&gt;
&lt;li&gt;PMA_getOffsets&lt;/li&gt;
&lt;li&gt;PMA_getSortParams&lt;/li&gt;
&lt;li&gt;PMA_getSortedColumnMessage&lt;/li&gt;
&lt;li&gt;PMA_setMessageInformation&lt;/li&gt;
&lt;li&gt;PMA_getMultiRowOperationLinks &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apart from this I used some coding conventions for improve the readability. If the function is not too small one, an empty space were kept both after starting bracket of the scope and before ending 
bracket of the scope. Not only for that, wherever I saw the codes are 
seems packed and hard to read, I put empty lines between code segments. As well I followed the conventions suggested in my proposal.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; At next week, I&#39;m going to change my plans by giving the place to most 
prioritized task at the moment. I am going to make the
 display_tbl.lib.php file as a PHP class. As well I&#39;m going to reduce 
the usage of global variables which are used in most of the functions. 
The strings used inside the functions for comparisons, will be replaced 
with constants. The design for the class will be discussed with the 
community on next week.&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/5842068225554388247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/gsoc-2012-2nd-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5842068225554388247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5842068225554388247'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/gsoc-2012-2nd-week-progress.html' title='GSoC 2012 - 2nd Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-3405141528019137678</id><published>2012-05-14T18:45:00.001+05:30</published><updated>2012-05-14T18:46:04.330+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>GSoC 2012 - 1st Week Progress</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is my first week of Google Summer of Code project which is &lt;b&gt;&lt;a href=&quot;http://www.google-melange.com/gsoc/project/google/gsoc2012/chanaka777/22001&quot; target=&quot;_blank&quot;&gt;Refactoring: Displaying query results&lt;/a&gt;&lt;/b&gt; under &lt;b&gt;&lt;a href=&quot;http://www.phpmyadmin.net/&quot; target=&quot;_blank&quot;&gt;phpMyAdmin&lt;/a&gt;&lt;/b&gt; organization. Since I have my final examination, I started my work before the official day for start coding(21&lt;sup&gt;&lt;span style=&quot;color: black;&quot;&gt;st &lt;/span&gt;&lt;/sup&gt;May). It was a great experience that working with world wide open source community. That experience will be very helpful for me to manage my work in the upcoming weeks.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; According to my project schedule, I was dealing with, refactoring the file &quot;display_tbl.lib.php&quot; in this week. That is a file with 22 global functions. Some of them are really huge functions. As well, though library files are suppose to provide functions which having logics(calculations, concatenation, manipulation etc), while being in a separate layer (data/model layer), this file have some HTML renderings inside themselves. And the naming convention of some methods were different from the phpMyAdmin (PMA) standards.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In this week, I modified the all the needed functions in &quot;display_tbl.lib.php&quot; file, to remove the HTML renderings inside themselves. Instead of that, that functions are now returning a string which having relevant HTML content for each function. Since inside some of functions are using the functions in &quot;common.lib.php&quot; file and some of them also had the same issue, I modified them as well. The unit tests for each also modified according to the changes I did in corresponding functions.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The names of most of the functions were changed due to changing of the behavior of some functions. Those names were changed with adding &quot;get&quot; phrase. I was also looked in to modify the code to keep necessary indentation, since it improve the readability of the code.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; At next week, I&#39;ll more look into improve the readability of the code with adding the suggested conventions in &lt;a href=&quot;http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/chanaka777/1&quot; target=&quot;_blank&quot;&gt;my proposal&lt;/a&gt;. As well the huge functions will be braked in to several functions. The unit tests also will introduced as possible for those function.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/3405141528019137678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/gsoc-2012-1st-week-progress.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/3405141528019137678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/3405141528019137678'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/05/gsoc-2012-1st-week-progress.html' title='GSoC 2012 - 1st Week Progress'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-339520979657766149</id><published>2012-04-25T21:32:00.000+05:30</published><updated>2012-05-09T09:40:14.550+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="GSoC 2012"/><title type='text'>Ready to walk with GSoC 2012</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am very happy to say that I have been selected for a project in Google Summer of Code 2012. The project idea is &quot;Refactoring: Display query results&quot; which is under phpMyAdmin organization. In this project I&#39;m going to refactor the code which is related to displaying query results and implement some feature requests.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Short description of my project:&lt;/b&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In current code base of phpMyAdmin, 
the code for displaying query results is not much reusable. To improve 
the ability of re usability of the code, I have suggestions to refactor 
the code with better approaches. The code is going to be improved by 
applying Object Oriented Programming concepts.

         Along with that, new features like support for displaying 
results for multiple queries at once, introducing some more built-in 
transformations where it is applicable will be considered.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now I&#39;m ready to walk with GSoC 2012 and hope to do a great job with phpMyAdmin developers and other GSoCERS. :)&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;More details on my project can be found at : &lt;a href=&quot;http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/chanaka777/1&quot;&gt;http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/chanaka777/1&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
My git repository can be found at : &lt;a href=&quot;https://github.com/Chanaka/phpmyadmin&quot; target=&quot;_blank&quot;&gt;https://github.com/Chanaka/&lt;wbr&gt;&lt;/wbr&gt;phpmyadmin&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/339520979657766149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/04/time-to-walk-with-gsoc-2012.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/339520979657766149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/339520979657766149'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2012/04/time-to-walk-with-gsoc-2012.html' title='Ready to walk with GSoC 2012'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-2273655502850029432</id><published>2012-04-15T17:00:00.000+05:30</published><updated>2012-05-09T09:51:38.362+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Test Driven Development with PHPUnit</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TDD (Test Driven Development) concept is common practice of 
most of the companies which involve with the long time projects. It 
helps to keep the static behavior of functions over the development 
period. The functions are implemented after implementing test methods 
(unit tests) for that function. After implementing the function, run the tests and if any test is failing, again modify the function. This process repeats until the all tests are passing.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
Test method is a function which check whether the specific behavior of a 
function is correct. Any function can have at least two test methods. one 
positive test and one negative test. Most probably a function may have 
many test methods. The class in which all the test methods are placed is 
called Test Case. By setting up a test suite for this class, the all 
tests methods can be run at once.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; In long time 
projects like open source projects, the functions are frequently 
modified by the developers during a long time. If the modified function 
is not given the previous behavior of that function, the output for other places will be going wrong. It can be cause to failures. By 
writing tests this problem can be reduced. Before and after modifying 
the test cases, by running the tests, developer can be verify the 
function behave correctly. As well by going through the test cases helps
 even understand what actually function does.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
 To follow this TDD concept with Java, JUnit framework can be used. As 
well with PHP, PHPUnit framework can be used. Let&#39;s do some experiments 
with PHPUnit with Ubuntu OS.&lt;/div&gt;
&lt;br /&gt;
Install PHPUnit framework&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$sudo apt-get install phpunit&lt;/pre&gt;
&lt;br /&gt;
Now create your test case as a
 sub class of &#39;PHPUnit_Framework_TestCase&#39; having just one dummy method 
to verify we can forward without issue.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php

    require_once &#39;PHPUnit/Framework.php&#39;; // installed file with phpunit framework which is located at : /usr/share/php/PHPUnit/

    class MyClassTest extends PHPUnit_Framework_TestCase {

        // This function just return true
        function testCheckAllWorksFine() {
            $this-&amp;gt;assertTrue(true);
        }

    }

?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Run this MyClassTest.php file as :&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$phpunit MyClassTest.php&lt;/pre&gt;
&lt;br /&gt;
If

 the result is as following (&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;b&gt;&lt;i&gt;Fig.

 1&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;), you can proceed the work with phpunit.&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNcPmECLIsY3DGWM9GE_O0IGtzaaW41Q_nzVySLILUYZtKy-kHpAnuISG0z5TthGNfjn_iorpgbfrJOj3VJTQtEYwsR1yaMh3WzTeRjYRlJvdtHs7QPvhQmiW39aowZfoPO4XTVadh050/s1600/TDD_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;110&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNcPmECLIsY3DGWM9GE_O0IGtzaaW41Q_nzVySLILUYZtKy-kHpAnuISG0z5TthGNfjn_iorpgbfrJOj3VJTQtEYwsR1yaMh3WzTeRjYRlJvdtHs7QPvhQmiW39aowZfoPO4XTVadh050/s400/TDD_1.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;b&gt;&lt;i&gt;Fig.

 1&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
Characters 
it returns :&lt;br /&gt;
&lt;br /&gt;
.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : pass&lt;br /&gt;
F&amp;nbsp;&amp;nbsp;&amp;nbsp; : fail&lt;br /&gt;
E&amp;nbsp;&amp;nbsp;&amp;nbsp; :
 error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The
 functions starting from &#39;assert&#39; is implemented in the framework. As 
well there are more useful functions we can use with this framework. You
 can find more assert functions by visiting &lt;a href=&quot;http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions&quot; target=&quot;_new&quot;&gt;http://www.phpunit.de/manual/3.6/en/writing-tests-for-phpunit.html#writing-tests-for-phpunit.assertions&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I
 have used following useful assert functions for this article : &lt;br /&gt;
assertTrue()



 : Check whether the parameter is True&lt;br /&gt;
assertFalse()



 : Check whether the parameter is False &lt;br /&gt;
assertEqual() : Match two 
results&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Start
 work&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
1. Requirement : need a function which accept two strings 
and return the length of the most lengthy string, if both arguments are 
not strings return false&lt;br /&gt;
&lt;br /&gt;
* First just declare your 
function properly with arguments&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php
    class MyClass {   

        function getMaxLength ($str1, $str2) {    

        }

    }
?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
* Now start
 to write test methods,&lt;br /&gt;
a). Check the arguments&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php

    require_once &#39;MyClass.php&#39;;
    require_once &#39;PHPUnit/Framework.php&#39;;

    class MyClassTest extends PHPUnit_Framework_TestCase {

        var $obj;

        // This function calls before any test merhod run
        function setUp() {
            $this-&amp;gt;obj = new MyClass();
        }

        // Positive : Test getMaxLength for correct arguments
        function testGetMaxLengthForAtLeastOneIsString() {
            $paramArray = array(&quot;str1&quot;, 2);
            $result = $this-&amp;gt;obj-&amp;gt;getMaxLength($paramArray[0], $paramArray[1]);
            $this-&amp;gt;assertEquals(4, $result);
        }

        // Negative : Test getMaxLength for non of arguments are string
        function testGetMaxLengthForNoStrings() {
            $paramArray = array(array(1,2), 12.3);
            $result = $this-&amp;gt;obj-&amp;gt;getMaxLength($paramArray[0], $paramArray[1]);
            $this-&amp;gt;assertFalse($result);
        }

    }

?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The setUp() will call automatically 
before running any test method. It can be used for create a fresh 
objects, load data for databases if using etc. All test methods must be 
start with &#39;test&#39;. Using the function name which is going to use by 
specific test method regardless of the length of the test method name, 
will be increase the readability and understandability while reviewing 
later.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
b).
 Check whether the function returns an integer&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;// Test getMaxLength for output integer for correct arguments
function testGetMaxLengthForCorrectReturnType() {
    $paramArray = array(&quot;str1&quot;, 2);
    $result = $this-&amp;gt;obj-&amp;gt;getMaxLength($paramArray[0], $paramArray[1]);
    $this-&amp;gt;assertTrue(is_int($result));
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
c).
 Check whether is returns the length of the most lengthy string&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;// Test getMaxLength for Length of the lengthy string
function testGetMaxLengthForCorrectLength() {
    $paramArray = array(&quot;short_string&quot;, &quot;lenghty_string&quot;);
    $result = $this-&amp;gt;obj-&amp;gt;getMaxLength($paramArray[0], $paramArray[1]);
    $this-&amp;gt;assertEquals(14, $result);
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now
 the most needed test cases are implemented. From the above test 
methods, some scenarios like check the function 
return length of the string for arguments having only one string, is 
already covered. Now just run the test and 
see most of them are failing. Its time to start implement the actual 
function in a 
way that all te test cases are passing.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Function

 can be
 written as :&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;function getMaxLength($str1, $str2) {   

    if(is_string($str1) || is_string($str2)) {
        if(is_string($str1) &amp;amp;&amp;amp; is_string($str2)) {
            $max = (strlen($str1) &amp;gt;= strlen($str2)) ? strlen($str1) : strlen($str2);
        } elseif (is_string($str1)) {
            $max = strlen($str1);
        } else {
            $max = strlen($str2);
        }
        return $max;
    }
    return false;

}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Now
 again run the test. See whether all the test are passing or not. If not
 your function may have some issues. Improve the function and again run 
the test. Do this process until all the test are passing.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The

 example we discussed was very easy one. But in real applications we 
have use more complex algorithms and tactics dealing with databases. To 
check the functionality of the data transaction functions, we can use a 
test database with some preloaded data. Inside the setUp() function we 
can create tables and load the data to the 
test database. As well using the function tearDown() which automatically call after execution of any test method, we can clean the data from the database.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Sometimes

 applications with MVC architecture have two or more separate layers in 
Data Layer. In such kind of situation, functions need to test 
independent from their layers. Lets assume in our application there are 
two layers in Data Layer. One is data transaction layer which directly 
deal with the database and other one is data processing layer which 
process data before or after deal with database through data transaction
 layer. So, while writing test for a function in data process layer 
which get some data by calling a function in data transaction layer, we 
should verify that the correct data set is returned from the function in
 data transaction layer. To do this we can use Moc Objects.&lt;/div&gt;
&lt;br /&gt;
Lets

 go through one example.&lt;br /&gt;
* getStrings() method in DataTransaction 
class return an array with two strings (No need of even declare this 
class)&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
* getProcessedResult() method in DataProcess 
class, get the array of two strings by calling the above mentioned 
function (getStrings()), and return the length of the most lengthy 
string out of them. This class contain getter and setter methods for use
 DataTransaction class.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
(Declare the getProcessedResult() function
 and implement getter and setter methods)&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php

    class DataProcess {

        private $dataTransaction;

        function getDataTransaction() {
            if(is_null($this-&amp;gt;dataTransaction)) {
                return new DataTransaction();
            }
            return $this-&amp;gt;dataTransaction;
        }

        function setDataTransaction($dataTransaction) {
            $this-&amp;gt;dataTransaction = $dataTransaction;
        }
  
        function getProcessedResult() {
    
        }

    }

?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
* Now write the test class using the Moc Object
 of DataTransaction class&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php

    require_once &#39;DataProcess.php&#39;;
    require_once &#39;PHPUnit/Framework.php&#39;;

    class TestMoc extends PHPUnit_Framework_TestCase {

     var $dataProcess;

     // This function calls before any test merhod run
     function setUp() {
                $this-&amp;gt;dataProcess = new DataProcess();
     }

     public function testGetProcessedResult() {

         // Create a Mock Object for the DataTransaction class
         // mocking only the getStrings() method.
         $dataTransaction = $this-&amp;gt;getMock(&#39;DataTransaction&#39;, array(&#39;getStrings&#39;));
  
         // Set up the expectation for the getStrings() method
         // to be called only once and with no arguments
         // and return value is array(&quot;abc&quot;, &quot;abcde&quot;)
         $dataTransaction-&amp;gt;expects($this-&amp;gt;once())
                         -&amp;gt;method(&#39;getStrings&#39;)
                         -&amp;gt;with()
                         -&amp;gt;will($this-&amp;gt;returnValue(array(&quot;abc&quot;, &quot;abcde&quot;)));
  
         // Set the mocked DataTransaction object to 
            // DataProcess object using setter
         $this-&amp;gt;dataProcess-&amp;gt;setDataTransaction($dataTransaction);
  
         // Call the getProcessedResult() method on the $dataProcess object
            // which we expect to call the mocked DataTransaction object&#39;s
         // getStrings() method with no arguments.
         $this-&amp;gt;assertEquals(5, $this-&amp;gt;dataProcess-&amp;gt;getProcessedResult());

     }

    }

?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Here, even we didn&#39;t implement (even declare) the DataTransaction class, we could run the test using Moc Object. So that we can test functions independent from the layer it contains and other needed functions.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Setting
 up test suite&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Test suit can be used to mange which test cases should run. We can run even all the test methods in several test cases at once. Test suite can be create as following example code snippet.&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;&amp;lt;?php

    require_once &#39;PHPUnit/Framework.php&#39;;

    class AllTests {

        public static function suite() {

            $suite  = new PHPUnit_Framework_TestSuite(&quot;PHPUnit&quot;);
            // Add needed test cases
            $suite-&amp;gt;addTestFile(&quot;MyTestClass1.php&quot;);
            $suite-&amp;gt;addTestFile(&quot;MyTestClass2.php&quot;);

            return $suite;

        }

    }

?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
With
 PHPUnit framework the percentage of the functions which covers from the unit 
tests can be obtained as a coverage report. Following command can be used to obtain a coverage report. (probably you need to install xDebug : &lt;a href=&quot;http://xdebug.org/docs/install&quot; target=&quot;_new&quot;&gt;http://xdebug.org/docs/install&lt;/a&gt;)&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:html&quot;&gt;$phpunit --coverage-html ./report AllTests.php&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
From


 this report we can find out the uncovered code segments. Some of code segments in MyClass.php has not covered from the unit tests. To cover
 them again test can be implemented.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
So, this is a 
basic idea of how to follow test driven development with PHPUnit framework. Hope this helpful to you.&lt;/div&gt;
&lt;br /&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/2273655502850029432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/11/test-driven-development-with-phpunit.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2273655502850029432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/2273655502850029432'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/11/test-driven-development-with-phpunit.html' title='Test Driven Development with PHPUnit'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNcPmECLIsY3DGWM9GE_O0IGtzaaW41Q_nzVySLILUYZtKy-kHpAnuISG0z5TthGNfjn_iorpgbfrJOj3VJTQtEYwsR1yaMh3WzTeRjYRlJvdtHs7QPvhQmiW39aowZfoPO4XTVadh050/s72-c/TDD_1.png" height="72" width="72"/><thr:total>1</thr:total><georss:featurename>Sri Lanka</georss:featurename><georss:point>7.873054 80.771797</georss:point><georss:box>5.8601534999999991 78.24494150000001 9.8859545 83.2986525</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-5249580799259197666</id><published>2011-12-24T23:17:00.000+05:30</published><updated>2012-05-09T09:52:17.286+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Use of Subversion client with sourceforge</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;font-size: large;&quot;&gt;Subversion (SVN) is Centralized, open-source &lt;a href=&quot;http://chanakaindrajith.blogspot.com/2011/12/version-control-systems-sourcerevision.html&quot; target=&quot;_blank&quot;&gt;Version Control System&lt;/a&gt;. SVN&amp;nbsp; manages files and directories and changes made to them over a period of time, while supporting to shared development with features like rollback code conflict resolve.&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt; As well this allows to recover older versions of the software (data) or examine the history of how the code-base changed. SVN is developed in order to overcome the bugs and misfeatures of CVS.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; In SVN there are two ends to deal with. One is the Subversion Repository which contains all the managed files and directories, and the other one is commandline or GUI client application to manage files from the client&#39;s end. It is important to know the concept of SVN repository before starting work with SVN.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Repository is a file server which is not behave like an usual one. It has it&#39;s own revisioning system. After any authorized person change a file in repository, the state of the code-base will change and it is given a index to identify that state which is new code-base. This index is called revision number. At the initial state of the repository revision number is &#39;0&#39;. For any change in repository the revision number will increase by one (&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;). So that people can refer the older versions of the code-base.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9fdp7f-T_V3pd5dqSQfDVjuIwucFrFsT3s4e-pZ8RDkctqxDGwXEdDcykSZR4oyLuiUxFBVglTA-99jdiyG6C685aBChGnkiOqhtQWmDndEXEr6yampauKzs93YXVM8ucU7MgsQmJyDI/s1600/SVN_repo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;281&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9fdp7f-T_V3pd5dqSQfDVjuIwucFrFsT3s4e-pZ8RDkctqxDGwXEdDcykSZR4oyLuiUxFBVglTA-99jdiyG6C685aBChGnkiOqhtQWmDndEXEr6yampauKzs93YXVM8ucU7MgsQmJyDI/s400/SVN_repo.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 1&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Usually repository contain three main directories containing the code-base.&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;trunk&amp;nbsp;&amp;nbsp; - code-base of main development process&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;branch - copy of specific revision, to implement new features(which takes some time to finish) concurrently and independently on top of that (&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: large;&quot;&gt;tag&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - some snapshots of the trunk. Can store stable versions of the code-base&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidzcjgIahzDPqjOTZJtyXkd4WZH5YavTkDXuQa4FDBig8UGge68zpuLSbnM_kD6GhoOVVPtiEAUP2L2SXEmIPhzAs2KSWHrkiRs5p0n7_Tzto36VYV_Ei7QfaoWNY4pwYmgLYt8ACw4m0/s1600/SVN_branch.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;167&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidzcjgIahzDPqjOTZJtyXkd4WZH5YavTkDXuQa4FDBig8UGge68zpuLSbnM_kD6GhoOVVPtiEAUP2L2SXEmIPhzAs2KSWHrkiRs5p0n7_Tzto36VYV_Ei7QfaoWNY4pwYmgLYt8ACw4m0/s400/SVN_branch.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 2&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Even in branching process, the revision numbers are depend on changes of the branches (&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;). How ever at the end of the branching process of a particular branch, containing code should be merge with the main code-base (in trunk).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8bfQeUmP7jQsON5GILtAwV3MEtB14KR7uNazTozQ9LHlyjesWv01JXMZ0tYfIeL-veGFseFKawnafokBWpfj9fn3WhLFAGsiDuNh4I8ZdzBV1rigpizKtSnlguyjBwVc0gvibSpalg7A/s1600/SVN_Branch_rev.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;146&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8bfQeUmP7jQsON5GILtAwV3MEtB14KR7uNazTozQ9LHlyjesWv01JXMZ0tYfIeL-veGFseFKawnafokBWpfj9fn3WhLFAGsiDuNh4I8ZdzBV1rigpizKtSnlguyjBwVc0gvibSpalg7A/s400/SVN_Branch_rev.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;i&gt;&lt;b&gt;Figure 3&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Now I think you have an idea on how the repository behave. To access SVN repository there are several methods. Following table shows the URL schemes map to each access method.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;table border-color=&quot;blue&quot; border=&quot;1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Scheme&lt;/th&gt;&lt;th&gt;Access Method&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;file:///&lt;/td&gt;&lt;td&gt;Direct repository access (on local disk)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;http://&lt;/td&gt;&lt;td&gt;Access via WebDAV protocol to Subversionaware Apache server&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;https://&lt;/td&gt;&lt;td&gt;Same as http://, but with SSL encryption&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;svn://&lt;/td&gt;&lt;td&gt;Access via custom protocol to an svnserve server&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;svn+ssh://&lt;/td&gt;&lt;td&gt;Same as svn://, but through an SSH tunnel&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/center&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;As I mentioned earlier, the&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt; second end of SVN is the application, in client&#39;s end. I&#39;ll explain how we can generally use SVN client applications with Linux &amp;amp; windows environment.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;i&gt;Setup a repository&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; We can get use of &lt;a href=&quot;https://sourceforge.net/&quot; target=&quot;_blank&quot;&gt;sourceforge&lt;/a&gt; in order to setup a repository. sourceforge is free repository provider for open-source projects. What you have to do is register for the sourceforge and create a project. Make sure to select the version control system as SVN (default is git) while you are creating the project. sourceforge itself can add folders and files. But since we are in another track forget it for a moment. Under the code tab of your project home page, you can see the command you should use to get a checkout for linux based system. (make sure you have login)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;font-family: inherit;&quot;&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;i&gt;&lt;b&gt;With UBUNTU-10.04 OS &lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt; SVN commandline client can be used with Linux based systems. After installing the SVN commandline client, files can managed via executing the commands in command prompt.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;install SVNcommandline client on your machine&lt;/span&gt;&lt;/div&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ sudo apt-get install subversion libapache2-svn
&lt;/pre&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;first go inside that directory and add source files to the repository.&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ cd /home/source_folder
$ svn import --username=your_username -m &quot;Meaningfull_message_about_the_source_changes_for_users&quot; url_of_repository
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;note : the repository url you can obtain from the sourceforge (sourceforge -&amp;gt; your project -&amp;gt; code tab)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;In sourceforge project your initial file upload will appear as revision number 2. This is due to sourceforge itself create the general folder structure of repository and it will appear as revision number 1.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;To start developing with SVN, first create a new folder and then get a checkout from the repository (copy of the latest code-base in repository)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ sudo mkdir /var/www/myproject
$ cd /var/www
$ svn co --username your_username url_of_repository myproject
&lt;/pre&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Now you can start further implementation on that checkout. If you modify an existing file it will already prepared to commit (upload) to the repository. But if you add a new file or a directory first you have to make prepare it to commit.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn add new_file_1 new_file_2
$ svn ci -m &quot;Meaningful_Message&quot; new_file_1 existing_file_1 existing_file_2&lt;/pre&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;If you want to commit all the files you changed, you use above code without the file paths. A summery of some useful SVN commands are shown below.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;information on usage of SVN&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn --help&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;initial commit&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn import --username=your_username -m &quot;Message&quot; URL
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;get a checkout&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn co --username your_username URL project_folder
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;make prepare to commit the newly added files (unversioned files)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn add file_path
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;see the states of the files (whether versioned or unversioned)&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn st
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;note: The meaning of the symbols shown for statuses, &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;? - unversioned file&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;M - locally modified file&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;A - schedule to add the file&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;D - &lt;/i&gt;&lt;i&gt;schedule to &lt;/i&gt;&lt;i&gt;delete the file&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;G - merged file&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;C - conflicted file while updating (file is waiting for user resolve the conflict)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;! - file is missing or incomplete (removed by non-svn command)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;~ - versioned file obstructed by some file of a different kind&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;I - file ignored&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;get latest code to working copy without changing local modifications&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn up
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;note: If any file is about to conflict (overwrite) commandline client itself give some options to user to agree,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;p - mark the conflict to be resolved later (postpone)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;df - show all changes made to merged file (diff-full)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;e - change merged file in an editor (edit)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;r - accept merged version of file (resolved)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;mf - accept my version of entire file and ignore their changes (mine-full)&lt;br /&gt;tf - accept their version of entire file and lose my changes (theirs-full)&lt;br /&gt;l - launch external tool to resolve conflict (launch)&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;h - show this list (help)&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;resolve conflicted file before commit (after postpone conflict we can manually resolve it)&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn resolved conflicted_file_path
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;commit all local changes&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn ci -m &quot;Message&quot;
&lt;/pre&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;note:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;to commit specific files, add file paths at the end of the above command separating each by a space &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;remove all the local changes of a working copy (become to base revision)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn revert -R .
&lt;/pre&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;note: to revert specific file replace &#39;&lt;/span&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;-R .&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&#39; with file path&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;information on base revision (revision of working copy on top)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn info&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;modifications between working copy and base revision&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn diff&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;get file differences to a file &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn diff &amp;gt; ~/Desktop/path/filename.diff
&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;apply patch (diff file) to working copy&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre class=&quot;screen&quot;&gt;&lt;span class=&quot;command&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;pre class=&quot;brush:html&quot;&gt;$ svn patch -p0 ~/Desktop/path/filename.diff&lt;/pre&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;screen&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;&lt;i&gt;With Widows 7 OS&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;span style=&quot;font-size: large;&quot;&gt;SVN GUI client can be used for windows based systems. &lt;a href=&quot;http://tortoisesvn.net/&quot; target=&quot;_blank&quot;&gt;TortoiseSVN&lt;/a&gt; is the GUI client of SVN. After Installing Tortoise SVN on a machine, files can be managed in UI level. To start the development, go to any directory, under which this project should be created, then right click and select &#39;SVN checkout&#39; option. Then you can give the repository URL and the local project directory name. If you have already created a project in sourceforge, from the SVN command appeared under &#39;code&#39; tab, you can fetch out the repository URL.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;After any improvement in the code, the corresponding file and all it&#39;s parent directories are shown as modified by a red mark on the file or directory. Using the right click options, the modified code can be committed (SVN commit) even while neglecting some of the modified files by selecting them. As well you can see lot of SVN operations can be done from this interface (&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 4&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo1o08vsIlOZ9Vu6Bj79tB58rU2aB1s8nbumADhmvrBXT-ldV7HYh0hVYqS_VtlSBJcNciEx7Lgte-b_th6NQbEU5vv02Pwh9iEnwopqkjXqEjJebFfy3pLPg07mV2I5w1NYmGRyehhXA/s1600/svn.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgo1o08vsIlOZ9Vu6Bj79tB58rU2aB1s8nbumADhmvrBXT-ldV7HYh0hVYqS_VtlSBJcNciEx7Lgte-b_th6NQbEU5vv02Pwh9iEnwopqkjXqEjJebFfy3pLPg07mV2I5w1NYmGRyehhXA/s400/svn.png&quot; width=&quot;331&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr align=&quot;center&quot;&gt;&lt;td class=&quot;tr-caption&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 4&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;So if you are new to SVN, hope this will helpful to you.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shCore.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;link href=&quot;http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;/link&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt; 
&lt;script language=&quot;javascript&quot;&gt;
 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = &#39;http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf&#39;;
SyntaxHighlighter.all();
&lt;/script&gt; 
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/5249580799259197666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/12/use-of-subversion-client-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5249580799259197666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/5249580799259197666'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/12/use-of-subversion-client-with.html' title='Use of Subversion client with sourceforge'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9fdp7f-T_V3pd5dqSQfDVjuIwucFrFsT3s4e-pZ8RDkctqxDGwXEdDcykSZR4oyLuiUxFBVglTA-99jdiyG6C685aBChGnkiOqhtQWmDndEXEr6yampauKzs93YXVM8ucU7MgsQmJyDI/s72-c/SVN_repo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2520666207174376438.post-9099455900564866958</id><published>2011-12-20T14:05:00.000+05:30</published><updated>2012-05-09T09:52:46.438+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Technical"/><title type='text'>Version Control Systems (Source/Revision Control Systems)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;Version Control Systems are playing an important role in software source controlling. Most of the software industry used Version Control Systems to keep their source code in a central space so that any authorized person can access to it and do the changes in source files concurrently. The main purpose of a Version Control System is to enable collaborative editing and sharing of data, and keep the older states of the software code base (keep revisions).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;In a project with large number of remote developers, there is a big probability to accidentally overwrite each other&#39;s changes in a regular file system (&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 1&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;). That&#39;s how the Version Control Systems come in to the picture in order to solve this problem.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIX_2_6CiBPYtTCDYTBt7u3X9poYU9WiFIn_czwKuDRk3yFeacGZZlTJkDmWs00MHmPU8NIB_Fwcy2zLWplUNsRndLOybYcElncLaZQo7XSVichczksCk7MGFo2ARaVv_JDXnJhqzoILI/s1600/problem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIX_2_6CiBPYtTCDYTBt7u3X9poYU9WiFIn_czwKuDRk3yFeacGZZlTJkDmWs00MHmPU8NIB_Fwcy2zLWplUNsRndLOybYcElncLaZQo7XSVichczksCk7MGFo2ARaVv_JDXnJhqzoILI/s320/problem.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 1&lt;/i&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;So, to avoid above problem Version Control Systems used a strategy called Lock-Modify-Unlock model (&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 2&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;). This repository allows only one person to change specific file at a time. To do this it is using a lock system. The user who is going to change a file must lock the file so that any other user cannot lock the file again (it means file can be read but cannot change). After he made the change and commit the file to the repository he must unlock the particular file.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikrbnHhtKALFeFc9XfjBaOTXEgPVOC9ChwPxTY_zo2vE-si2452Msd3W2MMJYWq-BTHd3BaFWFx5rv-TIIodKmSH_13nbAxHR0NUeyJakQu1KF-WWh03PkU616ri2Jw8jqIukG3SCYzW4/s1600/lmu.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikrbnHhtKALFeFc9XfjBaOTXEgPVOC9ChwPxTY_zo2vE-si2452Msd3W2MMJYWq-BTHd3BaFWFx5rv-TIIodKmSH_13nbAxHR0NUeyJakQu1KF-WWh03PkU616ri2Jw8jqIukG3SCYzW4/s320/lmu.png&quot; width=&quot;293&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 2&lt;/i&gt;&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;But in this model, the developing process will be unnecessarily serialized, and by mistakes some users may not unlock a file, though others are waiting for unlocking that files. As well concurrent developing of two files by different users cannot have idea of each other file which have some dependencies between them.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Therefore another method called Copy-Modify-Merge model (&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 3&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;) is used as alternative to this problem. In here, users can concurrently develop the same file and commit it by after merging the new changes in repository to the working copy (locally changed copy).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiroDF1nGhLTqQlXeaPS7Dlr0MOdlY5fCbIZq3GMdRr3qteS5639qcLCUtRWriYGErAzR4MSbqjR-Lvu4IoXXU49TRe36HdscTUqc6K2ipd-qnjO3ADV9I7osGpNt5xAfU8yOzoToijndc/s1600/cmm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;262&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiroDF1nGhLTqQlXeaPS7Dlr0MOdlY5fCbIZq3GMdRr3qteS5639qcLCUtRWriYGErAzR4MSbqjR-Lvu4IoXXU49TRe36HdscTUqc6K2ipd-qnjO3ADV9I7osGpNt5xAfU8yOzoToijndc/s640/cmm.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;i&gt;Figure 3&lt;/i&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;Version Control Systems such as SVN and CVS are using the above method to file managing.Using this method user have the full control of managing codes in conflicts (overwrite some code).&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;It&#39;s possible to classify the Version Control Systems as Centralized and Distributed. Centralized Version Control Systems means there is only one repository which developers are directly deals with. But in Distributed Version Control Systems are some kind of modification of the concept of Centralized Version Control Systems. The concept is to having two levels of Source Control Systems rather than one. So that, without all ways connecting with the main &amp;nbsp;Source Control System(main repository in server), using an own Source Control System(local host) until completing any specific work (can be a story of project). So that the main repository contains only working copies of the software. As well the operations (commit, revert) are faster due to using the own Source Control System more than Centralized Control System.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Some examples for Version Control Systems are as follows.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;(ref :&amp;nbsp;&lt;a href=&quot;http://www.smashingmagazine.com/2008/09/18/the-top-7-open-source-version-control-systems/&quot; target=&quot;new&quot;&gt;http://www.smashingmagazine.com/2008/09/18/the-top-7-open-source-version-control-systems/&lt;/a&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;1). CVS (Concurrent Versioning Systems)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Older technology. Simple system for make sure files and revisions kept up to date.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;2). SVN (Subversion)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Popular Version Control System. Most of the open-source projects use SVN.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;3). git&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;A fast populating, open-source Distributed Version Control System.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;4). Mercurial&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Open-source Distributed Version Control System. Very faster and much simpler system than &#39;git&#39;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;5). Bazaar&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Distributed Version Control System with different types of workflow than other Distributed Version Control Systems.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;6). LibreSource&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Web portal, with a built-in subversion repositories. Useful for manage collaborative projects.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;7). Monotone&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Fairly easy to learn. Places higher value on integrity than performance.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I think you may have some idea on Version Control Systems. And I&#39;m willing to have another article soon on use of Subversion client. &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chanakaindrajith.blogspot.com/feeds/9099455900564866958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/12/version-control-systems-sourcerevision.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/9099455900564866958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2520666207174376438/posts/default/9099455900564866958'/><link rel='alternate' type='text/html' href='http://chanakaindrajith.blogspot.com/2011/12/version-control-systems-sourcerevision.html' title='Version Control Systems (Source/Revision Control Systems)'/><author><name>chanaka777</name><uri>http://www.blogger.com/profile/16311536751379428635</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIX_2_6CiBPYtTCDYTBt7u3X9poYU9WiFIn_czwKuDRk3yFeacGZZlTJkDmWs00MHmPU8NIB_Fwcy2zLWplUNsRndLOybYcElncLaZQo7XSVichczksCk7MGFo2ARaVv_JDXnJhqzoILI/s72-c/problem.png" height="72" width="72"/><thr:total>2</thr:total></entry></feed>