## -*- coding: utf_8 -*- <% from fcp import connection from fcp import fcpdefs from fcutils import util from fcp import mlitem from cStringIO import StringIO %> <% myMLItem = fcp.MyMLItem thisWebID = myMLItem.WebID() myCID = str(client.sessionCID) jsonStr = StringIO() jsonStr.write('{"MYMLITEM":{"'+str(fcpdefs.dObjName)+'":"'+myMLItem.EscapedName()+'","webid":"'+thisWebID+'","ShortInfo":{"objType":0,"subType":0,"modDate":0,"status":0,"locationV":0,"locationH":0,"iconID":0,"size":0,"sizeInBytes":0,"unreadCount":0},"pwSeed":"'+client.pwSeed+'","serverTZ":'+str(client.serverTZ)+',"sessionCID":'+myCID+'},"RIGHTS":'+str(fcp.rights)+',"MLDS":[') sendOptions = mlitem.sendShortInfo|mlitem.sendParentID|mlitem.sendObjName|mlitem.sendWebID|mlitem.sendIndex i = 0 item = fcp.GetNthMLItem(i) while item: jsonStr.write(item.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ)) + ',') i = i + 1 item = fcp.GetNthMLItem(i) strOut = jsonStr.getvalue() jsonStr.close() lenJSON = len(strOut) if strOut[lenJSON-1]==',': strOut = strOut[0:lenJSON-1] fType,desktopLayout = fcp.GetEscapedFormField(14000) if desktopLayout and len(desktopLayout): strOut = strOut + '],"FORMDATA":{"14000":{"b64":"'+desktopLayout+'"}}}' else: strOut = strOut + ']}' context.write(strOut) %>