IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

26
1 © 2011 IBM Corporation IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

description

IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”). Contents. New Pluglets Feature in IDA 7.6 Pluglets, some background Install option “Run Pluglets” menu Installed Sample pluglets Develop Custom pluglets Trouble Shooting & Known Limitations Extra Slides Sample pluglet enablement - PowerPoint PPT Presentation

Transcript of IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

Page 1: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

1 © 2011 IBM Corporation

IDA 7.6 – New Features:

Pluglets (“Macros for Eclipse”)

Page 2: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

2 © 2011 IBM Corporation

Contents

New Pluglets Feature in IDA 7.6 Pluglets, some background

Install option

“Run Pluglets” menu

Installed Sample pluglets

Develop Custom pluglets

Trouble Shooting & Known Limitations

Extra Slides Sample pluglet enablement

Useful resources

Page 3: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

3 © 2011 IBM Corporation

Pluglets – Background

Need for scripting/macros:• Automate common tasks and task flows• Execute tasks in bulk (batch mode)• Customize existing product functions• Overcome product short-comings or missing links in particular

workflows• Adding very specialized functionality

Page 4: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

4 © 2011 IBM Corporation

Pluglets – Background (2)

“Macros for Eclipse”• A pluglet is a simple Java source file with plugletmain(…) method• pluglet.xml lists Eclipse/IDA plug-ins are required by the pluglets

this controls the pluglet classpath, both at compile and at runtime

• Compile and run in the same workspace (Java perspective)• Pluglet output in console view

Page 5: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

5 © 2011 IBM Corporation

pluglet.xml:– specifies which Eclipse plug-ins are visible to the pluglets in the pluglets project controls the pluglet classpath, both at compile and at runtime

Pluglets – Background (3)

Page 6: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

6 © 2011 IBM Corporation

IDA 7.6 Pluglet Install Option

Page 7: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

7 © 2011 IBM Corporation

Run Pluglet menu• Run pluglets from selection in Data Project

Explorer (DPE) or on a Data Diagram (IE notation only)

• Task groups contain installed sample pluglets

• Register Pluglets to run custom Pluglets on the objects selected in DPE or on Diagram

Note! Pluglets are enabled based

on the selected objects in DPE or on Diagram

Page 8: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

8 © 2011 IBM Corporation

Pluglet Task Groups

• Connectivity Tasks• Deployment Tasks • Diagram Tasks (IE notation diagrams only, not UML diagrams) • Model Navigation Tasks• Model Tasks• Reporting Tasks• Transformation Tasks

• Custom Tasks

Page 9: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

9 © 2011 IBM Corporation

Installed Sample Pluglets

• Diagram Tasks– Apply Domain Entity Color (enabled on: logical diagram)– Color Logical Only Attributes (enabled on: logical diagram)

• Model Navigation Tasks– Select Objects By Name (enabled on: DPE or diagram (IE notation))

• Model Tasks– Change Owning Schema For All Indexes/ ~ Tables / ~ Views (enabled: PDM or database - LUW/Z)– Change Table Space For All Tables (enabled on: PDM or database - LUW/Z)– Name Indexes (enabled on: PDM, database, schema)– Remove All Auxiliary Tables (enabled on: physical data model, database, schema – DB2 for Z)– Set Attributes of Selected Entities to Required (enabled on: entities)– Set Selected Tables Columns Not Null (enabled on: base tables – not Views, MQTs)– Set Default Values (enabled on: tables, columns)– Update Foreign Key Documentation from Primary Key (on entities, base tables – not Views, MQTs)

• Reporting Tasks– Calculate Table and Column Length (enabled on: PDM, database - LUW/Z)

Page 10: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

10 © 2011 IBM Corporation

Developing Custom Pluglets

Page 11: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

11 © 2011 IBM Corporation

Developing Custom Pluglets

Java perspective:– File > New > Pluglet New Pluglet wizard

– Select from existing pluglet templates:

Modeling Tasks > Data Pluglet

... basic code stubs with //TODO: tags will be created automatically

Page 12: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

12 © 2011 IBM Corporation

Developing Custom Pluglets (2)

Page 13: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

13 © 2011 IBM Corporation

Registering Custom Pluglets

Data Perspective:– Run Pluglet > Register Pluglets…

new pluglet is added to Task Group

Page 14: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

14 © 2011 IBM Corporation

Run simple pluglet (Java perspective)

Page 15: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

15 © 2011 IBM Corporation

Browse sample pluglets (Java pers.)

• Click Edit Pluglet to show Sample Pluglet source code

Page 16: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

16 © 2011 IBM Corporation

Browse sample pluglets (2)

Page 17: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

17 © 2011 IBM Corporation

IDA 7.6 Pluglet plugins and source

• com.ibm.datatools.pluglets.samples – Sample pluglets (+source code)• com.ibm.datatools.pluglets.tasks – Common tasks and dialogs (APIs)• com.ibm.datatools.pluglets.ui – UI integration (‘Run Pluglet’ menu)

Page 18: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

18 © 2011 IBM Corporation

Importing Sample Pluglet source plugins

Page 19: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

19 © 2011 IBM Corporation

Debugging Pluglets

See RSA v8 Documentation (link on last slide):– Add the debug arguments to the “eclipse.ini” file after the “-vmargs” workbench argument

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 – Modify your desktop shortcut, add the “-vmargs” workbench argument as above

– Start your Product (IDA)

– Run Pluglet Debugger from the Internal Tools menu

– The workbench that will come up actually drives the debug session start debugging by selecting the pluglet from the Internal Tools shortcuts

Page 20: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

20 © 2011 IBM Corporation

What can go wrong?

Page 21: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

21 © 2011 IBM Corporation

Trouble Shooting & Known Limitations

• No Sample Pluglets show – check install option, is selected object enabled for pluglets?

• Custom pluglets can't compile – pluglets.xml must contain the referenced plugins

• Registering pluglets doesn't work– no plugletmain() method– not implemented getName() method? …each pluglet needs unique name– no task group set? …implement getTaskGroups() method– Check Error Log for error messages (Window > Show View > Error Log)

Known defects & limitations:– Pluglets not available on UML diagrams (only on IE notation diagrams)– Compilation Error in CalculateTableColumnLenghtPluglet when importing sample pluglet plugin– Set Default Values pluglet:

– only enabled for physical models– throws NPE when columns in table have User Defined Type

– Select Objects By Name pluglet:– only selects immediate children of selected object in DPE– selected object in DPE need to be expanded in order to select any children– on diagram, when selected columns in multiple tables, right-click on selected column will lose selection

Page 22: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

22 © 2011 IBM Corporation

Known issues (cont’d)

• Problem: Compilation error in imported Sample Pluglets source plugin

• Work-around: import the missing plugin into the Java workspace

Page 23: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

23 © 2011 IBM Corporation

Pluglet Name, Enablement, Description (1)# Name of Pluglet source file

“Name of pluglet in menu”Valid on selected... Comments

1 ChangeIndexesOwnerGlobalPluglet "Change Owning Schema For All Indexes"

PDM, Database or Location (Z)

Sets all Indexes in the selected model to be contained by the specified Schema.  - this allows for new Schema to be created? This macro is only applicable to physical data modeling.

2 ChangeTablesOwnerGlobalPluglet "Change Owning Schema For All Tables" ChangeViewsOwnerGlobalPluglet "Change Owning Schema For All Views" ChangeSelectedObjectsOwnerPluglet "Change Owning Schema For Selected Objects"

PDM, Database or Location (Z)

Sets all Tables in the selected model to be contained by the specified Schema

3 ApplyGeneralizationSuperTypeStylePluglet "Apply Supertype Style"

Entities that are subtype of a Generalization (on Diagram)

Apply the color of a “Super-type entity" to its “Subtype entities”

