Embed Youtube Video in PageLayout in Sharepoint 2010

In Sharepoint you can Play YouTube Video by using Content Editor Webpart.There are nice article here and here.
My goal was to make easy for end users so i decided to go with event handler which will set Content Property of Content Editor Webpart once users checked in Page.I have PageLayout based on Video Content Type and this content type i have created Site Column called EmbedCode of type Multiple line of text.

 public override void ItemCheckingIn(SPItemEventProperties properties) {
          // base.ItemCheckingIn(properties);
         //  SPWeb web = properties.OpenWeb();
           SPFile file = properties.ListItem.File;
           using (SPLimitedWebPartManager mgr = file.GetLimitedWebPartManager(PersonalizationScope.Shared))  {
                   if (mgr != null) {
                        foreach (Microsoft.SharePoint.WebPartPages.WebPart webpart in mgr.WebParts) {
                           if (webpart.GetType().ToString().Equals("Microsoft.SharePoint.WebPartPages.ContentEditorWebPart")) {
                                ContentEditorWebPart contentEditor = (ContentEditorWebPart)webpart;
                               switch (contentEditor.Title) {
                                   case "Video1":
                                        XmlElement embedCode1 = new XmlDocument().CreateElement("embedCode1");
                                        embedCode1.InnerText = properties.ListItem["EmbedCode1"].ToString();
                                        contentEditor.Content = embedCode1;
                                        mgr.SaveChanges(contentEditor);
                                       break;
                                   case "Video2":
                                       XmlElement embedCode2 = new XmlDocument().CreateElement("embedCode2");
                                       embedCode2.InnerText = properties.ListItem["EmbedCode2"].ToString();
                                       contentEditor.Content = embedCode2;
                                       mgr.SaveChanges(contentEditor);
                                       break;
                                   default:
                                       break;
                               }

                           }
                       }

                   }
               }
           }

Now let’s register Event Handler with Content type.

 public override void FeatureActivated(SPFeatureReceiverProperties properties) {

            SPSite site = properties.Feature.Parent as SPSite;
            using (SPWeb web = site.OpenWeb()) {
                SPContentType VideoCT = web.ContentTypes["Video Publicity Page"];
                VideoCT.EventReceivers.Add(SPEventReceiverType.ItemCheckingIn, "CAS.UpdateCEWP.EventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1dce36753eab5b25", "CAS.UpdateCEWP.EventHandler.PageEventHandler");
                VideoCT.Update(true);
               // web.Update();
            }

        }

        // Uncomment the method below to handle the event raised before a feature is deactivated.

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties) {
            SPSite site = properties.Feature.Parent as SPSite;
            string assemblyName = "CAS.UpdateCEWP.EventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1dce36753eab5b25";
            using (SPWeb web = site.OpenWeb()) {
                SPContentType VideoCT = web.ContentTypes["Video Publicity Page"];
                for (int i = 0; i < VideoCT.EventReceivers.Count; i++) {
                    if (VideoCT.EventReceivers[i].Assembly.Equals(assemblyName)) {
                        VideoCT.EventReceivers[i].Delete();
                    }
                }
                VideoCT.Update(true);
                //web.Update();
            }

        }

Comments and suggestion are welcome.
hope this help.
Thanks
Ronak

Provision lookup field using CAML

There are lots of blog posts about how to create a lookup SiteColumn using Declaratively and Programmatically but i found following two post very useful and point me in right direction.
http://blogs.msdn.com/b/joshuag/archive/2008/03/14/add-sharepoint-lookup-column-declaratively-through-caml-xml.aspx?PageIndex=2#comments
http://pholpar.wordpress.com/2010/05/14/declaratively-adding-a-lookup-field-to-a-list-schema-using-the-name-of-the-referenced-list/
Peter Holpar blog post explain how to create a Lookup Filed using Custom list Definition but in my case i don’t want to create a custom definition as i need to Create  lookup to list based on Custom List Definition and that’s where CustomSchema attribute which is only available in sharepoint 2010  comes into picture.you can read about it in more details from Stefan Stanev nice blog post from here
http://stefan-stanev-sharepoint-blog.blogspot.com/2010/03/sharepoint-2010-listinstance.html?showComment=1303912623484#c1919163525190422580
Alright now i want to Create two list called Product and Category based on Custom list Definition and Create a CategoryName column as lookup to Category list and use it in Product list.simple you can do it through UI but there is no fun in that and also its not good practice in deployment point of view so lets do it using features.

First Create Empty sharepoint Project in Visual Studio 2010 and Select Deploy as Sandbox Solutions in my case its LookupSiteColumn.Now add New Item called EmptyElement to create siteColumns and give it name Fields.Now open Elements.xml and write CAML to Create Columns you need. In my case i need Columns called CategoryID(Number),ProductID(Number) and CategoryName(Lookup to CategoryList).

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field ID="{99C917A4-156E-46B9-9CAF-2FFC7FE7C5C3}"
       Name="CategoryID"
       StaticName="CategoryID"
       SourceID="http://schemas.microsoft.com/sharepoint/v3"
       DisplayName="CategoryID"
       Type="Number"
       Required="FALSE" ReadOnly="FALSE"
       Sealed="FALSE" Hidden="FALSE"
       Group="Custom Columns">
  </Field>
  <Field ID="{7E703095-633A-450C-968C-9C886FD9013E}"
     Name="ProductID"
     StaticName="ProductID"
     SourceID="http://schemas.microsoft.com/sharepoint/v3"
     DisplayName="ProductID"
     Type="Number"
     Required="FALSE" ReadOnly="FALSE"
     Sealed="FALSE" Hidden="FALSE"
     Group="Custom Columns">
  </Field>
  <Field ID="{67146805-10A0-473F-971C-1B41BD36C4C5}"
         Name="CategoryName"
         StaticName="CategoryName"
         Group="Custom Columns"
         Type="Lookup"
         DisplayName="CategoryName"
         List="Lists/Category"
         ShowField="Title"
         PrependId="TRUE">
 </Field>
