Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sqldeveloper/extension/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/*.md.html
/built/
7 changes: 7 additions & 0 deletions sqldeveloper/extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ You can add new folders and nodes to navigators, new actions on objects (*or set

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.

### New

* [XML Based Favorites Example](xml/favorites)


* [Example Update Center](https://github.com/bjeffrie/sqldev-update-center) (external) with pre-built cfu bundles for these examples.

### Contents

* [Set Up / Tutorial](./setup.md) - A step by step guide to building your first extension and check for updates bundle.
Expand Down
4 changes: 2 additions & 2 deletions sqldeveloper/extension/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ sqldev.dir=D:/sqldeveloper-18.1.0/sqldeveloper
# Information about the company or person creating the extension
extension.owner=Oracle Examples
extension.owner.desc=Example extensions for SQL Developer
extension.owner.url=https://github.com/oracle/oracle-db-examples/sqldeveloper
extension.owner.url=https://github.com/oracle/oracle-db-examples/tree/master/sqldeveloper/extension

#
# Base location of the CFU site.
# This is where the produced updates.xml will say the cfu bundle files are.
update.url=http://localhost
update.url=https://gitcdn.xyz/repo/bjeffrie/sqldev-update-center/master

9 changes: 7 additions & 2 deletions sqldeveloper/extension/xml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@ This allows combining a number of xml definitions together as well as the abilit

* [individual](individual)
Examples for ACTION, EDITOR, NAVIGATOR



* [packaged](packaged)
XML Examples packaged as an extension.jar



* [Simple Favorites](favorites)
XML-Based favorites folders (packaged as an extension.jar)


* [schema](schema)
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).
53 changes: 53 additions & 0 deletions sqldeveloper/extension/xml/favorites/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# [SQL Developer](http://www.oracle.com/technetwork/developer-tools/sql-developer/) Examples
## Simple Favorites
XML-Based favorites folders (packaged as an extension.jar)

This extension ands the ability to manage and use a simple favorites table in the connection schema (or available via public synonym from another).

### First, The Ugly

* 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.


* 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.


* 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.


* 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.

### Now The Good

* It's pretty darn useful even with the limitations!

* 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.
![Create Favorites Table image](images/CreateFavoritesTable.png) ![Favorites Table Created image](images/FavoritesTableCreated.png)


* The context menu on Favorites allows you to add folders or drop the favorites table.
![Add Favorites Folder image](images/AddFavoritesFolder.png) ![After Add Favorites Folder image](images/AfterAddFavoritesFolder.png)


* 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.
![Add To Favorites image](images/AddToFavorites.png) ![Add To Favorites Succeeded image](images/AddToFavoritesSucceeded.png) ![After Add To Favorites image](images/AfterAddToFavorites.png)


* 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.
![After Add To Favorites image 2](images/AfterAddToFavorites2.png)

### And Lastly
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.


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.


#### The changes I see needing are:
* Separate navigator / connection / repository for working sets. (I.e., similar to migrations or unit testing so the current connection is not impacted.)
* Much more efficient declaration and handling of favorites folder contents and actions.
* Being able to manipulate favorites references from the tree (delete specifically but maybe also drag / drop operations)
* Updating the favorites hierarchy when adding new references.
* Favorites folder nesting? Unlimited or?


4 changes: 4 additions & 0 deletions sqldeveloper/extension/xml/favorites/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extension.id=oracle.db.examples.sqldeveloper.extension.favorites
extension.name=Oracle SQL Developer - Simple Favorites Support
extension.descr=Extension to add simple favorites. See https://github.com/bjeffrie/oracle-db-examples/tree/master/sqldeveloper/extension/xml/favorites for usage information and caveats.
extension.version=18.3.0
26 changes: 26 additions & 0 deletions sqldeveloper/extension/xml/favorites/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="windows-1252" ?>
<project name="favorites" default="_deploy">
<!-- Override -->
<property name="extension.owner" value="Brian Jeffries" />
<property name="extension.owner.url" value = "https://github.com/bjeffrie/oracle-db-examples/tree/master/sqldeveloper/extension/xml/favorites" />

<!-- imports -->
<import file="../../buildtools/ant/build.xml" />

<!-- bundle dependencies -->
<property name="osgi.required.bundles"
value="${osgi.bundle.default.dependencies},${osgi.bundle.sqldev},${osgi.bundle.utils-nodeps},${osgi.bundle.utils}" />

<!-- classpath declarations -->
<path id="local.classpath">
<path refid="oracle.sqldeveloper.utils-nodeps"/>
<path refid="oracle.sqldeveloper.utils"/>
<path refid="oracle.sqldeveloper" />
</path>

<!-- local targets -->

<!-- target overrides -->
<!-- Build structure from ../../buildtools/ant/build.xml < targets.xml -->

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Generated File. Do Not Modify
/*
Copyright (c) 2008,2017, Oracle and/or its affiliates. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package oracle.db.examples.sqldeveloper.extension.favorites;

import java.awt.Image;
import javax.swing.Icon;

import oracle.dbtools.raptor.utils.MessagesBase;

public class FavoritesResources extends MessagesBase {
// Generated Resource Keys
public static final String favorites_folder_label = "favorites_folder_label"; //$NON-NLS-1$

private static final String BUNDLE_NAME = "oracle.db.examples.sqldeveloper.extension.favorites.FavoritesResources"; //$NON-NLS-1$

private static final FavoritesResources INSTANCE = new FavoritesResources();

private FavoritesResources() {
super(BUNDLE_NAME, FavoritesResources.class.getClassLoader());
}

// public static ResourceBundle getBundle() {
// return INSTANCE.getResourceBundle();
// }

// /**
// * @deprecated use getBundle()
// */
// public static ResourceBundle getInstance() {
// return getBundle();
// }

