ListTemplates()

This code sample describes how to create a script that returns a list of HTML templates that are stored in the templates directory of the custmod module (for example, c:/opentext/module/custmod_1_0_0/templates).

	Function List ListTemplates()
		String templatePath
		String moduleDir = $Custmod.custtaskmodule.PathPrefix()
		String templatesDir = moduleDir + "templates" + File.Separator()

		List vFileListList = File.FileList( templatesDir )
		List retList = {}
		
		//Retrieve the list of HTML templates that are stored in your
		//module's /template directory. These are the HTML templates that
		//the creators of workflow maps can attach to the custom display
		//step type in the Workflow Designer.

		if ( !IsError( vFileListList ) && \
		( Length( vFileListList ) > 0 ) )
			for templatePath in vFileListList
				retList = { @retList, File.GetName( templatePath ) }
			end
		end
		return( retList )
	end