Posted by: Shantha Kumar | March 11, 2009

WSS – User Information List

I did some research on Sharepoint(WSS) Users, about where are the users & their properties are stored. 

I got some result with that, So, i like to share that with you all via.. this post,

By using the SPWeb.SiteUserInfoList property,we will get a UserInfo list of the site collection of the current web.

The title of this userinfo list is “User Information List“.This was the hidden list and it has some metadata for storing some information about user.

Here, I list out the metadata available in “User Information List“,

Display Name Type Name
Content Type ID ContentTypeId ContentTypeId
Name Text Title
Approver Comments Note _ModerationComments
File Type Text File_x0020_Type
Account Text Name
E-Mail Text EMail
About Me Note Notes
SIP Address Text SipAddress
Locale Integer Locale
Calendar Type Integer CalendarType
AdjustHijriDays Integer AdjustHijriDays
TimeZone Integer TimeZone
Time Format Boolean Time24
Alternate Calendar Type Integer AltCalendarType
CalendarView Options Integer CalendarViewOptions
WorkDays Integer WorkDays
WorkDay StartHour Integer WorkDayStartHour
WorkDay EndHour Integer WorkDayEndHour
Is Site Admin Boolean IsSiteAdmin
Deleted Boolean Deleted
Picture URL Picture
Department Text Department
Job Title Text JobTitle
Is Active Boolean IsActive
Report To User Report_x0020_To
ID Counter ID
Content Type Text ContentType
Modified DateTime Modified
Created DateTime Created
Created By User Author
Modified By User Editor
Has Copy Destinations Boolean _HasCopyDestinations
Copy Source Text _CopySource
owshiddenversion Integer owshiddenversion
Workflow Version Integer WorkflowVersion
UI Version Integer _UIVersion
Version Text _UIVersionString
Attachments Attachments Attachments
Approval Status ModStat _ModerationStatus
Edit Computed Edit
Name Computed LinkTitleNoMenu
Title Computed LinkTitle
Select Computed SelectTitle
Instance ID Integer InstanceID
Order Number Order
GUID Guid GUID
Workflow Instance ID Guid WorkflowInstanceID
URL Path Lookup FileRef
Path Lookup FileDirRef
Modified Lookup Last_x0020_Modified
Created Lookup Created_x0020_Date
Item Type Lookup FSObjType
Effective Permissions Mask Computed PermMask
Name File FileLeafRef
Unique Id Lookup UniqueId
ProgId Lookup ProgId
ScopeId Lookup ScopeId
HTML File Type Computed HTML_x0020_File_x0020_Type
Edit Menu Table Start Computed _EditMenuTableStart
Edit Menu Table End Computed _EditMenuTableEnd
Name Computed LinkFilenameNoMenu
Name Computed LinkFilename
Type Computed DocIcon
Server Relative URL Computed ServerUrl
Encoded Absolute URL Computed EncodedAbsUrl
File Name Computed BaseName
Property Bag Lookup MetaInfo
Level Integer _Level
Is Current Version Boolean _IsCurrentVersion
Group Computed GroupLink
Edit Computed GroupEdit
Name Computed ImnName
Picture Computed PictureDisp
Name Computed NameWithPicture
Name Computed NameWithPictureAndDetails
Edit Computed EditUser
Selection Checkbox Computed UserSelection
Content Type Computed ContentTypeDisp

By using above metadata’s we can get or set the values to User items in “User Information List”

Read more…

Posted by: Shantha Kumar | March 10, 2009

SharePoint Databases

I did some research on SharePoint Databases and how are they providing datas to SharePoint sites?. Here i am come up with some details of Databases used in SharePoint.

Database Name Description Availablity
SharePoint_AdminContent_
GUID
This is the Central Admin Content database, is used to store all WSS 3.0 / MOSS content. WSS3.0, MOSS 
SharePoint_Config The configuration database contains data about all the databases used, all of the IIS Web sites, Web applications, solutions, Web Part packages, site templates, and Web application and farm settings specific to SharePoint technologies, such as default quota, blocked file types, and configuration. WSS3.0, MOSS 
WSS_Search_ComputerName This database is used for the search services. It contains the information that is required for searching content.By using this database, Windows SharePoint Search services enables users to search all Web site content on the server. WSS3.0, MOSS 
WSS_Content_GUID This database contains data specific to a Web application and its site collections. It contains the content data, such as the document uploaded to a list or a library. By default, a single content database is created for each Web application. All new site collections added to a Web application use the same database WSS3.0, MOSS 
SharedServicesN_DB Each Shared Service Provider (SSP) requires a database for service-specific data. MOSS
SharedServicesN_Search_DB In addition to the SSP database, a separate database is required for frequently changing search-related data. MOSS
SharedServicesContent This database is dedicated for the shared services content. MOSS
SSO This database stores the settings and account information for single sign-on. MOSS

