While I was guiding a colleague of mine to install a WAMP server on a windows XP machine and faced this small configuration issue which I thought would have a straightforward fix.

Seems that there isn’t, at least not for the situation I had so I found the hard way to do it. And decided to write a post explaining it since there wasn’t a good article anywhere already for doing it.

Situation: Install Apache to work on a non default (non port 80) port since we already have IIS on port 80.

This post here by Matthew Phillips explains how to configure the httpd.conf file to make Apache listen on a custom port (say 8080). (He blasts IIS for follies which I don’t really agree with, that is not really the point in discussion here :) )

But that doesn’t closely solve our problem since we just modified the Apache’s configuration file and that WAMP is still unaware of the change.

Trying to Install the Apache service from WAMP now still gives the error:

Your port 80 is actually used by:
Server: Microsoft-IIS/x.x

Cannot install the Apache Service, please stop this application and try again.

 

The next step after that would be to tell WAMP in its scripts to actually test the custom port (8080) and proceed to install apache. That we do in two files in the Scripts directory located in the WAMP install path.

Edit the following files in notepad:

  1. testPort.php
  2. testPortForInstall.php

In the above files, replace 80 with your custom port number (8080). For me, it was present in 3 places in each file. Save and close the files and restart your Wampmanager and try removing/installing the service now and it should work.

However, there still is the option “Test port 80” under the Services menu in Apache and other links that open up Localhost and phpMyAdmin in the browser that still point to port 80.

 

This menu option text is populated from the file Wampmanager.ini and which in turn is refreshed from the wampmanager.tpl each time the Wampmanager.exe is started. The menu item captions are populated from the various language files in the lang folder. The actual actions that are performed are in the wampmanager.tpl file. Just update this file to open the correct URL upon clicking Localhost or phpMyAdmin links. Look for the [Menu.Left] section.

To update the captions, you will have to edit the appropriate language file – find the variable name used in the wampmanager.tpl file for the specific item and look for the caption setting for this variable in the language file and change it accordingly.

For ex.: To change the caption of the item “Test port 80”, I checked that wampmanager.tpl uses a variable called w_testPort80 to populate this value. I opened up the lang\english.lang file and looked for this variable name and changed the string caption.

Restart Wampmanager and Voila!

Disclaimer: The changes mentioned in this post are to customize the work environment for a development machine and any such changes on production servers or internet facing servers should be made with more caution. But then that’s a rare situation to run your website on a non 80 port, isn’t it?

I am using WAMP version 2.0.

 

Found this awesome warning near the EPIP entrance in Whitefield.

I even asked an innocent Policeman sitting inside the chowki to stand out of the booth so I can take the pic. He believed I was from the Press and that I am reporting the pathetic state of the footpath to a news agency.

Only then did I realize the pathetic state of the footpath. :P

I could not tell him that I am a lame software engineer just out to have some fun so I carried his assumption forward and told him that im a journo for Bangalore Mirror. Ya rite!

 

Okay, so I recently completed building an end to end  Feed Viewer Web Part for SharePoint 2007.

I used jQuery for AJAX calls and DOM manipulation.

jQuery UI for creating Tabs and a ‘custom’ Accordion control

ASP.NET Web Services

Argotic Syndication Framework  to get, aggregate and generate feeds. (This free library is real cool stuff. Let me add a Web 2.0 style banner in cheers to it!)  

‘No Server Code’ User Control to load the Feed Viewer entirely using JavaScript code.

WSPBuilder to code, build and package my web part, lists and the custom Web Service into SharePoint.

While building this, I faced a lot of technical issues and built workarounds on them to finally roll it out successfully.

Let me foreach over the issues and workarounds.

1. ASP.NET Web Service does not accept an AJAX Call using a GET Request. Also, it does not honor the AJAX request if the content type is not explicitly specified as contentType: "application/json” in your AJAX call.

So you can right away throw the jQuery AJAX methods – get(), post() and getJSON() methods out of the window when your server side is an ASP.NET Web Service. Why – How can you explicitly specify the content type using these methods?

So we are left with the low level $.ajax jQuery call (its actually pretty neat to be called low level.) and here is a sample code snippet:

$.ajax({
            type: "POST",
            url: "http://myserviceurl/service.asmx/WebMethodName",
            data: "{}", // Pass empty parameter list - must for POST request to have content length tag
            contentType: "application/json; charset=utf-8",
            dataType: "json", // Specify return type - try xml, text etc here.
            success: function(msg) {
                alert(msg.d); // returned JSON data is encapsulated in msg.d
            },
            error: AjaxFailed
        });

Read about this restriction from The Gu. So that leaves us with another crippling limitation – We cannot make a cross site/domain (XSS) jsonp call to our web service. (Coz jsonp can be used only with GET requests and not POST.) SO this means our web service will have to be hosted within SharePoint’s domain itself and not on a separate web application even on the same server so that our jQuery web part can make a call to it.

