Monday, December 6, 2010

Different Security Issues that can be raised with SharePoint Site

1)Cross site request Forgery

2)Client Side Cookies refernces

3)Missing secure attribute  in encrypted  SSL Cookies

and some more

I will elaborate it soon..keep reading ..

Thursday, November 25, 2010

Synchronizing User Profiles With Site Collections In Webapplication

Command for Synchronizing User Profiles With Site Collections In Webapplication

To Modify the user profile , Go to Shared Service Provider site --> User Profile and Properties-->Edit User info

run the following commands.

STSADM -o Sync -synctiming M:1

STSADM -o sync -sweeptiming M:1

After 1 minute login with modified User

Wednesday, November 17, 2010

QuickLinks in Sharepoint

In this post , I will enlist the Quick links in Sharepoint.

While resolving any bug or developing any functionality you should keep hawk eye on urls generating in browser .Its like a clue to a issue, many times.

To Get the Webparts maintenance page

http://server/pages/default.aspx becomes http://server/pages/default.aspx?contents=1

To Get ServerTemplateID

To Get ContenttypeID
view in browser while modifying content Types

Some more to be added

Sunday, October 10, 2010

Fundamentals of Site Definition

Here I will add  details on following Placeholders (with respect to SP2007/2010)
Site definition is defining the site with prefigured set of Sharepoint Objects

1)How to provision Pages with Master Page ,Page Layouts ,Images and CSS,
1)Define the feature for Page which combines Pagelayouts   and Webparts  and other contents  of the page  as follows

(Define all the pages with GhostableInLibrary  attribute, which makes pages available in site)

<module Name="WelcomePage" Url="Pages" Path="Pages">
<file Url="Welcome.aspx" Path="page.aspx" NavBarHome="True" Type="GhostableInLibrary">
<property Name="Title" Value="Welcome" />
<!--<property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/VillageLayout.aspx,Custom Layout" />-->
<property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/CustomLayout.aspx, Custom Layout" />

Define the Web Scoped Feature
  define the feature  for the Pages in following  path of solution
solution Name\Site Definations\12\TEMPLATE\FEATURES\WebPages\Pages

Stapple this feature  with   Feature Stappler
Feature Stappler is the Farm level feature which associates Site  Template  with Feature Id  in its elements.xml
as follows

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Master Page Files -->
<FeatureSiteTemplateAssociation Id="6A4E5195-B0C0-42cb-B4AC-C18E72276A78"

<!-- Site -->
<FeatureSiteTemplateAssociation Id="07A8588D-CFB5-46bd-A315-6FA80E31AAA6"

<!-- Web -->
<FeatureSiteTemplateAssociation Id="72E6C98A-3E37-4a4a-81F5-504A48A646CC"

<!-- Feature Executing at site level -->
<FeatureSiteTemplateAssociation Id="2772D112-519A-43A2-AB91-8FE93B6130BE"

Where TemplateName   is  Folder at location
solution name\Site Definations\12\TEMPLATE\XML\SiteTemplates\TemplateName 
Which contains the Onet.xml

2)How to Provision Webparts
In   above elements.xml specify the webparts which are prefigured on  page when site is loaded

<module Name="WelcomePage" Url="Pages" Path="Pages" >
<file Url="Welcome.aspx" Path="page.aspx" NavBarHome="True" Type="GhostableInLibrary">
<property Name="Title" Value="Welcome" />
<!--<property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/VillageLayout.aspx,Custom Layout" />-->
<property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/CustomLayout.aspx, Custom Layout" />
<alluserswebpart WebPartZoneID="g_1D8BB5ABF0A14891B0AC79621A17C840" WebPartOrder="1">
<webpart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">
<assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<title>Site Image</Title>
<alluserswebpart WebPartZoneID="g_D6F8BAF418504B53B37617BC2FFD4A0C" WebPartOrder="1">
- <![CDATA[
<webpart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">
<assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<title>Site Image</Title>


Tag AllUsersWebPart specifies the Image Webpart to  be loaded on the Page provisioned in above elements
Two important things here
WebPartZoneID="g_1D8BB5ABF0A14891B0AC79621A17C840"  ,this value is to be retrieved from  corresponding Page Layouts, In above case its  to  be retrieved from /CustomLayout.aspx

Second , To get the CData of webpart
Site Actions -->Site settings--->Gallary-->Webpart Gallary-->Copy the xml of webpart and paste into CData  

Next time I will elaborate on following   and pending placeholder Ids'

1)Creating feature for layouts and and associating it with Site definitions
Create   Site Scoped  feature for Layouts at location
solution Name\Site Definations\12\TEMPLATE\FEATURES\PageLayOuts

In elements.xml specify the pagLayouts to be provisioned as follows
>File Url="XYZPageLayout.aspx" Type="GhostableInLibrary"<

>Property Name="Title" Value="Custom Layout" /<

>Property Name="MasterPageDescription" Value="A custom  layout." /<

>Property Name="ContentType" Value="Page Layout" /<

>Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png" /<


XYZPageLayout.aspx  defines the webpartzones and webparts or other Page Contents

2)Associating above Page feature with Site definition 

