Forum Discussion
ChrisFeller
2 years agoNew Contributor
Scheduling an extract of metadata
I'm being asked to schedule an extract of the OneStream metadata. I'm under the impression that this cannot be done using the Task Scheduler since an extract of metadata is not an option in Data Man...
- 2 years ago
You can create a Business Rule to extract the metadata and then schedule that through Task Scheduler.
See here for more info:
amritp02
1 year agoNew Contributor II
Any idea how I can export specific dimension hierarchy and get it to show specific properties in the column in a .csv file?
MarcusH
1 year agoValued Contributor
The xmlExtractOptions object has properties that control what is extracted (eg XmlLoadExtractType.ApplicationDashboards). Unfortunately I haven't found any documentation and intellisense doesn't work. In short the way I do it is extract everything and then read the output zip file and pick off the Metadata.XML file like this:
' You will need these imports:
' Imports System.IO.Compression
' Imports System.Xml
Dim xmlOptions As New XmlExtractOptions
xmlOptions.ExtractAllItems = True
'Execute the Metadata Extract
Using dbConnFW As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si)
Using dbConnApp As DbConnInfo = BRApi.Database.CreateApplicationDbConnInfo(si)
Dim zipBytes As Byte() = ApplicationZipFileHelper.Extract(dbConnFW, dbConnApp, Nothing, xmlOptions)
' Decompress the zipped bytes into memory
Using zipStream As New MemoryStream(zipBytes)
Using archive As New ZipArchive(zipStream, ZipArchiveMode.Read)
' Iterate through each entry in the zip archive
For Each entry As ZipArchiveEntry In archive.Entries
If entry.fullname.toupper = "METADATA.XML" Then
' Read the contents of the entry into a string
Using entryStream As Stream = entry.Open()
Using reader As New StreamReader(entryStream)
Dim contents As String = reader.ReadToEnd()
' Save file ...
End Using
End Using
Exit For
End If
Next
End Using
End Using
End Using
End UsingIf you then want a particular dimension, I would load the file into an XML document and parse out the dimension you want. Then convert it to a csv file.
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 3 years ago