Another headbanger: If you want to simply display SharePoint data on a web page (outside SharePoint) through this web service, then you will have to enable forms authentication on your SharePoint site or do a Windows Authentication Handshake before making this web service call. Not getting into that detail as its a very rare case of implementation.

Read more in detail about making jQuery calls to ASP.NET AJAX Web Services here. Thanks Dave for such a wonderful series!

Did I mention that the plain vanilla ASP.NET 2.0 Web Service is not capable of handling scripted requests (as in from JavaScript). Yes, that’s true. You either need to install the AJAX Extensions 1.0 for ASP.NET 2.0 or upgrade your .NET Framework to 3.0 or 3.5. Then you will be able to add the following tag to your web service class to make it accessible via scripted calls:

    [System.Web.Script.Services.ScriptService]

There is of course more to making your service and web site AJAX enabled. Discover options to AJAX enable an existing web service here. Neat video.

Best workaround for these problems: Use WCF! Works with GET; ContentType not restricted to json; REST support using UriTemplates and more. I tried this too but since upgrading to .NET 3.5 on the production server was a little too much to ask for this, I stuck to Web Services. If you are giving WCF a trial, might I also suggest the OOB Syndication Framework support in WCF. (Might help if your clients are against using open source plugins such as Argotic in their production environments.) It has support for RSS and ATOM as well as a Generic Syndication format which one can extend/override and use as you wish.

Now to the UI:

jQuery UI is a neat framework which provides OOB Javascript Tab controls complete with CSS themes (choose your theme and download the CSS). It also provides a neat ICON sheet with different colour overlays for different UI states. Check it out too.

View jQuery UI Demos here.

There are tabs and accordions available OOB for me to use. This was all I needed for my feed viewer web part. The root categories would be the tabs, sub-categories would be placed into accordion panels. Alas, I was too happy too early. jQuery UI is great, no doubt. But when it comes to nesting one control in another, it fails miserably. Maybe it wasn’t built for it but it surely made my life difficult just when I was thinking things were going smooth.

So I used the tabs from the UI. Then wrote my own jQuery code to create an accordion control which would load feed data from a SharePoint list on expanding. Of course, I made use of the library’s CSS classes for the accordion – active, inactive states etc.

My final UI looks like this:

Of course, how can I forget my friendly jQuery Plug-ins: jFeed and Pager

Now over to the server.

On the Server I needed a Web Service which my Web Part would call:

1. Get a category hierarchy for my tabs and accordions to render. I chose to send an xml string with sub-categories nested under categories in the xml with important data such as CategoryId which I hid into hidden fields in the accordion.

2. Get an aggregated feed data on a per category basis once user expanded a certain sub-category panel. This would require me to send information such as CategoryId, PageNo and pageSize to the web service via an Ajax call.

My Web Service method signature was like this:

[WebMethod]
    public string getAggregateFeed(int categoryId, int pageNo, int pageSize)

 

and my AJAX call looks like this:

$.ajax({
            type: "POST",
            url: "~/_layouts/service.asmx/getAggregateFeed",
            data: '{ "categoryId" : "' + 1 + '", "pageNo" : "' + 1 + '", "pageSize" : "' + 2 + '"}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(result) {
                renderFeed(result.d, divId, pageNo, pageSize);
            },
            error: AjaxFailed
        });

  TIP: To ensure that my web part is configurable, I need to allow the user/admin to configure the parameters such as List Names, Service URLs etc. Now since all my functionality is on the client, I needed to make sure that any Web Browsable Property I create gets added as a hidden input control to the Web Part controls so that my jQuery can pick it up. Remember to add a unique class name to the hidden control and not to use the ID to identify the control in jQuery, since ASP.NET adds its own additional meta characters to uniquely ID server controls but maintains class names as they are.

Next was a simple task to reference the Argotic Library in my web service and do the needful. The Argotic library is available in both .NET 2.0 assemblies as well as .NET 3.5 assemblies. It provides abstraction to fetch feeds, aggregate them and create new feeds and save them to XmlReader streams. Pretty neat stuff.

Now since I was using a jQuery plug-in that accepted either ATOM or RSS feed data and converted them to html, I only needed to aggregate multiple feeds into one Feed object on the server and then save the contents into a stream to return to my client. The plug-in would then parse the xml for available fields and generate appropriate HTML. I needed only the title and link to the item so I modified the feed a little to render only items I need.

And the majority of my functionality is done. Now remained to enhance it to make the Paging work, add a refresh button which would refresh the feed data and set an auto timer for it to refresh it automatically every 5 minutes and the likes.

I added all my JS code to a User Control. Created a WSP Builder Project and created a Web Part that would load this control and also add appropriate Web Properties. Added features to package my dependent SharePoint Lists and their instances and also a feature to deploy my custom web service to SharePoint and add my dlls to the GAC.