For more informations, visit Windows SharePoint Services 3.0 ,  Office SharePoint Server.

Read more…

The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again.

The above error will be thrown at the time of updating Library or Lists items due to authentication problem, or We didn’t have the rights to update the items.
By using the follwoing code, We can overcome this issue,

Web.AllowUnsafeUpdates = true;
item["Title"]=”Sample”;
item.Update();

or we can also use the follwoing code to overcome the above error, this will affect the WebApplication. This will change the Security settings of a Web Application to allow the anonymous user to update item.

web.Site.WebApplication.FormDigestSettings.Enabled = false;
item["Title"]=”Sample”;
item.Update();
web.Site.WebApplication.FormDigestSettings.Enabled = true;

or we can change the settings in Central Administration to anonymously update the items. But this method will be dangerous.

  • Central Administration > Application Management > Web Application General Settings
  • Choose the WebApplication to overwrite the settings
  • Select the option Off in Web Page Security Validation as follows,

securitysettings1

Read more…

Posted by: Shantha Kumar | March 8, 2009

Download Document from SharePoint Library using WebService

In this post, I am going to explain about downloading a document from sharepoint library using webservice, For that we need following things,

  • Read the contents from Document, located in SharePoint Library
  • Create and store the contents on a new document in Local Machine

To get the contents from Document under Sharepoint library,we shall use the GetItem method of Copy WebService. This method will generate a Byte array of the document, and then pass it as a parameter on FileStream Contrutor to create a new document.

The Syntax for the GetItem method as follows,

public uint GetItem ( string SourceUrl, out FieldInformation[] Fields, out byte[] Stream )

Parameters,

SourceUrl:
A String that contains the absolute source (on the server to which the SOAP request is sent) of the document that is to be retrieved.

Fields:
An array of FieldInformation objects, passed as an out parameter, that represent the fields and the corresponding field values that can be copied from the retrieved document.

Stream:
An array of Bytes, passed as an out parameter, that is a base-64 representation of the retrieved document’s binary data.

Return Value:
A UInt32 that returns 0 to indicate that the operation has completed. (There are also two out parameters containing an array of CopyResult objects and an array of FieldInformation objects.)

Below i’m providing a code for downloading a document from SharePoint Library,

//Copy WebService Settings
string webUrl = “http://localhost:1000″;
WSCopy.Copy copyService = new WSCopy.Copy();
copyService.Url = webUrl+”/_vti_bin/copy.asmx”;
copyService.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Source and Destination Document URLs
string sourceUrl = “http://localhost:1000/Shared Documents/Sample.doc”;
string destinationUrl = “C:\\Documents\Sample.doc”;

//Variables for Reading metadata’s of a document
WSCopy.FieldInformation fieldInfo = new WSCopy.FieldInformation();
WSCopy.FieldInformation[] fieldInfoArray = { fieldInfo };
WSCopy.CopyResult cResult1 = new WSCopy.CopyResult();
WSCopy.CopyResult cResult2 = new WSCopy.CopyResult();
WSCopy.CopyResult[] cResultArray = { cResult1, cResult2 };

//Receive a Document Contents  into Byte array (filecontents)
byte[] fileContents = new Byte[4096];
copyService.GetItem(sourceUrl, out fieldInfoArray, out fileContents);

//Create a new file and write contents to that document
FileStream fStream = new FileStream(destinationUrl, FileMode.Create, FileAccess.ReadWrite);
fStream.Write(fileContents, 0, fileContents.Length);
fStream.Close();

Read more…

Posted by: Shantha Kumar | March 5, 2009

No Excel Calculation Services is available in the farm.

xlserviceserr1

 This was the error, i recieved recently when i open an Excel sheet in browser.  I didn’t recived this error before, so i searched in recent log file. That file list out the following line

03/04/2009 14:27:33.07    w3wp.exe (0×14C4)    0×020C     Excel Services      Excel Services Web Front End  5pad    Critical     No Excel Calculation Services is available in the farm.[User: SHAREPOINT\system]

