Commit dd4949ec authored by Constantin Jucovschi's avatar Constantin Jucovschi

adding text and repo

parent eaba2556
......@@ -21,9 +21,13 @@ task 'build', 'Build the .js files', ->
exec "cp target/compile/theo.js release/"
exec "cp target/compile/sally_client.js release/"
exec "cp target/compile/frames.js release/"
exec "cp target/compile/text.js release/"
exec "cp target/compile/repository.js release/"
task 'sbuild', 'Build the .js files', ->
exec "r.js -o build.js optimize=none"
exec "cp target/compile/theo.js release/"
exec "cp target/compile/sally_client.js release/"
exec "cp target/compile/frames.js release/"
exec "cp target/compile/text.js release/"
exec "cp target/compile/repository.js release/"
......@@ -16,5 +16,13 @@
name : "frames",
exclude : ["sally_client"]
},
{
name : "repository",
exclude : ["sally_client"]
},
{
name : "text",
exclude : ["sally_client"]
}
]
}
\ No newline at end of file
......@@ -53,6 +53,3 @@ var info_kwarc_sally_comm_core = {
typeInfo: 'info_kwarc_sally_comm_core.RegisterClientRequest'
}]
};
if (typeof window === 'undefined') {
module.exports.info_kwarc_sally_comm_core = info_kwarc_sally_comm_core;
}
\ No newline at end of file
......@@ -2,6 +2,48 @@ var info_kwarc_sally_comm_frames = {
name: 'info_kwarc_sally_comm_frames',
defaultElementNamespaceURI: 'http:\/\/kwarc.info\/sally\/comm\/frames',
typeInfos: [{
type: 'classInfo',
localName: 'RemoveDocLevelService',
propertyInfos: [{
type: 'element',
name: 'id',
elementName: 'id',
typeInfo: 'String'
}]
}, {
type: 'classInfo',
localName: 'ExecDocLevelService',
propertyInfos: [{
type: 'element',
name: 'id',
elementName: 'id',
typeInfo: 'String'
}]
}, {
type: 'classInfo',
localName: 'NewDocLevelService',
propertyInfos: [{
type: 'element',
name: 'id',
elementName: 'id',
typeInfo: 'String'
}, {
type: 'element',
name: 'type',
elementName: 'type',
typeInfo: 'String'
}, {
type: 'element',
name: 'name',
elementName: 'name',
typeInfo: 'String'
}, {
type: 'element',
name: 'icon',
elementName: 'icon',
typeInfo: 'String'
}]
}, {
type: 'classInfo',
localName: 'ShowSallyFrameMenu',
propertyInfos: [{
......@@ -17,10 +59,19 @@ var info_kwarc_sally_comm_frames = {
}]
}],
elementInfos: [{
elementName: 'RemoveDocLevelService',
typeInfo: 'info_kwarc_sally_comm_frames.RemoveDocLevelService'
}, {
elementName: 'ExecDocLevelService',
typeInfo: 'info_kwarc_sally_comm_frames.ExecDocLevelService'
}, {
elementName: 'NewDocLevelService',
typeInfo: 'info_kwarc_sally_comm_frames.NewDocLevelService'
}, {
elementName: 'ShowSallyFrameMenu',
typeInfo: 'info_kwarc_sally_comm_frames.ShowSallyFrameMenu'
}, {
elementName: 'ListenDocLevelServices',
typeInfo: 'AnyType'
}]
};
if (typeof window === 'undefined') {
module.exports.info_kwarc_sally_comm_frames = info_kwarc_sally_comm_frames;
}
\ No newline at end of file
......@@ -65,6 +65,3 @@ var info_kwarc_sally_comm_theo = {
typeInfo: 'info_kwarc_sally_comm_theo.OpenTheoWindowResponse'
}]
};
if (typeof window === 'undefined') {
module.exports.info_kwarc_sally_comm_theo = info_kwarc_sally_comm_theo;
}
\ No newline at end of file
......@@ -9,18 +9,32 @@
require.config(
{
baseUrl : "release"
baseUrl : "release",
paths : {
"repository" : "../target/compile/repository",
"info_kwarc_sally_comm_repository" : "../target/compile/info_kwarc_sally_comm_repository",
"EventEmitter" : "../target/compile/EventEmitter"
}
});
require(["sally_client", "theo", "frames"], function(SallyClient, Theo, Frames) {
require(["sally_client", "theo", "frames", "repository"], function(SallyClient, Theo, Frames, Repository) {
var theo = new Theo();
var frames = new Frames();
var repository = new Repository("gl.kwarc.info/test/test", "blah.txt");
frames.on("NewDocLevelService", function(msg) {
frames.executeDocLevelService(msg.id);
});
frames.on("RemoveDocLevelService", function(msg) {
console.log(msg);
});
client = new SallyClient({stompUrl: "ws://localhost:61614", stompUser : "webclient", stompPassword : "webclient"});
client.register([theo, frames], "env"+Math.floor(Math.random()*100000), function() {
frames.requestOnShowSallyFrames(100, 100);
client.register([theo, frames, repository], "env"+Math.floor(Math.random()*100000), function() {
});
});
......
define (require) ->
require "sally_client"
require "info_kwarc_sally_comm_frames"
context = new Jsonix.Context([ info_kwarc_sally_comm_frames ]);
marshaller = context.createMarshaller();
unmarshaller = context.createUnmarshaller();
createShowSallyFrameMenu = (x, y) ->
{
name :
localPart : "ShowSallyFrameMenu"
namespaceURI : "http://kwarc.info/sally/comm/frames"
value :
"posx" : x,
"posy" : y
}
class Frames
getName : () -> "frames"
marshal : (obj) -> marshaller.marshalString(obj)
unmarshal : (str) -> unmarshaller.unmarshalString(str)
requestOnShowSallyFrames : (x, y) ->
@send(createShowSallyFrameMenu(x, y))
handleMessage : (msg) ->
\ No newline at end of file
require "sally_client"
require "info_kwarc_sally_comm_frames"
EventEmitter = require "EventEmitter"
context = new Jsonix.Context([ info_kwarc_sally_comm_frames ]);
marshaller = context.createMarshaller();
unmarshaller = context.createUnmarshaller();
createShowSallyFrameMenu = (x, y) ->
{
name :
localPart : "ShowSallyFrameMenu"
namespaceURI : "http://kwarc.info/sally/comm/frames"
value :
"posx" : x,
"posy" : y
}
executeDocLevelService = (id) ->
{
name :
localPart : "ExecDocLevelService"
namespaceURI : "http://kwarc.info/sally/comm/frames"
value :
"id" : id
}
class Frames extends EventEmitter
constructor : () ->
@services = {}
getName : () -> "frames"
marshal : (obj) -> marshaller.marshalString(obj)
unmarshal : (str) -> unmarshaller.unmarshalString(str)
executeDocLevelService : (id) ->
@send(executeDocLevelService(id))
requestOnShowSallyFrames : (x, y) ->
@send(createShowSallyFrameMenu(x, y))
handleMessage : (msg, sendBack) ->
if msg.name.localPart == "NewDocLevelService"
@services[msg.value.id] = msg.value;
@emit("NewDocLevelService", msg.value)
if msg.name.localPart == "RemoveDocLevelService"
delete @services[msg.value.id];
@emit("RemoveDocLevelService", msg.value)
......@@ -58,7 +58,7 @@ define (require) ->
@privateQueue = "editor_tools_"+Math.floor(Math.random()*100000);
@stompClient.subscribe("/queue/"+@privateQueue, (msg) =>
namespace = xmlns.exec(msg.body)[3];
console.log(namespace)
console.log(namespace, msg.body)
if namespace == "core"
body = unmarshaller.unmarshalString(msg.body)
if body.name.localPart == "HeartbeatRequest"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment