updating the static after last changes

parent d32c436f
...@@ -21,7 +21,9 @@ ...@@ -21,7 +21,9 @@
}); });
}).push(function(body) { }).push(function(body) {
var data = JSON.parse(body); var data = JSON.parse(body);
data.shift_spreadsheet = JSON.parse(editor_data); // create a property within input
// with name the provided at render time
data.input[gadget.props.name] = JSON.parse(editor_data);
return gadget.aq_putAttachment({ return gadget.aq_putAttachment({
_id: gadget.props.jio_key, _id: gadget.props.jio_key,
_attachment: "body.json", _attachment: "body.json",
...@@ -43,24 +45,18 @@ ...@@ -43,24 +45,18 @@
console.log("generic spreadsheet RENDER1"); console.log("generic spreadsheet RENDER1");
var jio_key = options.id, gadget = this; var jio_key = options.id, gadget = this;
gadget.props.jio_key = jio_key; gadget.props.jio_key = jio_key;
console.log("generic spreadsheet RENDER2"); // view_##### is the formulatino of the names
console.log(options); gadget.props.name = options.action.substr(5, options.action.length);
return new RSVP.Queue().push(function() { return new RSVP.Queue().push(function() {
console.log("generic spreadsheet RENDER3");
return RSVP.all([ gadget.aq_getAttachment({ return RSVP.all([ gadget.aq_getAttachment({
_id: jio_key, _id: jio_key,
_attachment: "body.json" _attachment: "body.json"
}), gadget.getDeclaredGadget("tableeditor") ]); }), gadget.getDeclaredGadget("tableeditor") ]);
}).push(function(result_list) { }).push(function(result_list) {
console.log("generic spreadsheet RENDER4"); var i, content, data = JSON.parse(result_list[0]).application_configuration.input;
console.log(JSON.parse(result_list[0]));
var i, content, data = JSON.parse(result_list[0]).application_configuration.Input;
console.log(data);
for (i = 0; i <= Object.keys(data).length; i += 1) { for (i = 0; i <= Object.keys(data).length; i += 1) {
if (Object.keys(data)[i] === options.action) { if (Object.keys(data)[i] === options.action) {
console.log("content");
content = data[options.action].configuration.columns; content = data[options.action].configuration.columns;
console.log(content);
} }
} }
// application_configuration.input.view_???_spreasheet.configuration // application_configuration.input.view_???_spreasheet.configuration
......
...@@ -62,9 +62,9 @@ ...@@ -62,9 +62,9 @@
var forward_kw = { var forward_kw = {
action: options.action || "view" action: options.action || "view"
}, queue = new RSVP.Queue(); }, queue = new RSVP.Queue();
if (portal_type === "Input") { if (portal_type === "input") {
forward_kw.id = options.id; forward_kw.id = options.id;
} else if (portal_type === "Output") { } else if (portal_type === "output") {
forward_kw.id = options.id; forward_kw.id = options.id;
queue.push(function() { queue.push(function() {
return gadget.getDeclaredGadget("jio"); return gadget.getDeclaredGadget("jio");
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
var title; var title;
if (portal_type === "Pre Input Module") { if (portal_type === "Pre Input Module") {
title = "Documents"; title = "Documents";
} else if (portal_type === "Input") { } else if (portal_type === "input") {
title = gadget.getDeclaredGadget("jio").push(function(jio_gadget) { title = gadget.getDeclaredGadget("jio").push(function(jio_gadget) {
return jio_gadget.get({ return jio_gadget.get({
_id: options.id _id: options.id
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
}).push(function(jio_doc) { }).push(function(jio_doc) {
return jio_doc.data.title + " (" + jio_doc.data.modified + ")"; return jio_doc.data.title + " (" + jio_doc.data.modified + ")";
}); });
} else if (portal_type === "Output") { } else if (portal_type === "output") {
title = gadget.getDeclaredGadget("jio").push(function(jio_gadget) { title = gadget.getDeclaredGadget("jio").push(function(jio_gadget) {
return jio_gadget.getAttachment({ return jio_gadget.getAttachment({
_id: options.id, _id: options.id,
...@@ -223,9 +223,9 @@ ...@@ -223,9 +223,9 @@
// Hey, I want to display some jIO document // Hey, I want to display some jIO document
// We'll display the result using the first enabled action // We'll display the result using the first enabled action
var action = "view", action_info, action_id; var action = "view", action_info, action_id;
for (action_id in portal_types.Output) { for (action_id in portal_types.output) {
if (portal_types.Output.hasOwnProperty(action_id)) { if (portal_types.output.hasOwnProperty(action_id)) {
action_info = portal_types.Output[action_id]; action_info = portal_types.output[action_id];
if (action_info.condition === undefined || action_info.condition(this)) { if (action_info.condition === undefined || action_info.condition(this)) {
action = action_id; action = action_id;
break; break;
...@@ -331,15 +331,15 @@ ...@@ -331,15 +331,15 @@
$('.pre_input_link').hide(); $('.pre_input_link').hide();
}*/ }*/
if (gadget.props.configSet === true) { if (gadget.props.configSet === true) {
portal_types.Input = gadget.props.configuration_dict.application_configuration.Input; portal_types.input = gadget.props.configuration_dict.application_configuration.input;
portal_types.Output = gadget.props.configuration_dict.application_configuration.Output; portal_types.output = gadget.props.configuration_dict.application_configuration.output;
} }
// Detect what is the kind of document displayed // Detect what is the kind of document displayed
if (options.id !== undefined) { if (options.id !== undefined) {
if (options.result === undefined) { if (options.result === undefined) {
portal_type = "Input"; portal_type = "input";
} else { } else {
portal_type = "Output"; portal_type = "output";
back_kw.action = "view_result"; back_kw.action = "view_result";
back_kw.id = options.id; back_kw.id = options.id;
} }
...@@ -363,8 +363,8 @@ ...@@ -363,8 +363,8 @@
if (result) { if (result) {
data = JSON.parse(result); data = JSON.parse(result);
gadget.props.data = data; gadget.props.data = data;
portal_types.Input = data.application_configuration.input; portal_types.input = data.application_configuration.input;
portal_types.Output = data.application_configuration.output; portal_types.output = data.application_configuration.output;
} }
// Get the action information // Get the action information
return gadget.declareGadget( return gadget.declareGadget(
......
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