Domino Upgrade

VersionSupport end
5.0
6.0
6.5
7.0
Upgrade to 8.5x now!
(see the full Lotus lifcyle) To make your upgrade a success use the Upgrade Cheat Sheet. Contemplating to replace Notes? You have to read this!

Search

Reference

1. Learn XPages online
2. Communicate with IBMers and Lotus Experts using Sametime

About Me

I am the "IBM Collaboration & Productivity Advisor" for IBM Asia Pacific. I'm based in Singapore.
Reach out to me via:
Follow notessensei on Twitter
(posts)
Skype
Sametime
IBM
Facebook
LinkedIn
XING
Amazon Store
Amazon Kindle

Mobile tag

Twitter

Languages

Other languages on request.

Visitors

Useful Tools

Get Firefox
Use OpenDNS
The support for Windows XP is coming to an end and has . Time to consider an alternative to move on. sounds like a lot of time, but, like an object in a mirror, it is closer than you think.

« DLink - a support experience (a nice one for a change) | Main| Online storage / backup »

Listing custom fields and attachments in Lotus Connections

Lotus Connections 2.x allows users to specify custom fields to be added to any item. This option is very useful together with the entry template function. Once a set of additional fields has been defined, they can be reused to capture structured information into an activity. Currently these additional fields are visible with the entry, but can't be visualized in other ways, most notably a table (It is on the list for future versions). So when a developer has an itch, it needs scratching. Connections comes with multiple entry points: the webUI, a Sametime plug-in, a Notes plug-in and a ATOM/REST API. A quick check of the ATOM XML showed, that the custom fields are in the XML and would be retrieved when loading the ATOM url. Fields are encoded as snx:field inside a feed/entry element. They come as type text, name, attachment and url. 70 lines of XSLT would transform that into a table for me. I created 2 examples: one for the list of attachments in an activity and one with a table of custom field values. The stylesheet needs to be called by something (I just downloaded the ATOM feed using wget and the command line version of DXLMagic to do that). Enjoy. As usual: YMMV.
The stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:f="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:thr="http://purl.org/syndication/thread/1.0" exclude-result-prefixes="xs" version="2.0">
    
    
<xsl:template match="/">

        
<html>
            
<head>
                
<title>Activity entries with custom fields</title>
                
<style type="text/css">
                    html, body, td {font-family : Verdana, Arial, sans-serif; font-size : small }
                    th, td {
                        text-align : left;
                        border-right : 1px solid gray ;
                        border-bottom : 1px solid gray ;
                    }
</style>
            
</head>
            
<body>
                
<table>
                    
<xsl:apply-templates select="//f:entry[snx:field[@type='text']][1]" mode="header" />
                    
<tbody>
                        
<xsl:apply-templates select="//f:entry" />
                    
</tbody>

                
</table>
            
</body>
        
</html>

    
</xsl:template>

    
<xsl:template match="f:entry" />

    
<!-- We presume we have one text field there -->
    
<xsl:template match="f:entry[snx:field[@type='text']]">
        
<tr>
            
<td>
                
<xsl:element name="a">
                    
<xsl:attribute name="href">
                        
<xsl:value-of select="f:link[@rel='self']/@href" />
                    
</xsl:attribute>
                
<xsl:value-of select="f:title" />
                
</xsl:element>
            
</td>
            
<xsl:apply-templates select="snx:field" />
        
</tr>
    
</xsl:template>
    
    
<xsl:template match="snx:field[@type='text']">
        
<td>
            
<xsl:value-of select="f:summary" />
        
</td>
    
</xsl:template>
    
    
<xsl:template match="snx:field[@type='person']">
        
<td>
            
<xsl:value-of select="f:name" />
            (
<xsl:value-of select="f:email" />)
        
</td>
    
</xsl:template>

    
<xsl:template match="f:entry[snx:field[@type='file']]" mode="header" />
    
<xsl:template match="snx:field[@type='file']" mode="header" />

    
<xsl:template match="f:entry[snx:field]" mode="header">
        
<thead>
            
<tr>
                
<th>Title</th>
                
<xsl:apply-templates select="snx:field" mode="#current" />
            
</tr>
        
</thead>
    
</xsl:template>

    
<xsl:template match="snx:field" mode="header">
        
<th>
            
<xsl:value-of select="@name" />
        
</th>
    
</xsl:template>

</xsl:stylesheet>
Download the samples.

Post A Comment

Please note: Comments without a valid and working eMail address will be removed. This is my site, so I decide what stays here and what goes.

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::rolleyes:;-)

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor enlightened by Lotus Software nor IBM Corporation. I may be an employee, but the opinions, theories, facts, etc. presented here are my own and are in now way given in any official capacity. In short, these are my words and this is my site, not IBM's - and don't even begin to think otherwise. (Disclaimer shamelessly plugged from Rocky Oliver)
© 2003 - 2012 Stephan H. Wissel - all rights reserved as listed here: Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution/NonCommercial/ShareAlike Creative Commons License, with the exception that no rights are granted -- since they are not mine to grant -- in any logo, graphic design, trademarks or trade names of any type.