Read about deploying lists and list instance using features and solutions on André Vala’s blog. This is the blog series I have referred the most till date. Thanks André!

Read about hosting a Custom Web Service in SharePoint: newbie tutorial | msdn walkthrough

It was a thoroughly enlightening experience building this web part. Adios for now!

 

SEBI has scrapped the Entry Load that is levied on investors investing in Mutual Funds. Now if an investor invests Rs.100 to purchase the units of XYZ Mutual Fund, all of that amount will go to purchasing units of the fund and no deduction will be made towards Entry Load.

Last year SEBI had passed a regulation to the effect that frees investors from the entry load on Mutual Funds if they invested directly without the help of a broker/intermediary. However, since most mutual fund schemes are confusing and the application forms are difficult to fill and submit directly to the mutual fund house, the majority of investors hardly found this move bringing them any joy. They would usually end up going through a broker and getting slapped with an entry load ranging from 2.25% to 3% of their investment, most of which is usually paid out the the broker/distributor in the form of commission. This means a loss of Rs.30 on every Rs.1000 you invest, right at the time of purchase.

From 18th June, 2009, SEBI has removed the concept of Entry Load on mutual funds, irrespective of whether you invest directly to the mutual fund house or go through a broker. This move may bring some cheer to investors but there is always a clause one has to watch out for in such rulings. And here is the catch. You have to pay a commission to the broker if you choose to invest through him. SEBI has issued in its statement that the investor will choose the amount of commission payable to the distributor. How this is supposed to work and what are the benchmarks for such a commission are unclear as yet but most brokers may choose to not accept any commission at all to keep up with competition and act as advisors to investors. All in all, a good move with respect to the investor in these troubled times. The markets are down in the dumps and are predicted to remain so for at least another year with marginal improvement. Hence investing in an Equity Mutual Fund through SIP is the best bet at present. Note that Mutual Funds only provide best returns in long term (over 3 yrs).

More: 1 2 3

 

When I first heard of , I wondered whether this is really gonna be of so much use, especially in the world of SharePoint. I mean, who would want to setup a site like YouTube on a SharePoint server?

Even today people would raise such questions but I am actually amazed at the number of client requests that I am coming across who want a site in their SharePoint intranet/blog/public website where they can simply upload a video and others can watch it plus have some additional social networking features such as rating and commenting a video, viewing the video publishers bio, tagging videos and searching based on keywords, show a thumbnail of every video uploaded etc. Imagine if you had to built such a site on SharePoint yourself? And for those who are still unaware, is the solution for the above requirement and it provides even more features and configuration options.

Having made a couple of installations of recently, I do admit that its not really just double clicking an .msi and you are ready. But the effort spent configuring it is well worth it if you have the requirement. I would say you need about 2 person days to set it up from scratch by following the quick installation guide that comes with the package, leaving configuration of search which would need another day and of course customizing the UI based on your needs would take its own time. PKS comes with its own masterpage and most likely you would want to change that so the portal look and feel is consistent with the rest of your site. And the amount of customization you need decides time needed for your UI trimming but my guess is it should not take more than a couple of days. So you can have a Podcast Publishing Site up and running in about one work week. The effort saving and the value it adds to your website is just amazing. Have you tried video marketing with the products you make? I suggest this is a good time for that since print ads and ads on the telly probably don’t reach out to the customer bracket you want to approach and also what better way to sell your product by showcasing it on your own website without additional cost – directly to the person who has come there in search of it. When you do decide for that, go for .

So what does have – Insider tips:

  • installs a few pages, lists and some web parts on your SharePoint site when you run the setup.
  • stores the videos you upload to a network file share and not the SharePoint database so it wont overload your content DB.
  • offers features for Video Rating, Commenting, Viewing the Podcaster’s information, Reporting features on videos uploaded/viewed/downloaded etc, Automated thumbnail generation on video upload, integrated video conversion to compatible format, mobile/zune/iPod/RSS support, tag clouds, search videos using tags, progressive playback of videos using etc.
  • Documentation for is exhaustive, clear and precise which makes the setup experience extremely smooth and also empowers you to extend it. There are video tutorials too! In fact its so good, I really wonder why any one would actually read this blog post.
  • It needs MOSS 2007. Won’t work on WSS 3.0.
  • is needed for to work. Thumbnail generation, duration detection and encoding to Silverlight are all done using that integrated into the PKS site.
  • There is still a bug in the thumbnail generation process for videos which are initially not in compatible format but are converted using Expression Encoder. The thumbnail wont get generated in this case as the application that queues videos for encoding tries to generate a thumbnail first and encode later. Hope this gets rectified soon.

Tomorrow I will cover the basic steps in configuring a simple PKS site. But the real resource is on the site itself.