Creating User Defined Extensions

30
Print Preview Creating User Defined Extensions in Oracle SQL Developer This tutorial contains the following sections: Purpose Time to Complete Overview Prerequisites Creating a Database Connection Sharing Reports Adding a Tab to Display Column Comments Reviewing the XML File Structure Adding a Tab to Describe Sub-partitions Adding a Context Menu Summary Viewing Screenshots Click icon to hide all screenshots Note: Alternatively, you can click an individual icon (or image) associated with each step to view (or hide) the screenshot associated with that step. Creating User Defined Extensions in Oracle SQL Developer Purpose This tutorial shows you how to add XML extensions to Oracle SQL Developer. Time to Complete Approximately 40 mins. Overview Oracle SQL Developer is a free graphical tool that enhances productivity and simplifies database development tasks. Using Oracle SQL Developer, you can browse database objects, run SQL statements, edit and debug PL/SQL statements and run reports, whether provided or created. Developed in Java, Oracle SQL Developer runs on Windows, Linux and the Mac OS X. This is a great advantage to the increasing number of developers using alternative platforms. Oracle SQL Developer is built on an extensible framework and, as such, is extensible itself. You can create basic XML extensions or more involved Java extensions to add utilities or other functionality to the product. Prerequisites Before starting this tutorial, you should: Install Oracle SQL Developer 3.0 from OTN. Follow the release notes here. Install the Oracle Database 11g. Unlock the HR user. Login to SQL Developer as the SYS user and execute the following command: alter user hr identified by hr account unlock; Download and unzip the sql_files.zip file that contains all the files you need to perform this tutorial. Creating a Database Connection To create a database connection, perform the following steps: Note: If you already have a database connection, you need not perform the following steps, you can move straight to Sharing Reports. 1 . If you installed the SQL Developer icon on your desktop, click the icon to start your SQL Developer and move 3. If you do not have the icon located on your desktop, perform the following steps to create a shortcut to laun Developer 3.0 directly from your desktop. Open the directory where the SQL Developer 3.0 is located, right-click sqldeveloper.exe (on Windows) or sqldeveloper.sh (on Linux) and select Send to > Desktop (create shortcut). 3 . In the Connections tab, right-click Connections and select New Connection. Note: If this tab is not visible, select View > Connections. 4 . Enter the following and click Test: Connection Name: HR_ORCL Username: hr Password: <your_password> Select Save Password Hostname: localhost Port: 1521 SID: <your_SID> Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev... 1 of 30 10/10/2011 17:49

description

Creating User Defined Extensions

Transcript of Creating User Defined Extensions

Page 1: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

Creating User Defined Extensions in Oracle SQL Developer

Purpose

This tutorial shows you how to add XML extensions to Oracle SQL Developer.

Time to Complete

Approximately 40 mins.

Overview

Oracle SQL Developer is a free graphical tool that enhances productivity and simplifies database developmenttasks. Using Oracle SQL Developer, you can browse database objects, run SQL statements, edit and debugPL/SQL statements and run reports, whether provided or created.

Developed in Java, Oracle SQL Developer runs on Windows, Linux and the Mac OS X. This is a greatadvantage to the increasing number of developers using alternative platforms. Oracle SQL Developer is built onan extensible framework and, as such, is extensible itself. You can create basic XML extensions or moreinvolved Java extensions to add utilities or other functionality to the product.

Prerequisites

Before starting this tutorial, you should:

Install Oracle SQL Developer 3.0 from OTN. Follow the release notes here.Install the Oracle Database 11g.Unlock the HR user. Login to SQL Developer as the SYS user and execute the following command:alter user hr identified by hr account unlock;Download and unzip the sql_files.zip file that contains all the files you need to perform this tutorial.

Creating a Database Connection

To create a database connection, perform the following steps:

Note: If you already have a database connection, you need not perform the following steps, you can movestraight to Sharing Reports.

1 . If you installed the SQL Developer icon on your desktop, click the icon to start your SQL Developer and move3. If you do not have the icon located on your desktop, perform the following steps to create a shortcut to launDeveloper 3.0 directly from your desktop.

Open the directory where the SQL Developer 3.0 is located, right-click sqldeveloper.exe (on Windows) orsqldeveloper.sh (on Linux) and select Send to > Desktop (create shortcut).

3 . In the Connections tab, right-click Connections and select New Connection.

Note: If this tab is not visible, select View > Connections.

4 . Enter the following and click Test:

Connection Name: HR_ORCLUsername: hrPassword: <your_password>Select Save PasswordHostname: localhostPort: 1521SID: <your_SID>

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

1 of 30 10/10/2011 17:49

Page 2: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

5 . Check for the status of the connection on the left-bottom side (above the Help button). It should read Successave the connection, click Connect.

