This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Using NB5.5 and Visual Web Pack: drag a DB view from the runtime window onto the form. No meaningful transfer object is created, so the designer cannot use the connection information. Doing the same thing with a DB table causes a DatabaseMetadataTransfer instance to be created, which contains all the information needed on the receiving end. Dragging a view should do something similar. There is no convenient workaround for this limitation.
DB columns should probably be treated in a similar way, although right now we don't do anything with drag/drop of columns.
Not a defect, dnd for views was never requested by the VWP team. Dragging columns is already supported on the form_promoh branch, which will be eventually integrated into trunk.
The comment about columns is a red herring for this issue - dnd of views
I have made modifications to the DB Explorer and dbapi in my workspace and along with changes to the VWP, DnD of Views is working. I'll write-up the changes and provide diffs. Since users may only have permission to access to Views, not Tables, a fix for DnD of Views should go in the next NB update
Created attachment 36571 [details] DatabaseMetaDataTransfer diff
Drag and drop of Views may be an enhancement for DB Explorer, however, unfortunately, this is a serious regression for Visual Web Pack. The product, Creator 2, included the feature to Drag and Drop Views, mainly, for users who just had permission to read/write data in Views, not Tables. The same feature is required for Visual Web Pack. In order to support Drag and drop of Views, a new DataFlavor for Views and implementation of clipboardCopy for Views are required. I have available low-risk enhancements that need to be applied for the next update release of NetBeans. Attached are the diffs of the files that needed to be modified.
Created attachment 36572 [details] ViewNode diff
Created attachment 36573 [details] DbMetaDataTransferProvider diff
Created attachment 36574 [details] explorer.plist diff - change seems to be required for DnD, without only Click+Click works
Looks good. There are a few unneeded whitespace changes, please remove them. Also the empty line after getViewDataFlavor() in DbMetaDataTransferProvider. "table" is used instead of "view" in two places in DatabaseMetaDataTransfer. After making these changes I guess you can just reassign to yourself and commit to trunk, or let me know and I will do it.
Andrei, thanks for reviewing the changes. I've cleaned up the whitespace and corrected table/view Integration was made to the trunk: Checking in db/src/org/netbeans/modules/db/explorer/DbMetaDataTransferProvider.j ava; /cvs/db/src/org/netbeans/modules/db/explorer/DbMetaDataTransferProvider.java,v <-- DbMetaDataTransferProvider.java new revision: 1.3; previous revision: 1.2 done Checking in db/src/org/netbeans/modules/db/explorer/nodes/ViewNode.java; /cvs/db/src/org/netbeans/modules/db/explorer/nodes/ViewNode.java,v <-- ViewNod e.java new revision: 1.20; previous revision: 1.19 done Checking in db/src/org/netbeans/modules/db/resources/explorer.plist; /cvs/db/src/org/netbeans/modules/db/resources/explorer.plist,v <-- explorer.pl ist new revision: 1.75; previous revision: 1.74 done Checking in db/dbapi/src/org/netbeans/modules/db/api/explorer/DatabaseMetaDataTr ansfer.java; /cvs/db/dbapi/src/org/netbeans/modules/db/api/explorer/DatabaseMetaDataTransfer. java,v <-- DatabaseMetaDataTransfer.java new revision: 1.3; previous revision: 1.2 done
Should have also stated that this is now fixed in the trunk
Looks fine, it can be integrated in the release_551 branch.
Checking in db/src/org/netbeans/modules/db/explorer/DbMetaDataTransferProvider.j ava; /cvs/db/src/org/netbeans/modules/db/explorer/DbMetaDataTransferProvider.java,v <-- DbMetaDataTransferProvider.java new revision: 1.1.4.2.24.3; previous revision: 1.1.4.2 done Checking in db/src/org/netbeans/modules/db/explorer/nodes/ViewNode.java; /cvs/db/src/org/netbeans/modules/db/explorer/nodes/ViewNode.java,v <-- ViewNod e.java new revision: 1.18.26.1.24.3; previous revision: 1.18.26.1 done Checking in db/src/org/netbeans/modules/db/resources/explorer.plist; /cvs/db/src/org/netbeans/modules/db/resources/explorer.plist,v <-- explorer.pl ist new revision: 1.70.56.1.2.4.20.3; previous revision: 1.70.56.1.2.4 done Checking in db/dbapi/src/org/netbeans/modules/db/api/explorer/DatabaseMetaDataTr ansfer.java; /cvs/db/dbapi/src/org/netbeans/modules/db/api/explorer/DatabaseMetaDataTransfer. java,v <-- DatabaseMetaDataTransfer.java new revision: 1.1.4.4.24.3; previous revision: 1.1.4.4 done
The bug has been verified on NB 5.5.1 VWP build #070130 (NB 5.5.1 build #200701231036).