Showing newest posts with label SharePoint. Show older posts
Showing newest posts with label SharePoint. Show older posts

July 23, 2010

Document Library “Open with Explorer” from custom WebPart

Today, some one posted in MSDN forums a question regarding, opening the pre defined document library in an Explorer mode from the custom WebPart.
image

Option, which is available with the ribbon menu of the library.


This can be achieved using below, by using the NavigateHttpFolder function in the core.js

NavigateHttpFolder('http:\u002f\u002fServerName:portno\u002fsitename\u002fdoclibraryname','_blank');

This method takes hex encoded URL and frameTarget as the parameters.
It worked for SharePoint 2010 and MOSS 2007 in IE8 and Firefox browsers.

July 10, 2010

MVP Award

I’m glad to say that, I have been awarded Microsoft Most Valuable Professional award for SharePoint Server. I take this moment to thank all my friends, readers of my blog, moderators and members of TechNet and MSDN forums.

Finally, thanks Microsoft for this recognition.

July 5, 2010

The referenced assembly "Microsoft.SharePoint.Client.Runtime" could not be resolved..

Error:
The referenced assembly "Microsoft.SharePoint.Client.Runtime" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

Fix:
When you get the above error, it means that in your project your pointing to .net framework 4.0 and its not installed in your machine. Now, change the project properties to point out available framework in your machine.

March 12, 2010

Enable Developer Dashboard using PowerShell

$service=[Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dashsetting=$service.DeveloperDashboardSettings
Turn on Dashboard
$dashsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$dashsetting.Update()
When turned on, all the information like data base call, request, response, web part events are show in the screen.
image
Turn off Dashboard
$dashsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::Off
$dashsetting.Update()
When turned off, all the information dashboard information are hidden.
$dashsetting.DisplayLevel=[Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::OnDemand $dashsetting.Update()
When set to demand an icon is added to the top right corner next to the user id, which helps in toggle the on/off state of the Developer dashboard.
I have used SharePoint 2010 Management Shell, if you are using windows powershell please load the respective SharePoint 2010 snapin to proceed.

March 7, 2010

Installation of SharePoint 2010 in Client OS

I successfully installed SharePoint 2010 in my laptop. I was not a calk walk, had to really spend some time in trouble shooting some issues. Initially I had issue in finding the PID for the SharePoint 2010 beta. Later it struck in my mind and checked my live ID inbox and found that the PIDs have been mailed to me.

Another issue was with the pre requisite installations, it failed to install. Even after lot of binging also, not able to find the problem. Then I started installing those manually one by one. Then faced the error not able to create the configuration database while running the configuration wizard. So reinstalled the SQL 2008 express edition again. One main thing to be noted after these installation of prerequisite framework and KB hot fixes is to restart the machine.

One more issue which took lot of my time “Failed to create sample data”, quiet puzzled with these one since I have followed all the approaches mentioned in the forums and MVP blogs. Only one thing I had missed that running the below

start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;
IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;
IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;
IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;
IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;
IIS-Security;IIS-BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;
IIS-RequestFiltering;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;
IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-IIS6ManagementCompatibility;
IIS-Metabase;IIS-WMICompatibility;WAS-WindowsActivationService;WAS-ProcessModel;
WAS-NetFxEnvironment;WAS-ConfigurationAPI;WCF-HTTP-Activation;
WCF-NonHTTP-Activation


I had done that manually by by selecting the features in the IIS 7, so it was not that much effective rather than running the above script in the command prompt.



If you are trying to install SharePoint 2010 in client OS, never ever miss a single step mention in the article, Setting up the Development Environment for SharePoint Server. My installation successfully with the below site running in Port 80.



image

March 4, 2010

SharePoint 2010 Training Topics

Below are the topics covered in the training, which I attended this week. These are exactly the same which are available in the SharePoint 2010 training kit.

  • SharePoint 2010 Services Architecture
  • BCS SharePoint
  • Client Object Model
  • Designing Lists and Schemas
  • Enterprise Content Management
  • LINQ2SharePoint
  • Sandboxed Solutions
  • SharePoint 2010 Workflow
  • SharePoint Development with VS10

March 1, 2010

SharePoint 2010 training

I’ll be leaving to Hyderabad tonight, to attend the SharePoint 2010 training conducted by Microsoft Partner. This has been arranged by my organisation unit. I had no clue till morning, that I’ll be attending this training. I’m totally not aware of level of in-depth of coverage. Will be posting about that soon after I come back on Thursday.

Until then, bye bloggy !!

November 16, 2009

Call ASMX Web Service using JQuery in SharePoint

There was query raised in TechNet forums regarding loading the Web Service content in Web part.

http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4dc136e1-7c2c-49ff-bb1b-d81e9037d2f8

I posted below answer for that

Add a Content Editor Web Part and add the below snippet in the source editor.
You have to work on the processResult function for desired presentation of the fetched stock information.

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetQuote xmlns='http://www.webserviceX.NET/'> \
<symbol>MSFT</symbol> \
</GetQuote> \
</soapenv:Body> \
</soapenv:Envelope>"
;

$.ajax({
url: "http://www.webservicex.net/stockquote.asmx",
type: "POST",
dataType: "xml",
data: soapEnv,
complete: processResult,
contentType: "text/xml; charset=\"utf-8\""
});
});