</Elements>

Now add two new Items Called Content Type to Create Content type for Product and Category based on Item Content type in Solution.in my case its looks like this
Category ContentType

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x0100c0a87e97a5ba4d22a1231c05253d7014"
               Name="Category"
               Group="Custom Content Types"
               Description=""
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
      <FieldRef ID="{99C917A4-156E-46B9-9CAF-2FFC7FE7C5C3}" Name="CategoryID" />
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Category" />
    </FieldRefs>
  </ContentType>
</Elements>

Product ContentType

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <!-- Parent ContentType: Item (0x01) -->
  <ContentType ID="0x0100dabceef503684c479fd5c2ae7d2e747d"
               Name="Product"
               Group="Custom Content Types"
               Description=""
               Inherits="TRUE"
               Version="0">
    <FieldRefs>
      <FieldRef ID="{7E703095-633A-450C-968C-9C886FD9013E}" Name="ProductID" />
      <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="ProductName" />
      <FieldRef ID="{67146805-10A0-473F-971C-1B41BD36C4C5}" Name="CategoryName"/>
    </FieldRefs>
  </ContentType>
</Elements>

Now Lets Create two New List Instance item to Create List Instance for Product and Category list based on Custom list Definition.in my case i give them name called Product and Category.Now right click on Category list and add new xml file called schema.xml and set it Deployment Type Property to ElementFile and do same step for Product.
Category LisInstance Elements.xml looks like this

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Category"
                OnQuickLaunch="FALSE"
                TemplateType="100"
                FeatureId="00bfea71-de22-43b2-a848-c05709900100"
                Url="Lists/Category"
                Description="A list to store Category for Products." 
                CustomSchema="Category\schema.xml">
  </ListInstance>
</Elements>

Category list schema.xml file looks like this

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="Category" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Category" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentType ID="0x0100c0a87e97a5ba4d22a1231c05253d7014" Name="Category" Group="Custom Content Types" Description="" Inherits="TRUE" Version="0">
        <FieldRefs>
          <FieldRef ID="{99C917A4-156E-46B9-9CAF-2FFC7FE7C5C3}" Name="CategoryID" />
          <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Category" />
        </FieldRefs>
      </ContentType>
    </ContentTypes>
    <Fields>
      <Field ID="{99c917a4-156e-46b9-9caf-2ffc7fe7c5c3}" Name="CategoryID" StaticName="CategoryID" SourceID="http://schemas.microsoft.com/sharepoint/v3" DisplayName="CategoryID" Type="Number" Required="FALSE" ReadOnly="FALSE" Sealed="FALSE" Hidden="FALSE" Group="Custom Columns">
      </Field>
      <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="Category" Type="Text" />
    </Fields>
    <Views>
      <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitleNoMenu">
          </FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="Modified" Ascending="FALSE">
            </FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
        </ParameterBindings>
      </View>
      <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="CategoryID"></FieldRef>
          <FieldRef Name="LinkTitle" DisplayName="Category"></FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="ID">
            </FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
        </ParameterBindings>
      </View>
    </Views>
    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
  </MetaData>
</List>

Now most import thing as per Josh Gaffey’s Blog(first link at starting of post) is that in order for lookup Column to work, the URL specified in your schema.xml file MUST MATCH the List attribute on all your Field references in fields.xml and schema.xml. If these don’t match, it will not work.So as per my example Url Property from schema.xml file match with Url Property in List Instance and List Property in lookup column definition.

Product LisInstance Elements.xml

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance Title="Product"
                OnQuickLaunch="FALSE"
                TemplateType="100"
                FeatureId="00bfea71-de22-43b2-a848-c05709900100"
                Url="Lists/Product"
                Description="A list to store Products Information"
                CustomSchema="Product\schema.xml" >
  </ListInstance>
</Elements>

Product LisInstance schema.xml

