Monday, June 15, 2009

OBIEE Availible images

Somebody asked for a complete overview of all the default images availible for OBIEE. I wrote a small script which make a webpage including the file locations:



'John Minkjan
'Get the all the OBIEE images
'to pipe the output into the file use: cscript OBIEE_GRAPHS.vbs > OBIEE_GRAPHS.HTML


Redim FolderList(0)'A flat list of the directory subtree

FolderList(0) = "E:\OracleBI\web\app\res\s_oracle10"

'This part of the script walks the directory structure and stores all of the folder paths in the FolderList Array.

FolderIndex = 0
Do Until FolderIndex > Ubound(FolderList)

    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(folderList(folderindex))

    If f.subfolders.count > 0 Then

        For Each folder In f.subFolders

        if folder.attributes <> 22 Then 'Exclude hidden system folders
            redim preserve FolderList(Ubound(FolderList)+1)
            FolderList(ubound(FolderList)) = folder.path
        End If
    End If
    FolderIndex = FolderIndex + 1

'Set up a header for the output
    wscript.echo "<BODY>"

'This part of the script Works through the list of folders and outputs the data for each file
    wscript.echo "<table border='1'>"
        for n = 0 to ubound(FolderList)
        Set fso = CreateObject("Scripting.FileSystemObject")

        Set f = fso.GetFolder(FolderList(n))
            For Each file In f.Files
                if (right(file.Name,3) = "jpg" or  right(file.Name,3) = "gif") and instr(file.parentfolder,"b_mozilla_4") = 0 then
                    wscript.echo "<TR>"
                        wscript.echo "<TD>"
                            wscript.echo file.parentfolder &"\" & file.Name
                        wscript.echo "</TD>"
                        wscript.echo "<TD>"
                            wscript.echo "<IMG SRC='" & file.parentfolder &"\" & file.Name & "'/>"
                        wscript.echo "</TD>"
                    wscript.echo "</TR>"
                End if
    wscript.echo "</table>"
wscript.echo "</BODY>"

Till Next Time


phnuxen said...

Hi John, thanks again for this, works fine with Explorer, but if i try to open in Firefox it gives a broken link to Img source. I solved it with a little change in the script.

I replaced this :
wscript.echo "(IMG SRC='" & file.parentfolder &"\" & file.Name & "'/)"

with this one :
wscript.echo "(IMG SRC='file:///" & replace(file.parentfolder,"\","/") & "/" & file.Name & "'/)"

< > = ()

John Minkjan said...


Thanks for sharing!

Foreign Currency said...

great post