All DDWRT Functions by SharePoint Version

Yesterday I’ve been asked “How can I get a list of all DDWRT extensions that are available in SharePoint 2013?”.

The online documentation is accurate but, unfortunately, a “little” bit outdated: this article by Serge van den Oever is a great source of information, but still refers to SharePoint 2003, therefore some functions are just missing.

I was curious, so I executed this simple PowerShell script to get the signature (name, return type, parameters) of each public, instance method of the Microsoft.SharePoint.WebPartPages.BaseDdwRuntime and of the Microsoft.SharePoint.WebPartPages.DataFormDdwRuntime where ddrwrt extensions are defined.

$spAssm = [Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$baseRuntime = $spAssm.GetType("Microsoft.SharePoint.WebPartPages.BaseDdwRuntime")
$ddwRuntime = $spAssm.GetType("Microsoft.SharePoint.WebPartPages.DataFormDdwRuntime")
$methods = ($baseRuntime.GetMethods("Public,Instance") |? { $_.DeclaringType -eq $baseRuntime -and !$_.IsSpecialName -and ! $_.IsAbstract }) + ($ddwRuntime.GetMethods("Public,Instance") |? { $_.DeclaringType -eq $ddwRuntime -and !$_.IsSpecialName -and ! $_.IsAbstract })

$methods | sort Name |% {
    ac C:\Scripts\DDWRTMethods.txt $_.Name
    Write-Host "Method Name: $($_.Name)"
    Write-Host "  Output: $($_.ReturnType.Name)"
    $_.GetParameters() |% {
        Write-Host "  Input: $($_.Name) ($($_.ParameterType.Name))"
    }
}
Write-Host
Write-Host "# of extensions found: $($methods.Count)"

I ran this script on a SharePoint 2013 box and I got a list of 63 functions (see the output at the bottom of this post).

Executing the very same script against a SharePoint 2007 and a SharePoint 2010 environment led to the results elaborated and represented by the table below (I did not have a SP 2003 farm where I could install PowerShell, so I grabbed the list of DDWRT function from the Serge’s article above).

image

Finally, here’s the list of DDWRT extensions supported by SharePoint 2013.

Method Name: AllowSilverlightPrompt
Output: Boolean
Method Name: AutoHyperLink
Output: String
Input: szStr (String)
Input: preserveWhitespace (Boolean)
Method Name: AutoNewLine
Output: String
Input: inputString (String)
Method Name: ConnEncode
Output: String
Input: szData (String)
Method Name: Counter
Output: String
Method Name: CurrentRights
Output: String
Method Name: DataBind
Output: String
Input: op (String)
Input: controlId (String)
Input: propertyName (String)
Input: eventName (String)
Input: keyField (String)
Input: keyValue (String)
Input: dataField (String)
Method Name: DateTimeTick
Output: Int64
Input: stringDate (String)
Method Name: EcmaScriptEncode
Output: String
Input: stringToEncode (String)
Method Name: EnsureAllowedProtocol
Output: String
Input: urlToCheck (String)
Method Name: EscapeDelims
Output: String
Input: str (String)
Method Name: FieldFilterImageUrl
Output: String
Input: fieldName (String)
Method Name: FieldFilterOptions
Output: String
Input: szName (String)
Method Name: FieldPrefix
Output: String
Method Name: FieldSortImageUrl
Output: String
Input: direction (String)
Method Name: FieldSortParameters
Output: String
Input: szName (String)
Method Name: FilterLink
Output: String
Method Name: FormatDate
Output: String
Input: stringDate (String)
Input: lcid (Int64)
Input: formatFlag (Int64)
Method Name: FormatDateTime
Output: String
Input: stringDate (String)
Input: lcid (Int64)
Input: formatString (String)
Method Name: FormatDateTimeUsingCurrentContext
Output: String
Input: stringDate (String)
Method Name: FormatDateUsingCurrentContext
Output: String
Input: stringDate (String)
Method Name: GenDisplayName
Output: String
Input: theValue (String)
Method Name: GenFireConnection
Output: String
Input: szConnectStr (String)
Input: szOtherPostback (String)
Method Name: GenFireServerEvent
Output: String
Input: szEventStr (String)
Method Name: GenFireServerEventEncode
Output: String
Input: szEventStr (String)
Method Name: GenFireWorkflowStart
Output: String
Input: listName (String)
Input: itemID (String)
Input: workflowId (String)
Input: workflowParams (String)
Method Name: GenFireWorkflowTaskComplete
Output: String
Input: taskID (String)
Input: taskListName (String)
Method Name: GetCurrentBuildVersion
Output: String
Method Name: GetFileExtension
Output: String
Input: targetUrl (String)
Method Name: GetRatingsData
Output: XPathNodeIterator
Input: itemId (String)
Method Name: GetUserID
Output: String
Input: fieldName (String)
Method Name: GetVar
Output: String
Input: szName (String)
Method Name: HtmlDecode
Output: String
Input: stringToDecode (String)
Method Name: HtmlTransHandleUrl
Output: String
Input: szExt (String)
Method Name: HtmlTransProgID
Output: String
Input: szExt (String)
Method Name: IfDebug
Output: Boolean
Method Name: IfHasRights
Output: Boolean
Input: permissions (UInt64)
Method Name: IfNew
Output: Boolean
Input: createdTime (String)
Method Name: IfNewlyUpdated
Output: Boolean
Input: createdTime (String)
Input: lastRefreshTime (String)
Method Name: IsPrivilegedUser
Output: Boolean
Method Name: Limit
Output: String
Input: inputText (String)
Input: maxLength (Int32)
Input: additionalText (String)
Method Name: ListProperty
Output: String
Input: szPropName (String)
Method Name: MapToAll
Output: String
Input: szProgID (String)
Input: szExt (String)
Method Name: MapToApp
Output: String
Input: szProgId (String)
Input: szExt (String)
Method Name: MapToControl
Output: String
Input: szProgID (String)
Input: szExt (String)
Method Name: MapToIcon
Output: String
Input: szProgID (String)
Input: szExt (String)
Method Name: Max
Output: Int32
Input: nodeIter (XPathNodeIterator)
Method Name: Min
Output: Int32
Input: nodeIter (XPathNodeIterator)
Method Name: NameChanged
Output: String
Input: theName (String)
Input: id (Int64)
Method Name: PagingImageUrl
Output: String
Input: direction (String)
Method Name: PresenceEnabled
Output: String
Method Name: Random
Output: String
Input: lowVal (String)
Input: highVal (String)
Method Name: RecycleBinEnabled
Output: Boolean
Method Name: SelectOptions
Output: String
Input: szName (String)
Method Name: SetVar
Output: String
Input: szName (String)
Input: szValue (String)
Method Name: ThreadStamp
Output: String
Method Name: Today
Output: String
Method Name: TodayIso
Output: String
Method Name: UrlBaseName
Output: String
Input: targetUrl (String)
Method Name: UrlDirName
Output: String
Input: targetUrl (String)
Method Name: UrlEncode
Output: String
Input: stringToEncode (String)
Method Name: URLLookup
Output: String
Input: listName (String)
Input: FieldAttributeName (String)
Input: FieldPosition (String)
Method Name: UserLookup
Output: String
Input: UserName (String)
Input: FieldName (String)

# of extensions found: 63

Leave a Reply

Your email address will not be published. Required fields are marked *