6 . Once the connection is saved, you will see the database in the list. When a connection is created, a SQL Wois opened automatically. The SQL Worksheet allows you to execute SQL against the connection you just crea

Sharing Reports

You can share user-defined reports by adding them as an extension to Oracle SQL Developer. To do this,perform the following steps:

1 . Select the Reports tab.

Note: If this tab is not visible, select View > Reports.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

2 of 30 10/10/2011 17:49

Page 3: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

2 . Expand each of the nodes. There are a selection of shipped reports under the Data Dictionary Reports nod

3 . There are also shipped Data Modeler Reports. Any report you create is added under the User Defined Renode.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

3 of 30 10/10/2011 17:49

Page 4: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

4 . To add a Shared Reports extension, select Tools > Preferences.

5 . Expand the Database node and select User Defined Extensions.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

4 of 30 10/10/2011 17:49

Page 5: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

6 . Click Add Row.

7 . Click in the field under Type and select REPORT from the list.

8 . Click in the field under Location and click Browse.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

5 of 30 10/10/2011 17:49

Page 6: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

9 . Browse to the directory where you unzipped the files from the Prerequisites section and select theemployees_reports.xml file. Then click Save.

10 . Ensure that the location is selected and click OK.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

6 of 30 10/10/2011 17:49

Page 7: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

11 . Exit and restart Oracle SQL Developer for the changes to take effect.

12 . The Shared Reports node is added in the Reports tab (View > Reports).

Note: If you do not see the Shared Reports node, then the extension was not saved properly in the previous

13 . Expand the Shared Reports and EmployeeReports nodes and select Employees per Manager.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

7 of 30 10/10/2011 17:49

Page 8: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

14 . Select the HR_ORCL connection, if prompted, to run the report.

15 . Right-click on the Employees per Manager report. Note that the context menu does not permit you to edit threport. You can copy and recreate it as a User Defined report, but shared reports are not editable.

Adding a Tab to Display Column Comments

Each object in the Navigator has a matching set of definition tabs. These are based on queries against the DataDictionary. Not all features describing an object are displayed in these tabs. To create a Column Comments tabfor a table, perform the following steps:

1 . Select the Connections and expand the connection.

Note: If this tab is not visible, select View > Connections.

2 . Expand the Tables node and select EMPLOYEES.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

8 of 30 10/10/2011 17:49

Page 9: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

3 . The initial tab displayed is the Columns. Select the Constraints and view the details displayed.

4 . Click through the other tabs to view the details available for a table.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

9 of 30 10/10/2011 17:49

Page 10: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

5 . You can also display the column comments for a table in a tab. To do this you need to add an extension. SeleTools > Preferences.

6 . As before, expand the Database node and select User Defined Extensions. Click Add Row.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

10 of 30 10/10/2011 17:49

Page 11: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

7 . Click in the field under Type and select EDITOR from the list.

8 . Click in the field under Location and click Browse.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

11 of 30 10/10/2011 17:49

Page 12: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

9 . Browse to the directory where you unzipped the files from the Prerequisites section and select thecomment_tab.xml file.

10 . Ensure that the location is selected and click OK.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

12 of 30 10/10/2011 17:49

Page 13: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

11 . Exit and restart Oracle SQL Developer for the changes to take effect.

12 . Expand the HR_ORCL connection from the Connections tab. Expand the Tables node and select EMPLOY

13 . Click through the tab till you reach the last tab. A new Column Comments tab is added after the other tabs.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

13 of 30 10/10/2011 17:49

Page 14: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

Note: If you do not see the Column Comments tab, then the extension was not saved properly.

Reviewing the XML File Structure

In order to add an XML extension to Oracle SQL Developer, you need to create the XML file. In this section, youreview the structure of the XML file used to add the Column Comments tab extension (previous topic).

1 . In Oracle SQL Developer, select File > Open.

2 . Browse to the directory where you unzipped the files from the Prerequisites section. Select the comment_tafile and click Open.

3 . Double-click the tab to maximize the editor.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

14 of 30 10/10/2011 17:49

Page 15: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

4 . The Oracle SQL Developer framework recognizes the XML tags. The tags you are interested in are the titleSQL query tags. The title here is Column Comments and is used to name the tab.

5 . The SQL query is querying the Data Dictionary for the column comments for the OWNER and OBJECT_NAthis example, the EMPLOYEES Table for the HR schema.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

15 of 30 10/10/2011 17:49

Page 16: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

Adding a Tab to Describe Sub-partitions

You can add a tab to describe sub partitions within a table. In this example, you create a table with partitions andsub partitions and add an extension to review the details. To do this, perform the following steps:

1 . In Oracle SQL Developer, select File > Open.