< Feature xmlns="http://schemas.microsoft.com/sharepoint/"
Title="Executes when web is created"

Description="Executes when web is created"





< ActivationDependencies >

< !-- Publishing -- >

< ActivationDependency FeatureId="22A9EF51-737B-4ff2-9346-694633FE4416"/ >

< !-- Navigation -- >

< ActivationDependency FeatureId="541F5F57-C847-4e16-B59A-B31E90E6F9EA" / >

< /ActivationDependencies >

< ElementManifests >

< ElementManifest Location="elements.xml"/ >

< /ElementManifests >

< /Feature >
where elements.xml    defines the structure  for Pages  as defined above
which includes xml for defining   layouts ,webparts etc.

3)How to Provision Lists with and Its contents

4)How to associate features with templates

5)How to Control Navigation properties of site from Onet.xml

Details about Implementing Site Definition in Sharepoint 2010

Friday, September 17, 2010

How to Debug Infopath forms running in SharePoint workflow

1)Open the Infopath  form's Project in Visual Studio 2008/Visual studio 2005
 To Get Project's path open Infopath form .And find Design Task -->Design checker -->Compatibility Setting -->Programming -->Project Location

2)Run the Infopath forms in workflow.
Copy the dll ,and infopath forms present in bin folder of project location to  12-->Template-->Feature folder of workflow solution -->copy this folder 12 hive (right click -->copy to 12 hive)

Infopath dont generate .pdb files by default .You need  follow as
right click project in solution explorer-->Properties-->Select Build Tab-->Advance--Build settings -->Set Debug Info--full

3)Refresh infopath forms ,In visual studio Tools -- >
Attach to process-->w3p.exe --> Select the Work flow code

Monday, August 30, 2010

What are the best ways to learn sharepoint2010/2007?

1)Try to read articles from Microsoft.Office ,MSDN or Technet completely .
2)Study the 14/12 hive structure and all the aspx pages inside it.grab the keywords from the pages and search on google.
3)Refer the nice books which provide miscellaneous , tricky things and tips
3)Complete all virtual labs.
4)Study for certifications .
6)View and make notes from videos and Screen casts.
7)Refer the SharePoint msdn Quick Notes

Saturday, July 24, 2010

Certification in Sharepoint 2010 for Developers

Any Certifications you do , validates yourself for the skills you have in corresponding technology (Not just reading dumps and passing , but with actual studies :) ).

This post is to inspire you for doing certification in Sharepoint 2010
For Developers
Exam 70-573:
TS: Microsoft SharePoint 2010, Application Development

Good resources for preparing
1)Microsofts Elearning
2)Channel 9 videos
Go through the contents and preapre for exam .All the best!!
If anyone has passed this exam , can share his/her experiance here..

Sunday, June 27, 2010

How to use Jquery in sharepoint development??

Hello All,

      Jquery is the powerful tool for customization and doing the things in much faster way.So its definitely effective , to use Jquery in sharepoint develpment where ever possible.

Work out on this code to start with Jquery and Sharepoint
its shared by Mohamed Mosallem

Click here to get some More Google Image Results

here to get some More Google Results

Visual learning is always effective and faster . So dont miss to view the following videos

Create a Sliding Interface in SharePoint
jQuery For Absolute Beginners
jQuery with Sharepoint - An intro to jPoint Screencast
jQuery and Sharepoint - Search this Page

