PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export...

36
COPYRIGHT © 2007 BUSINESS OBJECTS S.A. PRACTICAL USE OF THE DESIGNER SDK Rosalind Beasley, Web Intelligent Design, Inc.

Transcript of PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export...

Page 1: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.

PRACTICAL USE OF THE

DESIGNER SDK

Rosalind Beasley, Web Intelligent Design, Inc.

Page 2: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

SLIDE 2 COPYRIGHT © 2007 BUSINESS OBJECTS S.A.

AGENDA

1. BusinessObjects COM SDK Roadmap

2. Designer SDK use and benefits

3. Demonstration

4. Object model basics

5. C# code walk through

6. Conclusion

7. Q&A

Page 3: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A. SLIDE 3

BUSINESSOBJECTS COM SDK

ROADMAP

Page 4: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 4

Choosing the correct COM SDK

BUSINESSOBJECTS COM SDK

ROADMAP

Are you automating Desktop Intelligence or the

Universe Designer application?

Are you automating Desktop Intelligence or the

Universe Designer application?

Desktop

Intelligence

COM SDK

Desktop

Intelligence

COM SDK

Universe

Designer COM

SDK

Universe

Designer COM

SDK

BusinessObjects

Enterprise COM

SDK

BusinessObjects

Enterprise COM

SDK

Depreciated

Page 5: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 5

BUSINESS OBJECTS DESIGNER

SDK REQUIREMENTS

COM compliant development environment

Visual Basic for Applications (VBA)

Microsoft Visual Studio Visual Basic or C#

BusinessObjects Designer Module

Designer.tlb

BusinessObjects Designer SDK Documentation

boXI_designerSDK_OMD_en.pdf

Universe Designer API Reference

Diamond Community

http://diamond.businessobjects.com/developer/library

Page 6: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A. SLIDE 6

DESIGNER SDK USE AND

BENEFITS

Page 7: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 7

Business ownership

Visibility into previous changes

Change impact analysis

Documentation standards

CHALLENGES

Can the Designer

SDK help?

Why don’t the objects

have business meaning?

Which objects are affected by

the proposed change?

Didn’t we fix this last

month?

Page 8: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 8

METADATA EXPORT UTILITY

USE AND BENEFIT

Practical uses

Object description management

Agree universe class structure and object names

Export the list of classes and objects to Excel

Distribute list to data stewards

Data steward to update object descriptions in Excel.

Benefits

Object description management

Business owns and maintains object descriptions

Object descriptions have business meaning

Business data stewards use Excel to update object descriptions

Page 9: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 9

METADATA EXPORT UTILITY

USE AND BENEFIT

Practical uses

Design specification creation

Export universe metadata to Excel or Word

Benefits

Design specification creation

Format flexibility

Meet corporate standard

Design principles/guidelines

Design decisions

Smaller & more readable document

40 versus 400 pages

Include information not available in standard universe printout

Object incompatibility

Shortcut Join Flag

Alias List

Page 10: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 10

METADATA EXPORT UTILITY

USE AND BENEFIT

Practical uses

Change history capture

Export universe metadata details to an RDBMS

Timestamp metadata

Benefits

Change history capture

Supports change request process

Universe change logs provide insight into change recurrence

Object change impact/effort analysis

Comparison of two different universes

Page 11: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 11

METADATA IMPORT UTILITY USE

AND BENEFIT

Practical uses

Object description management

Import the list of objects maintained by the business owner

Benefits

Object description management

Business retains ownership of object descriptions

Objects have business meaningful descriptions

Page 12: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A. SLIDE 12

METADATA IMPORT AND

EXPORT DEMONSTRATION

Page 13: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 13

OBJECT DESCRIPTION

MANAGEMENT DEMO

Demonstration Scenarios

Scenario #1 Scenario #2

ExcelExcel C# Application

C# Application

UniverseUniverse

Update

Read

Update

Stewards

ExcelExcel C#

Application

C#

Application

UniverseUniverseExport

Traverse

Stewards

Page 14: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 14

SCENARIO #1 - EXPORT

METADATA UTILITY

Select a universe file as the source

Select a destination type of Excel

Provide Destination path and filename

Page 15: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 15

SCENARIO #1 - EXPORT

METADATA UTILITY OUTPUT

Excel Workbook

Object List - Worksheet

Class Name

Object Name

Object Description

Object Select Clause

Object Where Clause

Date Object Auto Hierarchy

LOV Export with Universe

Object Data Type

Object Type

Hidden Flag

Pre-Defined Condition List –

Worksheet

Class Name

Condition Object Name

Condition Object Description

Condition Object Where Clause