Then i understood, there is no Excel Calculation Services available in my Server Farm. So, I moved to my Central Administration Page,

  • Central Administration -> Operations -> Services on Server 
  •  Select Excel Calculation server role radio button
  • Start the Excel Calaculation Services

Now I moved back to my Excel sheets Library and clicked the Excel File. Now all works fine for me…

Read more…

In my previous post i’m explained about the members of Copy Web Service. For uploading a document from any local machine to sharepoint document library is possible by using CopyInToItems method.

Though, the syntax for that method is,

public uint CopyIntoItems (string SourceUrl,string[] DestinationUrls,FieldInformation[] Fields,byte[] Stream,out CopyResult[] Results)

Parameters,

SourceUrl:
A String that contains the absolute source URL of the document to be copied.
DestinationUrls:
An array of Strings that contain one or more absolute URLs specifying the destination location or locations of the copied document.
Fields:
An array of FieldInformation objects that define and optionally assign values to one or more fields associated with the copied document.
Stream:
An array of Bytes that contain the document to copy using base-64 encoding.
Results:
An array of CopyResult objects, passed as an out parameter.
Return Value:
A UInt32 that returns 0 to indicate that the operation has completed. (There is also an out parameter containing an array of CopyResult objects.)

Below i’m providing a code for uploading a document to SharePoint Library,

//Copy WebService Settings
string webUrl = “http://localhost:1000″;
WSCopy.Copy copyService = new WSCopy.Copy();
copyService.Url = webUrl+”/_vti_bin/copy.asmx”;
copyService.Credentials = System.Net.CredentialCache.DefaultCredentials;

