Skip to content

Commit 118dc96

Browse files
authored
Add files via upload
1 parent bc63c21 commit 118dc96

File tree

2 files changed

+165
-2
lines changed

2 files changed

+165
-2
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<displays>
3+
<!--
4+
The basic idea for master-detail or independent displays is:
5+
1) display entities can be nested to create parent-child or top-bottom multiple display
6+
2) initial load and subsequent parent/top row selections cause the child/bottom display to refresh
7+
3) parent/top query columns are available as bind variables to the child/bottom query
8+
4) displays at the same nesting level appear in tabs
9+
-->
10+
<!-- Note: OBJECT_OWNER, OBJECT_TYPE, OBJECT_NAME are standard binds for any db node -->
11+
<!-- Note: class="[connType]#[objectType]" can be used as shorthand when targeting a specific instance type. E.g., class="Oracle#TABLE" -->
12+
<!-- CONSTRAINTS -->
13+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE">
14+
<name><![CDATA[Master-Detail]]></name>
15+
<description><![CDATA[]]>
16+
</description>
17+
<tooltip><![CDATA[]]>
18+
</tooltip>
19+
<drillclass><![CDATA[null]]></drillclass>
20+
<query>
21+
<sql>
22+
<![CDATA[select c.constraint_name,decode(c.constraint_type,'P','Primary_Key','U','Unique','R','Foreign_Key','C','Check',c.constraint_type) constraint_type,c.search_condition,c.r_owner,(select r.table_name from all_constraints r where c.r_owner = r.owner and c.r_constraint_name = r.constraint_name) r_table_name,c.r_constraint_name,c.delete_rule,c.status,c.deferrable,c.validated,c.generated,c.bad,c.rely,c.last_change,c.index_owner,c.index_name,c.invalid,c.view_related from all_constraints c where c.owner = :OBJECT_OWNER and c.table_name = :OBJECT_NAME order by c.constraint_name]]>
23+
</sql>
24+
</query>
25+
<display type="" style="" enable="true">
26+
<name><![CDATA[Columns]]></name>
27+
<description><![CDATA[]]>
28+
</description>
29+
<tooltip><![CDATA[]]>
30+
</tooltip>
31+
<drillclass><![CDATA[null]]></drillclass>
32+
<query>
33+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
34+
CONSTRAINT_NAME is bound from the parent query selected row
35+
This means the initial load will have null CONSTRAINT_NAME
36+
and thus no rows shown. When a parent row is selected, the
37+
CONSTRAINT_NAME bind will be populated & the child query
38+
rerun -->
39+
<sql>
40+
<![CDATA[SELECT cols.column_name column_name, cols.position column_position
41+
FROM all_constraints cons, all_cons_columns cols
42+
WHERE cons.constraint_name = cols.constraint_name
43+
AND cons.owner = cols.owner
44+
and cols.table_name = :OBJECT_NAME
45+
and cons.owner = :OBJECT_OWNER
46+
and cols.constraint_name = :CONSTRAINT_NAME
47+
ORDER BY cols.position]]>
48+
</sql>
49+
</query>
50+
</display>
51+
</display>
52+
<!-- DEPENDENCIES -->
53+
<!-- Note: objectType can be a comma separated list of types -->
54+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE,VIEW">
55+
<name><![CDATA[Independent]]></name>
56+
<description><![CDATA[]]>
57+
</description>
58+
<tooltip><![CDATA[]]>
59+
</tooltip>
60+
<drillclass><![CDATA[null]]></drillclass>
61+
<query>
62+
<sql>
63+
<![CDATA[select owner, name, type, referenced_owner, referenced_name, referenced_type ,owner sdev_link_owner, name sdev_link_name, type sdev_link_type from ALL_DEPENDENCIES where referenced_owner = :OBJECT_OWNER and referenced_name = :OBJECT_NAME]]>
64+
</sql>
65+
</query>
66+
<display type="" style="" enable="true">
67+
<name><![CDATA[Independent2]]></name>
68+
<description><![CDATA[]]>
69+
</description>
70+
<tooltip><![CDATA[]]>
71+
</tooltip>
72+
<drillclass><![CDATA[null]]></drillclass>
73+
<query>
74+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
75+
There are no bound columns from the parent query selected row
76+
This means the initial load and any parent selection will show
77+
the same result. -->
78+
<sql>
79+
<![CDATA[select owner, name, type, referenced_owner, referenced_name, referenced_type ,referenced_owner sdev_link_owner, referenced_name sdev_link_name, referenced_type sdev_link_type from ALL_DEPENDENCIES where owner = :OBJECT_OWNER and name = :OBJECT_NAME]]>
80+
</sql>
81+
</query>
82+
</display>
83+
</display>
84+
<!-- DEPENDENCIES - modified -->
85+
<!-- Note: objectType can be a comma separated list of types -->
86+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE,VIEW">
87+
<name><![CDATA[Sibling-Tabbed]]></name>
88+
<description><![CDATA[]]>
89+
</description>
90+
<tooltip><![CDATA[]]>
91+
</tooltip>
92+
<drillclass><![CDATA[null]]></drillclass>
93+
<query>
94+
<sql>
95+
<![CDATA[select owner, name, type, referenced_owner, referenced_name, referenced_type ,owner sdev_link_owner, name sdev_link_name, type sdev_link_type from ALL_DEPENDENCIES where referenced_owner = :OBJECT_OWNER and referenced_name = :OBJECT_NAME]]>
96+
</sql>
97+
</query>
98+
<display type="" style="" enable="true">
99+
<name><![CDATA[Independent2]]></name>
100+
<description><![CDATA[]]>
101+
</description>
102+
<tooltip><![CDATA[]]>
103+
</tooltip>
104+
<drillclass><![CDATA[null]]></drillclass>
105+
<query>
106+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
107+
There are no bound columns from the parent query selected row
108+
This means the initial load and any parent selection will show
109+
the same result. -->
110+
<sql>
111+
<![CDATA[select owner, name, type, referenced_owner, referenced_name, referenced_type ,referenced_owner sdev_link_owner, referenced_name sdev_link_name, referenced_type sdev_link_type from ALL_DEPENDENCIES where owner = :OBJECT_OWNER and name = :OBJECT_NAME]]>
112+
</sql>
113+
</query>
114+
</display>
115+
<display type="" style="" enable="true">
116+
<name><![CDATA[Independent3]]></name>
117+
<description><![CDATA[]]>
118+
</description>
119+
<tooltip><![CDATA[]]>
120+
</tooltip>
121+
<drillclass><![CDATA[null]]></drillclass>
122+
<query>
123+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
124+
There are no bound columns from the parent query selected row
125+
This means the initial load and any parent selection will show
126+
the same result. -->
127+
<sql>
128+
<![CDATA[select 'Independent3' dummy from dual]]>
129+
</sql>
130+
</query>
131+
<display type="" style="" enable="true">
132+
<name><![CDATA[Independent3.1]]></name>
133+
<description><![CDATA[]]>
134+
</description>
135+
<tooltip><![CDATA[]]>
136+
</tooltip>
137+
<drillclass><![CDATA[null]]></drillclass>
138+
<query>
139+
<sql>
140+
<![CDATA[select 'Independent3.1' dummy from dual]]>
141+
</sql>
142+
</query>
143+
</display>
144+
</display>
145+
</display>
146+
</displays>