4 ColorLogicalOnlyAttributesPluglet "Change Non-Persistent Attribute Color"

Entities that have at least one non-persistent attribute (on Diagram)

Apply specific color or default color to all non-persistent attributes - "logical-only" attributes refers to non-persistent attributes (which are not transformed to Physical model, hence no DDL generated)

8 IndexNamingPluglet "Name Indexes"

PDM, Database or Location (Z), Schema

Name Indexes according to user-supplied naming rules.

10 SetSelectedTablesColumnsNotNullPluglet "Set Selected Tables Columns Not Nullable" - - - - - - - - - - - - - - - - - - - - - - - - - SetSelectedEntitiesAttributesRequiredPluglet "Set Attributes of Selected Entities to Required"

BaseTables (not Views, MQTs) - - - - - Entities

Set all the Attributes within the selected Entity to a "Not Null" value.

For Logical models this means setting the Attributes to be "Required"

This macro is applicable to both logical and physical modeling.

Page 24: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

24 © 2011 IBM Corporation

Pluglet Name, Enablement, Description (2)

# Name of Pluglet source file“Name of pluglet in menu”

Valid on selected... Comments

11 PullForeignKeysDefinitionsPluglet "Update Foreign Key Documentation from Primary Key"

BaseTables (not Views, MQTs) Entities

updates the foreign key definitions for the selected child Entities by pulling the textual definition from the parent Entity. …Copy the documentation from the parent primary key to the foreign keys' documentation.

13 ChangeTablesTablespaceGlobalPluglet "Change Table Space For All Tables"

PDM (LUW, Z, Oracle), Database (LUW, Oracle) or Location (Z)

Set the Tablespace for all Tables in the selected physical model. …will not allow for a new Tablespace to be created, since there are too many variables required to specify a new Tablespace.

17 CalculateTableColumnLengthPluglet "Calculate Table and Column Length"

PDM, Database or Location (Z)

"Generates a spreadsheet listing the byte size of the rows"  * we cannot create Excel formats, but we can generate a text file in .csv format (comma-separated list) to be imported by Excel (maybe Excel-XML format)  * no re-import of .csv files * byte-size will be calculated based on the data types of the columns

18 SetDefaultValuesPluglet "Set Default Values"

Base Tables (no Views, MQTs), Columns

Sets "WITH DEFAULT" on all attributes within selected entities  * default value is specification is not available on all datatypes  * the only default value in logical models is: USER  * the resulting DDL (after entity is transformed to a table) would look like this:

22 RemoveAuxiliaryTablesGlobalPluglet PDM (Z), Location (Z)

Removes all auxiliary tables and associated table spaces from the appropriate physical data model (based on DPE element selection)

Page 25: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

25 © 2011 IBM Corporation

# Name of Pluglet source file“Name of pluglet in menu”

Valid on selected... Comments

23 SelectObjectsByNamePluglet DPE: Database, Schema, Table, Package, Entity; Diagram: empty surface, Table, Entity

Selects children of selected object by name

Pluglet Name, Enablement, Description (3)

Page 26: IDA 7.6 – New Features: Pluglets (“Macros for Eclipse”)

26 © 2011 IBM Corporation

Helpful Resources

• RSA v8 Pluglets Documentation:http://publib.boulder.ibm.com/infocenter/rsahelp/v8/index.jsp?topic=/com.ibm.xtools.pluglets.ui.doc/topics/c_whypluglets.html

• Developer Works article:http://www.ibm.com/developerworks/rational/library/06/1114_kelsey/index.html

• Video tutorial:“Create Pluglets”:http://publib.boulder.ibm.com/infocenter/rsahelp/v8/index.jsp?topic=/com.ibm.xtools.pluglet.creating.tutorial.doc/topics/exercise2_pluglets.html

• Developer works – Code examples:http://www.ibm.com/developerworks/wikis/display/RSA/Pluglets+Developer+Guide