<?xml version="1.0" encoding="utf-8"?>
<List xmlns:ows="Microsoft SharePoint" Title="ProductList" EnableContentTypes="TRUE" FolderCreation="FALSE" Direction="$Resources:Direction;" Url="Lists/Product" BaseType="0" xmlns="http://schemas.microsoft.com/sharepoint/">
  <MetaData>
    <ContentTypes>
      <ContentType ID="0x0100dabceef503684c479fd5c2ae7d2e747d" Name="Product" Group="Custom Content Types" Description="" Inherits="TRUE" Version="0">
        <FieldRefs>
          <FieldRef ID="{7E703095-633A-450C-968C-9C886FD9013E}" Name="ProductID" />
          <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="ProductName" />
          <FieldRef ID="{67146805-10A0-473F-971C-1B41BD36C4C5}" Name="CategoryName" />
        </FieldRefs>
      </ContentType>
    </ContentTypes>
    <Fields>
      <Field ID="{7e703095-633a-450c-968c-9c886fd9013e}" Name="ProductID" StaticName="ProductID" SourceID="http://schemas.microsoft.com/sharepoint/v3" DisplayName="ProductID" Type="Number" Required="FALSE" ReadOnly="FALSE" Sealed="FALSE" Hidden="FALSE" Group="Custom Columns">
      </Field>
      <Field ID="{67146805-10a0-473f-971c-1b41bd36c4c5}" Name="CategoryName" StaticName="CategoryName" Group="Custom Columns" Type="Lookup" DisplayName="CategoryName" List="Lists/Category" ShowField="Title" PrependId="TRUE">
      </Field>
    </Fields>
    <Views>
      <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitleNoMenu">
          </FieldRef>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="Modified" Ascending="FALSE">
            </FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
        </ParameterBindings>
      </View>
      <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
        <Toolbar Type="Standard" />
        <XslLink Default="TRUE">main.xsl</XslLink>
        <RowLimit Paged="TRUE">30</RowLimit>
        <ViewFields>
          <FieldRef Name="LinkTitle"></FieldRef>
          <FieldRef Name="CategoryName"/>
        </ViewFields>
        <Query>
          <OrderBy>
            <FieldRef Name="ID">
            </FieldRef>
          </OrderBy>
        </Query>
        <ParameterBindings>
          <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
          <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
        </ParameterBindings>
      </View>
    </Views>
    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
    </Forms>
  </MetaData>
</List>

Now time to create features to deploy siteColumns,Content Types and list instances.In my case i have created three web scope features like this
1.CategoryList to deploy Category ListInstance.

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="CategoryList " Id="f07763e7-4b4a-48c7-9da5-0b06f0f2706e" Scope="Web">
  <ElementManifests>
    <ElementManifest Location="Category\Elements.xml" />
    <ElementFile Location="Category\schema.xml" />
  </ElementManifests>
</Feature>

2.FieldsContentTypes to deploy SiteColumns and Content types and activation dependency to Category list.

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="FieldsContentTypes" Id="344f18a5-4a18-4bf0-861d-caca7b17fe99" Scope="Web">
  <ActivationDependencies>
    <ActivationDependency FeatureId="f07763e7-4b4a-48c7-9da5-0b06f0f2706e" FeatureTitle="CategoryList " />
  </ActivationDependencies>
  <ElementManifests>
    <ElementManifest Location="Fields\Elements.xml" />
    <ElementManifest Location="CategoryCT\Elements.xml" />
    <ElementManifest Location="ProductCT\Elements.xml" />
  </ElementManifests>
</Feature>

3.ProductList to deploy Product ListInstance.

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="ProductList" Id="de1999ac-404d-4c1d-9d02-669d125765de" Scope="Web">
  <ActivationDependencies>
    <ActivationDependency FeatureId="f07763e7-4b4a-48c7-9da5-0b06f0f2706e" FeatureTitle="CategoryList " />
    <ActivationDependency FeatureId="344f18a5-4a18-4bf0-861d-caca7b17fe99" FeatureTitle="FieldsContentTypes" />
  </ActivationDependencies>
  <ElementManifests>
    <ElementManifest Location="Product\Elements.xml" />
    <ElementFile Location="Product\schema.xml" />
  </ElementManifests>
</Feature>

Now build and deploy.Please leave comments if you find any errors
Thanks
Ronak

Customize Content Query Webpart in Sharepoint 2010 and Deploy it using Visual Studio 2010

Scenario : I am working on Public facing site in Sharepoint 2010 and i have custom page layout to create pages for events.Now i had requirement to display all these events on home page of site as a Slider.
here is what i am trying to achieve go to http://www.music.udel.edu/Pages/home.aspx and look at In the Spotlight Webpart and it’s none another then most Popular CQWP Webpart in Sharepoint 2010.
Now let’s take look at technical aspect of this Custom CQWP.This CQWP will Query items created based on Event Publicity Content type and check to display as a Spotlight from Page Library called Pages located at site /news-events/events/ and display fields called Title1,Blurb;Location,RollupImage;Spotlightdatetime.OK so Now ready for some fun ? Go to page on which you want to add CQWP in my case its home page of site and edit page to add CQWP in one of Webpart Zone.It’s time to Configure CQWP as per requirement in my case it looks like as shown in image(Query & Presentation).Click on image to view it as large.


Once you verify that CQWP displaying all fields(don’t worry about Presentation) export webpart and save it some location and give it name like Spotlight.webpart.
In order to implement Slider functionality i have used Jquery plugin from EasySlider
Html markup for this jquery plugin to work

<div id="slider">
<ul>
	<li><img src="images/01.jpg" alt="" /></li>
	<li><img src="images/02.jpg" alt="" /></li>
	<li><img src="images/03.jpg" alt="" /></li>
	<li><img src="images/04.jpg" alt="" /></li>
	<li><img src="images/05.jpg" alt="" /></li>
</ul>
</div>

Now based on Query and presentation as per above CQWP render following html markup

<div id="cbqwpctl00_ctl24_g_a2d52845_efc6_449c_acd1_7268e2dd70e2" class="cbq-layout-main">
<ul class="dfwp-column dfwp-list" style="width: 100%;">
	<li class="dfwp-item">
<div class="item">
<div class="image-area-left">
                      <a href="http://Server/news-events/events/Pages/choral.aspx"><img class="image" src="/news-events/events/PublishingImages/u-singers.jpg" alt="" /></a></div>
