Posts mit dem Label SharePoint 2013 werden angezeigt. Alle Posts anzeigen
Posts mit dem Label SharePoint 2013 werden angezeigt. Alle Posts anzeigen

Mittwoch, 13. Februar 2013

Change from Managed to Structural Navigation in SharePoint 2013 publishing programmatically


I developped a WebTemplate based on a Publishing site definition. The publishing features activated Managed Navigation by default. And I was unable to find how to change it programmatically. Then I used SharePoint Manager 2013 and found in the web Properties following key: SPFeatureProperty
And this was the Value:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<WebNavigationSettings Version="1.1">
  <SiteMapProviderSettings>
    <SwitchableSiteMapProviderSettings Name="CurrentNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="CurrentNavigationTaxonomyProvider" UseParentSiteMap="True" />
    <SwitchableSiteMapProviderSettings Name="GlobalNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="GlobalNavigationTaxonomyProvider" UseParentSiteMap="True" />
  </SiteMapProviderSettings>
<NewPageSettings AddNewPagesToNavigation="True" CreateFriendlyUrlsForNewPages="True"/>
</WebNavigationSettings>

I Compared it tot he value of a second web I configured through the SiteSetting interface:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<WebNavigationSettings Version="1.1">
  <SiteMapProviderSettings>
    <SwitchableSiteMapProviderSettings Name="CurrentNavigationSwitchableProvider" TargetProviderName="CurrentNavigation" />
    <TaxonomySiteMapProviderSettings Name="CurrentNavigationTaxonomyProvider" Disabled="True" />
    <SwitchableSiteMapProviderSettings Name="GlobalNavigationSwitchableProvider" UseParentSiteMap="True" />
    <TaxonomySiteMapProviderSettings Name="GlobalNavigationTaxonomyProvider" UseParentSiteMap="True" />
  </SiteMapProviderSettings>
  <NewPageSettings AddNewPagesToNavigation="True" CreateFriendlyUrlsForNewPages="True"/>
</WebNavigationSettings>

So I started looking for the WebNavigationSettings Class and I found this Post: Working with publishing navigation in SharePoint 2013
Here ist the code like it should be in a feature receiver:
SPWeb web = (SPWeb)properties.Feature.Parent;
myNavigationSettings.CurrentNavigation.Source = StandardNavigationSource.PortalProvider;
myNavigationSettings.Update();

StandardNavigationSource is an enumeration and looks like this:
public enum StandardNavigationSource
    {
        Unknown = 0,
        PortalProvider = 1,
        TaxonomyProvider = 2,
        InheritFromParentWeb = 3,
    }

Montag, 28. Januar 2013

Deploy to Hostheader Error

 

image

I added the host header to the Hosts file as described in some blogs. Unfortunately SharePoint started asking me for my credentials.

The solution was to delete the entry from the hosts file and extend the web application site with the server name.

Samstag, 8. Dezember 2012

"The Workbook cannot be oppened." in SharePoint 2013


Last Week I installed SharePoint 2013 for a customer. After installation I got the same error with the Excel Web Part as described in this Post.

I tried the proposed Solution:

$webApplication = Get-SPWebApplication "http://intranet "
$webApplication.GrantAccessToProcessIdentity("Domain\serviceAccount")

In the PowerShell-Window the Script the powershell command seemed to be executed succesfully but nothing changed. A look in the SQL Management Studio confirmed that no permissions has been granted for the Service Account. 

After a second look at the Content Database permissions I understood the problem. My Admin Account was not db_owner on the Content_Database because I was added afterward. I asked the main Administrator to execute the above Commands, and everything worked well. 

So if you add a new Administrator to the Farm-Admins, don't forget that this account will not have all permissions Granted as you think.