Learn jQuery with FireBug, jQuerify and SelectorGadget
RSUG Session - JQuery with SharePoint  (1/6)
RSUG Session - JQuery with SharePoint  (2/6)
RSUG Session - JQuery with SharePoint  (3/6)
RSUG Session - JQuery with SharePoint (4/6)
RSUG Session - JQuery with SharePoint (5/6)
RSUG Session - JQuery with SharePoint (6/6)
SharePoint QuickLaunchExtender
SmartTools jQueryLoader Screencast
How to make Piles Of Money with Google, jQuery and SharePoint

Click here to contact the Jquery Guys if you are facing any issue

I think this is enough to digest the jquery in Sharepoint :)

Monday, June 21, 2010

Smart SP tools for Smart Sharepointing....... :)

Before developing any Software one needs to take care of best practices for good purformance and bug proof software..
Here i will list some of the ways in few days....

Working hard to meet deadlines becomes nightmare for any developer. So I thought,
why not to find  some smart ways 'To work smart not Hard'
for Sharepoint Development, i found some tools
1)Must Have and Top 10 tools
2)...And what more!!  Our Lord Google is always there to get Quick info .. :)

Now we should only improve on 1)how to get it and 2)how beautifuly we implement it facing the issues.

Sunday, June 13, 2010

Whats new in Sharepoint 2010? -A Quick overview

1)Visual Webpart

Visual webpart allows to query any list(without writing CAML query) or database with linq query and .ascx code provides the presentation logic for particular webart
for example


BCS external content type allows the contents of list to be used by external application like outlook
Microsoft Business Connectivity Services (BCS), formerly named the Business Data Catalog, provides read/write access to external data from line-of-business (LOB) systems, Web services, databases, and other external systems within Microsoft SharePoint 2010. SharePoint 2010 has product features that can use external data directly, both online and offline. Developers can gain access to a rich set of features and rapidly build solutions by using familiar tools such as Microsoft Visual Studio 2010 and Microsoft SharePoint Designer 2010.

Coming soon......


Sunday, May 23, 2010

Learn Basics of XSLT,Jquery with the interactive tutorials

Hi ,

As both XSLT and Jquery is required for Customization in sharepoint,I am adding some links to start with,
Dont stop yourself just by reading the above links, Now start practising on online IDEs
 Use CodeRun,
Hope you will enjoy it!!

Sunday, May 16, 2010

Customizing the Search Result By XSLT Using Dataform View

  1. Choose Site Actions -> Edit Page
  2. Locate the "Search Core Results" web part, and choose "Edit" -> "Modify Shared WebPart"
  3. Locate "Data View Properties" and choose the huge "XSL Editor..." button :)

Step 1)Modify the XSLT of the Search Core Results Web Part to get the raw XML

Step 2)
Replace the existing XSLT markup from the Search Core Results Web Part with the following snippet (which basically just give us the raw XML output when searching): as shown  in above

Step 3)Make use of the raw XML that SharePoint generated for us in the Search Core Results Web Part (Save this xml  file)

  Step  4)Open  the ASPX page in sharepoint designer and add DataFormview Webpart and Provide datasource as this xml file. Click on Change layout.Do the necessary changes.

Step 5)Get  the generated xml and  Paste in Search Core Results WebPart's XML-section.

Step 6)Publish this page and find the required output

Some more example  for XSLT transformations
1)Building a Pivot View Web Part based on Multi-value Column
2)Extending Custom Query Webparts
... Will be adding some more examples

Saturday, May 1, 2010

Building the Custom Activities for Workflow

Hello All,

                   This is how Custom activity  can be added for sharepoint designer workflow
step        1)Select Custom Workflow Library project

step 2) Set the required properties in Code behind which will act like parameters

step 3)Create .actions file as shown in following Images

step 4) Make its entry in web.config under authorized types

and Configure the workflow in sharepoint designer. For more info  watch the how to Custom Activity

Generating Solution Packages to Deploy at Production Server

Hello All,
here I will enlist the ways to generate the solution package

The smartest way
•Right-click on your project in Visual Studio Solution Explorer and go to Properties
•Go to the Build Events tab
•Enter the following in the Post-Build event command line section
cd $(SolutionDir)makecab /f Solution.ddf

2)Using the WSP Builder which is available @http://www.CodePlex.com/WspBuilder