function processResult(xData, status) {
var liHtml =$(xData.responseXML.text);
$("#stockUL").append(liHtml);
}
</script>
<ul id="stockUL"/>

November 7, 2009

SharePoint Property Bag

 

Property bag is a feature available in Windows SharePoint Services 3.0. Its nothing but a hash table of Key-Value pairs. It allows to add properties to objects in a SharePoint site.

image

Why to Use SharePoint Property Bag

The Property Bag hash table for a site can store any metadata as Key-Value pairs such as connection strings, server names, file paths, and other settings needed by your SharePoint application. Most of the time we will store the above settings in configuration file, which is common to the entire web application. If there is any setting specific each and individual sites in the web application, then we have maintain that many entries in the config file. To over come the above scenario we can use the SharePoint Property Bag.

There is no specific out of box user interface available to set or to read the property bag settings. In WSS 3.0 property bag values has to set/get using the object model. There is an option available in SharePoint designer to set/get the property bag settings. Go to Site -> Site Settings. click on the Parameters tab.  On this tab, you will be able to manipulate of all of your custom property bag values.

image

image

How to Use

SPSecurity.RunWithElevatedPrivileges(delegate()
{
try
{
using (SPSite RootSite = new SPSite(URL))
{
using (SPWeb SiteCollection = RootSite.OpenWeb())
{
try
{
SiteCollection.AllowUnsafeUpdates = true;
// Get connection string from Property bag
if (SiteCollection.AllProperties.ContainsKey("ConnectionString"))
{
ConnectionString = SiteCollection.AllProperties["ConnectionString"].ToString();
}
// Set siteID in the Property bag
SiteCollection.Properties["siteID"] = siteID;
SiteCollection.Properties.Update();
SiteCollection.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
//Handle Exception
}
}
}
}
catch(Exception ex)
{
}
});

October 20, 2009

Interesting fact on ows_created_x0020_by property mapping

I was working with Advance search and wondering that Created By is not yielding any search results. After searching I found this information from one blog site.

http://www.networkworld.com/community/node/19021

Its also advised to use “Author” property instead of “Created By”.

Some one posted saying that its solved in SP2, and in some blog sites its mentioned mapping against office(4), I have not tried these approaches. I’ll update once its solved.

Update:

It work like charm, just update the “Created By” property with the Office(4) mapping, and don’t forget to do at least an incremental crawl.

SharePoint Foundation Building Blocks

Preliminary documentation for SharePoint Foundation (SharePoint 2010) is available in MSDN.

http://msdn.microsoft.com/en-us/library/ee534971%28office.14%29.aspx

September 11, 2009

Remove “Send To” from ECB Menu

I faced a situation where I need to remove the Send To menu item from the ECB menu. I binged (Search using Bing) and found lot of blog post to remove the items from the ECB. Most of them are suggesting to have a copy of Core.js and remove the menu items in the new version of renamed core.js file. Refer the new copied version of core.js in the master page.

