| By Kirk Liemohn, Chris Edwards | Article Rating: |
|
| February 16, 2008 12:00 PM EST | Reads: |
4,986 |
Those features are broken out as follows: (Table 1)
Content Embedding
The goal of content embedding is to show Confluence content in SharePoint and SharePoint content in Confluence. The approaches for this were:
- Use Confluence plug-ins to show SharePoint content such as list data and document links in Confluence.
- Use SharePoint Web parts to show Confluence wiki pages and Confluence wiki page hierarchy in SharePoint.
The Confluence plug-in lets the user enter SharePoint-specific Confluence wiki markup in a Confluence wiki page. The plug-in uses the built-in SharePoint Web Services (primarily Lists.asmx) to retrieve list content. A simple example of the markup might be:
{sp-list:test doc library|doc}
The resulting section of the wiki pageis shown in Figure 2.
One interesting aspect of the plug-in was a technique4 used to provide an external link for editing a document in a SharePoint document library. The link is shown in a Confluence wiki page, but lets the user click the link, edit the document, and save the changes back to SharePoint as seamlessly as in a SharePoint document library.
SharePoint Web Parts
Two Web parts were created to show Confluence content in SharePoint:
- Confluence Page Web Part
- Confluence Space Pages Web Part
Confluence Page Web Part
The Confluence Page Web part shows a Confluence wiki page in a SharePoint Web part.
The example in Figure 3 shows a Confluence wiki page that displays news via RSS. The high-level work of displaying the page content in the Web part is shown below:
RemotePage page = ConfluenceHelper.GetConfluencePage(this.PageId);
this.TitleUrl = page.url;
pageContent = ConfluenceHelper.RenderContent(this.SpaceKey, this.PageId);
pageContent = GetCleanPageContent(pageContent);
_literalPage.Text = pageContent;
This is simplifying things a bit, but the ConfluenceHelper class basically has several methods that wrap Confluence Web Service method proxy calls. In this case, the GetConfluencePage method wraps the Confluence getPage Web method and the RenderContent wraps the Confluence renderContentAsUser Web method. In addition, regular expressions are used to prefix all URLs properly in the Confluence page content with the Confluence host and remove some inline CSS styles that were conflicting with the rest of the SharePoint page. Finally, the pageContent is simply applied to the Text property of a Literal control. All of this happens in the OnPreRender override of the Web part.
The image in Figure 3 also shows an "Edit Confluence Page" verb on the Web part menu. This is done simply by overriding the get of WebPartVerbCollection in the Web part as shown in Listing 1.
Once again we use our Web Service proxy wrapper, this time to determine if the user can edit the page. Note that caching should be done on operations such as this in the get of the WebPartVerbCollection since it may be called multiple times when a single Web part is displayed.
A more interesting aspect of the Web parts is the editor part. Editor parts are used to provide a custom editor for Web part properties. Without an editor part, custom Web part properties are typically text boxes shown in the "Miscellaneous" section when you edit your Web part properties (enumeration Web part properties show as drop-downs). In this case, we want to let the user select a page for the Web part. Our editor part is shown in Figure 4.
To make this work, we override the CreateEditorParts method on the Web part as shown in Listing 2, where you can see it references a ConfluencePageEditorPart. This class inherits from the EditorPart, which is an extension of a Panel (a WebControl). In this particular editor part we override CreateChildControls and OnPreRender to display the content you see in Figure 4. We happen to use our own custom DropDownList control to encapsulate the list of Confluence spaces and a custom TreeView control to encapsulate the pages in a space. This was done because they are both used in the Confluence Space Pages Web Part we'll discuss below.
The primary difference between a UserControl and an EditorPart is that the EditorPart must be able to communicate to the Web part. This is done through two methods: SyncChanges and ApplyChanges.
A Web part is in charge of storing and retrieving the Web part property values. SyncChanges is used to take the Web part property values in the Web part and provide them to the EditorPart so it can properly display the current settings as seen in Listing 3.
Typically, the EnsureChildControls method can be called to make sure that CreateChildControls is already called and then the properties can sometimes be applied directly to controls in the editor part. However, in our case the processing was a little more complex so we stored the property values in member variables to be used later in OnPreRender.
The ApplyChanges method is the corollary to SynChanges. It lets the editor part provide Web part property values to the Web part as shown in Listing 4.
Published February 16, 2008 Reads 4,986
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kirk Liemohn
Kirk Liemohn is a principal software engineer with ThreeWill. His recent project experience includes Microsoft Office SharePoint Server (MOSS) enterprise search projects as well as a Windows SharePoint Services (WSS) business analysis portal. Kirk manages a SharePoint blog at http://www.implementingsharepoint.com.
More Stories By Chris Edwards
Chris Edwards is a senior software engineer with ThreeWill. His project roles have ranged from development/technical lead to development resource. He is certified as MCSD using Microsoft .NET and as MCTS: SharePoint Services 3.0, Application Development. Chris manages resource links related to WSS at http://wssresourceguide.com.
![]() |
fdaske 09/23/09 11:33:00 AM EDT | |||
Generally SharePoint is a great platform for data integration. Sharepoint lists can be directly connected to almost any external data sources using the BDLC found here. In this way you can use all SharePoint list features, even workflows if external data records are changed. |
||||
![]() |
shirley 11/26/08 05:05:46 AM EST | |||
We can assist here as we specialize in developing and implementing SharePoint 2007 – that’s all we do. There is more information on this at http://www.nsynergy.com/Services/Pages/default.aspx or mail to Mark.Davis@nsynergy.com . |
||||
![]() |
shirley 11/04/08 12:01:21 AM EST | |||
For more information on document management and collaboration solutions, please visit http://www.nsynergy.com or please email to Mark.Davis@nsynergy.com. |
||||
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications




