Table List – Worksheet

Table Name

Alias Flag

Bases Table Name

Page 16: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 16

SCENARIO #2 - IMPORT

METADATA UTILITY

Select a universe file as the destination

Provide source path and filename

Review changes

Import changes

Page 17: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 17

CHANGE HISTORY DEMO

Demonstration Scenarios

Scenario #3 Scenario #4

Developer

Universe AUniverse A Universe BUniverse B

C#

Application

C#

Application

Change

History

Database

Universe

Comparison

Development

Universe

Development

Universe

CCB DeveloperApprove

Change

Test UniverseTest Universe

Production

Universe

Production

Universe

C#

Application

C#

Application

Change

History

Database

Change

log

Page 18: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 18

SCENARIO #3 - EXPORT

METADATA UTILITY

Select a universe file as the source

Select a destination type of RDBMS

Run Change History report

Page 19: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 19

SCENARIO #3 - EXPORT

METADATA UTILITY OUTPUT

Universe

Name Class Object Id Object Name Object Description Job Date

Universe

Modification Date

eFashion Product 165 Lines

Product line. Each line contains a set of

categories. 8/25/2007 8/26/2007

eFashion Product 165 Product Lines

Product line. Each line contains a set of

categories. 8/25/2007 8/26/2007

eFashion Product 508 Category

Each category contains the individual SKU codes

(and product descriptions). 8/25/2007 8/26/2007

eFashion Product 508 Product Category

Each category contains the individual SKU codes

(and product descriptions). 8/25/2007 8/26/2007

• tblJob• tblUnvHist

Change

History

Database

Change

History

Database

UnvHist.unvUnvHist.unv

Page 20: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 20

SCENARIO #4 - EXPORT

METADATA UTILITY

Provide a universe file as the source

Select a destination type of RDBMS

Repeat for second source

Page 21: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A. SLIDE 21

OBJECT MODEL BASICS

Page 22: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 22

DESIGNER OBJECT MODEL

OVERVIEW

ApplicationApplication

UniversesUniverses

UniverseUniverse

ClassesClasses

ClassClass

ObjectsObjects

Predefined

Conditions

Predefined

Conditions

ObjectObject

Predefined

Condition

Predefined

Condition

ListofValuesListofValues

TablesTables

TableTable

ColumnsColumns

ColumnColumn

Page 23: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A. SLIDE 23

C# CODE WALK THROUGH

Page 24: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 24

C# .NET COM

INTEROPERABILITY

Any code running outside the CLR is unmanaged

COM, COM+

WIN32 API

C++ Components

ActiveX

The BusinessObjects Designer SDK is a COM component

COM components are added to Visual Studio.NET projects

as references

Interop.Designer.dll will be

distributed with the application

Page 25: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 25

C# CREATE CLASS

Create a class in Visual C#

using System;

using System.Collections;

using System.Windows.Forms;

using System.Data.SqlClient;

using System.Diagnostics;

using Excel = Microsoft.Office.Interop.Excel;

namespace BOUNVMain

