Upload
alaina-wilkins
View
216
Download
0
Embed Size (px)
Citation preview
What is a Command Center?
A single BQY file on the OnDemand Server used as a launching point for all or a series of BQY files that are also available on the OnDemand Server as well as possibly other reporting documents available on the OnDemand Server or on other servers. The Command Center is where the user is first directed to when accessing a suite of Brio Intelligence reports.
Why Use a Command Center?Simplifying integration with existing
applicationsReductions and eliminations in user
training timePlaying to your developer’s strengthsSavings
What Types of Users Should be Using a Command Center?Quickview Users – Full functionality with
little to no training neededFreeview Users – Serves as a menu for
preprocessed reports or can be modified for real-time data via a Broadcast Server
Insight Users – Launching point, news & updates
What is in a Command Center Parent Document? Main EIS screen – An EIS containing a list of
reports, actions, etc. Empty section(s) – Empty report and/or
results sections for export communication, file deletions, etc.
Queries – Queries used to retrieve possible limit values or repository information
Secondary EIS sections – EIS sections for setting limits, company news and updates, etc.
How are Child Documents Opened and Closed?Remember that the browser is the
controlling application for pluginsBeware of browser security features
when closing documents or opening documents that will need to be closed
Don’t be afraid to reload the command center
Example:Normally:
Open: OpenURL(myURL, “_new”)
Close: OpenURL(“javascript:self.close”, “_self”)
Problem:
Solution:
Open: OpenURL("javascript:window.open(\"" + base + "\");window.back();", “_self”)
Close: OpenURL(“javascript:self.close”, “_self”)
Helpful tip:
Open: OpenURL("javascript:window.open(\"" + base + "\", \"\", \"left=1300\");window.back();", “_self”)
How do the Documents Communicate?Session variables – Information is
passed via the URL from the parent document to the child document
File communication – Information is passed into and read from text files (or other files) by any document used in the deployment
What are Session Variables and Why Use Them?Variable names and values appended
to a URLAble to be read by BQY files opened
with an appended URLQuick and easy communication from a
parent document to a child documentAlready being used in Brio URL’s
Example:Base URL:
http://brio01/ods-cgi/odscgi.exe?Method=getDocument&Docname=%40%24%40%24290&JScript=Enable
Format:http://base_url/executable?Parameter1=value&Parameter2=value…
Append Parameters:…?Method=getDocument&Docname=%40%24%40%24290&JScript=Enable&Name=Joe&Wife=Jane&Kids=true
Read Parameters:var msg = “Hello “ + Session.URL.Item(“Name”) + “!\r\n”
msg += “I hope “ + Session.URL.Item(“Wife”)
if(eval(Session.URL.Item(“Kids”))){
msg += “ and the kids are”
}
else{
msg += “ is”
}
msg += “ well.”
Alert(msg, “Welcome”)
Business Implications
Values can be passed for:Limits – Limit values to be used to filter
data in a child documentActions – Actions such as print, export,
save, etc.User information – Temp directory
location, temp file names, username, scripting support status, etc.
What is File Communication and Why Use It? Information written to and read from text
(or other format) filesAllows for numerous ways to write and
read information depending on client machine configuration
Allows for communication back to the parent document from the child document
Example 1 - Text Stream:Note: Text Streams are accessible via the FileSystemObject. This
object is only available if scripting support has not been disabled.
Write values to a text file:var fso = new JOOLEObject(“Scripting.FileSystemObject”)
var txt = fso.CreateTextFile(“C:\\WINDOWS\\TEMP\\BQCOMM.TXT”)
txt.WriteLine(“Joe”)
txt.WriteLine(“Jane”)
txt.Close()
File BQCOMM.TXT then reads:Joe
Jane
Add more information:var fso = new JOOLEObject(“Scripting.FileSystemObject”)
var file = fso.GetFile(“C:\\WINDOWS\\TEMP\\BQCOMM.TXT”)
var txt = file.OpenAsTextStream(8) // 8 is used to specify the iomode “ForAppending”
txt.WriteLine(“true”)
txt.Close()
File BQCOMM.TXT then reads:Joe
Jane
true
Example 1 - Text Stream (cont.):
Read values from the text file:var fso = new JOOLEObject("Scripting.FileSystemObject")
var file = fso.GetFile("C:\\WINDOWS\\TEMP\\BQCOMM.TXT")
var txt = file.OpenAsTextStream(1)
var msg = "Hello " + txt.ReadLine() + "!\r\n"
msg += "I hope " + txt.ReadLine()
if(eval(txt.ReadLine())){
msg += " and the kids are "
}
else{
" is "
}
msg += "well."
txt.Close()
Alert(msg, “Welcome”)
Result:
Example 2 – Import / Export:Creating the Export Section
Create a data file:
Import the data file:
Hide the single column:
Example 2 – Import / Export (cont.):Write computed columns:
var sec = ActiveDocument.Sections["CommExport"]
var cols = sec.Columns
cols.AddComputed("Name", "\"Joe\"")
cols.AddComputed("Wife", "\"Jane\"")
sec.Export("C:\\WINDOWS\\TEMP\\BQCOMM.CSV", 6, true, false)
File BQCOMM.CSV now reads:Name,Wife
Joe,Jane
Append file with additional value:ActiveDocument.Sections.ImportDataFile("C:\\WINDOWS\\TEMP\\BQCOMM.CSV", 2)
var sec = ActiveDocument.Sections[“BQCOMM.CSV”]
sec.Columns.AddComputed(“Kids”, “\”Yes\”)
sec.Export("C:\\WINDOWS\\TEMP\\BQCOMM.CSV", 6, true, false)
File BQCOMM.CSV now reads:Name,Wife,Kids
Joe,Jane,Yes
Example 2 – Import / Export (cont.):
Read values from the file:
ActiveDocument.Sections.ImportDataFile("C:\\WINDOWS\\TEMP\\BQCOMM.CSV", 2)
var cols = ActiveDocument.Sections["BQCOMM.CSV"].Columns
var msg = "Hello " + cols["Name"].GetCell(1) + "!\r\n"
msg += "I hope " + cols["Wife"].GetCell(1)
if(cols["Kids"].GetCell(1) == "Yes"){
msg += " and the kids are "
}
else{
msg += " is "
}
msg += "well."
Alert(msg, "Welcome")
Result:
How Can Temp Files be Used in the Command Center?
Seamless display in non-BQY formats like Excel or PDF
Automatic attachments for e-mailingError loggingFile communication
Where are Temp Files Stored?
Finding the Temp Directory
From the FileSystemObject:
function findTempDirectory(){
var fso = new JOOLEObject("Scripting.FileSystemObject")
var temp = fso.GetSpecialFolder(2)
return temp
}
From the Windows Scripting Host:
function findTempDirectory(){
var ws = new JOOLEObject("Wscript.Shell")
var temp = ws.Environment.Item(“TMP”)
return temp
}
Where are Temp Files Stored (cont.)?Trial & error:
function findTempDirectory(driveLetter){var directory = null
var possible = new Array(6)possible[0] = ":\\TEMP\\"
possible[1] = ":\\WINNT\\TEMP\\"possible[2] = ":\\WINDOWS\\TEMP\\"
possible[3] = ":\\WINDOWS\\TEMPORARY INTERNET FILES\\"possible[4] = ":\\WINNT\\TEMPORARY INTERNET FILES\\"
possible[5] = ":\\"var x = 0
do{try{
var fullPth = driveLetter + possible[x] + "TEST.TMP"ActiveDocument.Sections["Empty"].Export(fullPth, 8, true, false)
directory = driveLetter + possible[x]x = 6
} catch(er){
x++}}
while(x < 6)return directory
}
Where are Temp Files Stored (cont.)?
Ask the user:function getTempDirectory(){
var xl = new JOOLEObject("Excel.Application")
var valid = false
do{
var inputVal = xl.InputBox("", "Specify Temp Directory", "Please specify a temp directory (Format as C:\TEMP):")
try{
ActiveDocument.Sections["Empty"].Export(inputVal + "\\TEST.TMP", 4, true, false)
valid = true
}
catch(er){
}
}
while(valid == false)
return inputVal
}
How are Temp Files Named?Naming conventions:
BQCC1.TMPBQCC2.TMPBQCC3.CSV
From the FileSystemObject:
function getTempFileName(){var fso = new JOOLEObject(“Scripting.FileSystemObject”)
var filename = fso.GetTempName()return filename
}
Generated randomly:
function getTempFileName(){var fileName = “”
for(var a = 1; a <= 8; a++){var num = Math.ceil(Math.random() * 26) + 64
fileName += String.fromCharCode(num)}
return fileName}
How are Temp Files Removed?Deletion through the FileSystemObject:
function removeTempFiles(tempFileArray, tempDirectory){
var fso = new JOOLEObject(“Scripting.FileSystemObject”)
for(var a = tempFileArray; a.length > 0;){
var fileSpec = tempDirectory + tempFileArray[0]
var file = fso.GetFile(fileSpec)
try{
file.Delete()
tempFileArray.splice(0, 1)
}
catch(er){
var msg = “The command center cannot delete “
msg += tempFileArray[0]
msg += “ because the file is in use. Please close this file.”
Alert(msg, “Error”)
removeTempFiles(tempFileArray, tempDirectory)
}
}
}
How are Temp Files Removed (cont.)?
Overlaid with empty section exports:
function removeTempFiles(tempFileArray, tempDirectory){
for(var a = tempFileArray; a.length > 0;){
var fileSpec = tempDirectory + tempFileArray[0]
try{
ActiveDocuments.Sections[“Empty”].Export(fileSpec, 4, false, false)
tempFileArray.splice(0, 1)
}
catch(er){
var msg = “The command center cannot delete “
msg += tempFileArray[0]
msg += “ because the file is in use. Please close this file.”
Alert(msg, “Error”)
removeTempFiles(tempFileArray, tempDirectory)
}
}
}
What Else Can a Command Center do?
Launch and manage existing fully-functional documents
Launch pregenerated PDF, XLS and other files exported from a BCS
Generate BCS jobs by writing to the repository tables
Generate and use self-deleting temp files
What are the Limitations?
Your Own Imagination
The command center is what you make it. So make it efficient, functional, and
something you can be proud of!
Is This the End?
Only for now…
This presentation is based on the first in a series of white papers describing command center deployment, configuration and
techniques. There is more to come. For the latest updates on the command center series and what’s next contact:
Adam FranzIndependent Consultant
Phone: 603-661-6194Fax: 775-796-4665
E-mail: [email protected] Site: http://www.adamfranz.com
“CODITO ERGO SUM”