sqldeveloper/extension/xml/individual/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,26 @@
22
## XML Individual
33

44
To see these in action in your own copy of SQL Developer, go to Tools > Preferences > Database > User Defined Extensions and add them to the list as shown. ![UserDefinedExtensions image](images/UserDefinedExtensions.png)
5+
6+
57
* **SimpleObjectActionExample** *ACTION* - Basic example showing TABLE rename action.
68
![SimpleObjectActionExample image](images/SimpleObjectActionExample.png) ![SimpleObjectActionExampleDialog image](images/SimpleObjectActionExampleDialog.png)
7-
* **MultiSelectObjectExample** *ACTION* - Example showing how to create actions that work on a set objects. There are two examples of each. One that provides a script for you to copy to the worksheet to run, and another that actually executes it.
9+
10+
11+
* **MultiSelectObjectExample** *ACTION* - Example showing how to create actions that work on a set of objects. There are two examples of each. One that provides a script for you to copy to the worksheet to run, and another that actually executes it.
812
![MultiSelectObjectExample image](images/MultiSelectObjectExample.png) ![MultiSelectObjectExampleAuto image](images/MultiSelectObjectExampleAuto.png)
9-
* **fourLevel** *ACTION,EDITOR,NAVIGATOR* - Consolidated example showing how all three types are wired together.
13+
14+
15+
* **fourLevel** *ACTION,EDITOR,NAVIGATOR* - Consolidated example showing how all three types are wired together.
1016
![fourLevel image](images/fourLevel.png)
17+
18+
19+
* **NestedDisplaysExample** *EDITOR* - Example showing how to create parent-child (master-detail), independent (top-bottom), and sibling-tabbed displays.
20+
* *Master-Detail* - A simplified version of the Constraints display for TABLE.
21+
![Master-DetailDisplay image](images/Master-Detail.png)
22+
* *Independent* - A simplified version of the Dependencies display for TABLE,VIEW.
23+
![IndependentDisplay image](images/Independent.png)
24+
* *Sibling-Tabbed* - A simplified version of the Dependencies display for TABLE,VIEW with modifications to show how displays at the same nesting level appear in tabs.
25+
![Sibling-TabbedDisplay image](images/Sibling-Tabbed.png)
26+
27+

0 commit comments

Comments
 (0)