<div class="link-item">
                     <a href="http://Server/news-events/events/Pages/choral.aspx">Choral Concert with Concert Choir, University Singers and Schola Cantorum</a>
<div class="description">
                          ​Paul D. Head and Duane Cottrell, directors<br />Featuring Vivaldi’s Beatus Vir for double chorus and chamber orchestra.<br /></div>
</div>
</div></li>
	<li>same as above but for second item</li>
</ul>
</div>

As you can see this is exactly what we want to work for our plugin with some modification to give div id in our case its Slider and also add slots for Location and Spotlightdatetime,get rid of Css class that we don’t need.So in order to get this done you have modify either ContentQuerymain.xsl or ItemStyle.xsl or both in my case i had to modify both. Now i personally don’t modify out of box files but instead get copy of it and give some name and then modify copy.In order to do this open Style Library in SPD 2010 and make copy of it and open copy to modify in Editor.In Our case we need to get rid of class=”cbq-layout-main” and replace id=”cbqwpctl00_ctl24_g_a2d52845_efc6_449c_acd1_7268e2dd70e2″ with Slider so open copy of ContentQuerymain.xsl lets say it SpotlightContentQueryMain.xsl and find OuterTemplate and modify as per below

<xsl:template name="OuterTemplate">
        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
        <xsl:variable name="RowCount" select="count($Rows)" />
        <xsl:variable name="IsEmpty" select="$RowCount = 0" />
             <div id="slider">
                 <xsl:if test="$cbq_iseditmode = 'True' and string-length($cbq_errortext) != 0">
                    <div class="wp-content description">
                        <xsl:value-of disable-output-escaping="yes" select="$cbq_errortext" />
                    </div>
                  </xsl:if>
                  <xsl:choose>
                      <xsl:when test="$IsEmpty">
                           <xsl:call-template name="OuterTemplate.Empty" >
                               <xsl:with-param name="EditMode" select="$cbq_iseditmode" />
                           </xsl:call-template>
                      </xsl:when>
                      <xsl:otherwise>
                           <xsl:call-template name="OuterTemplate.Body">
                               <xsl:with-param name="Rows" select="$Rows" />
                               <xsl:with-param name="FirstRow" select="1" />
                               <xsl:with-param name="LastRow" select="$RowCount" />
                          </xsl:call-template>
                      </xsl:otherwise>
                  </xsl:choose>
            </div>
      
            <xsl:if test="$FeedEnabled = 'True' and $PageId != ''">
                <div class="cqfeed">
                    <xsl:variable name="FeedUrl1" select="concat($SiteUrl,$FeedPageUrl,'xsl=1&amp;web=',$WebUrl,'&amp;page=',$PageId,'&amp;wp=',$WebPartId,'&amp;pageurl=',$CBQPageUrl,$CBQPageUrlQueryStringForFilters)" />
                    <a href="{cmswrt:RegisterFeedUrl( $FeedUrl1, 'application/rss+xml')}"><img src="\_layouts\images\rss.gif" border="0" alt="{cmswrt:GetPublishingResource('CbqRssAlt')}"/></a>
                </div>
            </xsl:if>
    </xsl:template>

Now its time to modify ItemStyle.xsl file where presentation of items happen to include Slots for additional fields to display,css and may be some additional html markup.Now here we have two options to modify ItemStyle.xsl first one is you can modify ItemStyle.xsl in which you can copy of style that match closet to your req and modify it in our case its image on left or second option get copy of ItemStyle.xsl and get rid of all template except the one which is closet match to you req and modify it to get rid of OOB css class,to add custom css and html markup.In my case its looks like as per below

