updating the static after last changes

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