Monday, August 25, 2008

Hide Document library name like "Pages" link from BreadCrumb

Always people like breadcrumb but always hate sharepoint breadcrumb just because of it shows document library name in breadcrumb when you are on the page which exists in that document library. Like:- There is one Test.apsx page in my Pages Document Library.
Sharepoint will show it like :- Site -> Pages ->Test.aspx . Everybody hate that thing because when use click on Pages link it will show user that document library and all items in it. Which no body want to show.
When i was caught doing this then i realize that how big this issue is specialy for client. Then i thought to resolve this issue.

So finally here is the script which can save your like (can hide Document Library like "Pages" link from breadcrumb):-




[script language="javascript" type="text/javascript"]
var breadCrumbs = document.getElementById('ctl00_PlaceHolderTitleBreadcrumb_ContentMap')
if (breadCrumbs != null)
{
if (breadCrumbs.childNodes.length >= 3)
{
if (breadCrumbs.childNodes[2].innerHTML.indexOf('Pages') > 0)
{
breadCrumbs.childNodes[1].innerHTML = "";
breadCrumbs.childNodes[2].innerHTML = "";
}
}
}[/script]
//Change '"[","]" to "<",">" in script tag.
Just put this code either in Master page or on the same page where you want to hide document library name from breadcrumb.

Enjoy breadcrumb rather hate it more.
Kuldeep Kadyan.

Update list item without changing the version even versioning is enable on the list

A few days back i need to update metadeta of my document library after uploading the file using custom upload form. I done quickly everything as you know i am not an expert so had left lot of things were pending in that. The main thing was that each time when my code update any item it was counting an update event not create event for server so its create new version each time. Two versions were there within a single second
1. one file upload time
2. one metadata updation time.

I was really fed up.....after a lot of searching i got the solution and writing here for you all guys.

SPList list = site.Lists["MyList"];
SPListItem listItem = list.Items[CurrentFileIndex];
listItem["FileCode"] = strFileCode;
listItem["Comments"] = txtComments.Text;
listItem.SystemUpdate(false);


here the main thing is that we are calling listItem.systemUpdate() method instead of listItem.Update() method.

Hope it will help out you guys.

Tuesday, June 10, 2008

"Save site as Template" for Publishing sites!!! "

Hi guys,

I am here again to discuss one of small issue with developer and client when they are looking for reuse thier work with publishing sites.

When one of my client create a new site using publishing site template. He need to create more sites with same structure on his other site then he ask me that can they do the same without doing everything again...is their any feature in MOSS. I simply told them "Yes" just go to Site Setting->Under look and feel ->Save this site as a template with or without including contents depends on you. He was very happy to save their a lot of time as well as effort. But shortly shouted on me that their is no option here. :D

Then i double check my self and found that this feature is not enable for Publishing sites only. Rest of the sites you can use this feature. My client was worried about their rework and i was in confusion that Microsoft forgot this feature for Publishing sites.
Then again last option Google. I found that if site don't have publishing features enabled then you will not able to find out this feature for all sites...but even after this publishing sites will not able to use this feature. Then i found a little trick. Here it is:-

In order to save any Publishing Site as a template, you must manually append the site template address "/_layouts/savetmpl.aspx" to the site URL. So for instance, if your site is http://MyServer/Mysite , you can save the template by manually browsing to http://MyPortal/Myite/_layouts/savetmpl.aspx.

Thank GOD finally i save myself !!!

Hope it will work for you too...

Tuesday, May 27, 2008

"This item cannot be deleted because it is still referenced by other pages"

Hey,
I created some master pages to change the layout of my site with some content types with different page layouts.
After some time i got finalized my site layout. Now i thought that i should remove the garbage data from site like other content types, master page and page layout. So i prefer to go into SPD(Sharepoint Designer) and press delete button after selected item. What is this!!!!
"This item cannot be deleted because it is still referenced by other pages"
I thought might be on my site somewhere i am using these things so i did double check for everything and try again but its kick my a** again with the same error message.

Then again i went to great GOD google and found this is most popular error message when you are going to delete you content type, Master page and page layout etc and also get solution there. So to help you guys i am written the same thing here.

Steps:-
1. Create a new sub-folder in the masterpage document library.
2. Move the master page to the new folder (I did this by using SharePoint Designer)
3. Just delete the complete folder.
Yup, my master page finally gone from the document library!!!

You will feel relax after this if you had created a lot of sample items in you site.

Monday, May 26, 2008

Create your own Master Page (Minimal)...

Hey Guys,