<xsl:stylesheet
     version="1.0" 
     exclude-result-prefixes="x d xsl msxsl cmswrt"
     xmlns:x="http://www.w3.org/2001/XMLSchema" 
     xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" 
     xmlns:cmswrt="http://schemas.microsoft.com/WebParts/v3/Publishing/runtime"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
  <xsl:param name="ItemsHaveStreams">
    <xsl:value-of select="'False'" />
  </xsl:param>
  <xsl:variable name="OnClickTargetAttribute" select="string('javascript:this.target=&quot;_blank&quot;')" />
  <xsl:variable name="ImageWidth" />
  <xsl:variable name="ImageHeight" />

 <xsl:template name="ShowXML" match="Row[@Style='ShowXML']" mode="itemstyle">
    <xsl:for-each select="@*">
      Name: <xsl:value-of select="name()" /> Value:<xsl:value-of select="." /><br/>
    </xsl:for-each>
  </xsl:template>

 <xsl:template name="SpotLight" match="Row[@Style='SpotLight']" mode="itemstyle">
    <xsl:variable name="SafeLinkUrl">
      <xsl:call-template name="OuterTemplate.GetSafeLink">
        <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="SafeImageUrl">
      <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
        <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="DisplayTitle">
      <xsl:call-template name="OuterTemplate.GetTitle">
        <xsl:with-param name="Title" select="@Title"/>
        <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
      </xsl:call-template>
    </xsl:variable>
    <div class="item">
       <xsl:if test="string-length($SafeImageUrl) != 0">
          <div class="image-area-left">
          <!-- <a href="{$SafeLinkUrl}">
                              <xsl:if test="$ItemsHaveStreams = 'True'">
                                <xsl:attribute name="onclick">
                                  <xsl:value-of select="@OnClickForWebRendering"/>
                                </xsl:attribute>
                              </xsl:if>
                              <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                                <xsl:attribute name="onclick">
                                  <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                                </xsl:attribute>
                              </xsl:if>
                         </a> -->
               <img class="image" src="{$SafeImageUrl}" title="{@ImageUrlAltText}">
            <xsl:if test="$ImageWidth != ''">
              <xsl:attribute name="width">
                <xsl:value-of select="$ImageWidth" />
              </xsl:attribute>
            </xsl:if>
            <xsl:if test="$ImageHeight != ''">
              <xsl:attribute name="height">
                <xsl:value-of select="$ImageHeight" />
              </xsl:attribute>
            </xsl:if>
          </img>
        </div>
      </xsl:if>

       <div class="link-item">
        <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
          <a href="{$SafeLinkUrl}" title="{@LinkToolTip}">
                    <xsl:if test="$ItemsHaveStreams = 'True'">
                      <xsl:attribute name="onclick">
                        <xsl:value-of select="@OnClickForWebRendering"/>
                      </xsl:attribute>
                    </xsl:if>
                    <xsl:if test="$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'">
                      <xsl:attribute name="onclick">
                        <xsl:value-of disable-output-escaping="yes" select="$OnClickTargetAttribute"/>
                      </xsl:attribute>
                    </xsl:if> 
            <xsl:value-of select="$DisplayTitle"/></a>
            <p>
              <xsl:value-of select="@Spotlightdatetime"/>
            </p>
            <p>
               <xsl:value-of select="@Location"/>
           </p>
           <div class="description">
                <xsl:value-of select="@Description" disable-output-escaping="yes"/>
           </div>
      </div>
    </div>
  </xsl:template>
</xsl:stylesheet>

As you can see in this line means name of Style is Spotlight which can be selected in CQWP Presentation Section and also @Spotlightdatetime and @Location in file which will generate Slots for those two fields in Presentation section of CQWP.You can see in Image below

Wouldn’t be better for user to insert only webpart on page and just give Fields to display in slots and its done ?Also you don’t want to repeat all these steps in different environments like Dev,staging and production. Ok so how we can go for it.Now it’s time to dive in Visual Studio 2010 and Create Empty Sharepoint Project and give it name in my case CAS.SpotlightWebPart.Now in Solutions Explorer right Click on Project and add New SPI called Module and give it some name in my case its Spotlight.Now right Click on Spotlight and add existing item previously exported file called Spotlight.webpart and also download copy of SpotlightContentQueryMain.xsl and SpotlightStyle.xsl and add it under module called Spotlight.Project Structure should like this
.
Now in Properties window of project CAS.SpotlightWebPart change Site Url to your local sharepoint site and set Include in Assembly to False.
Elemenets.xml file should like this

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Url="Style Library/XSL Style Sheets" Path="SpotlightWebPart">
      <File Name="SpotlightContentQueryMain.xsl" Url="SpotlightContentQueryMain.xsl" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
      <File Name="SpotlightStyle.xsl" Url="SpotlightStyle.xsl" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
</Module>
<Module Url="_catalogs/wp" List="113" Path="SpotlightWebPart" >
    <File Name="Spotlight.webpart" Url="Spotlight.webpart" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
         <Property Name="Group" Value="CAS WebPart" />
    </File>
</Module>
</Elements>

Now we need to Modify Spotlight.webpart to update reference to our SpotlightContentQueryMain.xsl and SpotlightStyle.xsl so double click on file in VS 2010 to open in editor and modify following Properties

   <property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/SpotlightStyle.xsl</property>
   <property name="CommonViewFields" type="string">Spotlightdatetime,Text;Location,Text;</property>
   <property name="MainXslLink" type="string" >/Style Library/XSL Style Sheets/SpotlightContentQueryMain.xsl</property>

you can modify other properties as per your business requirement and its all documented on MSDN.Now Build Project,Package it and Deploy.

Restore Site collection and Managed Metadata from Production farm to Development farm in Sharepoint 2010

Once you have Sharepoint Site up and running in Production Environment sometime you would like to have copy of that Site on Development environment for reason likes Production content to test against your custom development.We had same task to copy production site to development and we also have managed metadata service  running on  production environment so also want to copy that as well.
Before i dive into steps thing to check up front make sure both farms have version of Configuration database and also install third Party Controls like Telerik if you are using one on development environment.

Summary of Steps that i have followed to achieve this task
1.Take Backup of Production Site using Sql Server Tools
Login to SqlServer and then right Click on Content Database of Production Site Select Tasks –> Backup and save it on some Shared.
2.Take Backup of Database of Managed Metadata if you have one otherwise skip this step.
3. Restore Content Database and Managed Metadata database on Development SqlServer
Login to Dev SqlServer and Create Database for Dev Site and make Sure dbo is your development farm account domain\farmaccountName.
Restore Production Content Database to this newly created database by right Click on Database Select Task–>Restore
Grant db_owner role to application pool identity which is you going to user to Create Web Application on farm lets say domain\appidentity by using following script

 EXEC sp_addrolemember 'db_owner', 'domain\appidentity' 

