Thursday, July 9, 2009

App_Code folder in SharePoint – Custom web services in SharePoint – Part 1

On the way of explaining the process of implementing custom web services in SharePoint, I thought of telling you the advantage of App_Code folder in SharePoint. So, Please read this post before continue here.

If you are a .NET developer then you know the advantage of App_Code folder. When I am new to SharePoint technology, I thought like we can't add App_Code folder in SharePoint root folder because i didn't find it in the virtual directory path. […/Inetpub/wwwroot/…../] But few days back, when I got time, I want to do experiment on the App_Code folder in SharePoint. So, what are the advantages and how to do it please follow below steps.

  • Go to SharePoint web site virtual directory file system path. There you can find web.config file, _app_bin, App_Browsers etc…
  • Create a folder named App_Code.
  • Copy a class file [.cs], which you want to use in SharePoint coding inside the App_Code folder.

Now, you can access this class any where in the SharePoint web site. Very useful one right?

Wow, This helped me many scenarios and really a good tactic for solving lot of problems. Try this now!!!

Wednesday, July 8, 2009

Fixing the error Permission denied to get property XULElement.selectedIndex in Mozilla Firefox

When working with Mozilla Firefox browser, I usually come across the error below many times.

Usual exception details: Permission denied to get property XULElement.selectedIndex

Error because of my own javascript function:
Permission denied to get property XULElement.popupOpen

I want to write this post because, for me it took long time to solve the issue. May be most of the people may get this error when working with Mozilla Firefox.

Why it is coming? What are the possibilities?

This will come if you are making AJAX calls with a input type text box, then firebug will throw this error. This is because it is a autocomplete functionality. To fix this what you need to do is, just add an attribute to input control as shown below.

<input type="text" autocomplete="off" />

This will stop Firefox from attempting to complete the content in the box.

That's it!!!

Is this helpful?

Microsoft.SharePoint.Upgrade.SPUpgradeException

After I installed the MOSS SP2 update yesterday, when I hit refresh on my custom ASPX page, I got the below exception.

Microsoft.SharePoint.Upgrade.SPUpgradeException: An error has occurred on the server.http://go.microsoft.com/fwlink?LinkID=96177.

I was little bit surprised and frustrated to find out the cause why it was showing. I ran the configuration wizard and checked the database schema version. Everything was fine. After research and thought about it for some time, started trail and error methods to find out the issue by going to event viewer and logs etc…

Finally found the problem. That was Because of not restarting the server after installing the SP2 on the server. After I restarted the server, everything worked fine and i am very happy by seeing the page on the browser.

Is this helpful?

Tuesday, July 7, 2009

Install language pack in SharePoint 2007

I have MOSS server running from long time and it has plenty of sites running. Now I got a new requirement from one of my clients that their site should support different languages. This bothered me somewhat because of this article. http://technet.microsoft.com/en-us/library/cc262108.aspx

Which explains as below

  • Install the necessary language files on the front-end Web servers.

  • Install Office SharePoint Server 2007 on each front-end Web server.

  • Run the SharePoint Products and Technologies Configuration Wizard on each front-end Web server.

If that is the case, I need to uninstall MOSS on the server and need to install all language files before installing MOSS. But if that happens I will loose my server settings and the whole environment. It’s impossible to get the same development settings if I uninstall it. Then I posted about this, in MSDN forums and Mike Walsh all time favorite to me, gave me very fast reply and his solution worked great!!!

You can take a look at it here.

http://social.msdn.microsoft.com/Forums/en-US/sharepointadmin/thread/1963f252-056e-43ec-8480-d99a4f8d5388

Hope this will help you too!!!

Show envelope icon in notification area – Outlook 2007

Today, I am little bit surprised that I didn’t see the envelope icon in notification area of my window Taskbar even i have unread emails in my Outlook inbox. So, as usual I thought, no new messages were in my inbox. After some time, my colleague came and asked me that why didn’t you give reply for the messages I sent. I told him that I didn’t get any. He was surprised and checked his sent items list and he was sure that mail was sent to me. Immediately I open my inbox and found couple of messages from him. That was a big shock and I didn’t believe that. Because I completely believe in the envelope symbol on the Taskbar that if any unread mail is in my inbox, it should show up there.

image

Some how the settings were changed and i started checking the tools options for getting that again. Below are the steps i followed to get it.

  • Open your Outlook.
  • Go to Tools menu, choose Options.
  • In the preference tab, you can find a section for E-mail as shown below.
  • image
  • Click on the E-mail Options button. Which will open a window for the email option.
  • Click on the Advanced E-main Options button which again opens another windows which has the option we want.
  • Select the option "Show envelope in notification area" as shown below.
  • image
  • That’s it. Now I am able to see the envelope icon in the notification area on new mail arrival.
  • image