{

public class clsBOUnvManager

{

Page 26: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 26

C# DECLARE OBJECTS

Declare BusinessObjects Designer objects

Declare hash table to store objects

public static Designer.Application dsApp;

public static Designer.Universes dsUnvs;

public static Designer.Universe dsUnv;

public static Designer.Classes dsclss;

public static Designer.Class dscls ;

public static Designer.Tables dsTables;

public static Hashtable colCls;

public static Hashtable colTbls;

Page 27: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 27

C# DESIGNER LOGON

Logon to Designer passing user information

public static bool DesignerLogin(string strUserName, string

strPassword, string strCMSName,string strAuthentication)

{

clsBOUnvManager.dsApp = new

Designer.Application();

clsBOUnvManager.dsApp.LoginAs(strUserName,

strPassword, strCMSName,strAuthenticaztion);

clsBOUnvManager.dsApp.Visible = false;

clsBOUnvManager.dsApp.Interactive = false;

return true;

}

Page 28: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 28

C# DESIGNER LOGON DIALOG

Display the standard Designer login screen

public static bool DesignerLoginDialog()

{

clsBOUnvManager.dsApp = new Designer.Application();

clsBOUnvManager.dsApp.LogonDialog();

clsBOUnvManager.dsApp.Visible = false;

clsBOUnvManager.dsApp.Interactive = false;

return true;

}

Page 29: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 29

C# OPEN UNIVERSE FROM FILE

SYSTEM

Open a specified universe

public static bool OpenUniverse(string strUnvName)

{clsBOUnvManager.dsUnv =

clsBOUnvManager.dsApp.Universes.Open(strUnvName);

clsBOUnvManager.GeUniverseMetadata(clsBOUnvManager.dsUnv);

return true;

}

Page 30: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 30

C# OPEN UNIVERSE FROM

REPOSITORY

Import a universe from the repository and open it

public static bool ImportUniverse(string strUnvName, string

strFolder)

{clsBOUnvManager.dsUnv =

clsBOUnvManager.dsApp.Universes.OpenFromEnterprise(strUnvName,

strFolder);

clsBOUnvManager.GeUniverseMetadata(clsBOUnvManager.dsUnv);

return true;

}

Page 31: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 31

C# GET UNIVERSE METADATA

Navigate the universe structure

Populate hash table with universe objects

private static bool GetUniverseMetadata(Designer.Universe dsUnv)

{

clsBOUnvManager.colCls = new Hashtable();

for (int i = 1; i <= clsBOUnvManager.dsUnv.Classes.Count; i++)

{

dscls = clsBOUnvManager.dsUnv.Classes.get_Item(i);

clsBOUnvManager.colCls.Add(dscls.name,dscls)

clsBOUnvManager.TraverseUniverse(dscls);

}

return true;

}

Page 32: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 32

C# TRAVERSE UNIVERSE

Navigate through the hierarchy of the current class

private static void TraverseUniverse(Designer.Class boclsRoot)

{ Designer.Class clsCurrent;

if (boclsRoot.Classes.Count != 0)

{ for (int i = 1; i <= boclsRoot.Classes.Count; i++)

{clsCurrent = boclsRoot.Classes.get_Item(i);

clsBOUnvManager.colCls.Add(clsCurrent.Name, clsCurrent);

TraverseUniverse(clsCurrent);

}

}

}

Page 33: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 33

C# EXPORT UNIVERSE

METADATA TO EXCEL

Create new workbook and add worksheet

Excel.Workbooks xlsWorkBooks;

Excel.Workbook xlsWorkBook;

Excel.Worksheet xlsWorkSheet;

Excel.Application xlsApp = new Excel.Application();

xlsApp.ScreenUpdating = false;

xlsApp.DisplayAlerts = false;

xlsApp.Visible = false;

xlsWorkBooks = xlsApp.Workbooks;

xlsWorkBook = xlsWorkBooks.Add(Excel.XlSheetType.xlWorksheet);

xlsWorkSheet = ((Excel.Worksheet)xlsWorkBook.ActiveSheet);

Page 34: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 34

C# EXPORT UNIVERSE

METADATA TO EXCEL

Update worksheet with universe metadata

int iCellRow = 1;

foreach (Designer.Class dsclass in clsBOUnvManager.colCls.Values)

{for (int i = 1; i <= dsclass.Objects.Count; i++)

{xlsWorkSheet.Cells[iCellRow, 1] = dsclass.Name;

xlsWorkSheet.Cells[iCellRow, 2] =

dsclass.Objects.get_Item(i).Name;

xlsWorkSheet.Cells[iCellRow, 3] =

dsclass.Objects.get_Item(i).Description;

xlsWorkSheet.Cells[iCellRow, 4] =

dsclass.Objects.get_Item(i).Select;

x++;

}

}

Page 35: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

COPYRIGHT © 2007 BUSINESS OBJECTS S.A.SLIDE 35

C# IMPORT UNIVERSE

METADATA FROM EXCEL

Update universe metadata with Excel content

foreach (Designer.Class dsclass in clsBOUnvManager.colCls.Values)

{for (int i = 1; i <= dsclass.Objects.Count; i ++)

{for (int iArrayIndex = 1; iArrayIndex <

xlsArray.GetUpperBound(0); iArrayIndex++)

{if (xlsArray.GetValue(iArrayIndex, 3) != null)

{if (dsclass.Objects.get_Item(i).Name ==

xlsArray.GetValue(iArrayIndex, 2).ToString()

& dsclass.Objects.get_Item(i).Show

& dsclass.Name ==

xlsArray.GetValue(iArrayIndex, 1).ToString())

{dsclass.Objects.get_Item(i).Description =

xlsArray.GetValue(iArrayIndex, 3).ToString();

}

}

}

}}

Page 36: PRACTICAL USE OF THE DESIGNER SDK - Archive Use of...Practical uses Change history capture Export universe metadata details to an RDBMS Timestamp metadata Benefits Change history capture

SLIDE 36 COPYRIGHT © 2007 BUSINESS OBJECTS S.A.

CONCLUSION

Designer object model is easy to learn

Start immediately with the foundational knowledge acquired today

Enhance your design documentation

Track and manage changes more effectively