Grant db_owner role to Account Configure for Search Crawl if you are using Search.
Now Expand Security Node Under Content Database and Verify that under Users you have ‘dbo’,’domain\appidentity’ users.
Double Click on ‘dbo’ and Verify loginName is your farm account for example domain\farmaccountName.
4.Restore Managed Metadata Database.
If you have Configure Managed Metadata Service you will have Database for that so restore Prod DB on this Database.
Grant db_owner role to application pool identity which is used to configure Managed Metadata Service lets say domain\appService by using following script

 EXEC sp_addrolemember 'db_owner', 'domain\appService' 

Now Expand Security Node Under Managed Metadata Database and Verify that under Users you have ‘dbo’,’domain\appService’ users.
Double Click on ‘dbo’ and Verify loginName is your farm account for example domain\farmaccountName.
5.Now Create a WebApplication on Development Server using Application Pool account which identity is domain\appidentity
6.Now Deploy all your Custom Solutions means .wsp to Development farm.
7.From Central Administration, Select Application Management and then under Databases section Click Manage content databases.
8.Select Previously Created WebApplication and Delete Content Database by Clicking On Content DB name and Check Remove Content Database.
9.Now Add Previously restored Content Database by Clicking on Add Content Database.
That’s it.This should work if you get it right.It worked like charm in my case as i have restored Entire SiteCollection from http://www.music.udel.edu to wwwtest.music.udel.edu
10.If you have different Domain Controller then from Central Administration,Select Application Management and under Site Collection Section Click on Change site collection administrators and change site collection administration.
Credit goes to Andrew Connell
Hope this will help someone out there.

Profile in Sharepoint 2010 Powershell

Hi Guys,

As we all Know Powershell is Powerfull and i am playing with Powershell for Quite sometime.Now everytime i start Powershell ISE  First i need to run following command in order to get access of all commands for Sharepoint 2010 and also i need to run all User Define Powershell functions.

 Add-PSSnapin "Microsoft.Sharepoint.Powershell" 

Wouldn’t be nice if we get all functions and above command run once we Start Powershell ISE ? Here is basic steps for that

Type $Profile on Command Line and u will get some path in my case  i have “C:\Users\LoginUser\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1″.

Now Create File called Microsoft.PowerShellISE_profile.ps1 at above address and add command

 Add-PSSnapin "Microsoft.Sharepoint.Powershell" 

Now add code for all user Define functions that you want to use everytime and save file.Restart ISE and Type some Sharepoint Powershell command

Get-SPWebApplication 

or User define function name  and u will get result.

That’s it…

Note if you are using Sharepoint 2010 Powershell host you don’t need to add Add-PSSnapin “Microsoft.Sharepoint.Powershell” and Also ISE is installed with Server but u need to activate it in order to Use.

Credit for this goes to book called Professional Sharepoint 2010 Administration……..

Thanks

Ronak

SharePoint Delegate Control

Hi,

I am working on Public Facing site in sharepoint 2010 and i had requirement to put Image after Top Navigation end on all subsites but not at Parent of Subsite and top level site of Site collection.

I could have done with this creating a Page layout and providing webpart zone so authors can add image in there but what if they want to change image then they have to go all pages change image manually so then i found this link  http://www.sharepointnutsandbolts.com/2007/06/using-delegate-control.html and thought of doing this with Powerful delegate Control.

I have Created Picture Library with Name of file and Site Title so i can fetch image based on site title from list.

First thing i have put Delegate Control Placeholder in MasterPage like below

 <SharePoint:DelegateControl ID="DelegateControl2" runat="server"  ControlId="PictureHolder" ></SharePoint:DelegateControl> 

In Visual Studio 2010 Create Sharepoint Empty Project and add Mapped folder to Control Temple in Layout and add Web User Control(.ascx).

<div id="pic">
<asp:Image ID="PicHolder" runat="server"  Visible="false"/>
</div>

Code Behind file .ascx.cs (Page_Load Event)

try  {

SPWeb web = SPContext.Current.Site.RootWeb;
SPWeb _currrentWeb = SPContext.Current.Web;
string Title = _currrentWeb.Title;
string _getImageByTitle = @"<Where>
<Eq>
<FieldRef Name='SiteLookUp' />
<Value Type='Lookup'>{0}</Value>
</Eq></Where>";

StringBuilder _query = new StringBuilder();
_query.AppendFormat(_getImageByTitle, Title);
SPQuery Query = new SPQuery();
Query.Query = _query.ToString();
SPList _PictureHolder = web.Lists["Site theme Images"];
SPListItemCollection items = _PictureHolder.GetItems(Query);
foreach (SPListItem item in items) {
//Check for Item Status as we are after only item with Approved Status
if((item.ModerationInformation.Status == SPModerationStatusType.Approved) && item.HasPublishedVersion) {
PicHolder.Visible = true;
PicHolder.ImageUrl = item.File.ServerRelativeUrl;
break;
}
}
}
catch(Exception ex) {
Trap Exception
}

Now Its time to replace delegate control in master page with this .ascx Control for that add new feature in Visual Studio 2010 and elements.xml  file of feature should look like this

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Control Id="PictureHolder" ControlSrc="~/_ControlTemplates/Name of Folder /Name of COntrol.ascx" Sequence="80" />
</Elements>

as i said requirement was to put image on SubSite so scope feature at Web Now deploy it and activate feature.

Take look at here for working sample : http://wwwtest.music.udel.edu/about-us/Pages/default.aspx

Now Content Authors want to change image they change in Picture Library and it will change in all pages within that site….

Simple yet Powerfull…

Comments and suggestions are always welcome

Thanks

Ronak

