Thursday, June 25, 2009
Good article on document versions
http://www.sharepointblogs.com/dez/archive/2007/11/30/moving-copying-documents-between-libraries-with-metadata-including-version-history.aspx
Monday, April 20, 2009
Microsoft SharePoint “14” is now Microsoft SharePoint 2010
Microsoft SharePoint “14” is now Microsoft SharePoint 2010
Here are the some point of discussion with Sharepoint Director
You have probably seen the news announcement today where we announced the public beta for the new Microsoft Exchange Server 2010. As part of that announcement, we also talked about some of the names for the “14” wave of products including Microsoft Office 2010 and Microsoft SharePoint Server 2010. I wanted to answer some questions that I think will inevitably pop to the top of your mind:
What happened to the Office piece of the name? We love MOSS. . . .
The first thing you’ll notice is that the MOSS acronym goes away with the new name since Office is no longer in the SharePoint official name. No one should worry that SharePoint doesn’t work great with Office 2010 since we removed Office from the name, just like people didn’t worry whether SharePoint was a great portal product when we removed Portal from the 2007 name.
The primary reason why we took Office out of the name - lots of folks associate the name Office with the Office client. We wanted to take the opportunity to reestablish the Office name and brand to be synonymous with the client suite. I say “Give the people what they Want” so everyone should immediately think of Microsoft Office = Office apps.
Don’t try to acronym Microsoft SharePoint Server to MSS since MSS is already taken by Microsoft Search Server. Just remember, SharePoint is SharePoint is SharePoint.
What about Windows SharePoint Services?
When you read through the announcement, you may be wondering what happened to Windows SharePoint Services. While we didn’t announcement anything new for WSS, and I want to assure you that we’re definitely working on a new v4 version of the product. It’s too early to drill into any of the details but WSS is getting a lot of new features and will be a great release. We’ll talk more about WSS at a later date.
So, what was announced?
Here are my key takeaways from the interview with Chris Capossela:
• Exchange 2010 will lead the way for the 2010 (previously referred by its codename “14”) wave of technologies and it will be available in the second half of 2009. You can download a beta today.
• Using Office Web applications, customers will be able to create, edit and collaborate on Office documents through a browser.
• IT professionals will be able to choose to either deploy and manage on-premises or hosted as a service.
• For developers, we are working on Open APIs, deep support for industry standards and developer tool support with Visual Studio 2010.
You can read the entire interview here.Thomas Rizzo ,Sr. Director SharePoint
SharePoint Conference 2009 will be the conference to learn about SharePoint Server 2010.
http://www.mssharepointconference.com/.
Some other links are also available here for Moss2007
http://sharepoint.microsoft.com/sharepoint/videos/default.aspx
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
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
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
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 extractOther then nthis a custom utility has been written to read this binary data and save it in to the specified format.
Friday, February 27, 2009
Customize /_layouts files in Sharepoint 2007
Customizing PlaceHolder values in MOSS 2007
Here something
intresting while changing some text based in the _layouts/ folder.These folders
pages cannot be customised in Share point designer.
Case 1:
In a wiki site we need to chagne the CreatewebPage.aspx
label "New Wiki Page " to "My Library page."
A quick solution would be
to, remove the line the bwlow Sharepoint Tag :
<SharePoint:EncodedLiteral runat="server"
text="<%$Resources:wss,webpagecreation_newwk_pagetitle%>"<%$Resources:wss,webpagecreation_newwk_pagetitle%>
EncodeMethod='HtmlEncode'/ >And replace it with:
<SharePoint:EncodedLiteral runat=”server”text=” Text I want” EncodeMethod=’HtmlEncode’/>Though this would work, this is not recommended.My friend (Pawan) gave me an idea to do these change in resource file.
________________________________________________________________
Case 2:
A customer of mine wanted to get rid of the “Error: Access Denied” message that’s displayed to unauthorized (but authenticated) users in MOSS 2007/WSS V2. Instead, user wanted something like “Feel free to join this site”, which according to her organization would convey a more positive message to users.
I had a look at the AccessDenied.aspx page and as expected couldn’t find the text in question. Instead, there were content placeholders. This page uses the “simple.master” as its master page. Certain content placeholder IDs are overridden here. A few are “PlaceHolderPageTitle”, “PlaceHolderPageTitleInTitleArea”, “PlaceHolderMain” and the likes.
A quick solution would be to, remove the line:<SharePoint:EncodedLiteral runat=”server” text=”<%$Resources:wss,accessDenied_pagetitle% >” EncodeMethod=’HtmlEncode’ >
And replace it with:
< SharePoint:EncodedLiteral runat=”server” text=”whatever text I want” EncodeMethod=’HtmlEncode’ >
Though this would work, this is not recommended.________________________________________________________________
Recommended Solution
Another way is to understand how resources work and try tampering with it (well, a copy of it actually).The overridden attribute is referencing a resource file.You would see something like:
<%$Resources:wss,accessDenied_pagetitle%>
or
< %$Resources:wss,webpagecreation_newwk_pagetitle%>
The above syntax indicates that we need to look into wss resource file located *somewhere* and need to find the variable “accessDenied_pagetitle” or "webpagecreation_newwk_pagetitle".
Under \12\config\resources and the others under \app_globalresources folder of the individual virtual directories created by MOSS 2007/WSS v2.
Modifying the wss.en-US.resx file under \12\config\resources wouldn’t reflect the change in the UI.
This would also mean we are modifying the default OOB files and is not recommended.
We can modify the wss.en-US.resx file under \app_globalresources and that would reflect the changes.
Note:Every time a new web application is create the resource files are copied over to \app_globalresources and they govern the resource part of that application.Pop open the wss.en-US.resx under \app_globalresources file and look for the variable “accessDenied_pagetitle” or "webpagecreation_newwk_pagetitle" in it. There would be a data name/value pair. You’ll also see wss.resx file. If you have a wss.en-US.resx (the en-US part can vary depending on the language), you'll need to use that. If you don't, you can use wss.resx.But, if both wss.resx and wss.en-US.resx (or any other language file) are present, wss.en-US.resx would take precedence.
Thursday, February 26, 2009
Customize Search - Advanced Search.
2. Now go to the search settings and go to "Metadata property mappings" and click on "New managed property". On this page give a unique name to your managed property, choose a data type for it, and map it to one or more "Crawled Properties" by using the "Add Mapping" button down the bottom. Search for your column and click add. Once your done do another full crawl to re-index the metadata as a managed property.
Content type is already defined in managed property in Moss as shown in below screen shot.
4. Under the
In this way a new property can be added in advanced search page property restrictions dropdown.
Wednesday, February 25, 2009
Tuesday, February 24, 2009
Upgrate SPS2003 Team site TO MOss2007
1 Pre-Upgrade Steps
Verify that WSS 2.0 Service Pack 2 is installed Install .NET Framework 3.0 Enable Microsoft ASP.NET 2.0 in IIS Web Service Extensions Communicate downtime to site owners and users
2 Upgrade Steps The upgrade steps are explained below:
2.1 Run the Prescan.exe
Copy the “Prescan.exe” from your local drive Run the prescan tool from a command prompt with the following parameter (Prescan.exe /all) Browse the prescan log and lookout for errors. Errors occur if there are orphaned sites/ subsites or lists. These errors should be corrected either by fixing them or if not found to be active, they can be removed. (Refer to section 2.4 below for fixing errors)
2.3 Create the Site Definition Folder as described in my previous article
2.5 Create the Upgrade file Copy an past the upgrade.xml file and past from the below path C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\UPGRADE and replce its content with WSS to the new site definition name[XYZ].
2.6 Run the configuration Wizard Select "No, I want to create a new server farm” Provide database Server Name, Database name, User Account Info Hit Upgrade You should get Configuration Status as Successfully Completed
2.7 Change the URL of existing team site Go to Start Run type ‘inetmgr’ Expand the Web Sites and select WSS
2.8 website Right click Properties Select Web Site tab Advanced Select the host header click Edit Type the new Host Header Value : ABC.com” Click ok and close
2.9 Add entry in the hosts file Go to Start Run type ‘drivers’ Click on etc folder Open the hosts file in notepad Add a new entry for “ABC.com” Save & Close
2.9 Run upgrade and Migrate Go to Central Admin. Under Operations - Site Content Upgrade. Hit Begin Upgrade. Clear the port text box Type ABC.com in host header Select “Create new application pool” type “NewWssAppPool” in a application pool name specify user name and password Select “Manually set database names” in content database section
Click Ok Specify the temporary database name as WSSUP_Temp_”actual content database name” Click Ok
Customize MOSS 2007 ContextMenu
Drop-down menus in Windows SharePoint Services and SharePoint Portal Server 2003 enable actions that relate to a specific document in a document library to be viewed and invoked. This article shows how these document context menus can be extended to add custom menu items. The document first explains how SharePoint document library context menus work, and then demonstrates how custom menu items can be added.
The Business Problem
Windows SharePoint Services (WSS) document libraries provide a location to store and share files and documents. The WSS user interface provides a context sensitive drop-down menu for each item stored in a document library (Figure 1). A common requirement is the ability to customise this menu to add new actions. For example you might wish to add an option to enable a document to be copied or moved to another location or emailed to a colleague.
Figure 1 Document context menu in a SharePoint Document Library
The solution and sample code presented in this article shows how a custom menu item can be created that sends an email link to the relevant document to another user.
Solution Overview
The WSS document context menu is generated by client-side Javascript. The script to display these menus is located in a file called ows.js in the folder \Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033 on the SharePoint server. The AddDocLibMenuItems function in ows.js is responsible for generating the drop-down menus. The AddDocLibMenuItems implementation provides a hook through which additional menu items can be added to the context menu. The first few lines of this function read:
function AddDocLibMenuItems(m, ctx)
{
if (typeof(Custom_AddDocLibMenuItems) != “undefined”)
{
if (Custom_AddDocLibMenuItems(m, ctx))
return;
}
..etc..
This piece of code is checking whether a function called Custom_AddDocLibMenuItems is defined, and if it is then calling it. By implementing this function in a page containing a document library web part, we can extend the context menu, adding our own menu items.
The Custom Menu Items Web Part
So, how can we add a custom piece of JavaScript to a SharePoint page? We need to make sure that the technique we use is configurable and flexible, and that we don’t change any of the built-in script or features of SharePoint so that our implementation is not overwritten by any SharePoint upgrades or service packs that may be deployed in the future.
Fortunately SharePoint provides a convenient mechanism for doing this – the Content Editor Web Part. The Content Editor Web Part enables custom HTML and script to be added to a page and delivered to the browser.
Adding the Web Part to a Page
In SharePoint, navigate to a page with a document library web part on it, or add one to an existing page.
On the Modify Shared Page menu, point to Add Web Parts and click on Browse.
Drag the Content Editor Web Part from the tool pane onto the page, then click Open Tool Pane link in the web part.
In the Layout section clear the Visible on Page checkbox. This means the web part is not visible to the end-user, but the script we add to the web part is still delivered to the client browser. In the page design view, you can still see the web part, but it is marked as hidden. If you wish you can also change the title of the web part in the Appearance section of the tool pane.
Figure 2 Hidden Web Part in Design View
From the tool pane, open the Source Editor and insert the following script:
Click Save in the Source Editor, and then click OK in the tool pane.
Now test the web part by opening a document library drop-down menu on the same page. You should see the new menu item at the top of the menu with a separator bar splitting it from the rest of the menu.
How It Works
The Custom_ AddDocLibMenuItems function takes two parameters. The first parameter, called m, represents the menu object itself; the second parameter, ctx, provides HTTP context information about the web request.
Adding a menu item to the menu requires just one function call:
CAMOpt(m, strDisplayText, strAction, strImagePath);
The CAMOpt function takes four parameters: the menu object to add the new item to, the display text of the menu item, the javascript action to perform when the item is clicked and a path to an image file to associate with the item.
A call to the CAMSep function adds the separator bar to the menu. Both these functions are defined in the menu.js file on the SharePoint server. Finally, the function returns false to the caller. This makes sure the standard menu items are also added to the menu; returning true indicates that these items should not be added.
Debugging the Web Part
To debug the web part, insert a debugger statement into the web part JavaScript:
debugger;
Provided a suitable debugger (such as Visual Studio.NET or the Microsoft Script Debugger) is installed, this statement causes Internet Explorer to break into the script when it is run, and offer the opportunity to start debugging.
Note: By default Internet Explorer disables script debugging. To make sure script debugging is enabled, open the Internet Options dialog from the Tools menu, and on the Advanced tab clear the Disable script debugging check box.
Once in the debugger, you can use the watch window to examine the variables that are available. Interesting variables to examine are m – the menu object, ctx which contains HTTP context information and itemTable which contains information about the list item the menu is associated with.
The Send Mail Web Part
Now we have figured out the principles of customising the drop down menus, the next step is to have them do something useful! The following script adds a menu item that sends an email link to the relevant document. It works by parsing the document URL out of the itemTable object and creating an action that instructs Internet Explorer to start a new mail message.
To use create this web part, simply follow the same steps that we used to create the Hello World menu item, using this script instead:
Clicking the custom menu item opens a new email message with the URL of the document in the body of the message.
Creating Custom Site Definition
As a SharePoint administrator, if you want to customize your SharePoint sites, the first step is to create a custom site definition with a custom master page.
In order to create a new site definition, you pretty must have two options:
design from scratch or copy and edit the existing template.
The former will be more difficult than the latter. Designing your own site definition from scratch can be quite challenging if you are not comfortable with what you are doing.
In this exercise, I will explain the "easy" way to do this.
- You need to start with copying the existing site template from.
On the server computer, browse to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\" folder. Each folder represents a site definition. Copy STS folder and paste with new name. In this exercise, we are going to name this site definition "Business" so rename it BUSINESS. - In this site definition, a custom master page will be used because in the future, you might want to change the master page of the site definition and not unghost it. To do this, copy "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\default.master" file to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS" folder with its name changed to businesscustom.master.
- Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS\default.aspx" file with notepad. In the first line, changeMasterPageFile="~masterurl/default.master"toMasterPageFile="~masterurl/custom.master"Doing so will allow the default.aspx file to use the custom master page. Repeat this step for "defaultdws.aspx" file.
- Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\BUSINESS\xml\ONET.XML" file with notepad.
- Add the following line under
tag: - . Locate the first
tag under tag. - Change
to Notice that I am assigning businesscustom.master value to MasterUrl. - Locate
tag under tag and add the following tag under tag: - Repeat step 6-9 for
and tags. - Locate
tag after and add the following lines to tag:
Notice the file url is the assigned to the custom master page. - So far, we have successfully created a site definition. All we have to do now is to register this definition to the site definition list. To do this, create "WEBTEMPBUSINESS.XML" file in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML" folder. Notice that there exists "WEBTEMP.XML" file in the folder and we are not editing this file. We are creating a new xml file to register a new custom site definition.
- Open the file with notepad and insert the following lines.
- Notice DisplayCategory="Corporation"; this will create a another tag named Corporation and the three items will be inserted to it. You can change titles, descriptions, and imageUrl's based on your needs. Save and close the notepad.
Run IISreset.