Spark graphx moved to a new project due to a incompatibility of scala compiler

This commit is contained in:
Norberto Ritzmann Jr
2019-10-06 21:57:54 +02:00
parent db85c8f275
commit 45be61376e
20299 changed files with 1635696 additions and 0 deletions
@@ -0,0 +1,5 @@
'use strict';
var angularApp = angular.module('angularApp', ['ngRoute']);
@@ -0,0 +1,13 @@
'use strict';
angularApp
.controller('indexController', function ($scope) {
$scope.greeting = '';
$scope.initialize = function () {
$scope.greeting = "Howdy!"
};
$scope.initialize();
});
@@ -0,0 +1,52 @@
'use strict';
angularApp
.controller('socketController', function ($scope, SocketService) {
/**
* URL mapping endpoints.
*/
var SECURED_CHAT = '/secured/chat';
var SECURED_CHAT_HISTORY = '/secured/history';
var SECURED_CHAT_ROOM = '/secured/room';
var SECURED_CHAT_SPECIFIC_USER = '/secured/user/queue/specific-user';
var opts = {
from: 'from',
to: 'to',
text: 'text',
disconnect: 'disconnect',
conversationDiv: 'conversationDiv',
response: 'response'
};
$scope.sendEndpoint = '';
$scope.stompClient = null;
/**
* Broadcast to All Users.
*/
$scope.connectAll = function (context) {
$scope.sendEndpoint = context + SECURED_CHAT;
$scope.stompClient = SocketService.connect($scope.sendEndpoint , opts, true);
};
$scope.subscribeAll = function () { SocketService.subscribeToAll($scope.stompClient, SECURED_CHAT_HISTORY, opts); };
/**
* Broadcast to Specific User.
*/
$scope.connectSpecific = function (context) {
$scope.sendEndpoint = context + SECURED_CHAT_ROOM;
$scope.stompClient = SocketService.connect(context + SECURED_CHAT_ROOM, opts, false);
};
$scope.subscribeSpecific = function () { SocketService.subscribeToSpecific($scope.stompClient, SECURED_CHAT_SPECIFIC_USER, opts); };
$scope.disconnect = function () { SocketService.disconnect(opts, $scope.stompClient); };
$scope.sendMessage = function () { SocketService.sendMessage(opts, $scope.stompClient, $scope.sendEndpoint); };
});
@@ -0,0 +1,12 @@
'use strict';
angularApp
.controller('successController', function ($scope) {
$scope.successMsg = '';
$scope.initialize = function () {
$scope.successMsg = "You've logged in!";
};
$scope.initialize();
});
@@ -0,0 +1,16 @@
'use strict';
angularApp
.config(function ($routeProvider) {
$routeProvider
.when('/index', {
controller: 'indexController'
})
.when('/sockets', {
controller: 'socketController'
})
.when('/success', {
controller: 'successController'
})
.otherwise('/index');
});
@@ -0,0 +1,99 @@
'use strict';
var idHelper = function (context) {
return document.getElementById(context);
};
function SocketService() {
var that = this;
that.sessionId = '';
/**
* Generic methods.
*/
that.setConnected = function (opts, connected) {
idHelper('connectAll').disabled = connected;
idHelper('connectSpecific').disabled = connected;
idHelper(opts.disconnect).disabled = !connected;
idHelper(opts.response).innerHTML = '';
idHelper('subscribeAll').disabled = !connected;
idHelper('subscribeSpecific').disabled = !connected;
};
that.connect = function (endpoint, opts, isBroadcastAll) {
var socket = new SockJS(endpoint), stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
that.setConnected(opts, true);
if (!isBroadcastAll) {
var url = stompClient.ws._transport.url;
console.log(stompClient.ws._transport.url);
url = url.replace("ws://localhost:8080/spring-security-mvc-socket/secured/room/", "");
url = url.replace("/websocket", "");
url = url.replace(/^[0-9]+\//, "");
console.log("Your current session is: " + url);
that.sessionId = url;
}
});
return stompClient;
};
that.disconnect = function (opts, stompClient) {
if (stompClient !== null && stompClient !== undefined) { stompClient.disconnect(); }
that.setConnected(opts, false);
};
that.sendMessage = function (opts, stompClient, endpoint) {
var to = idHelper(opts.to).value;
var from = idHelper(opts.from).value;
var msg = {
'from': (from === undefined || from === null ) ? to : from,
'to': (to === undefined || to === null ) ? "ALL" : to,
'text': idHelper(opts.text).value
};
console.log(JSON.stringify(msg));
stompClient.send(endpoint, {}, JSON.stringify(msg));
};
that.messageOut = function (msg, opts) {
var r = idHelper(opts.response), p = document.createElement('p');
p.style.wordWrap = 'break-word';
p.appendChild(document.createTextNode(msg.from + ': ' + msg.text + ' (' + msg.time + ')'));
r.appendChild(p);
};
/**
* Broadcast to All Users.
*/
that.subscribeToAll = function(client, url, opts) {
idHelper('subscribeAll').disabled = true;
idHelper('subscribeSpecific').disabled = true;
client.subscribe(url, function (msgOut) {
that.messageOut(JSON.parse(msgOut.body), opts);
});
};
/**
* Broadcast to Specific User.
*/
that.subscribeToSpecific = function(client, url, opts) {
idHelper('subscribeAll').disabled = true;
idHelper('subscribeSpecific').disabled = true;
client.subscribe(url + "-user" + that.sessionId, function (msgOut) {
that.messageOut(JSON.parse(msgOut.body), opts);
});
};
}
angularApp
.service('SocketService', SocketService);