Flash WebPart to Play Flash Video in Sharepoint 2010

Hi Sharepoint Folks,

Sharepoint 2010 Provide Media webpart which support only .wmv file and Silverlight which is great if you have intranet site but i am working on Public facing site most of users browser have flash plugin so i develop a Webpart to play flash video.

I have used FlowPlayer and you can download it from here http://flowplayer.org/index.html and used Visual Studio 2010 for development.First download flowplayer Jquery,flowplayer swf  and flowplayer control swf files from link above.

Now Create a Sharepoint 2010 empty project and add Module from Items to upload all files for Player to /Style Library/Media Player/.The elements.xml file of Module should like this if you want to Upload files in Style Library like i did.Please note that you can also put all these file in other location.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Styles" Url="Style Library/Media Player" RootWebOnly="TRUE" >
<File  Path="FlowPlayer Resources\flowplayer.controls-3.2.2.swf"  Url="flowplayer.controls-3.2.2.swf" Type="GhostableInLibrary" />
<File Path="FlowPlayer Resources\flowplayer-3.2.4.swf" Url="flowplayer-3.2.4.swf" Type="GhostableInLibrary" />
<File  Path="FlowPlayer Resources\flowplayer.commercial-3.2.4.swf"  Url="flowplayer.min-3.2.4.swf" Type="GhostableInLibrary" />
</Module>
</Elements>

Now add Other Sharepoint in Visual Studio called Webpart and Code (.cs) file of webpart add following Code

