Commit 7a0f2dc7 authored by Jérome Perrin's avatar Jérome Perrin

graph editor for business process

parent 3d7289b9
<workflow_chain>
<chain>
<type>Business Process</type>
<workflow>business_process_graph_editor_interaction_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5_graph_editor</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>import json\n
portal = context.getPortalObject()\n
\n
import json\n
position_graph = context.getProperty(\'jsplumb_graph\')\n
\n
if position_graph:\n
context.log(position_graph)\n
\n
position_graph = json.loads(position_graph)\n
\n
\n
visited_business_process_set = set() # prevent infinite recurisions\n
\n
def getBusinessProcessGraph(business_process):\n
graph = dict(node=dict(), edge=dict())\n
if business_process in visited_business_process_set:\n
return graph\n
visited_business_process_set.add(business_process)\n
for link in business_process.contentValues(portal_type=\'Business Link\'):\n
for trade_state in (link.getPredecessorValue(), link.getSuccessorValue()):\n
if trade_state is not None:\n
graph[\'node\'][trade_state.getReference() or trade_state.getId()] = dict(\n
_class=\'erp5.business_process.trade_state\',\n
name=trade_state.getTranslatedTitle())\n
if link.getPredecessor() and link.getSuccessor(): # XXX no start ??\n
graph[\'edge\'][link.getRelativeUrl()] = dict(\n
_class=\'erp5.business_process.business_link\',\n
source=link.getPredecessorReference() or link.getPredecessorId(),\n
destination=link.getSuccessorReference() or link.getSuccessorId(),\n
name=link.getTranslatedTitle())\n
\n
for specialise in [context] + business_process.getSpecialiseValueList(portal_type=\'Business Process\'):\n
specialise_graph = getBusinessProcessGraph(specialise)\n
for node_id, node_data in specialise_graph[\'node\'].items():\n
graph[\'node\'].setdefault(node_id, node_data)\n
for node_id, node_data in specialise_graph[\'edge\'].items():\n
graph[\'edge\'].setdefault(node_id, node_data)\n
return graph\n
\n
return json.dumps(dict(graph=getBusinessProcessGraph(context), class_definition=[]), indent=2)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessProcess_getGraph</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string>application/x-www-form-urlencoded</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_description</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_int_index</string>
<string>listbox_order_builder_title_list</string>
<string>listbox_delivery_builder_title_list</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_version</string>
<string>my_specialise_title_list</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_reference</string>
<string>my_jsplumb_graph</string>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessProcess_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>BusinessProcessModel_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Business Process Model</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>columns</string>
<string>editable_columns</string>
<string>portal_types</string>
<string>selection_name</string>
<string>sort</string>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>columns</string> </key>
<value>
<list>
<tuple>
<string>int_index</string>
<string>Index</string>
</tuple>
<tuple>
<string>title</string>
<string>Title</string>
</tuple>
<tuple>
<string>predecessor_title</string>
<string>Predecessor</string>
</tuple>
<tuple>
<string>successor_title</string>
<string>Successor</string>
</tuple>
<tuple>
<string>order_builder_title_list</string>
<string>Order Builders</string>
</tuple>
<tuple>
<string>delivery_builder_title_list</string>
<string>Delivery Builders</string>
</tuple>
<tuple>
<string>trade_phase_title</string>
<string>Trade Phase</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>int_index</string>
<string>int_index</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>portal_types</string> </key>
<value>
<list>
<tuple>
<string>Business Link</string>
<string>Business Link</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string>business_process_model_view_selection</string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value>
<list>
<tuple>
<string>int_index</string>
<string>ascending</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Business Links</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_delivery_builder_title_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_delivery_builder_title_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_int_index</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_int_index</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_order_builder_title_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox_order_builder_title_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_description</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_jsplumb_graph</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string>http://localhost:55432/erp5/portal_skins/custom/jsplumb/index.html</string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Graph</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>context/BusinessProcess_getGraph</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_specialise_title_list</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_business_process_specialise_title_list</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_validation_state_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_translated_validation_state_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_version</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_version</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>dream</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681758.84</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>InputModule_viewAddDocumentDialog.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Create Document</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="mixin_promise.js" type="text/javascript"></script>\n
<script src="InputModule_viewAddDocumentDialog.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<form class="new_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline ui-icon-plus ui-btn-icon-right">Empty</button>\n
</form>\n
<form class="import_form">\n
<input id="dream_import" type="file" required=""\n
name="dream_import">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline ui-icon-plus ui-btn-icon-right">Import</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>968</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681758.95</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>InputModule_viewAddDocumentDialog.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/*global rJS, RSVP, promiseEventListener, promiseReadAsText,\n
initGadgetMixin */\n
(function(window, rJS, RSVP, promiseEventListener, promiseReadAsText, initGadgetMixin) {\n
"use strict";\n
function createDocument(gadget, name) {\n
var now = new Date();\n
// Create jIO document\n
return gadget.aq_post({\n
title: name,\n
type: "Dream",\n
format: "application/json",\n
modified: now.toUTCString(),\n
date: now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate()\n
});\n
}\n
function waitForImport(gadget) {\n
var json_data, name;\n
return new RSVP.Queue().push(function() {\n
return promiseEventListener(gadget.props.element.getElementsByClassName("import_form")[0], "submit", false);\n
}).push(function(evt) {\n
// Prevent double click\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
var file = evt.target.dream_import.files[0];\n
name = file.name;\n
return promiseReadAsText(file);\n
}).push(function(json) {\n
json_data = json;\n
return createDocument(gadget, name);\n
}).push(function(jio_document) {\n
// Add JSON as attachment\n
return gadget.aq_putAttachment({\n
_id: jio_document.id,\n
_attachment: "body.json",\n
_data: json_data,\n
_mimetype: "application/json"\n
});\n
});\n
}\n
function waitForNew(gadget) {\n
var json_data = {\n
nodes: {},\n
edges: {},\n
preference: {},\n
general: {},\n
wip_part_spreadsheet: [ [ "Order ID", "Due Date", "Priority", "Project Manager", "Part", "Part Type", "Sequence", "Processing Times", "Prerequisites Parts" ] ],\n
shift_spreadsheet: [ [ "Day", "Machines", // XXX more generic name ?\n
"Start", "End" ] ],\n
capacity_by_project_spreadsheet: [ [ "Project Name", "Sequence", "Capacity Requirements" ] ],\n
capacity_by_station_spreadsheet: [ [ "Day", "CS1" ] ],\n
dp_capacity_spreadsheet: [ [] ],\n
dp_route_spreadsheet: [ [] ]\n
}, name = "Untitled";\n
return new RSVP.Queue().push(function() {\n
return promiseEventListener(gadget.props.element.getElementsByClassName("new_form")[0], "submit", false);\n
}).push(function(evt) {\n
// Prevent double click\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
return createDocument(gadget, name);\n
}).push(function(jio_document) {\n
// Add JSON as attachment\n
return gadget.aq_putAttachment({\n
_id: jio_document.id,\n
_attachment: "body.json",\n
_data: JSON.stringify(json_data),\n
_mimetype: "application/json"\n
});\n
});\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_post", "jio_post").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("whoWantsToDisplayThisDocument", "whoWantsToDisplayThisDocument").declareMethod("startService", function() {\n
var gadget = this;\n
return new RSVP.Queue().push(function() {\n
return RSVP.any([ waitForImport(gadget), waitForNew(gadget) ]);\n
}).push(function(result) {\n
return gadget.whoWantsToDisplayThisDocument(result.id);\n
}).push(function(url) {\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
});\n
})(window, rJS, RSVP, promiseEventListener, promiseReadAsText, initGadgetMixin);</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3780</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.06</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>InputModule_viewInputList.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Document List</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/handlebars.min.js" type="text/javascript"></script>\n
\n
<script id="table-template" type="text/x-handlebars-template">\n
<ul data-role="listview" data-inset="true" class="document-listview">\n
{{#documentlist}}\n
<li><a href="{{link}}">{{title}}</a></li>\n
{{/documentlist}}\n
</ul>\n
</script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="InputModule_viewInputList.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<section class="document_list"></section>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>890</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.17</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>InputModule_viewInputList.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, Handlebars, initGadgetMixin */\n
/*jslint nomen: true */\n
(function(window, rJS, RSVP, Handlebars, initGadgetMixin) {\n
"use strict";\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window), source = gadget_klass.__template_element.getElementById("table-template").innerHTML, table_template = Handlebars.compile(source);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_allDocs", "jio_allDocs").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("whoWantsToDisplayThisDocument", "whoWantsToDisplayThisDocument").declareMethod("render", function() {\n
var gadget = this;\n
return gadget.aq_allDocs({\n
select_list: [ "title", "modified" ]\n
}).push(function(document_list) {\n
var result_list = [], doc, i;\n
for (i = 0; i < document_list.data.total_rows; i += 1) {\n
doc = document_list.data.rows[i];\n
result_list.push(RSVP.all([ gadget.whoWantsToDisplayThisDocument(doc.id), doc.value.title, doc.value.modified ]));\n
}\n
return RSVP.all(result_list);\n
}).push(function(document_list) {\n
// Create new doc if nothing exists\n
if (document_list.length === 0) {\n
return gadget.whoWantsToDisplayThisDocument(undefined, "view_fast_input").push(function(url) {\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
}\n
var i, parameter_list = [], doc;\n
for (i = 0; i < document_list.length; i += 1) {\n
doc = document_list[i];\n
parameter_list[i] = {\n
link: doc[0],\n
title: doc[1] + " (" + doc[2] + ")",\n
date: new Date(doc[2])\n
};\n
}\n
parameter_list.sort(function(a, b) {\n
return b.date - a.date;\n
});\n
// gadget.props.element.querySelector(\'a\').href = document_list[0];\n
gadget.props.element.querySelector(".document_list").innerHTML = table_template({\n
documentlist: parameter_list\n
});\n
});\n
});\n
})(window, rJS, RSVP, Handlebars, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2461</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.28</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewAvailableCapacitySpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Required Capacity Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewAvailableCapacitySpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>932</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.39</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewAvailableCapacitySpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.capacity_by_station_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).capacity_by_station_spreadsheet), {\n
minSpareCols: 1,\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3085</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.51</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningCapacitySpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Required Capacity Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewDemandPlanningCapacitySpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>937</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.6</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningCapacitySpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.dp_capacity_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).dp_capacity_spreadsheet), {\n
minSpareCols: 1,\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3069</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.7</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningRouteSpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Required Capacity Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewDemandPlanningRouteSpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>934</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681759.97</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningRouteSpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.dp_route_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).dp_route_spreadsheet), {\n
minSpareCols: 1,\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3063</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.56</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningapacitySpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Required Capacity Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewAvailableCapacitySpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>932</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.68</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDemandPlanningapacitySpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.capacity_by_station_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).capacity_by_station_spreadsheet), {\n
minSpareCols: 1,\n
minSpareRows: 1\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2729</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.13</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDocumentManagement.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Manage document</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="mixin_promise.js" type="text/javascript"></script>\n
<script src="Input_viewDocumentManagement.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<a class="export_link ui-btn ui-btn-inline ui-icon-action ui-btn-icon-right">Export</a>\n
<form class="knowledge_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-refresh ui-btn-icon-right">Run Knowledge Extraction Tool</button>\n
</form>\n
<form class="delete_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline ui-icon-delete ui-btn-icon-right">Delete</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1150</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.25</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewDocumentManagement.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, jQuery,\n
promiseEventListener, initGadgetMixin */\n
(function(window, rJS, RSVP, $, promiseEventListener, initGadgetMixin) {\n
"use strict";\n
function datatouri(data, mime_type) {\n
var result = "data:";\n
if (mime_type !== undefined) {\n
result += mime_type;\n
}\n
return result + ";base64," + window.btoa(data);\n
}\n
function disableAllButtons(gadget) {\n
// Prevent double click\n
var i, button_list = gadget.props.element.getElementsByClassName("ui-btn");\n
for (i = 0; i < button_list.length; i += 1) {\n
button_list[i].disabled = true;\n
}\n
}\n
function waitForKnowledgeExtraction(gadget) {\n
return new RSVP.Queue().push(function() {\n
return promiseEventListener(gadget.props.element.getElementsByClassName("knowledge_form")[0], "submit", false);\n
}).push(function() {\n
disableAllButtons(gadget);\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body_json) {\n
$.mobile.loading("show");\n
// XXX Hardcoded relative URL\n
return gadget.aq_ajax({\n
url: "../../runKnowledgeExtraction",\n
type: "POST",\n
data: body_json,\n
headers: {\n
"Content-Type": "application/json"\n
}\n
});\n
}).push(undefined, function(error) {\n
// Always drop the loader\n
$.mobile.loading("hide");\n
throw error;\n
}).push(function(evt) {\n
$.mobile.loading("hide");\n
var json_data = JSON.parse(evt.target.responseText);\n
if (json_data.success !== true) {\n
throw new Error(json_data.error);\n
}\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(json_data.data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key);\n
}).push(function(url) {\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
}\n
function waitForDeletion(gadget) {\n
return new RSVP.Queue().push(function() {\n
return promiseEventListener(gadget.props.element.getElementsByClassName("delete_form")[0], "submit", false);\n
}).push(function() {\n
disableAllButtons(gadget);\n
// Delete jIO document\n
return gadget.aq_remove({\n
_id: gadget.props.jio_key\n
});\n
}).push(function() {\n
return gadget.whoWantsToDisplayHome();\n
}).push(function(url) {\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_remove", "jio_remove").declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareAcquiredMethod("aq_get", "jio_get").declareAcquiredMethod("aq_ajax", "jio_ajax").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("whoWantsToDisplayThisDocument", "whoWantsToDisplayThisDocument").declareAcquiredMethod("whoWantsToDisplayHome", "whoWantsToDisplayHome").declareMethod("render", function(options) {\n
this.props.jio_key = options.id;\n
var gadget = this;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_get({\n
_id: options.id\n
}), gadget.aq_getAttachment({\n
_id: options.id,\n
_attachment: "body.json"\n
}) ]);\n
}).push(function(result_list) {\n
var export_link = gadget.props.element.querySelector(".export_link");\n
export_link.download = result_list[0].data.title;\n
export_link.href = datatouri(result_list[1], "application/json");\n
});\n
}).declareMethod("startService", function() {\n
return RSVP.all([ waitForDeletion(this), waitForKnowledgeExtraction(this) ]);\n
});\n
})(window, rJS, RSVP, jQuery, promiseEventListener, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4364</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.35</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewProductionLine.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit table</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="mixin_promise.js" type="text/javascript"></script>\n
\n
<script src="Input_viewProductionLine.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../toolbox/index.html"\n
data-gadget-scope="productionline_toolbox"></div>\n
<div data-gadget-url="../jsplumb/index.html"\n
data-gadget-scope="productionline_graph"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>871</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681758.58</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewProductionLine.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/*global window, rJS, RSVP, loopEventListener*/\n
(function(window, rJS, RSVP, loopEventListener) {\n
"use strict";\n
var gadget_klass = rJS(window);\n
// TODO: save on parent gadget\n
function saveGraph(evt) {\n
var gadget = this;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("productionline_graph");\n
}).push(function(graph_gadget) {\n
return graph_gadget.getContent();\n
}).push(function(body) {\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(JSON.parse(body), null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveGraph.bind(gadget));\n
}\n
gadget_klass.ready(function(g) {\n
g.props = {};\n
}).ready(function(g) {\n
return g.getElement().push(function(element) {\n
g.props.element = element;\n
});\n
}).declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").allowPublicAcquisition("notifyDataChanged", function() {\n
// We are notified by an included gadget that the data has changed.\n
// Here we save automatically. We could mark a dirty flag to warn the\n
// user if she leaves the page without saving.\n
// Since we are notified quite often and saving is resource expensive, we\n
// use this trick to prevent saving too many times\n
if (this.timeout) {\n
window.clearTimeout(this.timeout);\n
}\n
this.timeout = window.setTimeout(saveGraph.bind(this), 100);\n
}).declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this, data;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
/*jslint nomen: true*/\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("productionline_graph") ]);\n
}).push(function(result_list) {\n
data = result_list[0];\n
return result_list[1].render(data);\n
}).push(function() {\n
return gadget.getDeclaredGadget("productionline_toolbox");\n
}).push(function(toolbox_gadget) {\n
toolbox_gadget.render(data);\n
});\n
}).declareMethod("startService", function() {\n
var g = this, graph;\n
return g.getDeclaredGadget("productionline_graph").push(function(graph_gadget) {\n
graph = graph_gadget;\n
return g.getDeclaredGadget("productionline_toolbox");\n
}).push(function(toolbox) {\n
return RSVP.all([ graph.startService(), toolbox.startService(), waitForSave(g) ]);\n
});\n
});\n
})(window, rJS, RSVP, loopEventListener);</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3328</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.45</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewRequiredCapacitySpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Available Capacity Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewRequiredCapacitySpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>932</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.86</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewRequiredCapacitySpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.capacity_by_project_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).capacity_by_project_spreadsheet), {\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3052</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681760.97</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewResultList.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Result List</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/handlebars.min.js" type="text/javascript"></script>\n
\n
<script id="table-template" type="text/x-handlebars-template">\n
<ul data-role="listview" data-inset="true" class="document-listview">\n
{{#each documentlist}}\n
<li><a href="{{link}}">{{title}}</a></li>\n
{{else}}\n
<p>No result yet.</p>\n
{{/each}}\n
</ul>\n
</script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewResultList.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<section class="document_list"></section>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>929</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.06</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewResultList.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, Handlebars, initGadgetMixin */\n
/*jslint nomen: true */\n
(function(window, rJS, RSVP, Handlebars, initGadgetMixin) {\n
"use strict";\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window), source = gadget_klass.__template_element.getElementById("table-template").innerHTML, table_template = Handlebars.compile(source);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("whoWantsToDisplayThisResult", "whoWantsToDisplayThisResult").declareMethod("render", function(options) {\n
var gadget = this;\n
this.props.jio_key = options.id;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json"\n
}).push(undefined, function(error) {\n
if (error.status === 404) {\n
// Simulation not yet generated\n
return JSON.stringify([]);\n
}\n
throw error;\n
}).push(function(sim_json) {\n
var document_list = JSON.parse(sim_json), result_list = [], i;\n
for (i = 0; i < document_list.length; i += 1) {\n
result_list.push(RSVP.all([ gadget.whoWantsToDisplayThisResult(gadget.props.jio_key, i), document_list[i].score, document_list[i].key ]));\n
}\n
return RSVP.all(result_list);\n
}).push(function(document_list) {\n
var i, parameter_list = [], doc;\n
for (i = 0; i < document_list.length; i += 1) {\n
doc = document_list[i];\n
parameter_list[i] = {\n
link: doc[0],\n
title: doc[1] + " " + doc[2]\n
};\n
}\n
gadget.props.element.querySelector(".document_list").innerHTML = table_template({\n
documentlist: parameter_list\n
});\n
});\n
});\n
})(window, rJS, RSVP, Handlebars, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2148</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.17</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewShiftSpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Shift Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewShiftSpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>908</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.28</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewShiftSpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.shift_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).shift_spreadsheet), {\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3024</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.43</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewSimulation.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Run Simulation</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/handlebars.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script id="label-template" type="text/x-handlebars-template">\n
<label>{{label}}</label>\n
</script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="mixin_promise.js" type="text/javascript"></script>\n
<script src="Input_viewSimulation.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<form class="run_form">\n
<fieldset>\n
<div data-gadget-url="../fieldset/index.html"\n
data-gadget-scope="fieldset"></div>\n
</fieldset>\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-refresh ui-btn-icon-right">Run Simulation</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1205</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681758.69</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewSimulation.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, jQuery, promiseEventListener, initGadgetMixin */\n
/*jslint nomen: true */\n
(function(window, rJS, RSVP, $, promiseEventListener, initGadgetMixin) {\n
"use strict";\n
function saveForm(gadget) {\n
var general;\n
return gadget.getDeclaredGadget("fieldset").push(function(fieldset_gadget) {\n
return fieldset_gadget.getContent();\n
}).push(function(content) {\n
general = content;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.general = general;\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
});\n
}\n
function runSimulation(gadget) {\n
return new RSVP.Queue().push(function() {\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body_json) {\n
// XXX Hardcoded relative URL\n
return gadget.aq_ajax({\n
url: "../../runSimulation",\n
type: "POST",\n
data: body_json,\n
headers: {\n
"Content-Type": "application/json"\n
}\n
});\n
}).push(function(evt) {\n
var json_data = JSON.parse(evt.target.responseText);\n
if (json_data.success !== true) {\n
throw new Error(json_data.error);\n
}\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json",\n
_data: JSON.stringify(json_data.data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
return gadget.whoWantsToDisplayThisDocument(gadget.props.jio_key, "view_result");\n
}).push(function(url) {\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
}\n
function waitForRunSimulation(gadget) {\n
var submit_evt;\n
return new RSVP.Queue().push(function() {\n
return promiseEventListener(gadget.props.element.getElementsByClassName("run_form")[0], "submit", false);\n
}).push(function(evt) {\n
submit_evt = evt;\n
// Prevent double click\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
$.mobile.loading("show");\n
return saveForm(gadget);\n
}).push(function() {\n
return runSimulation(gadget);\n
}).push(undefined, function(error) {\n
// Always drop the loader\n
$.mobile.loading("hide");\n
throw error;\n
}).push(function() {\n
submit_evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
$.mobile.loading("hide");\n
});\n
}\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareAcquiredMethod("aq_ajax", "jio_ajax").declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash").declareAcquiredMethod("whoWantsToDisplayThisDocument", "whoWantsToDisplayThisDocument").declareMethod("render", function(options) {\n
var gadget = this, data;\n
this.props.jio_key = options.id;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
}).push(function(json) {\n
var application_configuration = {};\n
data = JSON.parse(json);\n
application_configuration = data.application_configuration.general || {};\n
return gadget.getDeclaredGadget("fieldset").push(function(fieldset_gadget) {\n
return fieldset_gadget.render({\n
value: data.general,\n
property_definition: application_configuration\n
});\n
});\n
});\n
}).declareMethod("startService", function() {\n
return waitForRunSimulation(this);\n
});\n
})(window, rJS, RSVP, jQuery, promiseEventListener, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4723</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.53</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewTable.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit table</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Input_viewTable.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>583</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.63</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewTable.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/*global console, rJS, RSVP, initGadgetMixin */\n
(function(window, rJS, RSVP, initGadgetMixin) {\n
"use strict";\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).wip_part_spreadsheet));\n
});\n
}).declareMethod("startService", function() {\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return tableeditor.startService();\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin);</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1032</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.56</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewWipPartSpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Edit Wip Part Spreadsheet</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquerymobile.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="mixin_promise.js" type="text/javascript"></script>\n
<script src="Input_viewWipPartSpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<div data-gadget-url="../handsontable/index.html"\n
data-gadget-scope="tableeditor"></div>\n
<form class="save_form">\n
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline\n
ui-icon-edit ui-btn-icon-right">Save</button>\n
</form>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>981</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.66</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Input_viewWipPartSpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, RSVP, initGadgetMixin, loopEventListener */\n
(function(window, rJS, RSVP, initGadgetMixin, loopEventListener) {\n
"use strict";\n
function saveSpreadsheet(evt) {\n
var gadget = this, editor_data, editor_gadget;\n
return new RSVP.Queue().push(function() {\n
// Prevent double click\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = true;\n
}\n
return gadget.getDeclaredGadget("tableeditor");\n
}).push(function(tablegadget) {\n
editor_gadget = tablegadget;\n
return editor_gadget.getData();\n
}).push(function(data) {\n
editor_data = data;\n
// Always get a fresh version, to prevent deleting spreadsheet & co\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json"\n
});\n
}).push(function(body) {\n
var data = JSON.parse(body);\n
data.wip_part_spreadsheet = JSON.parse(editor_data);\n
return gadget.aq_putAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "body.json",\n
_data: JSON.stringify(data, null, 2),\n
_mimetype: "application/json"\n
});\n
}).push(function() {\n
if (evt) {\n
evt.target.getElementsByClassName("ui-btn")[0].disabled = false;\n
}\n
});\n
}\n
function waitForSave(gadget) {\n
return loopEventListener(gadget.props.element.getElementsByClassName("save_form")[0], "submit", false, saveSpreadsheet.bind(gadget));\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareAcquiredMethod("aq_putAttachment", "jio_putAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
return new RSVP.Queue().push(function() {\n
return RSVP.all([ gadget.aq_getAttachment({\n
_id: jio_key,\n
_attachment: "body.json"\n
}), gadget.getDeclaredGadget("tableeditor") ]);\n
}).push(function(result_list) {\n
return result_list[1].render(JSON.stringify(JSON.parse(result_list[0]).wip_part_spreadsheet), {\n
minSpareRows: 1,\n
onChange: function() {\n
if (gadget.timeout) {\n
window.clearTimeout(gadget.timeout);\n
}\n
gadget.timeout = window.setTimeout(saveSpreadsheet.bind(gadget), 100);\n
}\n
});\n
});\n
}).declareMethod("startService", function() {\n
var gadget = this;\n
return this.getDeclaredGadget("tableeditor").push(function(tableeditor) {\n
return RSVP.all([ tableeditor.startService(), waitForSave(gadget) ]);\n
});\n
});\n
})(window, rJS, RSVP, initGadgetMixin, loopEventListener);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3030</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.76</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewCapacityUtilisationGraph.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Stations Utilization</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
<script src="../lib/jquery.flot.js"></script>\n
<script src="../lib/jquery.flot.stack.js"></script>\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Output_viewCapacityUtilisationGraph.js" type="text/javascript"></script>\n
</head>\n
<body>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>684</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681761.88</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewCapacityUtilisationGraph.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, jQuery, initGadgetMixin */\n
/*jslint unparam: true */\n
(function(window, rJS, $, initGadgetMixin) {\n
"use strict";\n
function capacity_utilisation_graph_widget(all_data) {\n
var available_capacity_by_station = {}, station_id, series, graph_list = [], options, capacity_usage_by_station = {}, input_data = all_data.input, output_data = all_data.result;\n
// Compute availability by station\n
$.each(input_data.nodes, function(idx, obj) {\n
var available_capacity = [];\n
if (obj.intervalCapacity !== undefined) {\n
$.each(obj.intervalCapacity, function(i, capacity) {\n
available_capacity.push([ i, capacity ]);\n
});\n
available_capacity_by_station[obj.id] = available_capacity;\n
}\n
});\n
// Compute used capacity by station\n
$.each(output_data.elementList.sort(function(a, b) {\n
return a.id < b.id ? -1 : 1;\n
}), function(idx, obj) {\n
if (obj.results !== undefined && obj.results.capacityUsed !== undefined) {\n
var capacity_usage = [];\n
$.each(obj.results.capacityUsed, function(i, step) {\n
var period = 0, usage = 0;\n
$.each(step, function(k, v) {\n
if (k === "period") {\n
period = v;\n
}\n
});\n
$.each(step, function(k, v) {\n
if (k !== "utilization" && k !== "period") {\n
usage += v;\n
}\n
});\n
capacity_usage.push([ period, usage ]);\n
});\n
capacity_usage_by_station[obj.id] = capacity_usage;\n
}\n
});\n
for (station_id in available_capacity_by_station) {\n
if (available_capacity_by_station.hasOwnProperty(station_id)) {\n
series = [ {\n
label: "Capacity",\n
data: available_capacity_by_station[station_id],\n
color: "green"\n
}, {\n
label: "Utilisation",\n
data: capacity_usage_by_station[station_id],\n
color: "red"\n
} ];\n
options = {\n
series: {\n
lines: {\n
show: true,\n
fill: true\n
}\n
}\n
};\n
graph_list.push([ input_data.nodes[station_id].name || station_id, series, options ]);\n
}\n
}\n
return graph_list;\n
}\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
gadget.props.result = options.result;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json"\n
}).push(function(simulation_json) {\n
gadget.props.result_list = capacity_utilisation_graph_widget(JSON.parse(simulation_json)[gadget.props.result]);\n
});\n
}).declareMethod("startService", function() {\n
var element = $(this.props.element), graph;\n
$.each(this.props.result_list, function(idx, result) {\n
graph = $("<div class=\'capacity_graph\' " + "style=\'width: 70%; height: 250px\'></div>");\n
element.append($("<h2>").text(result[0]), graph);\n
$.plot(graph, result[1], result[2]);\n
});\n
});\n
})(window, rJS, jQuery, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3769</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.0</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewDebugJson.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Debug JSON</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Output_viewDebugJson.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<label for="json_input">Input</label>\n
<textarea spellcheck="false" rows="20" name="json_input" class="json_input"></textarea>\n
<label for="json_output">Output</label>\n
<textarea spellcheck="false" rows="20" name="json_output" class="json_output"></textarea>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>757</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.09</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewDebugJson.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/*global rJS, initGadgetMixin */\n
(function(window, rJS, initGadgetMixin) {\n
"use strict";\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {\n
var gadget = this;\n
this.props.jio_key = options.id;\n
this.props.result = options.result;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json"\n
}).push(function(result_json) {\n
var result = JSON.parse(result_json);\n
gadget.props.element.querySelector(".json_input").textContent = JSON.stringify(result[gadget.props.result].input, undefined, " ");\n
gadget.props.element.querySelector(".json_output").textContent = JSON.stringify(result[gadget.props.result].result, undefined, " ");\n
});\n
});\n
})(window, rJS, initGadgetMixin);</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>954</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.21</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewDownloadExcelSpreadsheet.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Download Excel Spreadsheet</title>\n
\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/jquery.js" type="text/javascript"></script>\n
\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Output_viewDownloadExcelSpreadsheet.js" type="text/javascript"></script>\n
</head>\n
<body>\n
<a class="download_link ui-btn ui-btn-inline ui-icon-action ui-btn-icon-right">Download</a>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>682</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.31</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewDownloadExcelSpreadsheet.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>/*global rJS, RSVP, jQuery, initGadgetMixin */\n
/*jslint nomen: true, unparam: true */\n
(function(window, rJS, RSVP, $, initGadgetMixin) {\n
"use strict";\n
var gadget_klass = rJS(window);\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
gadget.props.result = options.result;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json"\n
}).push(function(simulation_json) {\n
var result = JSON.parse(simulation_json)[0].result, download_link = gadget.props.element.querySelector(".download_link");\n
download_link.download = "demandPlannerOutput.xls";\n
download_link.href = "data:application/excel;base64," + result["demandPlannerOutput.xls"];\n
});\n
}).declareMethod("startService", function() {\n
return new RSVP.Queue().push(function() {\n
// Infinite wait, until cancelled\n
return new RSVP.defer().promise;\n
});\n
});\n
})(window, rJS, RSVP, jQuery, initGadgetMixin);</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1223</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.42</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewExitStatistics.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8">\n
<meta name="viewport" content="width=device-width, initial-scale=1">\n
<title>Exit Statistics</title>\n
<script src="../lib/rsvp.min.js" type="text/javascript"></script>\n
<script src="../lib/renderjs.min.js" type="text/javascript"></script>\n
<script src="../lib/handlebars.min.js" type="text/javascript"></script>\n
<script src="mixin_gadget.js" type="text/javascript"></script>\n
<script src="Output_viewExitStatistics.js" type="text/javascript"></script>\n
\n
<script id="interval-through-metric-template" type="text/x-handlebars-template">\n
<tr>\n
<td>Daily Attainment</td>\n
<td>\n
{{#interval_list}}\n
<i class="ui-link ui-btn ui-icon-{{icon}} ui-btn-inline ui-cornel-all ui-btn-icon-right">{{interval}}</i><br/>\n
{{/interval_list}}\n
</td>\n
</tr>\n
<tr>\n
<td>Average Daily Line Attainment</td>\n
<td>{{average}}%<td>\n
</tr>\n
</script>\n
\n
<script id="simple-metric-template" type="text/x-handlebars-template">\n
<tr>\n
<td>{{metric}}</td>\n
<td>{{{value}}}</td>\n
</tr>\n
</script>\n
\n
<script id="metric-object-template" type="text/x-handlebars-template">\n
<table width=\'100%\'>\n
<tbody>\n
<tr>\n
<td>Average</td>\n
<td>{{avg}}</td>\n
</tr>\n
<tr>\n
<td>Lower Bound</td>\n
<td>{{lb}}</td>\n
</tr>\n
<tr>\n
<td>Upper Bound</td>\n
<td>{{ub}}</td>\n
</tr>\n
</tbody>\n
</table>\n
</script>\n
\n
<script id="header-template" type="text/x-handlebars-template">\n
<tr>\n
<th colspan=\'2\'>{{name}}</th>\n
</tr>\n
</script>\n
\n
</head>\n
<body>\n
<table>\n
</table>\n
</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1813</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts17681762.74</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Output_viewExitStatistics.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global rJS, Handlebars,\n
initGadgetMixin */\n
/*jslint nomen: true */\n
(function(window, rJS, Handlebars, initGadgetMixin) {\n
"use strict";\n
/////////////////////////////////////////////////////////////////\n
// Handlebars\n
/////////////////////////////////////////////////////////////////\n
// Precompile the templates while loading the first gadget instance\n
var gadget_klass = rJS(window), header_source = gadget_klass.__template_element.getElementById("header-template").innerHTML, header_template = Handlebars.compile(header_source), metric_object_source = gadget_klass.__template_element.getElementById("metric-object-template").innerHTML, metric_object_template = Handlebars.compile(metric_object_source), metric_simple_source = gadget_klass.__template_element.getElementById("simple-metric-template").innerHTML, metric_simple_template = Handlebars.compile(metric_simple_source), metric_interval_source = gadget_klass.__template_element.getElementById("interval-through-metric-template").innerHTML, metric_interval_template = Handlebars.compile(metric_interval_source);\n
/////////////////////////////////////////////////////////////////\n
// Calculate widget\n
/////////////////////////////////////////////////////////////////\n
function calculate_average(attainment_list) {\n
return (attainment_list.reduce(function(a, b) {\n
return a + b;\n
}) / attainment_list.length * 100).toFixed(2);\n
}\n
function calculate_exit_stat(data) {\n
var output_data = data.result, input_data = data.input, elementList = output_data.elementList, i, j, metric, metric_value, element, interval_value, interval_list, attainment_list, throughputTarget = input_data.general.throughputTarget, result = "";\n
for (i = 0; i < elementList.length; i += 1) {\n
element = elementList[i];\n
if (element.family === "Exit") {\n
result += "<table>";\n
result += header_template({\n
name: element.name || element.id\n
});\n
for (metric in element.results) {\n
if (element.results.hasOwnProperty(metric)) {\n
metric_value = element.results[metric];\n
if (metric === "intervalThroughputList") {\n
interval_list = [];\n
attainment_list = [];\n
for (j = 0; j < metric_value.length; j += 1) {\n
interval_value = metric_value[j];\n
attainment_list.push(interval_value / throughputTarget);\n
if (interval_value > throughputTarget) {\n
interval_list.push({\n
interval: interval_value,\n
icon: "check"\n
});\n
} else {\n
interval_list.push({\n
interval: interval_value,\n
icon: "delete"\n
});\n
}\n
}\n
result += metric_interval_template({\n
interval_list: interval_list,\n
average: calculate_average(attainment_list)\n
});\n
} else {\n
if (typeof metric_value === "object") {\n
if (metric_value.ub === metric_value.lb) {\n
metric_value = metric_value.ub;\n
} else {\n
metric_value.metric = metric;\n
metric_value.avg = metric_value.avg.toFixed(2);\n
metric_value.lb = metric_value.lb.toFixed(2);\n
metric_value.ub = metric_value.ub.toFixed(2);\n
metric_value = metric_object_template(metric_value);\n
}\n
}\n
if (typeof metric_value === "number") {\n
metric_value = metric_value.toFixed(2);\n
}\n
// Rename some metric to something more meaningful\n
if (metric === "lifespan") {\n
metric = "Cycle Time";\n
}\n
if (metric === "takt_time") {\n
metric = "Average Departure Rate";\n
}\n
result += metric_simple_template({\n
metric: metric,\n
value: metric_value\n
});\n
}\n
}\n
}\n
result += "</table>";\n
}\n
}\n
return result;\n
}\n
initGadgetMixin(gadget_klass);\n
gadget_klass.declareAcquiredMethod("aq_getAttachment", "jio_getAttachment").declareMethod("render", function(options) {\n
var jio_key = options.id, gadget = this;\n
gadget.props.jio_key = jio_key;\n
gadget.props.result = options.result;\n
return gadget.aq_getAttachment({\n
_id: gadget.props.jio_key,\n
_attachment: "simulation.json"\n
}).push(function(simulation_json) {\n
var result = calculate_exit_stat(JSON.parse(simulation_json)[gadget.props.result]);\n
gadget.props.element.innerHTML = result;\n
});\n
});\n
})(window, rJS, Handlebars, initGadgetMixin);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5794</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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