def jqueryListOnCollection():
    #Get request param: collectionId, start, cnt
    param = webUtils.paramWithDefault({u"collectionId":u"D:/tmp",u"start":0,u"cnt":100})
    #Get collection from system, collection system contains cached collections and filesystem collections.
    #h.write("<!--")
    #print "hello"
    if not objTools.isUuid(param["collectionId"]):
        #param["collectionId"] = collectionListItems.jsIdEncoding(param["collectionId"])
        param["collectionId"] = stringTools.jsIdDecoding(param["collectionId"])
    #h.write(unicode(str(int(param["start"])))+unicode(str(int(param["cnt"]))))
    co = collectionManager.getCollection(param["collectionId"], dbSys.dbSysSmart())
    containerCo = container.collectionContainer(co, dbSys.dbSysSmart()).getRange(int(param["start"]), int(param["cnt"]))
    #Output
    #h.write(str(co))
    #res = ""
    #h.write("-->")
    if True:#try:
        res = collectionListItem(containerCo)
    else:#except:
        pass
    h = libs.html.response.html()
    #print "hello"
    #h.write("good")
    h.genPartialHtmlHead()
    h.write(res)
    #h.write(l.s)
    #print res
    h.end()
Example #2
0
File: tag.py Project: weijia/ufs
def getCollection(url, dbSysInst):
    t = tagSys.tagSystemShoveDb(dbSysInst)
    notUsed, tagValue = url.split(t.getExcludedTagPrefix(),2)
    '''
    print tagValue.encode('gbk', 'replace')
    return collectionContainer.collectionContainerWrapperForPythonList([tagValue])
    '''
    paths = baseTagSys.tagSystemShoveDb.getObjs(t, t.getExcludedTagStr(tagValue))
    taggedList = t.getAllObjects(tagValue)
    '''
    for i in t.enumObjsWithTag(tagValue):
        #print i
        taggedList.append(i)
    '''
    taggedCollection = collectionContainer.collectionContainerWrapperForPythonList(taggedList)
    return collectionContainer.collectionContainer(taggedCollection, dbSysInst)
Example #3
0
def getCollection(url, dbSysInst):
    listRes = ['good', 'bad']
    collectionContainer.collectionContainerWrapperForPythonList(listRes)
    return collectionContainer.collectionContainer(taggedCollection, dbSysInst)