Tuesday, May 20, 2014

Term Store Management and Get Parent Child Name - Guid - Properties

Guys, this can useful where you wanna get the properties associated to the Term Store Management Tools:

You create a Windows Forms where you will have to add a Button, TextBox for Site Url Input and a a DataGridView for Output and Paste the below Code.

private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                string url = textBox1.Text;

                SPSecurity.RunWithElevatedPrivileges(delegate{
                    using (SPSite site = new SPSite(url))
                    {
                            TaxonomySession TaxonomySession = new TaxonomySession(site);

                            TermStoreCollection TermStoreCollection = TaxonomySession.TermStores;
                            {
                                DataTable table = CreateTable();

                                foreach (TermStore ts in TermStoreCollection)
                                {
                                    DataRow rowTS = table.NewRow();
                                    rowTS["ServiceAppName"] = ts.Name;
                                    rowTS["ServiceAppID"] = ts.Id;
                                    rowTS["ServiceAppIsOnline"] = ts.IsOnline;
                                    table.Rows.Add(rowTS);

                                    if (ts.IsOnline)
                                    {
                                        #region Main

                                        TermStore TermStore = TaxonomySession.TermStores[ts.Name];

                                        GroupCollection groups = TermStore.Groups;

                                        foreach (Group grp in groups)
                                        {

                                            DataRow rowGroup = table.NewRow();
                                            rowGroup["GroupName"] = grp.Name;
                                            rowGroup["GroupId"] = grp.Id;
                                            table.Rows.Add(rowGroup);

                                            string termStoreGroup = grp.Name;
                                            var cTermStore = TermStore.Groups.Where(s => s.Name == termStoreGroup);
                                            if (cTermStore.ToList().Count > 0)
                                            {
                                                //Group group = TermStore.Groups[termStoreGroup];
                                                foreach (var termSets in grp.TermSets)
                                                {
                                                    DataRow rowTermSets = table.NewRow();
                                                    rowTermSets["TermSetsID"] = termSets.Id;
                                                    rowTermSets["TermSetsName"] = termSets.Name;
                                                    table.Rows.Add(rowTermSets);

                                                    foreach (var terms in termSets.Terms)
                                                    {
                                                        DataRow rowTerms = table.NewRow();
                                                        rowTerms["TermID"] = terms.Id;
                                                        rowTerms["TermName"] = terms.Name;
                                                        table.Rows.Add(rowTerms);

                                                        foreach (var subTerms in terms.Terms)
                                                        {
                                                            DataRow rowSubTerms = table.NewRow();
                                                            rowSubTerms["SubTermID"] = subTerms.Id;
                                                            rowSubTerms["SubTermName"] = subTerms.Name;
                                                            table.Rows.Add(rowSubTerms);
                                                        }
                                                    }
                                                }
                                        
                                            }
                                            else
                                            {
                                                MessageBox.Show("Group not found");
                                            }
                                        }

                                        #endregion
                                    }
                                }
                        
                                dataGridView1.DataSource = table;
                            }
                    }
                });

                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private DataTable CreateTable()
        {
            try
            {
                DataTable table = new DataTable();
                table.Columns.Add("ServiceAppName");
                table.Columns.Add("ServiceAppID");
                table.Columns.Add("ServiceAppIsOnline");

                table.Columns.Add("GroupName");
                table.Columns.Add("GroupID");

                table.Columns.Add("TermSetsName");
                table.Columns.Add("TermSetsID");

                table.Columns.Add("TermName");
                table.Columns.Add("TermID");

                table.Columns.Add("SubTermName");
                table.Columns.Add("SubTermID");
                
                return table;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return null;
            }
        }

Wednesday, May 14, 2014

ToolbarType "ShowToolbar" of SharePoint ListViewWebPart

Helper method to Set the "ShowToolbar" of ListViewWebPart Toolbar


 private void SetToolbarType(SPWeb web)
        {
            try
            {
                string url = web.Url + "/Pages/defaultlenze.aspx";
                SPLimitedWebPartManager splwManager = web.GetLimitedWebPartManager(url, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);
                SPFile file = splwManager.Web.GetFile(url);
                file.CheckOut();
                foreach (WebPart webPart in splwManager.WebParts)
                {
                    if (webPart is Microsoft.SharePoint.WebPartPages.ListViewWebPart)
                    {
                        Guid webPartGuid = new Guid(((Microsoft.SharePoint.WebPartPages.ListViewWebPart)webPart).ViewGuid);
                        string listName = string.Empty;
                        if (webPart.Title == "My Active Task")
                        {
                            listName = "Tasks";
                        }
                        else if(webPart.Title == "News")
                        {
                            listName = "News";  
                        }
                        SPView view =  web.Lists[listName].Views[webPartGuid];
                        Type[] toolbarMethodParamTypes = { Type.GetType("System.String") };
                        MethodInfo setToolbarTypeMethod = view.GetType().GetMethod("SetToolbarType", BindingFlags.Instance | BindingFlags.NonPublic, null, toolbarMethodParamTypes, null);
                        object[] setToolbarParam = { "ShowToolbar" }; //set the type here
                        setToolbarTypeMethod.Invoke(view, setToolbarParam);
                        view.Update();
                    }
                }
                file.CheckIn("");
                file.Publish("");
            }

Wednesday, April 23, 2014

BaseViewID in Sharepoint List View Element

Hey,

I have created a SharePoint List named "Tasks" using CAML approach - For the same I had created a dummy Tasks List and took the Schema of the list using SharePoint Manager tools.

Note that within my dummy Tasks List, I had created 2 customs views however when I looked carefully at the Schema the BaseViewID was always 1 tho it was a custom view.

I deployed my List and I wanted to show the View on my Default page using ListViewWebPart but when I was mapping my BaseViewID it was not showing the right View.

It took me hours to figure out that SharePoint was referring to the Tasks Schema within the below path - why ? may be because my list name was Tasks... My customer wanted to use the same name and I had to find out some solutions...
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\TasksList\Tasks
On my custom view I gave a different unique ID mentioned by Brian Bedard but it didn't work...

Finally, I decided to re-create the List Instance with the same name "Tasks" but this time using the assistant of Visual Studio which provide a nice interface to create Views and there it worked - It created the custom views with different BaseViewID.

Here is the Elements.xml of the Page (Module) if it can help anyone

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="PageModule" Url="$Resources:cmscore,List_Pages_UrlName;">
    <File Url="defaultLeaf.aspx" Type="GhostableInLibrary" Path="PageModule\defaultLeaf.aspx" IgnoreIfAlreadyExists="TRUE" >
      <Property Name="Title" Value="Home" />
      <Property Name="IncludeInGlobalNavigation" Value="FALSE" />
      <Property Name="ContentType" Value="Welcome Page" />
      <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Leaf.Layout.aspx, Leaf Web Part Page" />
      <AllUsersWebPart WebPartZoneID="Header" WebPartOrder="0">
        <![CDATA[
           <?xml version="1.0" encoding="utf-8"?>
            <WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
              <Title>Welcome</Title>
              <FrameType>None</FrameType>
              <Description>Welcome</Description>
              <IsIncluded>true</IsIncluded>
              <ZoneID>Left</ZoneID>
              <PartOrder>1</PartOrder>
              <FrameState>Normal</FrameState>
              <Height />
              <Width />
              <AllowRemove>true</AllowRemove>
              <AllowZoneChange>true</AllowZoneChange>
              <AllowMinimize>true</AllowMinimize>
              <AllowConnect>true</AllowConnect>
              <AllowEdit>true</AllowEdit>
              <AllowHide>true</AllowHide>
              <IsVisible>true</IsVisible>
              <DetailLink />
              <HelpLink />
              <HelpMode>Modeless</HelpMode>
              <Dir>Default</Dir>
              <PartImageSmall />
              <MissingAssembly>An error has occured - Please contact your system administrator.</MissingAssembly>
              <PartImageLarge>/_layouts/images/mscontl.gif</PartImageLarge>
              <IsIncludedFilter />
              <Assembly>Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
              <TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>
              <ContentLink xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
              <Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor">
                <h2>Welcome to your Site Template</h2>
              </Content>
              <PartStorage xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor" />
              </WebPart>
              ]]>
      </AllUsersWebPart>
      <View List="Lists/News" DisplayName="" Url="" DefaultView="FALSE" BaseViewID="0" Type="HTML" WebPartOrder="1" WebPartZoneID="Header" ContentTypeID="0x">
        <![CDATA[<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name="InitialAsyncDataFetch" type="bool">False</property>
        <property name="ChromeType" type="chrometype">Default</property>
        <property name="Title" type="string" />
        <property name="Height" type="string" />
        <property name="CacheXslStorage" type="bool">True</property>
        <property name="ListDisplayName" type="string" null="true" />
        <property name="AllowZoneChange" type="bool">True</property>
        <property name="AllowEdit" type="bool">True</property>
        <property name="XmlDefinitionLink" type="string" />
        <property name="DataFields" type="string" />
        <property name="Hidden" type="bool">False</property>
        <property name="ListName" type="string">{$ListId:Lists/Announcements;}</property>
        <property name="NoDefaultStyle" type="string" />
        <property name="AutoRefresh" type="bool">False</property>
        <property name="ViewFlag" type="string">8388621</property>
        <property name="Direction" type="direction">NotSet</property>
        <property name="AutoRefreshInterval" type="int">60</property>
        <property name="AllowConnect" type="bool">True</property>
        <property name="Description" type="string" />
        <property name="AllowClose" type="bool">True</property>
        <property name="ShowWithSampleData" type="bool">False</property>
        <property name="ParameterBindings" type="string">  &lt;ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/&gt;
            &lt;ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/&gt;
            &lt;ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/&gt;
            &lt;ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/&gt;
            &lt;ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)" /&gt;
       &lt;ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)" /&gt;
            &lt;ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)" /&gt;
            &lt;ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)" /&gt;&lt;ParameterBinding Name="NoAnnouncements" Location="Resource(wss,NoAnnouncements)" /&gt;&lt;ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,NoAnnouncementsHowTo)" /&gt;&lt;ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,idHomePageNewAnnounce)" /&gt;&lt;ParameterBinding Name="MoreAnnouncements" Location="Resource(wss,MoreAnnouncements)" /&gt;&lt;ParameterBinding Name="ByText" Location="Resource(wss,2000)" /&gt;</property>
        <property name="Xsl" type="string" null="true" />
        <property name="CacheXslTimeOut" type="int">86400</property>
        <property name="WebId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">00000000-0000-0000-0000-000000000000</property>
        <property name="ListUrl" type="string" null="true" />
        <property name="DataSourceID" type="string" />
        <property name="FireInitialRow" type="bool">True</property>
        <property name="ManualRefresh" type="bool">False</property>
        <property name="ViewFlags" type="Microsoft.SharePoint.SPViewFlags, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">Html, TabularView, Hidden, Mobile</property>
        <property name="ChromeState" type="chromestate">Normal</property>
        <property name="AllowHide" type="bool">True</property>
        <property name="PageSize" type="int">-1</property>
        <property name="SampleData" type="string" null="true" />
        <property name="BaseXsltHashKey" type="string" null="true" />
        <property name="AsyncRefresh" type="bool">False</property>
        <property name="HelpMode" type="helpmode">Modeless</property>
        <property name="ListId" type="System.Guid, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">$ListId:Lists/Announcements;</property>
        <property name="DataSourceMode" type="Microsoft.SharePoint.WebControls.SPDataSourceMode, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">List</property>
        <property name="AllowMinimize" type="bool">True</property>
        <property name="TitleUrl" type="string">/sites/TeamSite/Lists/Announcements</property>
        <property name="CatalogIconImageUrl" type="string" />
        <property name="DataSourcesString" type="string" />
        <property name="GhostedXslLink" type="string">main.xsl</property>
        <property name="PageType" type="Microsoft.SharePoint.PAGETYPE, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">PAGE_NORMALVIEW</property>
        <property name="DisplayName" type="string" />
        <property name="UseSQLDataSourcePaging" type="bool">True</property>
        <property name="Width" type="string" />
        <property name="ExportMode" type="exportmode">All</property>
        <property name="XslLink" type="string" null="true" />
        <property name="ViewContentTypeId" type="string" />
        <property name="HelpUrl" type="string" />
        <property name="XmlDefinition" type="string">&lt;View Name="{A7CDF12B-A952-4931-8E82-3A7B3170D5ED}" MobileView="TRUE" Type="HTML" Hidden="TRUE" DisplayName="" Url="/sites/TeamSite/default.aspx" Level="1" BaseViewID="0" ContentTypeID="0x"&gt;&lt;Query&gt;&lt;Where&gt;&lt;Or&gt;&lt;IsNull&gt;&lt;FieldRef Name="Expires"/&gt;&lt;/IsNull&gt;&lt;Geq&gt;&lt;FieldRef Name="Expires"/&gt;&lt;Value Type="DateTime"&gt;&lt;Today/&gt;&lt;/Value&gt;&lt;/Geq&gt;&lt;/Or&gt;&lt;/Where&gt;&lt;OrderBy&gt;&lt;FieldRef Name="Modified" Ascending="FALSE"/&gt;&lt;/OrderBy&gt;&lt;/Query&gt;&lt;ViewFields&gt;&lt;FieldRef Name="LinkTitleNoMenu" Explicit="TRUE"/&gt;&lt;FieldRef Name="Body" Explicit="TRUE"/&gt;&lt;FieldRef Name="Author" Explicit="TRUE"/&gt;&lt;FieldRef Name="Modified" Explicit="TRUE"/&gt;&lt;FieldRef Name="Attachments" Explicit="TRUE"/&gt;&lt;/ViewFields&gt;&lt;RowLimit&gt;5&lt;/RowLimit&gt;&lt;Toolbar Type="Freeform"/&gt;&lt;/View&gt;</property>
        <property name="Default" type="string" />
        <property name="TitleIconImageUrl" type="string" />
        <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
        <property name="SelectParameters" type="string" />
      </properties>
    </data>
  </webPart>
</webParts>]]>
      </View>
      <View List="Lists/Tasks" DisplayName="My Active Task" Name="My Active Task"  WebPartZoneID="Header"  BaseViewID="9" Type="HTML" WebPartOrder="2">
        <![CDATA[
             <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
                  <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
                  <TypeName>Microsoft.SharePoint.WebPartPages.ListViewWebPart</TypeName>
                  <Title>My Active Task</Title>
             </WebPart>
      ]]>
      </View>
     
     
      <AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1">
        <![CDATA[
        <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
          <Assembly>Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
          <TypeName>Microsoft.SharePoint.WebPartPages.MembersWebPart</TypeName>
          <Title>Site Manager</Title>
          <Description>Use the Members Web Part to see a list of the site members and their online status.</Description>
          <FrameType>Standard</FrameType>
          <IsVisible>true</IsVisible>
        </WebPart>
      ]]>
      </AllUsersWebPart>
      <AllUsersWebPart WebPartZoneID="Right" WebPartOrder="2">
        <![CDATA[
        <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
          <Assembly>Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
          <TypeName>Microsoft.SharePoint.WebPartPages.MembersWebPart</TypeName>
          <Title>Site Members</Title>
          <Description>Use the Members Web Part to see a list of the site members and their online status.</Description>
          <FrameType>Standard</FrameType>
          <IsVisible>true</IsVisible>
        </WebPart>
      ]]>
      </AllUsersWebPart>
    </File>
  </Module>
</Elements>
    

Deploy Metadata Navigation through CAML - NO CODE Approach

Hey,

The requirements was to create a new List Instance using CAML approach with some Metadata Navigation Settings pre-configured into it as in my list I have used a Managed Metadata Field.

This turned out to be harder than I thought !!!

After Googling I came to the post by Corey Roth which help understand the concept of MetadataNavigationSettings used as a CAML.

Now, where to find the Value of  client_MOSS_MetadataNavigationSettings  Property, I tried to rebuild the CAML manually using the common sense and doing some trial and error with the MetadataField FieldID GUID however it wasn't working...

Thereafter, I decided to get the value programmatically - for that I created a dummy Document Library and I got the XML Value of the client_MOSS_MetadataNavigationSettings using the below code and VOILA - I got the value.
SPDocumentLibrary lib = (SPDocumentLibrary)site.OpenWeb().Lists["SharedDocuments"];var res = lib.RootFolder.Properties["client_MOSS_MetadataNavigationSettings"];
Once I got the value, I converted the XML tag into HTML - These 3 symbols only:
" by &quot;
< by &lt;
> by &gt;
Finally, my Elements.xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <ListInstance FeatureId="{00bfea71-e717-4e80-aa17-d0c71b360101}" TemplateType="101" Title="MyDocuments" Description="" Url="MyDocuments" CustomSchema="Files\MyDocuments\Schema.xml" HyperlinkBaseUrl="http://zin506/sites/TeamSite" RootWebOnly="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/"  OnQuickLaunch="TRUE" />
  <PropertyBag Url="MyDocuments" ParentType="Folder" RootWebOnly="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/">
    <Property Name="client_MOSS_MetadataNavigationSettings" Type="string"
              Value="&lt;MetadataNavigationSettings SchemaVersion=&quot;1&quot; IsEnabled=&quot;True&quot; AutoIndex=&quot;True&quot;&gt;
  &lt;NavigationHierarchies&gt;
    &lt;FolderHierarchy HideFoldersNode=&quot;True&quot; /&gt;
    &lt;MetadataField FieldID=&quot;7ced7787-dcf6-4748-a23e-f0248f89db58&quot;
                   FieldType=&quot;TaxonomyFieldType&quot;
                   CachedName=&quot;Category&quot;
                   CachedDisplayName=&quot;Category&quot; /&gt;
  &lt;/NavigationHierarchies&gt;
  &lt;KeyFilters /&gt;