If you search something about master page for SharePoint site, you will find out thousand of blogs upon it. As i did in my starting phase. I was neither a good developer so that i can create master page in Visual Studio nor i was good in sharepoint customization. so i was just looking for easiest way by which i can create my own master. Even i didn't know abc of designing also. So you can say just a blank paper on which i want to write down something. So finally i got a great blogger which makes my life easier from that day at least in sharepoint designing. That is only one Kyle Schaeffer. I just did whatever he told me to do for design a master page. The best thing of his blog was that he provide Minimal master page code with Core.css and one sample Demo Master page code with it's Demo.css file that made things easy for me.

So as usual for beginners i will explain the Master page design step by step so that nobody need to struggle with this as much i did.

Here are the steps:-

1. Open your Site in SharePoint Designer like http://myserver/ or http://myserver:port/ .
2. Open _catalogs folder from the root of the site.
3. Open Masterpage document library. You can see all masterpages of your site collection here.
4. Now go to File Menu->New-> Sharepoint Content->Page tab->MasterPage then ok. Like:-






5. Now you get a Untitled page1 with some line of HTML code. Don't bother about these lines just delete all the lines.
6.Copy this Minimal Master Page Code from here provided by Kyle and paste in your page HTML code.
7. Now Copy the code of Core.css from here and paste in your folder/library where you want just by creating a Core.css file. You can use default Core.css if you don't want to customize it at the first glance but at least you need to customize it for better look and feel. Please don't modify existing Core.css file otherwise you will not able to revert back.
(Note that you must override the default core.css file in order for this to work properly. The best way to do this is to programmatically override the "SharePoint:CssLink" control, but if you need a quick fix, you can simply customize the "core.css" file for each site in your site collection. Do this using the "Manage Styles" task pane in SharePoint Designer. Just double-click on any style that begins with ".ms" and then replace the entire contents of core.css with the contents of CoreCss.txt) .
8. Just Save the Page with appropriate name and publish it as a major version (when you do Check-In then it will ask for this). If it will ask for approval then do complete the process otherwise the contents will be not available for all users.
9. Now go to the site (Browser). Here Site Actions->Site Sittings->Modify all site settings.
10. Under Look and Feel you will see Master Page. Click on this and select the master page whatever you create. Click OK.
11. Come the home page and see you had your master page dude!!!!


If you want to use Kyle's Demo Master page for your design then use it's Master Page Code and it's Demo.css file.

I think guys it will help out you a lot.


I would like to here your comments!!!

Sunday, May 25, 2008

No Template is available except Publishing Site!!!

Hi,

