Skip to content

Commit 1a2d0fa

Browse files
committed
Ready for Preview!
Added doc for favorites example Changed cfu / update center URLs to gitcdn
1 parent 097b801 commit 1a2d0fa

14 files changed

+72
-9
lines changed

sqldeveloper/extension/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ You can add new folders and nodes to navigators, new actions on objects (*or set
44

55
Depending on requirements, this can be done in either XML or java and deployed by simply copying an XML file to the appropriate directory, or creating an extension jar -- or *check for updates* bundle for XML and/or java.
66

7+
### New
8+
9+
* [XML Based Favorites Example](xml/favorites)
10+
11+
12+
* [Example Update Center](https://github.com/bjeffrie/sqldev-update-center) (external) with pre-built cfu bundles for these examples.
13+
714
### Contents
815

916
* [Set Up / Tutorial](./setup.md) - A step by step guide to building your first extension and check for updates bundle.

sqldeveloper/extension/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ extension.owner.url=https://github.com/oracle/oracle-db-examples/tree/master/sql
1616
#
1717
# Base location of the CFU site.
1818
# This is where the produced updates.xml will say the cfu bundle files are.
19-
update.url=https://cdn.rawgit.com/bjeffrie/sqldev-update-center/master
19+
update.url=https://gitcdn.xyz/repo/bjeffrie/sqldev-update-center/master
2020

sqldeveloper/extension/xml/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ This allows combining a number of xml definitions together as well as the abilit
1717

1818
* [individual](individual)
1919
Examples for ACTION, EDITOR, NAVIGATOR
20-
20+
21+
2122
* [packaged](packaged)
2223
XML Examples packaged as an extension.jar
2324

24-
25+
26+
* [Simple Favorites](favorites)
27+
XML-Based favorites folders (packaged as an extension.jar)
28+
29+
2530
* [schema](schema)
2631
XML schema for the three extension types. Note that the dialogs(ACTION) schema is heavily annotated and has been run through [xsddoc](http://xframe.sourceforge.net/xsddoc/index.html) to produce javadoc-like documentation [here](http://xmlns.oracle.com/sqldeveloper/3_1/dialogs).
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) Examples
2+
## Simple Favorites
3+
XML-Based favorites folders (packaged as an extension.jar)
4+
5+
This extension ands the ability to manage and use a simple favorites table in the connection schema (or available via public synonym from another).
6+
7+
### First, The Ugly
8+
9+
* Because of the simplistic design, creating the table and adding favorites will require issuing a commit on the current connection. All actions state this explicitly and indicate if there are transactions pending.
10+
11+
12+
* In order for the objects in a favorites folder to behave as the real thing, a separate query must be used for each object type. This example includes all 50+ of the types shown in an Oracle connection navigator. I encourage you to remove the types you do not care about from favorites_nav.xml & favorites_actions.xml if the performance is an issue.
13+
14+
15+
* Since the objects in a favorites folder act as the real object, you can delete a favorites folder via context menu from the tree but will need to use SQL or the data viewer on the raw SQX$FAVORITES table to remove favorites from a folder.
16+
17+
18+
* Since the focus is on the object you are adding to favorites, the favorites tree will not update automatically. You will need to manually update the favorites / folder node to see the newly added object references.
19+
20+
### Now The Good
21+
22+
* It's pretty darn useful even with the limitations!
23+
24+
* After installing the extension or using one of the [manual methods](../../xml) to register the raw XML files, use the context menu on an open connection to create the favorites table.
25+
![Create Favorites Table image](images/CreateFavoritesTable.png) ![Favorites Table Created image](images/FavoritesTableCreated.png)
26+
27+
28+
* The context menu on Favorites allows you to add folders or drop the favorites table.
29+
![Add Favorites Folder image](images/AddFavoritesFolder.png) ![After Add Favorites Folder image](images/AfterAddFavoritesFolder.png)
30+
31+
32+
* The context menu on any object declared in favorites_actions.xml will have an add to favorites option. Choosing a favorites folder to put it in is required.
33+
![Add To Favorites image](images/AddToFavorites.png) ![Add To Favorites Succeeded image](images/AddToFavoritesSucceeded.png) ![After Add To Favorites image](images/AfterAddToFavorites.png)
34+
35+
36+
* Note that since favorites is declared for connType="Oracle", it will "follow you" as you navigate to / add to favorites from the Other Users tree nodes.
37+
![After Add To Favorites image 2](images/AfterAddToFavorites2.png)
38+
39+
### And Lastly
40+
Given the interest this has generated, I am looking at doing a java working sets style version to overcome the ugly aspects of this one. Perhaps as a hands on lab or OBE kind of series.
41+
42+
43+
I welcome feedback on this example and ideas for desirable features of a potential working sets version at [my fork](https://github.com/bjeffrie/oracle-db-examples) of the examples repository.
44+
45+
46+
#### The changes I see needing are:
47+
* Separate navigator / connection / repository for working sets. (I.e., similar to migrations or unit testing so the current connection is not impacted.)
48+
* Much more efficient declaration and handling of favorites folder contents and actions.
49+
* Being able to manipulate favorites references from the tree (delete specifically but maybe also drag / drop operations)
50+
* Updating the favorites hierarchy when adding new references.
51+
* Favorites folder nesting? Unlimited or?
52+
53+
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
favorites_folder_label=Favorites (sketchy - for Peter Nosko)
1+
favorites_folder_label=Favorites

sqldeveloper/extension/xml/favorites/src/oracle/db/examples/sqldeveloper/extension/favorites/action/xml/favorites_actions.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ limitations under the License.
4242
"OBJECT_NAME" VARCHAR2(128),
4343
CONSTRAINT OBJ_NEEDS_FAV_FOLDER CHECK ((FAV_FOLDER IS NULL AND OBJECT_TYPE='FAV_FOLDER') OR (FAV_FOLDER IS NOT NULL AND FAV_FOLDER!=''))
4444
) ;
45-
-- INSERT INTO SDX$FAVORITES (FAV_FOLDER, OBJECT_OWNER, OBJECT_TYPE, OBJECT_NAME)
46-
-- VALUES ('', '#OBJECT_OWNER#', 'FAV_FOLDER', 'Default')
47-
-- ;
45+
INSERT INTO SDX$FAVORITES (FAV_FOLDER, OBJECT_OWNER, OBJECT_TYPE, OBJECT_NAME)
46+
VALUES ('', '#OBJECT_OWNER#', 'FAV_FOLDER', 'Default')
47+
;
4848
COMMIT
4949
;
5050
]]>
@@ -99,8 +99,6 @@ COMMIT
9999
<sql type="SCRIPT"><![CDATA[
100100
INSERT INTO SDX$FAVORITES (OBJECT_OWNER, OBJECT_TYPE, OBJECT_NAME)
101101
VALUES (sys_context('USERENV','AUTHENTICATED_IDENTITY'), 'FAV_FOLDER', '#0#')
102-
WHERE NOT EXISTS (SELECT OBJECT_NAME FROM SDX$FAVORITES WHERE OBJECT_NAME='#0#'
103-
AND OBJECT_TYPE='FAV_FOLDER')
104102
;
105103
COMMIT
106104
;

0 commit comments

Comments
 (0)