3)To Know whats going on behind the Scenes
Watch this how to Configuring and Deploying Workflows to SharePoint Server 2007 Using Solution Packages

Then Run Add Solution, Deploy solution, install feature and
activate feaure Commands to deploy the WSP to SP site

Sunday, April 11, 2010

Querying The List of SharePoint With ServerTemplate ID and Display the result in SPGridView

Create a webpart and initialize the SPGridView control

private SPGridView grid;

protected override void CreateChildControls() {
// create and add the gridview control
this.grid = new SPGridView();
this.grid.AutoGenerateColumns = false;

On PreRender Query list ServerTemplate ID
for contact list as follows

protected override void OnPreRender(EventArgs e) {
SPWeb site = SPContext.Current.Web;
SPSiteDataQuery query = new SPSiteDataQuery();

query.Lists = @"<lists servertemplate="105">"
      query.ViewFields = @"<fieldref name="ID">" + <br />
                          "<fieldref name="FirstName">" +
                          "<fieldref name="Title">";
      query.Webs = @"<webs scope="Recursive">";

DataTable dtResults = site.GetSiteData(query);
DataView dv = new DataView(dtResults);

// set up the field bindings
SPBoundField boundField = new SPBoundField();
boundField.HeaderText = "Last Name";
boundField.DataField = "Title";

boundField = new SPBoundField();
boundField.HeaderText = "First Name";
boundField.DataField = "FirstName";

this.grid.AutoGenerateColumns = false;
this.grid.DataSource = dv;

this.grid.AllowSorting = true;
this.grid.HeaderStyle.Font.Bold = true;


Saturday, March 20, 2010

List of the .files in Sharepoint and its Use and reference

1).actions file --> to add the custom conditions in workflow
2)Element.xml and Feature.xml
Feature.xml will have the location of element.xml
element.xml will have the custom actions which will contain information about executable code

Sunday, January 10, 2010

Some things in SharePoint .. Should be Known Commonly..

We all know that whenever we add a list item or do some modification, we update the list. Here we have two options:
1)List.Update() creates automatically new version of list
2)List.SystemUpdate()does not create automatically new version of list.


To Query for items inside the folder
SPQuery.ViewAttributes = "Scope='Recursive'";
SPQuery.ViewAttributes = "Scope='RecursiveAll'

C)Adding a Recurring Event to Lists on Multiple Sites

D) To impersonate user checking out a file.

SPSite site = new SPSite("SiteCollection_Url");
SPWeb web = site.OpenWeb();
SPUser user = web.AllUsers["User_Name"];
SPUserToken token = user.UserToken;
SPSite impersonatedSiteCollection = new SPSite("SiteCollection_Url", token);

E)Enabling the Send To Record option Enabled
SPAdministration wp=new SPAdministration();
Uri url=new Uri("//portal/records/_vti_bin/officialfile.asmx")

F)To send the email to site users when item is added to custom list
Write the event handler for ItemAdding event and write following
SPSite site = new SPSite("http://yoursite");
SPWeb web = site.OpenWeb();
SPList lst = web.Lists["Alert Test"];
SPAlert alert = web.Alerts.Add();
alert.AlertFrequency = SPAlertFrequency.Immediate;
alert.AlertType = SPAlertType.List;
alert.EventType = SPEventType.All;
alert.DynamicRecipient = "To";
alert.List = lst;
alert.Status = SPAlertStatus.On;
alert.Title = “Auto Email Alert”;
alert.Filter = "";

G)A very Nice tool for Workflow aspx forms

a)WSP Builder
b)Creating Custom fields using WSP Builder
Overriding GetvalidateString Method of Custom field for validation

I)Creating site definition in sharepoint
Site definition have following files
Path:- Local_drive:\Program Files\Common Files\Microsoft Shared\Web server extensions\60\TEMPLATE\1033\XML
Description:- Specifies configurations of lists and modules for a site definition.

Path :-Local_drive:\Program Files\Common Files\Microsoft Shared\Web server extensions\60\TEMPLATE\1033\*\XML
Decription:-Defines navigation bars such as the top link bar and the quick launch, available lists, document templates, base types, configurations, modules


Path :- Local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\1033\Custom_Site_Template\LISTS

Decription:-Defines the columns, views, and contents of a list