<?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>"""Add selected product to the cart and continue"""\n
portal = context.getPortalObject()\n
prefered_resource = portal.portal_preferences.getPreferredSoftwareSetupResource()\n
service = portal.restrictedTraverse(prefered_resource)\n
\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
\n
##Get item list\n
item_list = []\n
if uids:\n
  item_list = [item.getObject() for item in portal.portal_catalog(uid=uids, portal_type="Software Release")]\n
\n
if len(item_list) != 1:\n
  return context.Base_redirect(dialog_id,\n
                        keep_items={\'portal_status_message\':context.Base_translateString("Please select one software release.")})\n
\n
item = item_list[0]\n
# XXX Check that release is associate to product\n
\n
computer = portal.portal_catalog.getResultValue(\n
  uid=params[\'computer_uid\'],\n
  portal_type="Computer",\n
)\n
\n
computer.requestSoftwareReleaseInstallation(software_release_url=item.getUrlString())\n
\n
params[\'instance_software_product_uid\'] = None\n
params[\'instance_software_release_uid\'] = None\n
params[\'computer_uid\'] = None\n
\n
web_section = context.getWebSiteValue()\n
return web_section.Base_redirect(keep_items={\'editable_mode\': 0})\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>dialog_id, uids=[], quantity=1, **kw</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>WebSection_triggerSelectedSoftwareReleaseInstallation</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