2 . Browse to the directory where you unzipped the files from the Prerequisites section. Select the cust_part.sqclick Open.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

16 of 30 10/10/2011 17:49

Page 17: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

3 . Review the file. This script creates a partitioned table, CUSTOMERS_PART.

4 . Select the HR_ORCL connection from the drop-down list on the right of the SQL Worksheet.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

17 of 30 10/10/2011 17:49

Page 18: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

5 . Click the Run Script .

6 . To add the extension, select Tools > Preferences.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

18 of 30 10/10/2011 17:49

Page 19: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

7 . Expand the Database node and select User Defined Extensions. Click Add Row.

8 . Click in the field under Type and select EDITOR from the list.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

19 of 30 10/10/2011 17:49

Page 20: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

9 . Click in the field under Location and click Browse.

10 . Browse to the directory where you unzipped the files from the Prerequisites section and select thesubpartition_tab.xml file.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

20 of 30 10/10/2011 17:49

Page 21: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

11 . Ensure that the location is selected and click OK.

12 . Exit and restart Oracle SQL Developer for the changes to take effect.

13 . Expand the HR_ORCL connection in the Connections tab. Expand the Tables node and select theCUSTOMERS_PART table.

Adding a Context Menu

In the above examples, you added tabs to the table definition using XML files. You can add context menus usinga similar approach. Context menus can be added at any level to the existing context menu structure. In thisexample, you add a high-level context menu to set a transaction to READ ONLY.

To add a new context menu, perform the following steps:

1 . In Oracle SQL Developer, select File > Open.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

21 of 30 10/10/2011 17:49

Page 22: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

2 . Browse to the directory where you unzipped the files from the Prerequisites section. Select the readonly_mefile and click Open.

3 . Double-click tab to maximize the editor.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

22 of 30 10/10/2011 17:49

Page 23: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

4 . This XML file is more involved. Notice that in this case there are two sections; one for Set Read Only and thefor Set Read/Write. The image below highlights one of the sections between the <item> tags.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

23 of 30 10/10/2011 17:49

Page 24: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

5 . Notice the <prompt> and <confirmation> tags.

6 . To add the extension, select Tools > Preferences.

7 . Expand the Database node and select User Defined Extensions. Click Add Row.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

24 of 30 10/10/2011 17:49

Page 25: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

8 . Click in the field under Type and select ACTION from the list.

9 . Click in the field under Location and click Browse.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

25 of 30 10/10/2011 17:49

Page 26: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

10 . Browse to the directory where you unzipped the files from the Prerequisites section and select thereadonly_menu.xml file.

11 . Ensure that the location is selected and click OK.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

26 of 30 10/10/2011 17:49

Page 27: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

12 . Exit and restart Oracle SQL Developer for the changes to take effect.

13 . Select the HR_ORCL connection and right-click to invoke the context menu. Scroll to the bottom and select SRead Only.

14 . The title Set Read Only is displayed in the dialog header. Notice the Prompt. The text is from the following pthe xml file.

<prompt type="confirm"><label>Confirm Setting Connection to Read Only.</label></prompt>

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

27 of 30 10/10/2011 17:49

Page 28: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

15 . Select the SQL tab. Find the equivalent SQL code in the XML file. Click Apply.

16 . The final Confirmation dialog is also driven by the XML file. Click OK.

17 . Expand the HR_ORCL connection and expand the Tables node. Select EMPLOYEES. Select the Data tab.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

28 of 30 10/10/2011 17:49

Page 29: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

18 . Modify the FIRST_NAME for one of the records.

19 . Select Commit changes to commit the changes.

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

29 of 30 10/10/2011 17:49

Page 30: Creating User Defined Extensions

Print Preview

Creating User DefinedExtensions in Oracle SQLDeveloper

This tutorial contains the following sections:

Purpose

Time to Complete

Overview

Prerequisites

Creating a Database Connection

Sharing Reports

Adding a Tab to Display Column Comments

Reviewing the XML File Structure

Adding a Tab to Describe Sub-partitions

Adding a Context Menu

Summary

Viewing Screenshots

Click icon to hide all screenshots

Note: Alternatively, you can click an individual icon(or image) associated with each step to view (orhide) the screenshot associated with that step.

20 . You are not able to commit the records due to the READ ONLY transaction.

Summary

In this tutorial, you have learned how to:

Create a Database ConnectionShare ReportsAdd a Tab to Display Column CommentsReview the XML File StructureAdd a Tab to Describe Sub-partitionsAdd a Context Menu

About Oracle |Oracle and Sun | | Careers | Contact Us | Site

Maps | Legal Notices | Terms of Use | Your Privacy Rights

Creating User Defined Extensions http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/sqldev...

30 of 30 10/10/2011 17:49