SPWeb web = null;
string _html = string.Empty;
StringBuilder _playerhtml = null;
private string _webUrl  = string.Empty;
private string _skin = string.Empty;
private string _pImg = string.Empty;</p>
[WebBrowsable(true)]
[Personalizable(PersonalizationScope.Shared)]
[WebDisplayName("Url Of File to Play")]
[Category("Configuration")]
[WebDescription("Example:/PublishingImages/filename.ext")]
public string VideoUrl {
get { return _webUrl; }
set { _webUrl = value; }
}
[WebBrowsable(true)]
[Personalizable(PersonalizationScope.Shared)]
[WebDisplayName("Url Of Preview Image File")]
[Category("Configuration")]
[WebDescription("Example:/Style Library/Media Player/FileName.ext")]
public string PreviewImag  {
get { return _pImg; }
set { _pImg = value; }
}
protected override void CreateChildControls()
{
  try {
           //get Current Web
          web = SPContext.Current.Site.RootWeb;
          string url = web.Url;
        _playerhtml = new StringBuilder();
          if (_webUrl != string.Empty) {
                   url += VideoUrl.ToString();
                  _playerhtml.AppendFormat("<a id='flowplayer' href='{0}'>",url);
            }
          else {
                _playerhtml.AppendFormat("<a id='flowplayer' href=''>");
           }
           if (_pImg != string.Empty) {
                     _playerhtml.AppendFormat("<img src='{0}' alt='Search engine friendly content' id='PreviewImg' />", PreviewImag.ToString());
           }
           else  {
                    _playerhtml.AppendFormat("<img src='{0}' alt='Search engine friendly content' id='PreviewImg' />", "/Style Library/Media Player/MediaWebPartPreview.png");
            }
            _playerhtml.Append("</a>");
            _playerhtml.Append("<script type='text/javascript' language='javascript'>");
            _playerhtml.Append("$(document).ready(function() {");
             _playerhtml.Append("flowplayer('flowplayer', {allowfullscreen: 'false',src:'/Style Library/Media Player/flowplayer.min-3.2.4.swf'},{ plugins: { ");
            _playerhtml.Append("controls:{url:'/Style Library/Media Player/flowplayer.controls-3.2.2.swf',fullscreen: false}");
            _playerhtml.Append("}});");
            _playerhtml.Append("});");
           _playerhtml.Append("</script>");
           Controls.Add(new LiteralControl(_playerhtml.ToString()));
}
catch (Exception ex)
{
     Controls.Add(new LiteralControl(String.Format("<p>Error: {0} : Description: {1}\n<br/>stack {2}</p>", ex.Source, ex.Message, ex.StackTrace)));
}

Please don’t forget to add reference to Flowplayer.min.js file in Master Page or in page Layout….
That’s It  Deploy it and if its doesn’t work then debug it.
Hope you get is working now add webpart in webpart zone and edit Webpart in Configuration sections Provide Url for Video and Preview Image.
wolah…..Flash Video in Sharepoint…
Take Look at this http://wwwtest.music.udel.edu/Pages/home.aspx to see outcome of above webpart
I haven’t tried this webpart in Sharepoint 2007 but i think it should work.
Thanks for Visiting Blog and comments,suggestions are welcome.

Ronak

Get ID of Item From Query String and Display It on Edit form Page.

Hi Folks,
We Have Online Sharepoint Request from for Users to Submit their Request once users submit the request admin Verify Request and edit it to tag.Now admin want to Display ID of the Item they are editing so they can reference in Comments and Workflow.
You Always can Use SPD to do this but i decide to go with Jquery.here is Jquery

     <script src="/JSLibrary/jquery-1.3.2.min.js" type="text/javascript"></script>
     <script type="text/javascript">
                $(document).ready(function() {
                      var qs= location.search.substring(1, location.search.length);
                      var args = qs.split("&");
                      var ID = args[0].split("=");
                      var Title=$("h2.ms-pagetitle").text();
                      var IDTitle = " (ID: "
                      var NewTitle= Title + IDTitle + ID[1] +")"
                      $("h2.ms-pagetitle").text(NewTitle)
               });
      </script>

This Will Display ID in Editform.aspx like Title of Item (ID: ##)


Thanks
Ronak

How To send Email Notification in HTML format in Sql Server 2005

I have Sql Server 2005 Database with table holding Clearance data for Organization Employees.HR Department wants to get notification for Employees Clearance information whose Clearance is going to expire within 60 Days. In Sql Server 2005 you can configure database mail Profile to send email.here is good link to configure sql Server 2005 for mail Profile.http://www.mssqltips.com/tip.asp?tip=1100
Now Create Store Procedure to get data for Employees whose clearance will expire within 60 days if there any and Format HTML email and then Use msdb.dbo.sp_send_dbmail Procedure to send email.

CREATE PROCEDURE [dbo].[sp_Clearance_Alert]
AS
BEGIN
DECLARE
@body_message varchar(1000)
IF((SELECT count(*) FROM JM_EMPLOYEE_CLEARANCE_T C INNER JOIN JM_EMPLOYEE_T E ON E.JM_EMPLOYEE_ID = C.JM_EMPLOYEE_ID
INNER JOIN btw.dbo.JM_CLEARANCE_ORGANIZATION_T O ON C.JM_CLEARANCE_ORGANIZATION_ID = O.JM_CLEARANCE_ORGANIZATION_ID
INNER JOIN btw.dbo.JM_AGENCY_CLEARANCE_T A ON A.JM_AGENCY_CLEARANCE_ID = C.JM_AGENCY_CLEARANCE_ID WHERE ABS(DATEDIFF(day,GETDATE(),CLEARANCE_RENEWED_DATE)) = 60) > 0)

BEGIN
SET  @body_message = N'<h4>List of Employees Whose Clearance will Expire in 60 Days.</h4>' +
                                 N'<table style="font-  family: Arial, Helvetica, sans-serif; font-size: 10px;" border="1" cellspacing="0" cellpadding="2" width="100%">' +
                                 N'<tbody><tr valign="top">'+
                                 N'<th align="left">First Name</th><th align="left">Last Name</th><th align="left">Organization</th>' +
                                 N'<th align="left">Clearance</th><th align="left">Issue  Date</th><th align="left">Renew Date</th></tr>' +
                                 CAST((SELECT td = FIRST_NAME, '',
                                                      td = LAST_NAME, '',
                                                      td = CLEARANCE_ORGANIZATION_DESC, '',
                                                      td = AGENCY_CLEARANCE_DESC, '',
                                                      td = SUBSTRING(CONVERT(VARCHAR,CLEARANCE_ISSUED_DATE,101),1,10),'',
                                                      td = SUBSTRING(CONVERT(VARCHAR,CLEARANCE_RENEWED_DATE,101),1,10)
                                                      FROM  btw.dbo.JM_EMPLOYEE_CLEARANCE_T C INNER JOIN btw.dbo.JM_EMPLOYEE_T E ON  E.JM_EMPLOYEE_ID = C.JM_EMPLOYEE_ID
                                                      INNER JOIN JM_CLEARANCE_ORGANIZATION_T O  ON C.JM_CLEARANCE_ORGANIZATION_ID =  O.JM_CLEARANCE_ORGANIZATION_ID
                                                      INNER JOIN JM_AGENCY_CLEARANCE_T A ON  A.JM_AGENCY_CLEARANCE_ID = C.JM_AGENCY_CLEARANCE_ID
                                                      WHERE  ABS(DATEDIFF(day,GETDATE(),CLEARANCE_RENEWED_DATE)) = 60 AND LOWER(EMPLOYEE_STATUS) = 'active'
                                                      FOR XML PATH('tr'),TYPE) AS NVARCHAR(MAX) ) +</tbody></table>';
         EXEC msdb.dbo.sp_send_dbmail
                              @profile_name = 'ClearanceAlerts',
                              @recipients = 'name@domain.com',
                              @subject ='Clearance About to Expire.',
                              @body = @body_message,
                              @body_format = 'HTML';
         END
END

Thanks
Ronak

Modify UI in DVWP based on Users is in Sharepoint Group

I have DVWP which display data from Sql Server 2005 and i have also Insert,Edit and Delete link enable in DVWP.
Client wants like only Super admin can see all of these link,Admin can see only edit and Insert link and Read only users cant see any link.so what i did is i have Created 3 Sharepoint group as mention above and Used Jquery Web services library developed By Marc d Anderson to hide links based on whether users is in group or not.

<script src="/JSLibrary/jquery.SPServices-0.4.6.min.js" type="text/javascript"></script>
<script src="/JSLibrary/jquery1.3.min.js" type="text/javascript"></script></div>
<script type="text/javascript">
      $().SPServices ({
              operation: "GetGroupCollectionFromUser",
              userLoginName: $().SPServices.SPGetCurrentUser(),
              async: false,
              completefunc: function(xData, Status) {
                           if($(xData.responseXML).find("Group[Name='Read']").length == 1){ 
                                                    $("img[alt='Edit']").hide();
                                                    $("img[alt='Delete']").hide();
                            }
                          else if($(xData.responseXML).find("Group[Name='Admin']").length == 1){
                                                   $("img[alt='Delete']").hide();</div>
                                       }
                        }
});
</script>

Ronak