I found another way of doing this by adding the below line of script to a content editor web part in the item list page or in master page.

function AddSendSubMenu(m,ctx){ return false;}

May 31, 2009

Sticky posts in SharePoint Discussion boards

If you have used SharePoint discussion board in your team site, then you would have wondered that there is no option to make the post as sticky.
By default SharePoint doesn't provide this facility, but it can be acheived easily with the out of box options available with the Discussion board list. After making this changes the discussion board will look like below.

Step 1 Create a Column in the list

Goto the list settings and create column.

Name the column as "Sticky", and choose as
checkbox (Yes/No). We are going to give the option to the owner of the post,
while creating the post whether it should be set as sticky or not.

Step 2 Create a View for Sticky posts

Goto the settings page and create the view and name its as "Sticky", set is as
public view

Another important thing in the Sticky view is changing the sort columns. First
sort coumn should be "Sticky", that is the intention of having the sticky posts.
Sticky posts should be always shown on the top and then followed by the Last
updated posts. So set the "Then sort by column" to Last Updated column. as indicated below.
Step 3 Selecting the Sticky view

Whereever we are showing the discussion board, that is the List View webpart.
Click on modify share webpart menu and change the selected view to "Sticky"
which we created in Step 2.

Now we have the Discussion board ready with the Sticky option.




All the posts which are marked as sticky will be shown on top always.

May 28, 2009

SharePoint object model performance tuning.

Today, I was looking into the performance tuning on our code,
I found this very useful to achieve some.
Although some of them are familiar before, its nice to recollect it.

http://blogs.msdn.com/sowmyancs/archive/2008/10/26/best-practices-sharepoint-object-model-for-performance-tuning.aspx

May 27, 2009

PPT vs PPTX Search behaviour in SharePoint

Recently, I got a mail from my collegue describing a problem in SharePoint search.

Issue : We have a portal on MOSS 2007. Documents are standard office document types to pdf etc. I have a very unique situation during a search. Find attached ppts. One is pptx, and other ppt ( 97- 2003) , content wise both are same. When searching for “Case study I” it lists both ppt’s, but when searching for autoparts (this autoparts is content within a textboxin the ppt , slide 2), it lists only pptx. I cant figure out the reason for this behavior, any suggestions.
In fact, any keyword provided from the content in slide 2 does not bring the 97-2003 format of ppt


Content Crawling

SharePoint crawling process accesses and parses content and its properties, sometimes called metadata, to build a content index from which search queries can be served.

The result of successfully crawling content is that the individual files or pieces of content that you want to make available to search queries are accessed and read by the crawler. The keywords and metadata for those files are stored in the content index, sometimes called the index. The index consists of the keywords that are stored in the file system of the index server and the metadata that is stored in the search database. The system maintains a mapping between the keywords, the metadata associated with the individual pieces of content, and the URL of the source from which the content was crawled.

Lets come to the issue ...

Crawling content is sucessful incase of PPTX since Office 2007 uses New file formt called Office XML format which has lot of benefits one among them is effective search when compared to other previous MS office formats.
Textbox content are also stored as part of XML which was not available in the previous formats.

May 23, 2009

SharePoint 2010 prelim system requirements

Do you know, SharePoint 2010 will require 64 bit OS.

SharePoint Server 2010 will be 64-bit only.
SharePoint Server 2010 will require 64-bit Windows Server 2008 or 64-bit Windows Server 2008 R2.
SharePoint Server 2010 will require 64-bit SQL Server 2008 or 64-bit SQL Server 2005.

Read more from here

December 31, 2008

September 13, 2008

Error while activating publishing feature

Error :
I was trying to activate the Office SharePoint Server Publishing Infrastructure feature through the ManageFeatures pages, but it threw me the access denied error.



Fix :
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>
stsadm -o activatefeature -name PublishingResources -url http://website

Run the above in the command prompt and then try activating the feature it will work, digging on the cause.. will post when I'm done.

May 20, 2008

Binding Datagrid with SPList

To be honest, I was struggling a bit to bind the SPList with the datagrid... and found the way to do so.