Skip to content

Commit 4cad7bd

Browse files
authored
Merge pull request oracle-samples#1 from oracle/master
Update from oracle base
2 parents bc63c21 + 877bec5 commit 4cad7bd

File tree

5 files changed

+177
-2
lines changed

5 files changed

+177
-2
lines changed
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<displays>
3+
<!--
4+
Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
<!--
16+
The basic idea for master-detail or independent displays is:
17+
1) display entities can be nested to create parent-child or top-bottom multiple display
18+
2) initial load and subsequent parent/top row selections cause the child/bottom display to refresh
19+
3) parent/top query columns are available as bind variables to the child/bottom query
20+
4) displays at the same nesting level appear in tabs
21+
-->
22+
<!-- Note: OBJECT_OWNER, OBJECT_TYPE, OBJECT_NAME are standard binds for any db node -->
23+
<!-- Note: class="[connType]#[objectType]" can be used as shorthand when targeting a specific instance type. E.g., class="Oracle#TABLE" -->
24+
<!-- CONSTRAINTS -->
25+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE">
26+
<name><![CDATA[Master-Detail]]></name>
27+
<description><![CDATA[]]>
28+
</description>
29+
<tooltip><![CDATA[]]>
30+
</tooltip>
31+
<drillclass><![CDATA[null]]></drillclass>
32+
<query>
33+
<sql>
34+
<![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]]>
35+
</sql>
36+
</query>
37+
<display type="" style="" enable="true">
38+
<name><![CDATA[Columns]]></name>
39+
<description><![CDATA[]]>
40+
</description>
41+
<tooltip><![CDATA[]]>
42+
</tooltip>
43+
<drillclass><![CDATA[null]]></drillclass>
44+
<query>
45+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
46+
CONSTRAINT_NAME is bound from the parent query selected row
47+
This means the initial load will have null CONSTRAINT_NAME
48+
and thus no rows shown. When a parent row is selected, the
49+
CONSTRAINT_NAME bind will be populated & the child query
50+
rerun -->
51+
<sql>
52+
<![CDATA[SELECT cols.column_name column_name, cols.position column_position
53+
FROM all_constraints cons, all_cons_columns cols
54+
WHERE cons.constraint_name = cols.constraint_name
55+
AND cons.owner = cols.owner
56+
and cols.table_name = :OBJECT_NAME
57+
and cons.owner = :OBJECT_OWNER
58+
and cols.constraint_name = :CONSTRAINT_NAME
59+
ORDER BY cols.position]]>
60+
</sql>
61+
</query>
62+
</display>
63+
</display>
64+
<!-- DEPENDENCIES -->
65+
<!-- Note: objectType can be a comma separated list of types -->
66+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE,VIEW">
67+
<name><![CDATA[Independent]]></name>
68+
<description><![CDATA[]]>
69+
</description>
70+
<tooltip><![CDATA[]]>
71+
</tooltip>
72+
<drillclass><![CDATA[null]]></drillclass>
73+
<query>
74+
<sql>
75+
<![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]]>
76+
</sql>
77+
</query>
78+
<display type="" style="" enable="true">
79+
<name><![CDATA[Independent2]]></name>
80+
<description><![CDATA[]]>
81+
</description>
82+
<tooltip><![CDATA[]]>
83+
</tooltip>
84+
<drillclass><![CDATA[null]]></drillclass>
85+
<query>
86+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
87+
There are no bound columns from the parent query selected row
88+
This means the initial load and any parent selection will show
89+
the same result. -->
90+
<sql>
91+
<![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]]>
92+
</sql>
93+
</query>
94+
</display>
95+
</display>
96+
<!-- DEPENDENCIES - modified -->
97+
<!-- Note: objectType can be a comma separated list of types -->
98+
<display type="editor" style="null" enable="true" connType="Oracle" objectType="TABLE,VIEW">
99+
<name><![CDATA[Sibling-Tabbed]]></name>
100+
<description><![CDATA[]]>
101+
</description>
102+
<tooltip><![CDATA[]]>
103+
</tooltip>
104+
<drillclass><![CDATA[null]]></drillclass>
105+
<query>
106+
<sql>
107+
<![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]]>
108+
</sql>
109+
</query>
110+
<display type="" style="" enable="true">
111+
<name><![CDATA[Independent2]]></name>
112+
<description><![CDATA[]]>
113+
</description>
114+
<tooltip><![CDATA[]]>
115+
</tooltip>
116+
<drillclass><![CDATA[null]]></drillclass>
117+
<query>
118+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
119+
There are no bound columns from the parent query selected row
120+
This means the initial load and any parent selection will show
121+
the same result. -->
122+
<sql>
123+
<![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]]>
124+
</sql>
125+
</query>
126+
</display>
127+
<display type="" style="" enable="true">
128+
<name><![CDATA[Independent3]]></name>
129+
<description><![CDATA[]]>
130+
</description>
131+
<tooltip><![CDATA[]]>
132+
</tooltip>
133+
<drillclass><![CDATA[null]]></drillclass>
134+
<query>
135+
<!-- Note: OBJECT_OWNER, OBJECT_NAME are standard binds for any db node
136+
There are no bound columns from the parent query selected row
137+
This means the initial load and any parent selection will show
138+
the same result. -->
139+
<sql>
140+
<![CDATA[select 'Independent3' dummy from dual]]>
141+
</sql>
142+
</query>
143+
<display type="" style="" enable="true">
144+
<name><![CDATA[Independent3.1]]></name>
145+
<description><![CDATA[]]>
146+
</description>
147+
<tooltip><![CDATA[]]>
148+
</tooltip>
149+
<drillclass><![CDATA[null]]></drillclass>
150+
<query>
151+
<sql>
152+
<![CDATA[select 'Independent3.1' dummy from dual]]>
153+
</sql>
154+
</query>
155+
</display>
156+
</display>
157+
</display>
158+
</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)