Permalink
Browse files

renamed core package

configured logger (authentication succ and fail events)
  • Loading branch information...
1 parent e18d4c3 commit b2f69b78ae03beadf83ec60ec2f6d1d822957b83 @tomekkup committed Dec 19, 2012
Showing with 743 additions and 262 deletions.
  1. +2 −1 .gitignore
  2. +3 −1 README.md
  3. +1 −1 src/main/frontend/source/class/helenos/Application.js
  4. +1 −1 src/main/frontend/source/class/helenos/components/SchemaPane.js
  5. +19 −3 src/main/frontend/source/class/helenos/components/menu/ColumnFamilyContextMenu.js
  6. +75 −75 src/main/frontend/source/class/helenos/components/tab/AccountsEditorPage.js
  7. +1 −1 src/main/frontend/source/class/helenos/remote/AccountsTableModel.js
  8. +31 −0 src/main/frontend/source/class/helenos/ui/table/cellrenderer/Authorities.js
  9. +5 −0 src/main/frontend/source/class/helenos/util/RpcActionsProvider.js
  10. BIN src/main/frontend/source/resource/helenos/connections-16.png
  11. BIN src/main/frontend/source/resource/helenos/connections.png
  12. BIN src/main/frontend/source/resource/helenos/isctf.png
  13. BIN src/main/frontend/source/resource/helenos/key.png
  14. BIN src/main/frontend/source/resource/helenos/logout.png
  15. BIN src/main/frontend/source/resource/helenos/query-16.png
  16. BIN src/main/frontend/source/resource/helenos/query.png
  17. BIN src/main/frontend/source/resource/helenos/users-16.png
  18. BIN src/main/frontend/source/resource/helenos/users.png
  19. +0 −68 src/main/java/com/kuprowski/helenos/service/impl/AbstractProvider.java
  20. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/ClusterConfiguration.java
  21. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/Converter.java
  22. +37 −0 src/main/java/tomekkup/helenos/cassandra/model/AllConsistencyLevelPolicy.java
  23. +4 −4 src/main/java/{com/kuprowski → tomekkup}/helenos/context/PostConfiguringClusterListener.java
  24. +2 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/dao/AbstractDao.java
  25. +2 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/dao/AccountDao.java
  26. +2 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/dao/ClusterConfigDao.java
  27. +114 −0 src/main/java/tomekkup/helenos/dao/model/Account.java
  28. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/dozer/converters/HeapByteBufferConverter.java
  29. +39 −0 src/main/java/tomekkup/helenos/security/web/authentication/AbstractJsonAuthenticationHandler.java
  30. +30 −0 src/main/java/tomekkup/helenos/security/web/authentication/JsonAuthenticationFailureHandler.java
  31. +28 −0 src/main/java/tomekkup/helenos/security/web/authentication/JsonAuthenticationSuccessHandler.java
  32. +33 −0 src/main/java/tomekkup/helenos/security/web/authentication/JsonLogoutSuccesHandler.java
  33. +8 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/service/AccountsProvider.java
  34. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/service/ClusterConfigAware.java
  35. +2 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/service/ClusterConnectionProvider.java
  36. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/service/CredentialsProvider.java
  37. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/service/QueryProvider.java
  38. +5 −5 src/main/java/{com/kuprowski → tomekkup}/helenos/service/SchemaProvider.java
  39. +9 −6 src/main/java/{com/kuprowski → tomekkup}/helenos/service/StandardQueryProvider.java
  40. +6 −6 src/main/java/{com/kuprowski → tomekkup}/helenos/service/SuperQueryProvider.java
  41. +94 −0 src/main/java/tomekkup/helenos/service/impl/AbstractProvider.java
  42. +4 −4 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/AbstractQueryProvider.java
  43. +19 −4 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/AccountsProviderImpl.java
  44. +6 −6 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/ClusterConnectionProviderImpl.java
  45. +2 −2 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/CredentialsProviderImpl.java
  46. +7 −7 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/SchemaProviderImpl.java
  47. +28 −9 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/StandardQueryProviderImpl.java
  48. +9 −9 src/main/java/{com/kuprowski → tomekkup}/helenos/service/impl/SuperQueryProviderImpl.java
  49. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/Column.java
  50. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/JsonColumnDefinition.java
  51. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/JsonColumnFamilyDefinition.java
  52. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/JsonComparatorType.java
  53. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/JsonKeyspaceDefinition.java
  54. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/Slice.java
  55. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/QxJsonColumnFamilyDefinition.java
  56. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/QxJsonKeyspaceDefinition.java
  57. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/AbstractPredicateQuery.java
  58. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/AbstractQuery.java
  59. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/AbstractRangeQuery.java
  60. +32 −0 src/main/java/tomekkup/helenos/types/qx/query/CqlQuery.java
  61. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/RangeQuery.java
  62. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/SingleColumnQuery.java
  63. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/SingleSubColumnQuery.java
  64. +1 −1 src/main/java/{com/kuprowski → tomekkup}/helenos/types/qx/query/SubRangeQuery.java
  65. +3 −0 src/main/resources/dbinit.sql
  66. +6 −6 src/main/resources/xml-bean-mappings.xml
  67. +1 −1 src/main/webapp/WEB-INF/context/applicationContext-hector.xml
  68. +29 −0 src/main/webapp/WEB-INF/context/applicationContext-security.xml
  69. +2 −2 src/main/webapp/WEB-INF/context/applicationContext.xml
  70. +6 −6 src/main/webapp/WEB-INF/helenos-servlet.xml
  71. +15 −3 src/main/webapp/WEB-INF/log4j.xml