&lt;/MetadataNavigationSettings&gt;" />
  </PropertyBag>
</Elements>

Enjoy! 

Tuesday, April 22, 2014

Provisioning Managed Metadata (Taxonomy) Fields through CAML in SharePoint 2010

Hey guys,

The requirement was to provision a List trough CAML with some metadata columns associated to a specific Managed Metadata Service.

Things was the customer wanted to use the features as a template so NO CODE approach has been decided.

This tasks give me a tough time as there was no help available in the net as in all the blogs written for creating a Managed Metadata field were associating the fields using a Feature Receiver - that means using code.

What I did is that within a Team Site, I created a dummy list where I created the required fields and associate them to the specific Managed Metadata Service.

Once done, I saved the Site as a Template and downloaded the Wsp solution from the Solution Gallery.

Now using Visual Studio 2012 (thanks to VS2012), while creating a project it gives an option to create a solution from a Wsp Solution so here we go !!!

There after the project loaded successfully, I looked into the dummy list and copied the schema associated into it and pasted into my custom list schema and VOILA ! The list was provisioned with the managed metadata field associated to the MMS.

note that in case if you don't have Visual Studio 2012, you can still rename the wsp solution into a .CAB file and look for the schema of the dummy list but without intellisense...

Thursday, January 16, 2014

Install-SPSolution : This solution contains resources scoped for a Web application and must be deployed to one or more Web applications. - Planning Deployment of Farm Solutions for SharePoint 2013

Hello folks,

SharePoint 2013 allows users to run sites in SharePoint 2010 mode. That would be possible only with PowerShell command:

Install-SPSolution –Identity Solution.wsp –GACDeployment –CompatibilityLevel {14,15}

Install-SPSolution -Identity Solution.wsp –WebApplication http://localhost/ –GACDeployment –CompatibilityLevel {14,15}

The deployment was successful however I had done lots of branding (masterpages, page layouts, css..) so those seems corrupted while activating the features...

This failed for me.

Ref: http://blogs.technet.com/b/mspfe/archive/2013/02/04/planning-deployment-of-farm-solutions-for-sharepoint-2013.aspx

WelcomePageUrl Property of the Publishing Feature and "Page not found - The page you're looking for doesn't exist." - SharePoint 2013

