Showing posts with label SharePoint 2007. Show all posts
Showing posts with label SharePoint 2007. Show all posts

Wednesday, November 9, 2011

Enable Web folders in SharePoint Explorer View

Some of the below points you should aware if web folder is not working properly in your SharePoint site.
*       When you try to access an Explorer View page on Windows Server 2003, you will sometimes receive the following error: “Explorer View requires Internet Explorer 5.0 or greater and Web Folders.”
This is typically caused by the fact that Windows Server 2003 does not include Web Folders (FPRPC) technology and, by default, the Web Client Service is disabled.
You can resolve this in one of two ways:
1. Install Microsoft Office 2003 or FrontPage on the server. Office 2003 and FrontPage install Web Folders components which will then allow you to access the Explorer View using FPRPC.
2. Enable the Web Client Service on the server. (We have tested in our production which did not work out)
*       If anybody out there has been building demo machines on Windows Server 2008 or Windows Server 2003 you will have run into this issue at some point. Explorer View does not work on document libraries, nor can you map a network drive to a SharePoint site.
Solution:  The server platforms effectively don't like web folder views until you install the fix KB907306. That fixes works for both Windows 2003 and 2008.
Now you can happily map a SharePoint site to your network places and use the Windows Explorer to browse the SharePoint sites.
*       It does not seem to be the problem with an internet explorer. When you attempt to way in an Explorer View page on Windows 7 then you must receive the following error: “Explorer View requires Internet Explorer 5.0 or greater and Web Folders.” Actually this issue comes when your operating system does not include the Web Folders (FPRPC) technology and this service is disabled by default on client machine. To solve this problem, you just need to install the FrontPage on the server then you may try doing the same thing.
Reference Link:

Thursday, September 8, 2011

Tips: Unexpected issue in the out-of-box functionality of SharePoint site

One interesting issue !
 
Suppose just before yesterday you checked that your SharePoint site was working fine, but today you start getting unexpected issue in the out-of-box functionality of SharePoint site( like displaying All Items data, Deleting List Item/Library or Creating View etc.), Then you might thought that without any changes how can the issue arise. Yes you are right, but do you regularly verify the content database size of the site collection. Yes, those unexpected error comes whenever the Content DB has no free space to use. Now it's your task to increase the Content DB size.
 
I got below error while displaying All Items data for a library.
 
<---Render Method ----!>
 
Then I verify the event Viewer where I got the error that TempDB is expecting some space to do the SharePoint transactions(whether displaying data, creating or deleting items etc).
 
 
-Samarendra swain

Monday, February 22, 2010

70-541: Change a user's permissions to edit a list.

using (SPSite spSite = new SPSite("http://testsite/"))


{

using (SPWeb objWeb = spSite.OpenWeb())

{

SPUser objUser = objWeb.EnsureUser("manuhsolutions\\samarendra");

SPList objLst = objWeb.Lists["ListName"];



// break inheriting parent permissions for this List.

objLst.BreakRoleInheritance(false);



// assign Role to the defined User

SPRoleDefinitionCollection objWebRoleDefn = objWeb.RoleDefinitions;

SPRoleAssignment objRoleAssign = new SPRoleAssignment(objUser);



// change the name of the role definition from [Limited Access] to [Full Control]

objRoleAssign.RoleDefinitionBindings.Add(objWebRoleDefn["Full Control"]);



objLst.RoleAssignments.Add(objRoleAssign);

}

}

Monday, December 14, 2009

Delete all site groups programmatically.

SPSecurity.RunWithElevatedPrivileges(delegate
{
using (SPSite spSite = new SPSite("http://testserver/spsite"))
{
using (SPWeb spWeb = spSite.OpenWeb())
{
SPGroupCollection objCol = spWeb.SiteGroups;

for (int count = 0; count <= objCol.Count - 1; count++)
{
spWeb.SiteGroups.Remove(0);
}
}
}
});

Fetching SPList object properly.

When ever we need to access a Custom List or a Document Library , we normally write like:

SPList lst = web.Lists["List Name"];

But this is a performance killer. So avoid this and modify the code to:

SPList lst = web.GetList("http://testServer/Lists/ListName");

Tuesday, August 25, 2009

Create SharePoint Web Application Programmatically

Generally web applications in SharePoint are created using the out-of-box functionality provided within Central Administration. But because of some client's needs there might be a requirement of creating these web applications within a custom utility solution. This functionality can be achieved programmatically using Microsoft SharePoint APIs. By this, one can easily create a web application & associate a content database to it, register the web application in the IIS server, create an associated application pool and define different credentials for the web aplication.

Example code using C#.Net

// namespace required
using System.IO;
using Microsoft.SharePoint.Administration;


// Create new object of SPWebApplication & SPWebApplicationBuilder class
SPWebApplication newApplication;
SPWebApplicationBuilder webAppBuilder = new SPWebApplicationBuilder(SPFarm.Local);

// Set necessary values to webAppBuilder object

webAppBuilder.Port = portNo;
webAppBuilder.RootDirectory = new DirectoryInfo(@"D:\projects\TestWebSite3030");
webAppBuilder.ApplicationPoolId = appPoolId;
webAppBuilder.ApplicationPoolUsername = appPoolUserName;
webAppBuilder.ApplicationPoolPassword = password;
webAppBuilder.CreateNewDatabase = true;
webAppBuilder.DatabaseServer = dbServerName; // DB server name
webAppBuilder.DatabaseName = dbName;// DB Name
if (isSQLAuth)
{
webAppBuilder.DatabaseUsername = dbUid; // dbUid is username of the DB sever
webAppBuilder.DatabasePassword = dbPwd; // dbpassword is password of the DB sever
}
webAppBuilder.UseNTLMExclusively = true; // authentication provider for NTLM
webAppBuilder.AllowAnonymousAccess = isAnonymous; // anonymous access permission

// Finally create web application
newApplication = webAppBuilder.Create();
newApplication.Provision();


I have written the same here also:Create SharePoint Web Application Programmatically

Samarendra Swain

Monday, August 24, 2009

Programmatically assign specific permission in SharePoint

SharePoint site security helps manage permissions for different resources within a site by defining the levels of accessibility permissions for different peoples and groups. In SharePoint, always the top-level or the parent level permissions are inherited to it's child contents (e.g. a sub-site inheriting permissions from it's parent site collection).

In-order to create unique permission we need to break the inheriting parent permission and create new permission level for the SharePoint content. These permissions can be defined for specific users or groups.

Provided below is an example using C# for defining custom permission for a list item.

// assign a item to SPListItem object.
SPListItem objLstitem = objLst.Items[0]; // objLst is the SPList object


// get the user by ID/Email
// objSpWeb is the SpWeb object


SPUser objUser = objSpWeb.SiteUsers.GetByEmail(samarendra@test.com);


// Break inheriting parent permissions for this List Item.
objLstitem.BreakRoleInheritance(false);


// assign Role to the defined User
SPRoleDefinitionCollection objWebRoleDefn = objSpWeb.RoleDefinitions;
SPRoleAssignment objRoleAssign = new SPRoleAssignment(objUser);


// specify the name of the role definition like [Full Control][Read][Contribute] etc.
objRoleAssign.RoleDefinitionBindings.Add(objWebRoleDefn["Contribute"]);
objLstitem.RoleAssignments.Add(objRoleAssign);


I have written the same here also:Programmatically assign specific permission in SharePoint

Samarendra Swain