View
@@ -8,4 +8,5 @@
/src/main/webapp/WEB-INF/logs/
/src/main/webapp/gui/resource/
/src/main/webapp/gui/script/
-/src/main/frontend/version.json
+/src/main/frontend/version.json
+/src/main/frontend/contribs/dialog/
View
@@ -10,14 +10,16 @@ Helenos is a web based GUI Cassandra client that helps you to explore data and m
## Download
-[here](https://github.com/tomekkup/helenos/downloads)
+[sourceforge](https://sourceforge.net/projects/helenos-gui/files/)
## Changelog
[here](https://github.com/tomekkup/helenos/wiki/Changelog)
## Gallery
+
+
[Picasa album](https://picasaweb.google.com/tomekkuprowski/Helenos)
## Twitter
@@ -51,7 +51,7 @@ qx.Class.define("helenos.Application",
qx.Class.include(helenos.ui.table.Table, qx.ui.table.MTableContextMenu);
// Enable logging in debug variant
- if (qx.core.Environment.get("qx.debug"))
+ //if (qx.core.Environment.get("qx.debug"))
{
// support native logging capabilities, e.g. Firebug for Firefox
qx.log.appender.Native;
@@ -140,7 +140,7 @@ qx.Class.define("helenos.components.SchemaPane",
cfItem.set({
icon : cf.columnType == 'Super' ? 'helenos/supercf.png' : 'helenos/standardcf.png',
toolTip : this.__createColumnFamilyToolTip(cf),
- contextMenu: new helenos.components.menu.ColumnFamilyContextMenu(ks.name, cf.name)
+ contextMenu: new helenos.components.menu.ColumnFamilyContextMenu(ks.name, cf.name, cf.columnType)
});
cfItem.setIcon(cf.columnType == 'Super' ? 'helenos/supercf.png' : 'helenos/standardcf.png');
cfItem.setToolTip(this.__createColumnFamilyToolTip(cf));
@@ -17,15 +17,15 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
{
extend : qx.ui.menu.Menu,
- construct : function(ksName, cfName)
+ construct : function(ksName, cfName, columnType)
{
this.base(arguments);
- this.__initMenuItems(ksName, cfName);
+ this.__initMenuItems(ksName, cfName, columnType);
},
members : {
- __initMenuItems : function(ksName, cfName) {
+ __initMenuItems : function(ksName, cfName, columnType) {
var propsButton = new qx.ui.menu.Button('Properties', 'icon/16/status/dialog-information.png');
propsButton.setUserData('KSNAME', ksName);
propsButton.setUserData('CFNAME', cfName);
@@ -36,6 +36,15 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
browseButton.setUserData('CFNAME', cfName);
browseButton.addListener('execute', this.__showBrowseByPredicatePane);
+ var cqlButton = new qx.ui.menu.Button('CQL query', 'helenos/query-16.png');
+ cqlButton.setUserData('KSNAME', ksName);
+ cqlButton.setUserData('CFNAME', cfName);
+ cqlButton.addListener('execute', this.__showBrowseByCqlQueryPane);
+
+ if (columnType != 'Standard') {
+ cqlButton.setEnabled(false);
+ }
+
var dropButton = new qx.ui.menu.Button('Drop', 'icon/16/actions/edit-delete.png');
dropButton.setUserData('KSNAME', ksName);
dropButton.setUserData('CFNAME', cfName);
@@ -48,6 +57,7 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
this.add(propsButton);
this.add(browseButton);
+ this.add(cqlButton);
this.add(new qx.ui.menu.Separator());
this.add(dropButton);
this.add(truncateButton);
@@ -79,6 +89,12 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
helenos.util.GuiObserver.showBrowseByPredicateTab(ksName, cfName);
},
+ __showBrowseByCqlQueryPane : function(e) {
+ var ksName = e.getTarget().getUserData('KSNAME');
+ var cfName = e.getTarget().getUserData('CFNAME');
+ helenos.util.GuiObserver.showBrowseByCqlQueryTab(ksName, cfName);
+ },
+
/**
* @lint ignoreUndefined(dialog)
*/
@@ -35,24 +35,26 @@ qx.Class.define("helenos.components.tab.AccountsEditorPage",
members :
{
- __connectionsTable : null,
+ __accountsTable : null,
__addButton : null,
- __connectButton : null,
__editButton : null,
__deleteButton : null,
__addMainContainer : function() {
- this.__connectionsTable = new helenos.ui.table.Table(new helenos.remote.AccountsTableModel());
- this.__connectionsTable.getTableColumnModel().setDataCellRenderer(2, new qx.ui.table.cellrenderer.Boolean());
- this.__connectionsTable.getSelectionModel().addListener('changeSelection', this.__onTableSelectionChanged, this);
- this.__connectionsTable.setContextMenuHandlers([0,1,2]);
- this.__connectionsTable.setColumnsWidth([23,63,13]);
+ this.__accountsTable = new helenos.ui.table.Table(new helenos.remote.AccountsTableModel());
- var gb = new qx.ui.groupbox.GroupBox('Available accounts');
+ this.__accountsTable.getTableColumnModel().setDataCellRenderer(1, new helenos.ui.table.cellrenderer.Authorities());
+ this.__accountsTable.getTableColumnModel().setDataCellRenderer(2, new qx.ui.table.cellrenderer.Password());
+ this.__accountsTable.getTableColumnModel().setDataCellRenderer(3, new qx.ui.table.cellrenderer.Boolean());
+ this.__accountsTable.getSelectionModel().addListener('changeSelection', this.__onTableSelectionChanged, this);
+ this.__accountsTable.setContextMenuHandlers([0,1,2,3]);
+ this.__accountsTable.setColumnsWidth([18,38,35,8]);
+
+ var gb = new qx.ui.groupbox.GroupBox('Accounts');
gb.setLayout(new qx.ui.layout.VBox(5));
var sp = new qx.ui.core.scroll.ScrollPane();
- sp.add(this.__connectionsTable);
+ sp.add(this.__accountsTable);
gb.add(sp, {
flex : 1
@@ -66,80 +68,95 @@ qx.Class.define("helenos.components.tab.AccountsEditorPage",
__getActionButtonsPane : function() {
var pane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right'));
this.__addButton = new qx.ui.form.Button('Add', 'icon/16/actions/list-add.png');
- this.__addButton.addListener('execute', this.__onAddConnection, this);
-
- this.__connectButton = new qx.ui.form.Button('Connect to', 'helenos/connect.png');
- this.__connectButton.addListener('execute', this.__onConnectToConnection, this);
- this.__connectButton.setEnabled(false);
+ this.__addButton.addListener('execute', this.__onAddAccount, this);
this.__deleteButton = new qx.ui.form.Button('Delete', 'icon/16/actions/list-remove.png');
- this.__deleteButton.addListener('execute', this.__ondeleteConnection, this);
+ this.__deleteButton.addListener('execute', this.__onDeleteAccount, this);
this.__deleteButton.setEnabled(false);
this.__editButton = new qx.ui.form.Button('Edit', 'icon/16/actions/edit-cut.png');
- this.__editButton.addListener('execute', this.__onEditConnection, this);
+ this.__editButton.addListener('execute', this.__onEditAccount, this);
this.__editButton.setEnabled(false);
pane.add(this.__addButton);
pane.add(this.__editButton);
- pane.add(this.__connectButton);
pane.add(this.__deleteButton);
return pane;
},
/**
* @lint ignoreUndefined(dialog)
*/
- __onAddConnection : function(e) {
+ __onAddAccount : function(e) {
var formData = {
- 'alias' : {
- 'type' : 'TextField',
- 'label' : 'Alias (unique)',
+ 'username' : {
+ 'type' : 'textfield',
+ 'label' : 'Username (unique)',
'value' : '',
'validation' : {
'required' : true
}
},
- 'hosts' : {
- 'type' : 'TextField',
- 'label' : 'Hosts (comma separated)',
+ 'password1' : {
+ 'type' : 'passwordfield',
+ 'label' : 'Password',
'value' : '',
'validation' : {
'required' : true
}
},
- 'clusterName' :
- {
- 'type' : 'TextArea',
- 'label' : 'Cluster name',
- 'lines' : 4,
+ 'password2' : {
+ 'type' : 'passwordfield',
+ 'label' : 'Repeat password',
'value' : '',
'validation' : {
'required' : true
}
+ },
+ 'authorities' :
+ {
+ 'type' : "combobox",
+ 'label' : "Authorities",
+ 'value' : "ROLE_USER",
+ 'height' : 120,
+ 'options' : [
+ {
+ 'label' : "ROLE_USER", 'value' : "ROLE_USER"
+ },
+ {
+ 'label' : "ROLE_ADMIN", 'value' : "ROLE_ADMIN"
+ }
+ ]
+ },
+ 'enabled' :
+ {
+ 'type' : 'checkbox',
+ 'label' : 'Enabled',
+ 'value' : true
}
};
(new dialog.Form({
- "message" : '<h3>Create new connection</h3>',
+ "message" : '<h3>Create new account</h3>',
"formData" : formData,
"allowCancel" : true,
"callback" : function(context, result) {
if (result != null) {
- result['active'] = false;
- helenos.util.RpcActionsProvider.storeConnection(result);
- context._reloadConnectionsTable();
+ helenos.util.RpcActionsProvider.storeAccount(result);
+ context._reloadAccountsTable();
}
},
"context" : this
- })).set({width : 550}).show();
+ })).set({
+ width : 350
+ }).show();
},
/**
* @lint ignoreUndefined(dialog)
*/
- __onEditConnection : function(e) {
+ __onEditAccount : function(e) {
var alias = this.__getSelectedAlias();
- var cc = helenos.util.RpcActionsProvider.getConnectionByAlias(alias);
+ var cc = helenos.util.RpcActionsProvider.getAccountByAlias(alias);
var formData = {
'hosts' : {
'type' : 'TextField',
@@ -160,69 +177,52 @@ qx.Class.define("helenos.components.tab.AccountsEditorPage",
}
};
(new dialog.Form({
- "message" : '<h3>Edit connection</h3>',
+ "message" : '<h3>Edit account</h3>',
"formData" : formData,
"allowCancel" : true,
"callback" : function(context, result) {
if (result != null) {
result['alias'] = cc.alias;
result['active'] = cc.active;
- helenos.util.RpcActionsProvider.storeConnection(result);
- context._reloadConnectionsTable();
+ helenos.util.RpcActionsProvider.storeAccount(result);
+ context._reloadAccountsTable();
}
},
"context" : this
- })).set({width : 550}).show();
+ })).set({
+ width : 550
+ }).show();
},
/**
* @lint ignoreUndefined(dialog)
*/
- __ondeleteConnection : function(e) {
- var selectionModel = this.__connectionsTable.getSelectionModel();
+ __onDeleteAccount : function(e) {
+ var selectionModel = this.__accountsTable.getSelectionModel();
var selectedRow = selectionModel.getSelectedRanges()[0].minIndex;
- var active = this.__connectionsTable.getTableModel().getValue(3, selectedRow);
- if (active == true) {
- dialog.Dialog.error('Active connection can not be deleted !');
- } else {
- var alias = this.__connectionsTable.getTableModel().getValue(0, selectedRow);
- dialog.Dialog.confirm(this.tr('are.you.sure'), function(ret) {
- if (ret == true) {
- helenos.util.RpcActionsProvider.deleteConnection(alias);
- this._reloadConnectionsTable();
- }
- }, this);
- }
+ var username = this.__accountsTable.getTableModel().getValue(0, selectedRow);
+ dialog.Dialog.confirm(this.tr('are.you.sure'), function(ret) {
+ if (ret == true) {
+ helenos.util.RpcActionsProvider.deleteAccount(username);
+ this._reloadAccountsTable();
+ }
+ }, this);
+
},
- _reloadConnectionsTable : function() {
- this.__connectionsTable.resetSelection();
- this.__connectionsTable.getTableModel().reloadData();
+ _reloadAccountsTable : function() {
+ this.__accountsTable.resetSelection();
+ this.__accountsTable.getTableModel().reloadData();
},
__getSelectedAlias : function() {
- var selectedRow = this.__connectionsTable.getSelectionModel().getSelectedRanges()[0].minIndex;
- return this.__connectionsTable.getTableModel().getValue(0, selectedRow);
- },
-
- /**
- * @lint ignoreUndefined(dialog)
- */
- __onConnectToConnection : function(e) {
- var alias = this.__getSelectedAlias();
- dialog.Dialog.confirm(this.tr('are.you.sure'), function(ret) {
- if (ret == true) {
- helenos.util.RpcActionsProvider.activate(alias);
- this._reloadConnectionsTable();
- helenos.util.GuiObserver.refreshSchemaTree();
- }
- }, this);
+ var selectedRow = this.__accountsTable.getSelectionModel().getSelectedRanges()[0].minIndex;
+ return this.__accountsTable.getTableModel().getValue(0, selectedRow);
},
__onTableSelectionChanged : function(e) {
- var isSelected = !this.__connectionsTable.getSelectionModel().isSelectionEmpty();
- this.__connectButton.setEnabled(isSelected);
+ var isSelected = !this.__accountsTable.getSelectionModel().isSelectionEmpty();
this.__deleteButton.setEnabled(isSelected);
this.__editButton.setEnabled(isSelected);
}
@@ -13,7 +13,7 @@ qx.Class.define('helenos.remote.AccountsTableModel',
construct: function() {
this.base(arguments);
- this.setColumns(['Username','Authorities', 'Enabled'],['username','authorities', 'enabled']);
+ this.setColumns(['Username','Authorities', 'Password', 'Enabled'],['username','authorities', 'password', 'enabled']);
},
members:
@@ -0,0 +1,31 @@
+/* ************************************************************************
+Copyright:
+ 2012 Tomek Kuprowski
+License:
+ GPLv2: http://www.gnu.org/licences/gpl.html
+Authors:
+ Tomek Kuprowski (tomekkuprowski at gmail dot com)
+ ************************************************************************ */
+qx.Class.define("helenos.ui.table.cellrenderer.Authorities",
+{
+ extend : qx.ui.table.cellrenderer.Default,
+
+ members : {
+ _getContentHtml : function(cellInfo)
+ {
+ var value = cellInfo.value;
+ if ( value === null ){
+ value = "";
+ } else {
+ var temp = "";
+ for (var i = 0; i < value.length; i++) {
+ temp += value[i].authority + " ";
+ }
+ value = temp;
+ }
+
+ cellInfo.value = value;
+ return qx.bom.String.escape(this._formatValue(cellInfo));
+ }
+ }
+});
Oops, something went wrong.

0 comments on commit b2f69b7

Please sign in to comment.