Saturday, September 19, 2009

While Publishing InfoPath error comes as Administrator must approve this form template before it can be filled out by using a browser.

Was in a training session recently working on InfoPath forms and when tried publishing it to a sharepoint server, the following message was coming:
"An administrator must approve this form template before it can be filled out by using a browser. The template may contain form code, require full trust, be enabled to render on a mobile device, or use a data connection managed by a server administrator."
After some meddling here and there, found that this was the reason since my InfoPath had some managed code in it. Now I did not add any managed code in there myself, so how did it come there. Well it was due to the reason that I had gone in the programming option while modifying a control's properties, and opened VSTA (Visual Studio Tools Application). Although I closed it without adding anything into it, their was some default code generated. To remove that follow these steps:
Go to Tools Menu -> Form Options -> Programming menu
In there a "Remove Code" button is there, click on that, all the managed code should be removed. Now try publishing the InfoPath on the server again, and it should work fine.
Happy SharePointing!!

Friday, August 28, 2009

Hello All,

I wanted to create publishing pages that is aspx pages in the Pages library. After lots of tricks here and there, finally managed to do it through the following piece of code:
using Microsoft.SharePoint.Publishing;
PublishingSite pSite = new PublishingSite(siteurl);
SPContentType projectCT = pSite.ContentTypes[];
PageLayoutCollection pageLayouts = pSite.GetPageLayouts(projectCT, true);
PageLayout projectLayout = pageLayouts[];
PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(hlfWeb);
PublishingPageCollection pageCollection = pWeb.GetPublishingPages();
PublishingPage projectPage = pageCollection.Add("page1.aspx", projectLayout);
SPListItem projectPageItem = projectPage.ListItem;
projectPageItem["Title"] = "page1";
//other properties can be given here as well.
projectPageItem.update();

Requirement was such that I had to create these pages in specific folders. A simple way out:
PublishingPage projectPage = pageCollection.Add(projectFolder.ServerRelativeUrl + "/" + projectDetail.ProjectTitle + ".aspx", projectLayout);

Where projectFolder is the folder in the library.

Hope it saves on time for somebody with similar problem.
Happy Sharepointing!!

Monday, August 3, 2009

MOSS Search - Content for this URL is excluded

I recently faced this strange issue, some of the content in a site was not getting searched, no error. I executed full crawl several no. of times, but without success. Then I saw this warning in the crawl logs: "Content for this URL is excluded by the server because a no-index attribute". Well for some items that were not being crawled the reason was my crawl rule was such, but for others like subsites itself could not understand what could be the cause.
Then I looked into search visibility of those sites, and found that indeed the option for this web to appear in search results was set to NO. How simple, but it took me 3 hours to come to that setting :)
http:///_layouts/srchvis.aspx

Sometimes critical problems have simple solutions!!!

Friday, July 17, 2009

An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown while applying MOSS service packs

I was building out a new medium farm the other day and applying the various SharePoint updates, when I received the following error after installing the Infrastructure Updates and running the Config wizard:
“An exception of type Microsoft.SharePoint.PostSetupConfiguration.PostSetupConfigurationTaskException was thrown. Additional exception information: Failed to upgrade SharePoint Products and Technologies.”
Going through my log files, I realized the exception was being thrown for the following reason:
“The access control list on C:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\template\layouts\Web.config could not be modified because the path could not be located in the file system.”
After a few Google searches, I found the solution in the “Deploy software updates for Office SharePoint Server 2007” article on TechNet (go figure). The reason this was happening was because my farm still didn’t have any Web Apps provisioned so the Web.config file which was supposed to be in the 12\template\Layouts folder was missing.

To resolve this, simply copy the Web.config file in the 12\Config folder and paste it into your 12\templates\Layouts. Now run the Config wizard again and everything should work smoothly.

Hope this helps!!

Thursday, July 16, 2009

Evolution of Mahendra Singh Dhoni




If all here think am just going to put technology, then here's a surprise...To start with, I read an article about Mahi in one of my Orkut communities, and wish to put it here as a memory.....

He may keep acting legend Amitabh Bachchan waiting for an acknowledgement to a congratulatory message the actor sent to Mahendra Singh Dhoni for being awarded Padma Shree, but we cannot brand him arrogant. Unassuming, may be. Popular as Ranchi Rambo in (he was born in Ranchi, Jharkhand), Mahi the cricketer was born in Kharagpur just about eight years ago.

Unable to find a job in Ranchi, Dhoni went to Kharagpur in the early 2001 seeking a job through sports quota in the Railways. Satyaprakash Krishna, Dhoni’s Jharkhand teammate, introduced him to the then Divisional Railway Manager (DRM) of Kharagpur, late Animesh Kumar Ganguly.
Shubhra Ganguly, his widow and now a resident of Kolkata, recalled, “My husband was looking for a keeper-batsman for the South Eastern Railway team then. It was then that Satya brought Mahi to our bungalow in Kharagpur and introduced him as a promising player.

Sporting a creased T-shirt, he pleaded my husband for a job. Animesh took him to the SERSA stadium and bowled him around 60 deliveries to test his mettle. Satisfied after the trial, he was recruited in the Railways as a ticket collector.”

Home away from home
Dhoni used to share a one-room tenament with Robin Kumar, the South Eastern Railway team captain, and another friend, Deepak Singh. He would often feel homesick. But Ganguly, an ardent fan of cricket, not only recognised his potential but also realised he was missing home.

In a bid to boost his confidence, he began supporting him mentally. Soon, Mahi became a part of the Ganguly household. He would come to their lawns every morning with fellow cricketers to practice at the nets there.

"Mahi would spend several hours at our place. He would call me mummy. My daughter Lakshmi was so friendly with Mahi, she would even comb his hair! My son Santodeep loved watching him hit towering sixes at the SERSA Stadium,” said Shubhra Ganguly.

Dhoni was a regular on the dining table of the DRM’s bungalow between 2001 and 2003. “Being a simple guy, he would be happy with whatever he was served.”

The thread that binds
When AM asked Shubhra if Mahi was still in touch with her, she said: “He came to attend Lakshmi’s marriage after the India-Sri Lanka ODI tie was washed out at the Eden Gardens in February 2007.

Lakshmi is now settled in Canada. But Santodeep, who’s pursuing engineering at Haldia, keeps in touch with him. I’m sure if he visits Calcutta and has spare time, he would visit my house. It will be a morale booster for me in the absence of my husband, who I believe played some role in his becoming a cricket icon.”
The first spark
The Team India skipper, then a ticket collector of South Eastern Railway, first showcased his natural leadership skills when his team, Durga Sporting (a local club of Kharagpur), was in trouble on a winter day of 2002. It was the final of a six-over-a-side tennis ball tournament on the Golkhuli ground and his side was bowled out for just 30 runs. The opposition was cruising when an umpiring controversy over a boundary erupted.

"With the match all but lost, we decided to walk off in protest,” recounted Satyaprakash Krishna, who was also playing for Balaji Sporting. Satyaprakash, a teammate of Dhoni in the Jharkhand team in yesteryears, added, “At this point, Mahi intervened and urged us not to leave the field. ‘Let’s channel all our energies into bowling and fielding and give it all we have’, Mahi had said.”

Mahi was the team’s fastest bowler. Soma Rao, the wicket-keeper of Balaji Sporting in that match, recalled, “Mahi bowled his heart out after that and I can still feel his deliveries thudding into my palms behind the wicket.”

Durga Sporting managed to tie the match and then win it through the flip of a coin. Dhoni had worked his first miracle on the cricket field.

Tennis-ball cricket
In days when Sourav Ganguly was Indian captain and Yuvraj Singh the great young hope, Dhoni was a ticket collector on the Kharagpur platform. His claim to cricket fame was playing on the dusty fields there with a tennis ball. “He had a cool head and would never give up,” said Siddhartha Chatterjee, under whose captaincy Dhoni played for Sangha Shree, another local club of Kharagpur.

But even back then, Dhoni didn’t come cheap. “He wouldn’t charge a rupee to play for Durga Sporting — he lived close to its home ground of Golkhuli and Sangha Shree — to which most of his colleagues in the Railways were attached.

But when he turned his arm over for other teams, he pocketed Rs 2,000 per match,” said Chatterjee, who also captained the Bengal Police team in the CAB league till 2008.

That made him the most expensive tennis-ball cricket player in Kharagpur and an inspirational leader on the cricket field. Today, not much has changed. He just leads Team India in all forms of the game and has added a few zeroes to his match fees.

Sweet memories




The railway town in Bengal has fond memories of Dhoni. People have seen him cycling, gulping milk or sipping tea at roadside shops and playing tennis ball cricket in almost all the green patches in Kharagpur.

He has played in tennis ball tournaments at Traffic, BNR Ground, Silver Jubilee School and Hijli High School grounds. The young and old of Kharagpur have seen him taking guard even at grounds dotted by slums.

Buy it or not, “the most powerful man of India after the Prime Minister” spent his days in Kharagpur staying in an outhouse in Golkhuli (the locality owes its name to the semi-circular structure of the quarters) in Traffic area.

The man who lifted the Twenty20 World Cup joined the South Eastern Railway as a ticket collector in its Kharagpur Division in March 2001. He would be seen at his post on platforms of the longest railway station in Asia till the end of 2003, when he started to play for India A.