Hope this helps for the people who faced the same problem.

Tuesday, June 30, 2009

Copy data from MS Office Project to MS Word

We usually work on MS Office project when we deal with project management, project estimation etc…. So I used it to create project estimation document for forwarding that to management and client. But unfortunately, Client don't have MS Office Project installed. So I need to send him in either Excel or Word format.

I planned to copy and paste the data from MS Office project to MS word, when I did that it came like unformatted text. It's not looking good at all. I can't manually format it, Because it is a very big document.

After spending some time on it, found a solution how to do that. Please follow the process below.

    • Select the information pasted into Microsoft Word from Microsoft Project.
    • On the Table menu, click Convert, and then click Text to Table.
    • Under Separate Text At, click Tabs, and then click OK.

That’s it!!! This trick did everything like well formatted and rendered in table. It saved lot of time for me.

Hope this helps you too!! You can get the more details about it here.

Saturday, June 27, 2009

How to submit all posts to Google webmasters for better indexing all the posts in my blog?

You all know that the Blogger’s atom.xml file will burn only the top 25 results in the feed. This is the file usually we will submit to the Google webmaster tool to index our blog posts. But because it only returns top 25, Google crawler indexes only these 25 and it don’t care about the posts which are older than 25. So, there you are loosing your visitors to see those posts because they won’t be show up in the search results  because of not crawled well. So how to solve this issue? and how to submit all posts to Google webmasters?

Solution:

Before you proceed, please check the below posts once for the better understanding.

  • How to submit your blogger blog site feed to Google webmasters if you enable the option Post Feed redirection url. View here.
  • How to see all posts in the atom.xml feed instead of getting only top 25? View here.

Once you read above posts you will get complete idea of how to solve the problem.

  • Open Google webmaster site and submit the below url
  1. For submitting the top 50 blog feed results then use

   atom.xml?redirect=false&start-index=1&max-results=50

  1. For submitting from 50 to 100 results then use

         atom.xml?redirect=false&start-index=50&max-results=100

So you can submit all the posts to Google webmasters to crawl all the posts instead of only top 25. How good it is?

Bloggers feed is showing only 25 posts, how to get all?

This is the question in my mind from long time that why feed is not showing all the posts when I open atom.xml. It always get me the top 25 posts in the feed. So how to get all the posts?

Solution:

  • We need to use certain querystring parameters to solve the issue to get all the posts.
  1. start-index : Which tells to the blogger feed generator that starts from this post.
  2. max-results : Which tells to the blogger feed generator that the number of maximum results count from the start index.
  3. redirect : Which is not actually needed. If you enabled post feed redirection then only we need this. But, better to keep this always in the feed url. You can find the more information about it here.

How to use:

After the atom.xml feed url, append the below querystrng url.

?redirect=false&start-index=1&max-results=50

For testing you can browse my feed http://praveenbattula.blogspot.com/atom.xml?redirect=false&start-index=1&max-results=50

Which will burn you the top 50 posts in the feed. Actually we get top 25 only by default, but from the solution I told you, which will return how many posts you want.

For getting top 100 results use this querystring url

?redirect=false&start-index=1&max-results=100

For getting the results between 50 to 100, use this

?redirect=false&start-index=50&max-results=100

You can give any value to the parameters start-index and max-results to get that many results…

Happy Blogging.

How to submit blogspot feed to Google webmaster where feedburner feed is enabled in blogspot blog

I enabled the option Post Feed redirection url in my blog settings. From the time I did that Google webmaster tool is started giving the error "URL not allowed". But I need to enable the post feed redirection to Feedburner instead of general atom.xml feed. So how to solve this problem? After read the Google blog documentation found some attributes how to solve this issue.

For my blog the atom/feed url is http://praveenbattula.blogspot.com/atom.xml. When I type this, it will redirect to my feedburner url http://feeds2.feedburner.com/praveenbattula. So when I submit the atom.xml in the Google webmaster it’s not taking this and gives me the error "URL not allowed" because of the redirection. So finally I understood that redirection is the problem.

If you want to use custom redirected feed like FeedBurner then you need to use the "redirect" querystring parameter to the url of your feed, which stops the redirection.

atom.xml?redirect=false

So, when I use the url http://praveenbattula.blogspot.com/atom.xml?redirect=false i always see the message "successfully crawled" in Google webmaster tool.

So except in Google webmaster tool I don’t use the redirect querystring. So, all users will see my customized feedburner feed, only webmaster crawler see my atom.xml feed. How nice it is….

Nice tip!!!!