Hello guys,
After getting the above error, The trick is to name the module like the custom default page - for example in my case my default page name is "defaultCustom.aspx" hence I named the module <Module Name="defaultCustom" />.
Here is the entire onet.xml
<?xml version="1.0" encoding="utf-8"?>
<Project Title="SiteDefinition1" Revision="2" ListDir="" xmlns:ows="Microsoft SharePoint" xmlns="http://schemas.microsoft.com/sharepoint/">
  <NavBars>
  </NavBars>
  <Configurations>
    <Configuration ID="0" Name="SiteDefinition1"  CustomMasterUrl="_catalogs/masterpage/CustomV4.master" MasterUrl="_catalogs/masterpage/CustomV4.master">
      <Lists/>
      <SiteFeatures>

        <!--PublishingPrerequisites Feature-->
        <Feature ID="{a392da98-270b-4e85-9769-04c0fde267aa}"/>

        <!--PublishingResources Feature-->
        <Feature ID="{aebc918d-b20f-4a11-a1db-9ed84d79c87e}"/>

        <!--PublishingLayouts Feature-->
        <Feature ID="{d3f51be2-38a8-4e44-ba84-940d35be1566}"/>

        <!--Publishing Feature-->
        <Feature ID="{f6924d36-2fa8-4f0b-b16d-06b7250180fa}" />

        <!--Sharepoint Server Standard Feature-->
        <Feature ID="{b21b090c-c796-4b0f-ac0f-7ef1659c20ae}" />

        <!--Sharepoint Server Enterprise Feature-->
        <Feature ID="{8581a8a7-cf16-4770-ac54-260265ddb0b2}" />

        <!--Document Set Feature-->
        <Feature ID="{3bae86a2-776d-499d-9db8-fa4cdc7884f8}" />

        <!--Document ID Feature-->
        <Feature ID="{b50e3104-6812-424f-a011-cc90e6327318}" />

        <!--Search Server Webparts Feature-->
        <Feature ID="{eaf6a128-0482-4f71-9a2f-b1c650680e77}" />

        <!-- Termstore Site Features -->
        <Feature ID="73EF14B1-13A9-416b-A9B5-ECECA2B0604C" />

        <Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4" />
        
        <Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="AllowRss" Value="false"/>
            <Property Key="SimplePublishing" Value="false" />
          </Properties>
        </Feature>

        <!--Custom Site Feature-->
        <Feature ID="7916bd78-38dd-4595-a02f-68cd4975144a" />

        <!--Custom Master Page Feature-->
        <Feature ID="{66b35b36-fd66-4a16-ab68-d3b47ae8cbf7}" />

        <!--Custom Layout Page Feature-->
        <Feature ID="{7a226876-f2c4-45da-b09b-bd06598cecac}" />
        
      </SiteFeatures>

      <WebFeatures>

        <!-- Publishing feature -->
        <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/CustomV4.master"/>
            <Property Key="DefaultPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom.Layout.aspx"/>
            <Property Key="WelcomePageUrl" Value="$Resources:osrvcore,List_Pages_UrlName;/defaultCustom.aspx" />
            <Property Key="SimplePublishing" Value="true" />
            <Property Key="RequireCheckoutOnPages" Value="False" />
          </Properties>
        </Feature>

        <!--This Feature and Properties corresponds to the Navigation Settings UI page-->
        <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
          <!-- Per-Web Portal Navigation Properties-->
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="InheritGlobalNavigation" Value="true"/>
            <Property Key="ShowSiblings" Value="true"/>
            <Property Key="IncludeSubSites" Value="true"/>
          </Properties>
        </Feature>

        <!-- Enterprise Wiki Feature -->
        <Feature ID="76D688AD-C16E-4cec-9B71-7B7F0D79B9CD" />

      </WebFeatures>

      <Modules>
        <Module Name="defaultCustom" />
      </Modules>
      
    </Configuration>
  </Configurations>

  <Modules>
    <Module Name="defaultCustom" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Url="defaultCustom.aspx" Type="GhostableInLibrary" Level="Draft" >
        <Property Name="Title" Value="$Resources:cmscore,EnterpriseWiki_Site_WelcomePageTitle;" />
        <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/Custom.Layout.aspx, Custom Web Part Page" />
        <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
    </Module>
  </Modules>
</Project>

Monday, January 13, 2014

Visual WebPart Template missing in Visual Studio 2012

Hi folks,

Did not know why the Visual Studio Team has changed the SharePoint Visual WebPart Template.

The SharePoint 2010 developers know that the Visual WebPart is nothing but an Asp.Net user control (.ascx) which is loaded by SharePoint from the file system.

However I have recently installed Visual Studio 2012 and got surprised that the template have been changed and go to know that I was not only the one who experienced that.

Resolution: http://chuvash.eu/2012/09/20/the-original-visual-web-part-template-is-missing-in-visual-studio-2012/

Cheers !

AppFabric installation and SharePoint 2013 Installation

While installing SharePoint 2013 - the AppFabric was failing and I noticed 2 erros:

 - Installer MSI returned with error code : 1603
 - The term 'Add-ASAppSqlInstanceStore' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The solution is to add the below entry to the PSModulePath (System properties -> Environment Variables -> System variables)

C:\Windows\system32\WindowsPowerShell\v1.0\Modules\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\PowerShell\Modules\;C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules

Cheers !