<?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>""" \n
  Add resource to current (or to be created shopping cart). \n
"""\n
selection = context.getPortalObject().portal_selections.getSelectionFor(\'vifib_session_id\')\n
if selection is None:\n
  context.getPortalObject().portal_selections.setSelectionParamsFor(\'vifib_session_id\', {})\n
  selection = context.getPortalObject().portal_selections.getSelectionFor(\'vifib_session_id\')\n
return selection\n
\n
from DateTime import DateTime\n
from random import choice\n
import string\n
\n
request = context.REQUEST\n
expire_timeout_days = 90\n
session_id = request.get(\'vifib_session_id\', None)\n
portal_sessions = context.portal_sessions\n
\n
if session_id is None:\n
  raise NotImplementedError, "no session..."\n
  ## first call so generate session_id and send back via cookie\n
  now = DateTime()\n
  session_id = \'\'.join([choice(string.letters) for i in range(20)])\n
  request.RESPONSE.setCookie(\'vifib_session_id\', session_id, expires=(now +expire_timeout_days).fCommon(), path=\'/\')\n
\n
return portal_sessions[session_id]\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>WebSection_getVifibSession</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