//Declare and initiates the Copy WebService members for uploading
string sourceUrl = “C:\\Sample.doc”;
string[] destinationUrl = { “http://localhost:1000/Shared Documents/Sample.doc” };
WSCopy.CopyResult cResult1 = new WSCopy.CopyResult();
WSCopy.CopyResult cResult2 = new WSCopy.CopyResult();
WSCopy.CopyResult[] cResultArray = { cResult1, cResult2 };
WSCopy.FieldInformation fFiledInfo = new WSCopy.FieldInformation();
fFiledInfo.DisplayName = “Description”;
fFiledInfo.Type = WSCopy.FieldType.Text;
fFiledInfo.Value = “Sample Description”;
WSCopy.FieldInformation[] fFiledInfoArray = { fFiledInfo };

//Reading the document contents in to stream
FileStream strm = new FileStream(sourceUrl, FileMode.Open, FileAccess.Read);
byte[] fileContents = new Byte[strm.Length];
byte[] r = new Byte[strm.Length];
int ia = strm.Read(fileContents, 0, Convert.ToInt32(strm.Length));
strm.Close();

//Copy the document from SourceUrl to destinationUrl with metadatas
uint copyresult = copyService.CopyIntoItems(sourceUrl, destinationUrl, fFiledInfoArray, fileContents, out cResultArray);

* Where WSCopy is the WebReference Name and the document is uploaded successfully, copyresult returns 0.

Read more…

Posted by: Shantha Kumar | February 10, 2009

SharePoint Copy WebService – Part 1

I got a work on moving a file from document library using Web Service. I already work on this, but I did that with SharePoint Object model. Now I have to search for this using web service, oh… now i’m remembered the Copy web service in sharepoint; it’s just announced in WSS3.0

This Copy Web service plays the role of copying, and moving documents with the field information’s. There are three classes to play this role,

Copy :
Provides methods for copying files between SharePoint sites or within a SharePoint site.
CopyResult  :
Represents the result of a copy operation.
FiledInformation :
Provides properties that define a field associated with a document copied by using a Copy web service operation.

The three methods within Copy class do the job for us to move the files in Sharepoint libraries,

GetItem  :
Generates a Byte array representation of a document that can be passed to the CopyIntoItems method to copy the document to a different server.
CopyIntoItems :
Copies a document represented by a Byte array to one or more locations on a server.
CopyIntoItemLocal  :
Copies a document from one location on a server running Windows SharePoint Services to another location on the same server.

By using this methods we can upload, download from different servers, local machines. In my coming posts I’ll explain each method in deep.

Read more…

Posted by: Shantha Kumar | November 9, 2008

Pre-Release VS 2010 and .NET Framework 4.0 CTP download

Microsoft Visual Studio 2010 and the .NET Framework 4.0 are the next generation development tools and platform for Windows Vista, the 2007 Office System, and the Web.

Click VS2010 to download the Microsoft Pre-release Software Visual Studio 2010 and .NET Framework 4.0 Community Technology Preview (CTP).

To know more details about VS2010, visit http://msdn.microsoft.com/en-us/vs2008/products/cc948977.aspx

Read more…

Posted by: Shantha Kumar | June 5, 2008

WSS 3.0 Tools, now supports VS2008

Hi everybody, It’s nice to hear that Visual Studio 2008 now support the WSS3.0 Tools (VseWSS Version1.2).
If you are using vs2005, you should still use Vsersion1.1

The Downloads for VS extensions for WSS Tools
VS 2008:
VseWSS12

VS 2005:
VseWSSv11

Version 1.2 of the Visual Studio 2008 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:

Visual Studio 2008 Project Templates
Web Part
Team Site Definition
Blank Site Definition
List Definition
Empty SharePoint Project

Visual Studio 2008 Item Templates (items that can be added into an existing project)
Web Part
Custom Field
List Definition (with optional Event Receiver)
Content Type (with optional Event Receiver
Module
List Instance
List Event Handler
Template

SharePoint Solution Generator
This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.

Read more…

Posted by: Shantha Kumar | April 14, 2008

SharePoint Navigation Providers – Part 1

I want to share with you all, about navigation features in both WSS3.0 and MOSS. SharePoint Navigation features called Navigation Providers are enabled in the root directory of webapplications’s web.config file to access widely. These named Navigation providers are added to the <SiteMap> element under <System.Web> Section.

Named Providers are defined under WSS3.0 are,

· SPNavigationProvider

· SPSiteMapProvider

· SPContentMapProvider

· SPXmlContentMapProvider

· SPXmlAdminContentMapProvider*

*This named procedure only available in Central Administration webapplication

All the above providers share the same namespace called Microsoft.SharePoint.Navigation

MOSS included some named providers in addition to the WSS3.0 named providers.

· AdministrationQuickLaunchProvider

· SharedServicesQuickLaunchProvider

· GlobalNavSiteMapProvider

· CombinedNavSiteMapProvider

· CurrentNavSiteMapProvider

· CurrentNavSiteMapProviderNoEncode

· MySiteMapProvider

· MySiteLeftNavProvider

· SiteDirectoryCategoryProvider

· UsagePagesSiteMapProvider

 

Provider Names:

AdministrationQuickLaunchProvider:

Assembly

Microsoft.Office.Server.UI

Namespace

Microsoft.Office.Server.UI

Class Name

Microsoft.Office.Server.Web.

AdministrationQuickLaunchProvider

Description

QuickLaunch navigation provider for the central administration site

Assembly Path

GAC

SharedServicesQuickLaunchProvider:

Assembly

Microsoft.Office.Server.UI

Namespace

Microsoft.Office.Server.UI

Class Name

Microsoft.Office.Server.Web.

SharedServicesQuickLaunchProvider

Description

QuickLaunch navigation provider for shared services administration sites

Assembly Path

GAC

PortalSiteMapProvider:

Assembly

Microsoft.SharePoint.Publishing

Namespace

Microsoft.SharePoint.Publishing.Navigation

Class Name

Microsoft.SharePoint.Publishing.Navigation.

PortalSiteMapProvider

Description

Provides PortalSiteMapNode objects that represent a merging of the Windows SharePoint Services 3.0SPNavigation store and dynamic site structure, including sites and pages. This Provider has four navigation providers to merge with WSS3.0 Providers.

Assembly Path

..\12\ISAPI\

*The each different value of NavigationType property in PortalSiteMapProvider object represents the following providers. There are Current, Global & Combined navigationtypes.

GlobalNavSiteMapProvider:

NavigationType: Global

Description: Include SPNavigationNodes from navigation in the TopNavigationBar collection of Windows SharePoint Services; respect global inheritance and include or hide settings.

CombinedNavSiteMapProvider:

NavigationType: Combined

Description: This is attached to the global navigation or top navigation menu by default.

CurrentNavSiteMapProvider:

NavigationType: Current

Description: Gets the PortalSiteMapProvider object that is attached by default to the current navigation or Quick Launch, respect to current inheritance settings and include or hide settings.

CurrentNavSiteMapProviderNoEncode:

NavigationType: Current

EncodeOutput: false

Description: Gets the PortalSiteMapProvider object that is attached to the breadcrumb navigation by default.

*Gets or sets whether to HTML-encode the Title property of each PortalSiteMapNode object.

MySiteMapProvider:

Assembly

Microsoft.SharePoint.Portal

Namespace

Microsoft.SharePoint.Portal

Class Name

Microsoft.SharePoint.Portal.

MySiteMapProvider

Description

MySite provider that returns (MyProfile links) areas and based on the current user context.

Assembly Path

..\12\ISAPI\

MySiteLeftNavProvider:

Assembly

Microsoft.SharePoint.Portal

Namespace

Microsoft.SharePoint.Portal

Class Name

Microsoft.SharePoint.Portal.

MySiteLeftNavProvider

Description

MySite Left Nav provider that returns areas (Quick Launch) and based on the current user context.

Assembly Path

..\12\ISAPI\

SiteDirectoryCategoryProvider:

Assembly

Microsoft.SharePoint.Portal

Namespace

Microsoft.SharePoint.Portal.WebControls

Class Name

Microsoft.SharePoint.Portal.WebControls.

SiteDirectoryCategoryProvider

Description

SiteDirectory Category Provider returns the Category nodes present in the SiteDirectory Sites.

Assembly Path

..\12\ISAPI\

UsagePagesSiteMapProvider:

Assembly

Microsoft.SharePoint.Portal

Namespace

Microsoft.SharePoint.Portal.Analytics

Class Name

Microsoft.SharePoint.Portal.Analytics.

UsagePagesSiteMapProvider

Description

Provider for navigation in Portal Usage pages

Assembly Path

..\12\ISAPI\

SPNavigationProvider:

Assembly

Microsoft.SharePoint

Namespace

Microsoft.SharePoint.Navigation

Class Name

Microsoft.SharePoint.Navigation.

SPNavigationProvider

Description

Provides a base class for Windows SharePoint Services site-map providers that are specialized for SharePoint site navigation.

Node “sid:1002” represents the QuickLaunchBar,

Node “sid:1025” represents the TopNavigationBar

Assembly Path

..\12\ISAPI\

SPSiteMapProvider:

Assembly

Microsoft.SharePoint

Namespace

Microsoft.SharePoint.Navigation

Class Name

Microsoft.SharePoint.Navigation.

SPSiteMapProvider

Description

Provides the SiteMapNode objects that constitute the global content breadcrumb, which represents objects in the site hierarchy above the current site.

Assembly Path

..\12\ISAPI\

SPContentMapProvider:

Assembly

Microsoft.SharePoint

Namespace

Microsoft.SharePoint.Navigation

Class Name

Microsoft.SharePoint.Navigation.

SPContentMapProvider

Description

Provides methods and properties for implementing a site map provider for contents of a Windows SharePoint Services site. This class provides the SiteMapNode objects that constitute the content breadcrumb, where “content” referes to the lists, folders, items, and list forms composing the breadcrumb.

Assembly Path

..\12\ISAPI\

SPXmlContentMapProvider:

Assembly

Microsoft.SharePoint

Namespace

Microsoft.SharePoint.Navigation

Class Name

Microsoft.SharePoint.Navigation.

SPXmlContentMapProvider

Description

Provides methods and properties for implementing a site map provider for contents of a Windows SharePoint Services site. This class provides the SiteMapNode objects that constitute the content breadcrumb, where “content” referes to the lists, folders, items, and list forms composing the breadcrumb.

Site-Map Path

../ApplicationRootDirectory/_app_bin/layouts.sitemap

SPXmlAdminContentMapProvider:

Available to only Central Administration application

Assembly

Microsoft.SharePoint

Namespace

Microsoft.SharePoint.Navigation

Class Name

Microsoft.SharePoint.Navigation.

SPXmlContentMapProvider

Description

Provides methods and properties for implementing a site map provider for contents of a Windows SharePoint Services site. This class provides the SiteMapNode objects that constitute the content breadcrumb, where “content” referes to the lists, folders, items, and list forms composing the breadcrumb.

Site-Map Path

../CentralAdministrationRootDirectory/_app_bin/admin.sitemap

soon I will come with a deep details about each navigation Providers.

Read more…

« Newer Posts - Older Posts »

Categories