Loading...

Monday, December 24, 2012

How to add Taxonomy Fields To Page Layouts?

1)Create Site Column Of Type Manged Metadata and add this Site Column to Associated Page Layout Content type
For example
If Page Layout is associated  with Project Page,Edit Site columns to include this Manage Metadata columns

2)In SPD refresh toolbox  ,So that Managed Metadata field is visible  as shown in image, Drag this  field to PageLayout
Add taxonomy reference

<%@ Register Tagprefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

This field will be visible only when you create New Page using this Page Layout


Sunday, December 23, 2012

Importing Very Simple BDC Model

1)Create a SQL table in Sql DB 
2)Create New  External Content Type in SPD with SQL connection  with User's Identity as Authentication mode.
3)Create required operation like read, write for Table Created in SQL
4)In CA,In Secure Store Service , Create Target application which maps the Credentials for External Content Type (If necessary)
5)In BCS Service Application, Set the required permissions for External Content Type
6)Create The External List With this Content Type
When You browse the list , you come across to this exception
“Login failed for user “NT AUTHORITY\ANONYMOUS LOGON” while browsing to external list.”
To avoid this enable RevertToSelf Authentication Mode as described here
Now ,Set the Authentication Mode to BDC Identity.
7)Save the ECT and export this Model

8)Edit the .bdcm file and modify it according to production server as follows.Save  this file and Import this model in  Production server CA
 <LobSystemInstance Name="UserInfocon">
          <Properties>
            <Property Name="ShowInSearchUI" Type="System.String"></Property>
            <Property Name="AuthenticationMode" Type="System.String">RevertToSelf</Property>
            <Property Name="DatabaseAccessProvider" Type="System.String">SqlServer</Property>
            <Property Name="RdbConnection Data Source" Type="System.String">ProdServer</Property>
            <Property Name="RdbConnection Initial Catalog" Type="System.String">DataBaseName</Property>
            <Property Name="RdbConnection Integrated Security" Type="System.String">SSPI</Property>
            <Property Name="RdbConnection Pooling" Type="System.String">true</Property>
          </Properties>
        </LobSystemInstance>

Sunday, December 9, 2012

Silverlight Client Object Model For Windows Phone

In SharePoint 2010,Silverlight Client Object Model was not supported for Windows Phone
But This is improved in SharePoint 2013
As Windows Phone 7.5 first creates an object of the Authenticator class or ODataAuthenticator
which were added to the SharePoint 2013 client object model for Microsoft Silverlight for Windows Phone. It then uses this object as the user’s credentials.
Read more in this msdn post

Sunday, November 25, 2012

Wow!! Add SharePoint 2013 App Instantly

What an Interesting Ribbon this is !!

Now we should focus on converting the SharePoint Solutions in Apps, And that is  the SharePoint Future.

Sunday, November 18, 2012

Configure Anonymous Application Pages Without Enabling Anonymous Authentication

Without enabling the anonymous authentication on all list and libraries,It is possible to create few application pages anonymous.

1)Create in Mapped folder for Application Page in Solution Explorer.(Apply the masterpage which don't references css and js files from Style library)
2)In Code behind and .aspx of Application Page Inherit from UnSecuredLayoutBasePage
3)Implement URL authorization  (ASP.Net Concept)
In  Web.Config of this WebApp  add following section
(Use <location> configuration tag, and <allow users="?"/> to allow anonymous only or <allow users="*"/> for all
<location path="_layouts/MappedFolder/AnonymousPage.aspx">
      <system.web>
        <authorization>
          <allow users="*" />
        </authorization>
      </system.web>
    </location>

Monday, October 22, 2012

Brand Configurable Left Navigation With WebPart

1)In SPD , create the Page from  Master Page as shown  in below image

2)Add the required namespaces  and  contentplaceholderid="PlaceHolderLeftNavBar"
In this contentplaceholderid Insert the WebPartzone.
Now ,you can configure Left Navigation On Fly,with the help of configurable webpart in this zone

<%-- _lcid="1033" _version="14.0.4762" _dal="1" --%>
<%-- _LocalBinding --%>
<%@ Page language="C#" MasterPageFile="~masterurl/default.master"    Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"  %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content id="Content1" runat="server" contentplaceholderid="PlaceHolderLeftNavBar">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
    <tr>
     <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" width="100%"> 
     <WebPartPages:WebPartZone runat="server" Title="loc:FullPage" ID="FullPage" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td>
    </tr>
    <script type="text/javascript" language="javascript">if(typeof(MSOLayout_MakeInvisibleIfEmpty) == "function") {MSOLayout_MakeInvisibleIfEmpty();}</script>
  </table>
    </asp:Content>
To add the combined configurable left navigation and QuickLaunch check this link
3)To adjust the position of main contents and quicklaunch  apply this css

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server">
 <style type="text/css">
#s4-leftpanel-content   
 {
    width:25%;
   float:left;
 }
 
#MSO_ContentTable
{
  width:75%;
  float:right;
}

    </style>
</asp:Content>
Note --> Above Quicklaunch will be available only for Particular Page or PageLayout
If you want to make this consistent through out the Site, You need to write the Delegate control with WebPart Zone ,check this post for creating delegate control.

Thursday, October 11, 2012

Content Approval Workflow Using Reusable Workflows

A)Reusable Workflow associated with Content Type In SharePoint Designer
1)Create the Site columns(similar columns that are created after content approval is enabled on Library) and add those  Site Columns to Content type Inherited from Document Content Type


2)In Document Library , Enable the Custom Document Content type as created in above step
and delete the existing document Content Type

3)Enable the Content Approval on this Document Library
Library Settings -->Versioning-->Select allow content approval option

4)In SharePoint Designer ,In Workflows tab,create new Reusable workflow(this is only the deployable workflow , so avoid creating list workflows , If unknowingly you have created List workflow see this trick, another trick)
Associate this Workflow to Content Type (created in step1)
Link
One more..

5)Add this workflow to  Content Type Created in Step A 1
Edit the Custom Document Content Type, in workflow Settings  , Add the workflow instance using reusable workflow template as created above.

6)Save this Reusable workflow as Template in SPD  and download the required wsp from Site assets Library

B)Deploy reusable workflow to Production site
1)Save the site as Template (Test site where content type is created and associated with workflow )and Import into Visual Studio(select site columns ,Custom Document Content type  and Document Instance while importing.
Deploy this solution on production site (or create feature dependency).

2)Upload the wsp created in step A 5 and activate the Workflow  feature .
Or (Import  as Workflow in visual studio and create dependent feature on step B 1)

3)By default Document Workflow will not be associated with Custom Content Type.
When you import Reusable workflow ,Add the feature receiver which will  associate
Custom Document Content Type with this Workflow
Download the Source
In this source ,Association and Initiations forms are removed .you can add those if required.

C)Difference in Content Approval and Approval Workflow

Note -->For association of Content Type and importing wsp to Visual Studio, you can read this post