Star in the making

The Kharagpur cricket fraternity agrees that it never saw someone as disciplined as “our” Mahi. According to South Eastern Railway coach Subrata Kumar Banerjee (Baghada), Dhoni was always an aggressive player. “You still don’t know how explosive he can be. Not only in cricket, he would blast the ball as a striker in football and hit the ball very hard in table tennis as well as billiards. He is made that way,” Kumar said.

Great mates
Mahi befriended several youngsters in Kharagpur. All of them were impressed with his never-say-die approach to cricket. What fascinates them more than his game is the way he carries himself off the field, how he speaks so well.

“Once, after he received the man-of-the-match trophy from Bengal spinner Shiv Sagar Singh at the tournament finals in Panskura in 2002, Mahi was asked to say something.

He told the organiser apologetically ‘Mujhe bolna nahin aata’ (I can’t make a speech). This same guy is so articulate now,” recalled Prasenjit Sinha, 29, who played a number of tennis ball tournaments with Dhoni.

South Eastern Railway team captain Robin Kumar recalled how they would pull his leg since he kept his distance from girls, also because no girl showed any interest in him. What did fascinate him are bikes.

“He did not have one. But when we went to play tennis ball matches in Mecheda, Panskura, Dhantor or Digha, he would insist on driving my Bajaj Pulsar and I would have to ride pillion,” said Kumar

Myth busters
Mahi’s mates in Kharagpur differed from media reports about him drinking several litres of milk a day. He did drink some milk, but was more obsessed about aerated drinks. Dhoni used to gulp down a couple of bottles everyday.

“We had a friend of ours who would drink lots of alcohol. Mahi once asked him not to drink, at least that evening. He, in turn, asked Mahi to stay off cola. That evening, they both had lassi,” said Siddhartha Chatterjee.
“Contrary to popular belief, he did not always have long hair. It’s only in 2003 that he gave it a thought after his friend Mihir Diwakar, who played in the rebel Indian Cricket League for Royal Bengal Tigers, began to sport long hair,” Chatterjee added.

Price of fame

The guys in Kharagpur do not get to meet Mahi often now. The last time he went there was around two years ago when they secretly took him to a compartment of Gitanjali Express in the car-shed and had dinner.

“Mahi doesn’t take calls on his cellphone, so we leave a text message and he calls back,” said Chatterjee. His Kharagpur mates came to Kolkata in November 2007 for the last Test match that was played at Eden, “only to watch Mahi”.

“We had reached in the evening and sent him a text message when he was on his way to a party at Ranadeb Bose’s house.
The next day, there was such fuss over security that despite fever, Mahi had to come down to the hotel lobby to meet us since we were not being allowed upstairs. But once with us, Mahi was his old self. He didn’t change a bit,” smiled Kumar.

Getting an error like "The evaluation version of Microsoft Office SharePoint Server 2007 for this server has expired."

I tried accessing User Profiles and properties in Central admin, and got error:

"The evaluation version of Microsoft Office SharePoint Server 2007 for this server has expired."

Additionally when I tried using search from my site, it would give me some unexpected service.

The cause to these errors is insufficient permissions to WSS_WPG and WSS_ADMIN_WPG group users to registry.

Finally I was able to resolve these errors, here are my findings:

First of all open the registry editor (Regedt32.exe). you can open it through C:\Windows\System32. From there on the registry key HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\Office Server\12.0 give read permissions to WSS_WPG group and full permissions to WSS_ADMIN_WPG.

Once done with this, add the identity of application pools in the Distributed COM Users grouup.

Do a reboot of the server, and you are done.

For reference go through the following post:
http://blogs.msdn.com/joelo/archive/2008/01/02/evaluation-version-expired-but-not-really.aspx

Happy Sharepointing!!

Dealing with cookies expiration in forms authentication in MOSS sites

Few days back I was looking at a time out issue in a MOSS site having forms authentication. Even after setting the timeout to be 10 hours in the site and in IIS, still the authentication cookie seem to expire.

Then I found a simple solution. The timeout attribute should be given in web.config of the site in question. Open the web.config of the site, and look for the tag



Below this, there is ought to be a tag. Place the timeout attribute in the forms tag which would look something like as

enableCrossAppRedirects="false" />

Timeout is given in minutes.

For other settings to be done when having forms authentication for a MOSS/WSS site, go through this post:

http://www.cnblogs.com/WCFGROUP/archive/2008/06/02/1212150.html

Additionally, for cookies to be retained in forms authentication enabled subsites, install SP1 on IE 6.0, otherwise they would not be retained and on opening any subsite, user would be prompted again for logging in.