Team Macro

Here is some code to create a formatted table of users. Usage: create a new user macro using the code below, called {team}, check the box that it "has a body".

{team}
tcolson=Engineer
ugeek=Useful Geek
juser=Another Dude
{team}

Team Macro Code

## Macro: team
## Takes a list of userid=role pairs and creates a table with links to a
## corporate directory and Jira Profiles for the users (if present).
## USAGE:
## {team}
## uid=role
## uid=role
## {team}

#set ($teamdebug = 1)

#if ($teamdebug) 
<h3>team3:param1|$param1|</h3>
#end

## Use the body content
 #set ($mytype="body" )
 #set ($lines = $body.replaceAll("^(\n|\r|\r\n)+","") )
 #set ($lines = $lines.replaceAll("(\n|\r|\r\n)+$","") )
 #set ($uidRolePairs = $lines.split("\n") )

<table class="wikitable">
<tr>
<th>User</th>
<th>Role</th>
</tr>

#foreach ( $pair in $uidRolePairs)
  #set ($uid_end = $pair.indexOf("=") )
  #set ($role_start = $uid_end + 1 )
  #set ($uid  = $pair.substring(0,$uid_end) )
  #set ($end =  $pair.length() )
  #set ($role = $pair.substring($role_start, $end ) )

<tr>
#if ($teamdebug) 
<TD>## UID=$uid  ROLE=$!role <BR></TD>
#end
<td>
#if ($action.getUserFullName($uid))
 #set ($context = $req.getContextPath() )
 #set ($userFullName = $action.getUserFullName($uid) )
 
 <A HREF="link_somewhere?name=$uid.toLowerCase()">
 <img src="/icons/vcard.gif" border=0 hspace="3" width=18 height=14 align="middle"></A>
 <A HREF="$context/display/~$uid"><img src="$context/images/icons/user_12.gif"
 alt="Confluence Profile" align="middle" border="0">$userFullName</A>
#else
 <A HREF="link_somewhere?name=$uid.toLowerCase()">
 <img src="/icons/vcard.gif" border=0 hspace="3" width=18 height=14 align="middle">$uid</A>
#end
</td>
<td>$role</td>
</tr>
#end
</table>
#if ($teamdebug) end of <b>$mytype</b> <HR>#end

Labels

plugin plugin Delete
repository_excluded repository_excluded Delete
repository_excluded_by_user_macro repository_excluded_by_user_macro Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 24, 2005

    Dhananjay Nene says:

    It probably does not work since there is no "end" macro tag for the inline versi...

    It probably does not work since there is no "end" macro tag for the inline version. I believe it might work if you add a {team} between the INLINE and BODY versions.

  2. Jan 16, 2006

    Laks Krishnamoorthy says:

    Does this work? I am trying to use this and get a message there is no macro call...

    Does this work? I am trying to use this and get a message there is no macro called team

  3. Oct 23

    Mark Sheppard says:

    Please could you add a screenshot? It'd be useful to see what it looks like wit...

    Please could you add a screenshot? It'd be useful to see what it looks like without having to install and use the macro.