Your most unhappy customers are your greatest source of learning.

REST Call Using jQuery AJAX

March 31, 2015

$(document).on('ready',function(){
            var username ="vachhani_22kk@yahoo.com";
            var password ="password"; 
            function make_base_auth(user, password) {
              var tok = user + ':' + password;
              var hash = btoa(tok);
              return "Basic " + hash;
            }
                $.ajax({
                  url: 'http://google.com/api/jsonws/ocd-ws-portlet.ocdwebs/get-folder-files/folder-id/22793/repository-id/12368',
                  dataType: "json",
                  data:{},
                  type: "get",
                  success: function(data){
                          alert("hi");
                  },
                  beforeSend: function(xhr){
                          xhr.setRequestHeader('Authorization',make_base_auth(username, password));
                                    },
                                    complete: function(){
                                    },
                  error: function(){
                  }
                });
             
 });

Navigation using Structure and Template

Structure

<root available-locales="en_US" default-locale="en_US">
    <dynamic-element dataType="string" indexType="keyword" name="nav" readOnly="false" repeatable="true" required="false" showLabel="true" type="text" width="small">
        <dynamic-element dataType="string" indexType="keyword" name="navurl" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small">
            <meta-data locale="en_US">
                <entry name="label">
                    <![CDATA[URL]]>
                </entry>
                <entry name="predefinedValue">
                    <![CDATA[]]>
                </entry>
                <entry name="tip">
                    <![CDATA[]]>
                </entry>
            </meta-data>
        </dynamic-element>
        <dynamic-element dataType="string" indexType="keyword" name="subnav" readOnly="false" repeatable="true" required="false" showLabel="true" type="text" width="small">
            <dynamic-element dataType="string" indexType="keyword" name="subnavurl" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small">
                <meta-data locale="en_US">
                    <entry name="label">
                        <![CDATA[Sub Navigation URL]]>
                    </entry>
                    <entry name="predefinedValue">
                        <![CDATA[]]>
                    </entry>
                    <entry name="tip">
                        <![CDATA[]]>
                    </entry>
                </meta-data>
            </dynamic-element>
            <meta-data locale="en_US">
                <entry name="label">
                    <![CDATA[Sub Navigation Menu]]>
                </entry>
                <entry name="predefinedValue">
                    <![CDATA[]]>
                </entry>
                <entry name="tip">
                    <![CDATA[]]>
                </entry>
            </meta-data>
        </dynamic-element>
        <meta-data locale="en_US">
            <entry name="label">
                <![CDATA[Main Navigation Menu]]>
            </entry>
            <entry name="predefinedValue">
                <![CDATA[]]>
            </entry>
            <entry name="tip">
                <![CDATA[]]>
            </entry>
        </meta-data>
    </dynamic-element>
</root>

 Template


Know About Collection Framework

March 7, 2015

Hello Friends,

We are using many collection frameworks any daily routine works bit do we really know the collection fundamentals and how it works. Here I try to put this Information with basic detail.

Collections actually groups multiple elements into single unit which allows us to add,retrieve, update or delete set of objects.
It's actually using various data structures in back end and providing us API to play with this data structures like trees,lists,sets and maps.

Why we should have to use collection framework ?

Collection is resizable.
Provides us built in efficient API which reduces our manual coding efforts.
Provides very useful data structures and provides high performance implementation of useful data structures and algorithams.
Very easy to learn and API utilization.