Monday, March 30, 2009

Java script error in OOB Webparts Modification.

In a OOB webpart user gets an error onclick of edit.This error occures just becasue of the below reasons.This type of issues are due to conflicting IDs in the auto generated code from copy/pasting into content editor web part editor from other sources such as MS Word.
We can avoid this type of issues by formatting using Rich Text Editor from the content editor web part rather than copying and pasting from other sources.

The below steps may be useful in creating contents:

1) Put page in edit mode

2) Edit the content of the content editor web part by selecting the 'modify web part' drop down menu.

3) Select the Rich Text Editor and copy the text if you do not want to lose it.

4) Select Source Editor button, this opens the HTML source code for this Web Part 5) Remove the source code if our source code had a conflicting ID,auto generated code.

6) Update web part and make sure source code does not have auto generated code, or just add a new content editor web part

How to remove Bad web parts from the Share point site

To remove bad webparts from the site.Append ?Contents=1 to the Web Part Page’s URL. For example, http://gardenco/default.aspx?contents=1. The Web Part Maintenance Page is displayed and from there you can delete the offending Web Part. Using this page the above mentioned erronous webpart can be removed.

Friday, March 20, 2009

Issue adding sealed content types having same columns to list

Two known issue regarding content types :

1 ) If you are adding multiple sealed site content types to list and check content type properties from view you will see same default content type attached to every document.It is known issue with sharepoint because it will not recongnised new template at time of attaching content types.
Resolution : if you are doing it using object model then unsealed content type add it to list and then sealed it back at site level.
2) If all sealed content types having same columns then it will be failed again at time of adding all content types at saem time to list(both in GUI and using object model)
Resolution : Add one content type first and then add rest all content types to list will solve the purpose

Adding multiple content types with same columns - Known Issue

Two known issue regarding content types :



1 ) If you are adding multiple sealed site content types to list and check content type properties from view you will see same default content type attached to every document.It is known issue with sharepoint because it will not recognised new content type template at time of attaching content types and always recognize default sealed content type

Resolution : if you are doing it using object model then unseal the site content type first and then add it to list . Dont forget to sealed it back at site level.

2) If all sealed content types having same columns then it will be failed again at time of adding all content types at same time to list(in both cases : GUI and object model)

Resolution : Add only one content type first to list and then add rest all content types in second time. It will solve the purpose

Tuesday, March 10, 2009

Configure VPC to connect internet and network domain

Follow below simple steps to get your VPC configured for internet and system's network domain

1) Go to Virtual PC settings - > Networking and set network adapter to Shared networking (NAT)
2) Go to Local area connection in your VPC : -> properties : -> IP Config settings -> properties - > select "Obtain an IP address automatically" and "Obtain DNS server automatically"
Note : copy and save your existing IP and mask details before selecting this option as those will be erased once you select this option

these two steps will make your vpc in same network where your local system is running. you can test it by pinging any server in vpc command prompt

3) To run internet in VPC , one additional step : Go to Tools - > internet options - > connections tab ->LAN settings - > check "Automatically detect settings" option and uncheck others

sometime one has to repair the network connection if it does't work .

Thanks

Tuesday, March 3, 2009

Sharepoint 2007 Content Database Structure




Content DataBase Structure

Important Tables in Content Databse

Features: Table holds information about all the activated features for each site collection or site. Sites : Information about all the site collections for this content database.
Webs: Information about all the specific sites (webs) in each site collection.
UserInfo: Information about all the users for each site collection.
Groups:Information about all the SharePoint groups in each site collection.
Roles: Information about all the SharePoint roles (permission levels) for each site.
AllLists: Information about lists for each site.
AllDocs: Table that holds information about all the documents (and all list items) for each
AllUserData: Information about all the list items for each list.
RoleAssignment: Table that holds information about all the users or SharePoint groups that are assigned to roles.
GroupMembership: Table that holds information about all the SharePoint group members. document library and list.
I'll update some details of other tables very soon.

**** Note: Dont Update any any content Database table directly . It is not recommended.

Some Important Queries

-- Query to get all the top level site collections
SELECT SiteId AS SiteGuid, Id AS WebGuid, FullUrl AS Url, Title, Author, TimeCreatedFROM dbo.WebsWHERE (ParentWebId IS NULL)-- Query to get all the child sites in a site collectionSELECT SiteId AS SiteGuid, Id AS WebGuid, FullUrl AS Url, Title, Author, TimeCreatedFROM dbo.WebsWHERE (NOT (ParentWebId IS NULL))

-- Query to get all the SharePoint groups in a site collection
SELECT dbo.Webs.SiteId, dbo.Webs.Id, dbo.Webs.FullUrl, dbo.Webs.Title, dbo.Groups.ID AS Expr1, dbo.Groups.Title AS Expr2, dbo.Groups.DescriptionFROM dbo.Groups INNER JOINdbo.Webs ON dbo.Groups.SiteId = dbo.Webs.SiteId

-- Query to get all the users in a site collectionSELECT dbo.Webs.SiteId, dbo.Webs.Id, dbo.Webs.FullUrl, dbo.Webs.Title, dbo.UserInfo.tp_ID, dbo.UserInfo.tp_DomainGroup, dbo.UserInfo.tp_SiteAdmin, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_EmailFROM dbo.UserInfo INNER JOINdbo.Webs ON dbo.UserInfo.tp_SiteID = dbo.Webs.SiteId

-- Query to get all the members of the SharePoint GroupsSELECT dbo.Groups.ID, dbo.Groups.Title, dbo.UserInfo.tp_Title, dbo.UserInfo.tp_LoginFROM dbo.GroupMembership INNER JOINdbo.Groups ON dbo.GroupMembership.SiteId = dbo.Groups.SiteId INNER JOINdbo.UserInfo ON dbo.GroupMembership.MemberId = dbo.UserInfo.tp_ID




Monday, March 2, 2009

Recover a document from the Sharepoint Server 2007


This is an intresting article to know How to Recover a document from MOss2007
In the scenario whereby a document has been deleted from both levels of the
SharePoint recycle bin, you may have a request to recover it. Assuming you have
a SQL database backup of the content database which hosted the document, you can
get it back with minimal effort by following the steps below.

1) SQL Query to get the Document Content in binary format from MOss2007 Content Database.


SELECT AllDocStreams.Id, AllDocStreams.[Content], AllDocStreams.Size, AllDocs.Version, AllDocs.TimeLastModified, AllDocs.CheckoutUserId,
AllDocs.CheckoutDate, AllDocs.IsCurrentVersion, AllDocs.DirName, AllDocs.LeafName, AllDocs.[Level]


FROM AllDocs INNER JOIN


AllDocStreams ON AllDocStreams.Id = AllDocs.Id AND AllDocs.[Level] = AllDocStreams.[Level]
WHERE (AllDocs.DirName = 'sites/Test/Shared Documents') AND (AllDocs.LeafName = 'MOss2007-Details.docx')


If you get multiple records returned, you will want to use the Version field and the isCurrentVersion and perhaps the TimeLastModified fields to determine which record in the one you want to extract.
2) Extract the Document using TextCopy(Utility available in SQL2000 and it will used in this way )

textcopy /s @server /u @user /P @password /d “@database" /t docs /c content /F c:\temp\filename /O /Z /W "where ID= ‘@IdofRecord’ and Level=’@levelofrecord’

Variables
@database = content database
@server = name of SQL Server machine to use
@leafname = filename
@dirname = directory name of file
@IdofRecord = Id of the content record to extract
@levelofrecord = level of content record to extract

Other then nthis a custom utility has been written to read this binary data and save it in to the specified format.