Monday, February 25, 2013

How To Use Multiline Text Field as Calculated Column in Sharepoint?

Following are the Steps to use Multiline Text Field as Calculated Column: 

1. Create a Single line text column . ex, Newsfeed

2. Create a calculated column using the above single line text column.(and select number as data type if u renders any html output )

3. Delete the Single line text column created on step1.

4. Create the multi line text column with the same name as single line text column has,ex Newsfeed.

Now the multiline text is used as calculated column ..

Note: If U want to display any string as Html rendering y must follow above steps..

Client Object Model Architecture Sharepoint2010

The Architecture of Client Object Model, and understand how it functions,

Image1.png

As can be seen in the above diagram all versions of the Client OM go through the WCF Web Service namedClient.svc. This Web Service is located, along with all other SharePoint Web Services, in the folder [SharePoint Root]\ISAPI. The Client OM is responsible for packaging any requests into XML and calling the Web Server, however, when this call takes place is controlled by the developer as you will see. The response from the Client.svc Web Service is sent as JSON and the Client OM is responsible for transforming this into appropriate objects for use in the environment the call was made from.

   The SharePoint Client Object Model is supported in three environments; .NET managed code, JavaScript and SilverLight.

.NET Managed Code Assemblies

To use the Client Object Model in .NET Managed code you must add references to two assemblies in your Visual Studio project. Both of these assemblies can be found in [SharePoint Root]\ISAPI folder, which is typically C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\.
Microsoft.SharePoint.Client.dll (282kb)
Microsoft.SharePoint.Client.Runtime.dll (146kb)
As you can see from the indicated sizes these are not large assemblies and won't bloat an application very much. Despite their relatively diminutive size however they pack a great deal of punch, as you will soon see.

Silverlight Assemblies

Just like .NET managed code, to use the SharePoint Client OM from within a Silverlight application you must add two assemblie references. These assemblies are a little trickier to find and are located in the [SharePoint Root]\Templates\Layouts\ClientBin folder.
Microsoft.SharePoint.Client.Silverlight.dll (266kb)
Microsoft.SharePoint.Client.Silverlight.Runtime.dll (142kb)
The location is understandable considering the the Layout folder is mapped to each SharePoint Web Application and the heavy use of Silverlight within SharePoint 2010. You will notice the size of these assemblies is just slightly smaller than their .NET managed code counterparts. Despite this, there is no difference in functionality.

JavaScript code(ECMA Script) 

To make use of the Client OM in JavaScript you must include the SP.js file on the page. The corresponding SP.Runtime.js will be added automatically by SharePoint.

Object Models Comparision :

Server OMClient OM
SPContext ClientContext
SPSite                                   Site
SPWebWeb
SPListList
SPListItemListItem


Tuesday, February 19, 2013

SP 2010: Introduction to programmatically working with Taxonomies in SharePoint Server 2010

http://zimmergren.net/technical/sp-2010-introduction-to-programmatically-working-with-taxonomies-in-sharepoint-server-2010

Cascading dropdown (or) Filtered Values in Lookup Columns in SharePoint

Please see the below link..

http://sharepoint-works.blogspot.in/2012/02/cascading-dropdown-or-filtered-values.html#.USOhOB0_taY

Sunday, February 17, 2013

Hide the Recycle Bin & View all Site content links in SharePoint site?

Here is How in MOSS 2007: Just add the Content Editor Web part and place the below code ( Add it in Master page if you want to apply for all sites) :
<style>
  
.ms-quicklaunchheader{display: none;}
  
.ms-recyclebin{display: none;}
  
</style>
For SharePoint 2010, CSS classes are little different
/*To Hide both */
.s4-specialNavLinkList
{
display:none;
}
  
/* To Hide Recycle bin */
.s4-rcycl
{
display:none;
}
  
/* To Hide "All Site Content" */
#ctl00_PlaceHolderLeftNavBar_PlaceHolderQuickLaunchBottom_PlaceHolderQuickLaunchBottomV4_idNavLinkViewAllV4
{
display:none;
}


Want to Hide View All Site Content / Recycle Bin Links from everyone, except Site Owners?
Yes, You can set the permission string of these links to hide it from all users except the specified in PermissionString property.

Open your master page in SharePoint designer (either MOSS 2007 or SharePoint 2010). 
In Design view select "All Site content Link"
in Tag Properties, Go to PermissionString and Enter the permission string. Say, you want this link to be available only to Site owners, then enter: "FullMask"

Display PDF Icon in SharePoint



By default, SharePoint does not include a PDF icon. So we need to do the below changes to display the PDF icon for PDF files in our SharePoint environment. Here is how:

1. Download an appropriate icon for pdf document types. you can get it from
http://www.adobe.com/misc/linking.html
2. copy the downloaded PDF icon to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\template\images" (Dont forget to set the read, Read & Execute permissions to "Domain users" to that PDF icon file!)
3. Open the docicon.xml from C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\template\xml\docicon.xml
4. Add an entry under     <ByExtension> node:
  
<Mapping Key="pdf" Value="pdficon_small.png"/>

Once done, you will get the PDF icon as per below screen

One Step Access of SharePoint Feature Solution



  •  Add web parts to any page: append  ?PageView=Shared&ToolPaneView=2
  •  Create New Site Content  /_layouts/create.aspx
  •  List Template Gallery: _catalogs/lt/Forms/AllItems.aspx
  •  Master Page Gallery: _catalogs/masterpage/Forms/AllItems.aspx
  •  Manage your Alerts  _layouts/SubEdit.aspx
  •  Manage Site Collection Administrators  /_layouts/mngsiteadmin.aspx
  •  Manage Sites and Workspaces /_layouts/mngsubwebs.aspx
  •  Manage People  /_layouts/people.aspx
  •  Manage User Permissions /_layouts/user.aspx
  •  Modify Navigation  /_layouts/AreaNavigationSettings.aspx
  •  Recycle Bin /_layouts/AdminRecycleBin.aspx
  •  Save Site as Template: _layouts/savetmpl.aspx
  •  Site Settings page: _layouts/settings.aspx
  •  Site Template Gallery : _catalogs/wt/Forms/Common.aspx
  •  Site Column Gallery  /_layouts/mngfield.aspx
  •  Site Content Types /_layouts/mngctype.aspx
  •  Site Content and Structure Manager /_layouts/sitemanager.aspx
  •  Site Usage Summary /_layouts/SpUsageWeb.aspx
  •  User Alerts  /_layouts/sitesubs.aspx
  •  View All Site Content /_layouts/viewlsts.aspx
  •  Web Part Gallery: _catalogs/wp/Forms/AllItems.aspx
  •  Web part maintenance mode:  append ?contents=1 to the URL of the page

Magic of "New" Tag Indicator in SharePoint

 

        Want to replace it?

            
As part of branding, we can replace the New Indicator. Its just an image, new.gif , located       at:/_layouts/1033/images/new.gif (\14\template\layouts\1033\IMAGES\new.gif). Behind the scenes ddwrt:IfNew Function determines whether to display this image or not.

      Want to change the values?

           
You can query the current value of !New indicator by: 
                          stsadm -o getproperty -pn days-to-show-new-icon -url <URL-of-web-app>
            If you want to change the days:
                          stsadm -o setproperty -pn days-to-show-new-icon -pv <days-to-show> -url     <web-app-URL>

        Want about Disabling it?
Want to disable the !New tag indicator? execute the STSADM: stsadm -o setproperty -pn days-to-show-new-icon -pv 0 -url <web-app-URL>
Here we passed "0" in Property value, which disables the New indicator.