public static String getString( String key ) {
return INSTANCE.getStringImpl(key);
}

public static String get( String key ) {
return getString(key);
}

public static Image getImage( String key ) {
return INSTANCE.getImageImpl(key);
}

public static String format(String key, Object ... arguments) {
return INSTANCE.formatImpl(key, arguments);
}

public static Icon getIcon(String key) {
return INSTANCE.getIconImpl(key);
}

public static Integer getInteger(String key) {
return INSTANCE.getIntegerImpl(key);
}

}
39 changes: 39 additions & 0 deletions sqldeveloper/extension/xml/favorites/etc/extension.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<extension xmlns="http://jcp.org/jsr/198/extension-manifest"
id="@@extension.id@@" version="@@extension.version@@.@@extension.build@@"
esdk-version="1.0"
rsbundle-class="oracle.db.examples.sqldeveloper.extension.favorites.FavoritesResources">

<name>@@extension.name@@</name>
<owner>Oracle Corporation</owner>

<feature id="@@extension.id@@" xmlns="http://xmlns.oracle.com/ide/extension">
<category-id>db-category</category-id>
<name>@@extension.name@@</name>
<description>@@extension.descr@@</description>
<type>
<service can-user-disable="true" reload-if-used="true"/>
</type>
</feature>
<!-- These are automatically loaded and will cause the extension to be fully loaded if used -->
<trigger-hooks xmlns="http://xmlns.oracle.com/ide/extension">
<triggers xmlns:c="http://xmlns.oracle.com/ide/customization">
<sqldev-action-hook xmlns="http://xmlns.oracle.com/sqldeveloper/sqldev-actions">
<actionDescriptor package="oracle.db.examples.sqldeveloper.extension.favorites.action.xml"/>
</sqldev-action-hook>
<sqldev-navigator-hook xmlns="http://xmlns.oracle.com/sqldeveloper/sqldev-navigator">
<descriptor>/oracle/db/examples/sqldeveloper/extension/favorites/navigator/xml/favorites_nav.xml</descriptor>
</sqldev-navigator-hook>
</triggers>
</trigger-hooks>
<!-- These are only loaded once the extension is "triggered" -->
<hooks>
<jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
<addins>
</addins>
</jdeveloper-hook>
<sqldev-viewer-hook xmlns="http://xmlns.oracle.com/sqldeveloper/sqldev-viewers">
<viewerDescriptor package="oracle.db.examples.sqldeveloper.extension.favorites.viewer.xml"/>
</sqldev-viewer-hook>
</hooks>

</extension>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions sqldeveloper/extension/xml/favorites/resfiles.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
oracle.db.examples.sqldeveloper.extension.favorites.FavoritesResources
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
favorites_folder_label=Favorites
Loading