I had created new site collection using publishing template on my fresh farm server installation. Now i want to create a new subsite under this site collection like a "Helpdesk" using template providing by microsoft (40 favorite http://technet.microsoft.com/en-us/windowsserver/sharepoint/bb407286.aspx.)

You know i am the expert for these things so i just go blindly on site setting -> create new site...

What is this !!!!! there is no template except the publishing template not even team site, workspace nothing. I just kicked out myself.

Then i did workaround for that and found i didn't activate features on the site collection like Standard Site Collection features, Enterprise Site Collection features blah blah...

Not even i did upload and activate the custom site template provided by Microsoft.

After doing these things i feel little bit relax because i got everything what i want to create as a subsite and stop to say that i am expert for these things.

Sunday, May 18, 2008

Error: The search request was unable to connect to the Search Service

I had seen that sometimes when user is going to search something on site he get this error message: -
"The search request was unable to connect to the Search Service".
Why it is coming??? How it can be solved???

Is coming becuase of your web front end server is not able to search database. The must be either the user don't have permission to connect with database or Index server is not set for search. No issue we have some solutions by this we can get the results not the error message:-

Solution 1:-
Step 1
* Central Admin -> Application Management -> Office SharePoint Server Shared Services -> Create or Configure this farm's shared services
* Shared Services Provider (drop down) -> Edit Properties
* Edit Shared Services Provider -> Index Server: Verify the index server is set
Step 2
Single Server Farm
On the MOSS 2007 server:
* Start -> Run -> CMD -> stsadm.exe -o osearch -action stop
* Start -> Run -> CMD -> stsadm.exe -o osearch -action start -role queryindex

Hopefully your search will be start.

If not then try another solution:
Solution 2:-
1. Go to Run ->type inetmgr.
2. Open the application pools.
3. Select the application pool related to Shared Service.
4. Right click on it and select properties.
5. On Identity tab change the Identity from Network Service to Configurable with passing your User name(with your domain name) and password .
6. Go to run and iisreset.

Enjoy Search Results!!!
(If still not getting the results then check search services on the farm they are start or stop if stop then must start them)

How to delete a default SSP (Shared Service Provider) in MOSS 2007

I had one SSP sites on my farm. I found that there is something wrong with this SSP site. So i decide to delete this SSP site. I go to Central Administration site and click on the Shared Services Provider. Here i got the link of my SSP site. When i go to delete the SSP what is this!!! there is no link to delete the Default SSP site.
I googled up and found on some site the command by which i can delete my default SSP site. Oh god finally i saved myself.
So here i am putting this command to help out the SharePoint guys.
To delete it, either type in the URL: http:///_admin/deletessp.aspx?sspId=??? or
use stsadm –o deletessp –title

Enjoy!!!!!!
Note:- If you will delete default SSP may be you need to reconfigure the whole Shared Service Provider again. So be careful.

Unfortunately if you deleted the SSP Admin Site Collection…

Hey - we’ve all made mistakes. We all know that "oh my god" moment after we realize what we’ve done! Often times this occurs right after we click a friendly “Are you sure??” dialog। Of course I’m sure - if I wasn’t sure I wouldn’t have chosen to do it in the first place! Stupid computer।
Anyway, I recently had a situation where someone (honestly, in this case it wasn’t me) accidentally deleted the Site Collection for the SSP admin site (/ssp/admin). Since this was for a SharePoint farm in production I really didn’t want to have to re-create the entire SSP but I couldn’t figure out how to just re-create the site collection itself. I figured there had to be a site template for the site but since it didn’t show up in the Create Site Collection UI I went and looked on disk. Sure enough, a site template exists for the SSP Admin site. It’s called OSRV.
So to create a new SSP admin site, run this command line.
stsadm.exe -o createsite -url http://:/ssp/admin -owneremail -ownerlogin -sitetemplate OSRV#0 -title "Shared Services Administration: "


This might take a little while to complete, but it does eventually finish.
Next you need to edit the SSP to point to the recreated site.
stsadm.exe -o editssp -title "" -sspadminsite http://:/ssp/admin
That’s it। You should be back up and running।



Step by Step Install and configure the Sharepoint Server

This is my first blog so i just want to start the things from the base. so lets start with the installation and configuration of Share Point. Basically i am interested step by step explanation with pictures so that beginner should feel relax and nobaody face any problem regarding installation and configuration.

May be this bolg is very very long for the person who is just reading this as an artical but will be very useful who will do this practical.

Lets start!!!!!

Install SharePoint

The first step is to install SharePoint on all SharePoint servers in your SharePoint farm.
1. Run the SharePoint install program
2. Enter your license key and accept the licence agreement
3. Click Advanced when asked what installation type you want
4.







5. Next, on the Server Type screen, choose Complete
6.



7. Click Install Now
8. Once the installation is complete, leave the "Run the SharePoint Products and Technologies Configuration Wizard now" checkbox checked and click Close



Configure SharePoint

1. If it's not already running, run the SharePoint Products and Technologies Configuration Wizard.
2. Click Next on the first screen of the wizard.
3. On the Connect to a server farm page, choose No, I want to create a new server farm

4.





5. On the Database Configuration screen, enter the name of the SQL Server which will host your SharePoint databases. If you want to change the name of your configuration database you can but I recommend a consistant prefix for all SharePoint databases. In this walkthrough we will use SP_ as the prefix for all database names.
6. Enter the username and password for your chosen Farm Account and click Next
7.



8. Next you must configure the SharePoint Central Administration website. This will be the web-based application that you use to configure and manage SharePoint. I recommend choosing a specific port number that will be easy to remember for this site. So check the Specify a port number checkbox and enter a value you will remember. This walkthrough does not deail with configuring Kerberos so leave NTLM checked and click Next
9.



10.Finally review your settings and if everything is correct, click Next. SharePoint will now attempt to create the intial databases and configure itself on the current server. This can take a while.



Post-Install Configuration


At this point SharePoint is installed, but it cannot be used because it requires additional configuration. The next steps will include starting the required services, creating a Shared Services Provider, and creating your first Site Collection.



Starting the Services

1. If it isn't already open, launch SharePoint Central Administration from the start menu.
2. Click on the Operations tab and choose Services on Server
3. Locate the Office SharePoint Server Search item in the list of services and click Start.
4.



5. You will now be taken to the search configuration screen. Check the first two boxes and enter an email address for the search contact email address.
6. Next, enter the credentials for the Farm Account in the Farm Search Service Account area.
7. Leave the other options on this screen at their default settings.
8.



9. Next, back on the Services on Server page, locate the Document Conversions Load Balancer Service and click Start
10.Next, locate the Document Conversions Launcher Service and click Start
11.



12.On the Launcher Service Settings page, for the Load Balancer, choose the current server from the drop down box and click OK.
13.Now, back on the Services on Server page, locate Excel Calculation Services and click Start.
14.At this point your service list should look like this:
15.







Email Settings

1. Go back to the Operations tab in SharePoint Central Administration
2. Click on the Outgoing e-mail settings link
3. Enter the address or name for your SMTP relay server. Be sure that the server you choose will accept email relay from your SharePoint server. Also enter a From address and Reply-to address here. Then click OK


Create the Shared Services Provider


1. On the left navigation bar (Quick Launch) click Shared Services Administration
2. Now click New SSP
3. On the next screen enter a name for your new SSP. Typically you can just call this SharedServices.
4. Next we must create a web application to host the SSP Administration site (similar to central administration, but to manage the SSP). Click Create a new Web application
5.






6. First enter a name for the IIS web site. Best practice is to use the same name as you chose for your SSP.
7. Specify an easy to remember port number for this website.
8. Optionally, change the last portion of the path to be the name of the IIS web site instead of the port number. I find that this makes it easier to find if you ever need to modify the web.config or add files to the bin directory.
9.








10.You can leave the options in Security Configuration at their default settings.
11.Scroll to the Application Pool section
12.For the Application pool name, enter the same name as you used for your SSP
13.In the account section, enter the username and password for your Farm Account
14.






15.Scroll to the Database Name and Authentication section.
16.Enter the name of your database server.
17.For the database name, follow your database naming conventions but since this will be a SSP database, add SSP_ after your prefix. The database name should be something like SP_SSP_Content
18.





19.Click OK
20.Once the operation finishes you will be back on the New Shared Services Provider screen. You should see something like this:
21.







22.Scroll to the My Site Location section. We are going to host My Sites in the same web application as our portal so again we need to create a new web application. Click Create a new Web application
23.






24.First enter a name for the IIS web site. This time, name the application something like SharePointPortal or Portal
25.Use port 80
26.Optionally, change the last portion of the path to be the name of the IIS web site instead of the port number. I find that this makes it easier to find if you ever need to modify the web.config or add files to the bin directory.
27.




28.You can leave the options in Security Configuration at their default settings.
29.Scroll to the Application Pool section
30.For the Application pool name, enter the same name as you used for the IIS Web site above
31.This time, in the account section enter the username and password for your Portal Account
32.





33.Scroll to the Database Name and Authentication section.
34.Enter the name of your database server.
35.For the database name, follow your database naming conventions. The database name should be something like SP_SharePointPortal_Content.
36.






37.Click OK
38.Once the operation finishes you will be back on the New Shared Services Provider screen. Be sure to select your new web application for the My Site Location web app and enter a relative URL like /mysite.
39.








40.In the SSP Service Credentials section, enter the username and password for your Farm Account
41.In the SSP Database section enter your database server name and a database naming conforming to your naming conventions, but using the SSP_ convention for SSP databases. It should be something like SP_SSP_DB 42.








43.In the Search Database section enter a name for the SSP search database. Again, it should use your prefix and SSP_ and should look something like SP_SSP_SearchDB
44.





45.You can leave the rest of the settings at their default values and click OK
46.Once the operation is complete your Shared Services Provider will be set up.




Configure the Default Crawl Account

1. On the left nav bar you should now see a link to your SSP under the Shared Services Administration header. Mine is called SharedServices because that's the name I chose when creating the SSP. Click this link.
2.



3. In the Search section, click the Search settings link
4. Click the Default content access account link
5.





6. Enter the credentials for your Crawl Account and click OK


Create the Portal Site Collection

1. Finally we need to create a new Site Collection for the portal. Navigate back to SharePoint Central Administration
2. Click on the Application Management tab
3. Under SharePoint Site Management click Create site collection
4. First, be sure to choose the Web Application that is using port 80. By default one of your other web applications may be selected such as the Central Administration web app or SSP Admin web app.
5. Next, enter a name for your new site collection (you can change this later)
6. For the Web Site Address, choose the root /
7.




8. In the Templage Selection section, click Publishing and choose Collaboration Portal (For Internet Facing site always prefer Publishing portal or publishing site)
9. Next, enter up to two users who will be Site Collection Administrators. These users will have full administrative rights to this site.
10.



11.Click OK. Once the operation is complete SharePoint will be ready to use.