views:

424

answers:

2

We have a large number of Java based servlets/portlets running in a BEA portal that we want to convert into SharePoint 2007 webparts. Many of the portlets use user preferences but the implementations are split between preferences being handled by the portlet directly and stored in a separate database from the portal. Others are using the BEA WebLogic API for user preferences.

Three questions:

  1. Has anyone gotten a Java Servlet/JSP (compiled against JRE 1.4.2 and running on Tomcat 4.1) to run as a SharePoint 2007 webpart?
  2. How large of an effort was it in general (as in, was it measured in days/weeks/months)?
  3. Would it be easier to rewrite the portlet as native webparts at least as far as user preferences are concerned?
+1  A: 

We have a slightly similiar project, where we're converting from a BEA portal to Sharepoint.

The difference is we do not have any java servlet's or JSP pages as webparts/portlets, instead all that code on our system is .net portlets (and now webparts.).

The Java servlet's are in popup windows, which are linked from Sharepoint using hyperlinks.

So I can't give you an answer to 1. As we've never done this.
However to convert form a BEA portal portlet to a SharePoint webpart can be a significant exercise, as you need to build them in a completely different way.

In terms of efforts, we've migrated roughly 100 gadgets to webparts/applications in 1 year, with 1 full time developer, and 1 sharepoint infrastructure/configurer.

And for 3... it depends how complicated your portlet's are. If you want to keep them as portlet's/webparts then a complete rewrite is required unless you use a hack like a page viewer webpart... but then you're not really migrating, you just encapsulating your existing system with SharePoint on top.

I would say this is a large project, which needs careful planning to succeed.
I hope this helps.

Bravax
@Bravax, your solution using the popup windows sounds like what I had in mind for #1. Even if it is just encapsulating the existing system with SharePoint on top, it beats trying to rewrite all the portlets as webparts.
Kelly French
A: 

Here is what I've done for a single portlet, a stock quote panel.

We have a gadget that displays stock quotes. We have an account with Tickertech for them to provide us with quote information. There are user preferences which allow people to add the gadget to a private page and then select stocks of interest to them as individuals. You also can select which columns to display. This is accomplished through JavaScript. The selected stock symbols are sent along with a token which identifies the request as coming from a valid customer.

The simplest approach was to use a web content control and just paste in the JavaScript. This works but leaves no way for a user to change the stock symbols or other preferences involving Tickertech.

The next step was to create a custom Webpart. We are using the WSPBuilder add-on to Visual Studio. The consulting firm that is helping us with the project reccomended it and I'm very glad they did, reduces the integration cycle to a tolerable level.

In the webpart we have a property that contains the script.

public class MarketSummaryWP : Microsoft.SharePoint.WebPartPages.WebPart
{     
    string m_scriptBlockPre = "<script language='javascript'> \n"+ // the beginning of the JavaScipt block

In the CreateChildControls() override, I just added it as a literal.

this.Controls.Add(new LiteralControl(this.Script));

Next I changed the script to be private and created another property to hold the stock symbol list. Notice out the Script property does the concatenation inside the getter.

    //Script Property
    [WebBrowsable(false),
    WebDisplayName("Script"),
    WebDescription("The JavaScript to insert in the page.")]
    public string Script
    {
    get { return m_scriptBlockPre + m_stockSymbolsList + m_scriptBlockPost; }
    //set { ; }
    }

    //Stock Symbol list Property
    [Personalizable(PersonalizationScope.User), WebBrowsable(true),
    WebDisplayName("Stock Symbols"),
    WebDescription("The stock symbols to retrieve quotes for, seperated by commas.")]
    public string StockSymbols
    {
        get { return m_stockSymbolsList; }
        set { m_stockSymbolsList = value; }
    }


    string m_stockSymbolsList = "GE,CAT,$DJI,AMR,JNJ,";

    string m_scriptBlockPost = " *other JavaScript code* </script> \n"+

This gets me a webpart that can be added to any page because it is in the webpart gallery. To add a copy of the webpart built using the static html webpart, you'd need to get the JavaScipt block from an existing instance probably using 'view source', navigate to the target page, add a new instance of the static HTML webpart, and modify it to include the JavaScipt block; each time. This way the users only have to select it from a list of webparts and they can have customized stock quotes preferences.

Kelly French