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

Graph Editor: update to latest gadget and add support for DC Workflow edition

parent 4efafee2
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ActionInformation" module="Products.CMFCore.ActionInformation"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view_graph_editor</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>3.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Graph Editor</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/BusinessProcess_viewGraphEditor</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -63,9 +63,7 @@ visited_business_process_set = set() # prevent infinite recurisions\n
\n
def getBusinessProcessGraph(business_process):\n
graph = dict(node=dict(start=dict(_class=\'erp5.business_process.start\',\n
name=str(translateString(\'Start\'))),\n
end=dict(_class=\'erp5.business_process.end\', # XXX is there an implicit end state ???\n
name=str(translateString(\'End\'))),),\n
name=str(translateString(\'Start\'))),),\n
edge=dict())\n
\n
\n
......@@ -90,7 +88,7 @@ def getBusinessProcessGraph(business_process):\n
successor = \'end\'\n
if link.getSuccessor():\n
successor = link.getSuccessorReference() or link.getSuccessorId()\n
\n
\n
graph[\'edge\'][link.getRelativeUrl()] = dict(\n
_class=\'erp5.business_process.business_link\',\n
source=predecessor,\n
......@@ -98,7 +96,7 @@ def getBusinessProcessGraph(business_process):\n
name=link.getTranslatedTitle(),\n
business_link_url=link.getRelativeUrl(),\n
trade_phase=link.getTradePhase() or \'\')\n
\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
......@@ -114,9 +112,9 @@ class_definition = {\n
\'type\': \'object\',\n
\'description\': \'An ERP5 Business Link\',\n
\'properties\': {\n
\'name\': {\'type\': \'string\'}, \n
\'trade_phase\': {\'type\': \'string\', \'enum\': [\'\'] + [\n
trade_phase.getId() for trade_phase in portal.portal_categories.trade_phase.getCategoryChildValueList(local_sort_on=(\'int_index\', \'title\'))]}, \n
\'name\': {\'type\': \'string\', \'name\': translateString(\'Name\')},\n
\'trade_phase\': {\'type\': \'string\', \'name\': translateString(\'Trade Phase\'), \'enum\': [\'\'] + [\n
trade_phase.getId() for trade_phase in portal.portal_categories.trade_phase.getCategoryChildValueList(local_sort_on=(\'int_index\', \'title\'))]}, \n
}\n
}\n
}\n
......
<?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="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_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>
......@@ -83,7 +83,7 @@
<key> <string>center</string> </key>
<value>
<list>
<string>my_description</string>
<string>my_jsplumb_graph</string>
</list>
</value>
</item>
......@@ -102,8 +102,6 @@
<value>
<list>
<string>my_title</string>
<string>my_version</string>
<string>my_specialise_title_list</string>
</list>
</value>
</item>
......@@ -112,8 +110,6 @@
<value>
<list>
<string>my_reference</string>
<string>my_jsplumb_graph</string>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
......@@ -122,7 +118,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessProcess_view</string> </value>
<value> <string>BusinessProcess_viewGraphEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......@@ -146,7 +142,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Business Process Model</string> </value>
<value> <string>Graph Editor</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
......
......@@ -12,6 +12,7 @@
<list>
<string>columns</string>
<string>editable_columns</string>
<string>enabled</string>
<string>portal_types</string>
<string>selection_name</string>
<string>sort</string>
......@@ -122,6 +123,10 @@
</list>
</value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_listbox</string> </value>
......
......@@ -104,6 +104,10 @@
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
......@@ -175,6 +179,10 @@
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>data_url</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
......@@ -205,7 +213,7 @@
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
<value> <string>style="width: 100%; height: 100%"</string> </value>
</item>
<item>
<key> <string>gadget_url</string> </key>
......@@ -254,7 +262,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.getPortalObject().restrictedTraverse(\'jsplumb/index.html\').absolute_url()</string> </value>
<value> <string>python: context.getPortalObject().restrictedTraverse(\'dream_graph_editor/jsplumb/index.html\').absolute_url()</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>from Products.ERP5Type.Message import translateString\n
from Products.Formulator.Errors import FormValidationError\n
request = container.REQUEST\n
\n
form = getattr(context, form_id)\n
edit_order = form.edit_order\n
try:\n
# Validate\n
form.validate_all_to_request(request, key_prefix=\'my_\')\n
except FormValidationError, validation_errors:\n
# Pack errors into the request\n
result = {}\n
result[\'field_errors\'] = {}\n
field_errors = form.ErrorFields(validation_errors)\n
for key, value in field_errors.items():\n
result[\'field_errors\'][key] = value.error_text\n
return form()\n
\n
(kw, encapsulated_editor_list), action = context.Base_edit(form_id, silent_mode=1)\n
assert not encapsulated_editor_list\n
\n
context.setProperties(\n
title=kw[\'title\'],\n
description=kw[\'description\'],\n
manager_bypass=context.manager_bypass)\n
marker = []\n
if context.getProperty("jsplumb_graph", marker) is marker:\n
context.manage_setProperty("jsplumb_graph", kw["jsplumb_graph"])\n
else:\n
context.manage_changeProperties({\'jsplumb_graph\': kw["jsplumb_graph"]})\n
\n
# XXX handle workflow edition here.\n
\n
return context.Base_redirect(form_id, \n
keep_items={\'portal_status_message\': translateString("Data updated.")})\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>form_id, *args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DCWorkflow_edit</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>from Products.ERP5Type.Message import translateString\n
import json\n
portal = context.getPortalObject()\n
\n
# if a graph has been saved, we use this info for node coordinates.\n
position_graph = context.getProperty(\'jsplumb_graph\')\n
if position_graph:\n
position_graph = json.loads(position_graph)[\'graph\']\n
\n
# TODO:\n
# select after script in edge properties\n
# checked box for validation ? or at least select before script\n
\n
def getDCWorkflowGraph(dc_workflow):\n
graph = dict(node=dict(), edge=dict())\n
for state in dc_workflow.states.objectValues():\n
is_initial_state = state.getId() == dc_workflow.states.initial_state\n
graph[\'node\'][state.getId()] = dict(\n
_class=\'dc_workflow.state\',\n
name=state.title_or_id(),\n
is_initial_state="Yes" if is_initial_state else "No")\n
if is_initial_state:\n
graph[\'node\'][state.getId()][\'css\'] = { "color": "red" } # TODO: use different CSS for initial state\n
\n
for transition in state.transitions:\n
if transition in dc_workflow.transitions:\n
transition = dc_workflow.transitions[transition]\n
if transition.new_state_id:\n
graph[\'edge\']["%s_%s" % (state.getId(), transition.id)] = (\n
dict(_class=\'dc_workflow.transition\',\n
source=state.getId(),\n
destination=transition.new_state_id,\n
name=transition.actbox_name or transition.title_or_id(),\n
description=transition.description,\n
actbox_url=transition.actbox_url,\n
transition_id=transition.getId() # used for edition.\n
))\n
\n
if position_graph:\n
for state_id in graph[\'node\'].keys():\n
if state_id in position_graph[\'node\']:\n
graph[\'node\'][state_id][\'coordinate\'] = position_graph[\'node\'][state_id][\'coordinate\']\n
return graph\n
\n
\n
class_definition = {\n
\'dc_workflow.transition\': {\n
\'_class\': \'edge\',\n
\'type\': \'object\',\n
\'description\': \'A DCWorkflow Transition\',\n
\'properties\': {\n
\'name\': {\n
\'type\': \'string\',\n
\'name\': \'Name\',\n
\'description\': \'Name of this transition, will be displayed in the document actions\',\n
},\n
\'description\': {\n
\'type\': \'string\',\n
\'name\': \'Description\',\n
},\n
\'actbox_url\': {\n
\'type\': \'string\',\n
\'name\': \'URL of the action, variables will be substitued. XXX TODO: higher level ! just configure "script name" \'\n
},\n
}\n
},\n
\'dc_workflow.state\': {\n
\'_class\': \'node\',\n
\'type\': \'object\',\n
\'description\': \'A DCWorkflow State\',\n
\'properties\': {\n
\'name\': {\n
\'type\': \'string\',\n
\'name\': \'Name\',\n
\'description\': \'The name of the state, will be displayed in document view\',\n
},\n
\'id\': {\n
\'type\': \'string\',\n
\'name\': \'Id\',\n
\'description\': \'Id of the state, will be used for catalog searches\',\n
},\n
\'is_initial_state\': {\n
\'type\': \'string\',\n
\'enum\': [\'Yes\', \'No\'],\n
\'name\': \'Is initial State\',\n
\'description\': \'Set to Yes if this state is the initial state for newly created documents\',\n
},\n
}\n
}\n
}\n
\n
return json.dumps(dict(graph=getDCWorkflowGraph(context), class_definition=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>DCWorkflow_getGraph</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>from Products.PythonScripts.standard import Object\n
object_list = []\n
\n
def add(script):\n
# we use a function for lambda\'s closure\n
object_list.append(\n
Object(uid=\'new_\',\n
getUid=lambda: \'new_\',\n
id=script.id,\n
title_or_id=script.title_or_id,\n
absolute_url=lambda: "%s/manage_main" % script.absolute_url(),\n
getListItemUrl=lambda *args: "%s/manage_main" % script.absolute_url()))\n
\n
for script in context.scripts.objectValues(\'Script (Python)\'):\n
add(script)\n
return object_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DCWorkflow_getScriptList</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>DCWorkflow_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></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_jsplumb_graph</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_description</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DCWorkflow_viewGraphEditor</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string></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>DC Workflow</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>
......@@ -14,7 +14,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_version</string> </value>
<value> <string>my_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -71,7 +71,7 @@
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_version</string> </value>
<value> <string>my_view_mode_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
......
<?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>ts17681758.24</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>index.css</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/css</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>@media (min-width:110em){.jqm-navmenu-panel.ui-panel-closed{visibility:visible!important;width:17em;-webkit-transition:none!important;-moz-transition:none!important;transition:none!important;-webkit-transform:none!important;-moz-transform:none!important;transform:none!important;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;height:100%;position:absolute;display:block}.ui-panel-page-content-open{width:auto}.ui-panel-page-content-open.ui-panel-page-content-position-left{margin-right:17em}.ui-panel-dismiss,.menu_link{display:none!important}.gadget_container,header,nav{margin-left:17em}.close-entry{display:none!important}.gadget_container{padding:1em}}[data-gadget-scope=productionline_toolbox]{position:relative;width:19.5%;float:left}[data-gadget-scope=productionline_graph]{position:relative;width:79.5%;float:right}form.save_form{display:none}</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>865</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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