示例#1
0
def test(pea, proto):
    client123 = ACLClient(proto, pea.customHandle, 609)
    session = client123.login('aa', '1231')

    client = templClient(proto, pea.customHandle, 607)

    with open('tests/master-public.pem') as f:
        publicKey1 = f.read()
    with open('tests/master-private.pem') as f:
        privateKey1 = f.read()
    with open('tests/ghost-public.pem') as f:
        publicKey2 = f.read()
    with open('tests/ghost-private.pem') as f:
        privateKey2 = f.read()

    def success(msg):
        print "success"

    def failed(msg):
        print "failed"

    # client.upContent(session, 'OrderType::type','1.2',"enum OrderType::type\n\n{\nOTGFD = 0,\nSIMULATION = 1,\nIOC = 2,\nPOTF = 3\n};\n\n").then(
    #     success).catch(failed)
    # client.jsonRelation(session, 'IStrategy', '1.3').then(
    #     success).catch(failed)
    # client.baseCheck(session, 'Automaton', '1.0').then(
    #     success).catch(failed)
    # client.downLoad(session, 'OrderType::type', '1.2').then(
    #     success).catch(failed)
    # client.getJsonCon(session, 'OrderType::type', '1.2').then(
    #     success).catch(failed)
    # client.grantAuthority(session, '12').then(
    #       success).catch(failed)
    client.templMerge(session).then(success).catch(failed)
示例#2
0
 def onConnectionOpened(self, proto):
     try:
         self.securityClient = SecClient(proto, self.mesgHandle, 609)
         print '----securityClient connected successfully'
         self.aclClient = ACLClient(proto, self.mesgHandle, 609)
         print '----ACLClient connected successfully'
     except Exception as e:
         print e
示例#3
0
 def onConnectionOpened(self, proto):
     print '----begin login-----'
     self.aclClient = ACLClient(proto, self.mesgHandle, 609)
     self.securityClient = SecClient(proto, self.mesgHandle, 609)
     self.session = self.aclClient.login('bb', '1232')
     if 0 == self.session.userId and 0 == self.session.seqId:
         print '----login failed-----'
     else:
         print '----login success----'
示例#4
0
文件: views.py 项目: weijiayun/Json
def user(nickname):
    if nickname != session["uname"]:
        flash("you should login with acount: {0} firstly".format(nickname))
        return redirect(url_for("login"))

    user = dict()

    def myInformationSuccess(a):
        for k, v in a.items():
            user[k] = v

    def myInformationFailed(errMesg):
        print 'b'

    global userClientBasket
    aclClient = userClientBasket.getClient(session, "aclClient")
    loginSession = userClientBasket.getClient(session, "session")
    aclClient.myInformation(loginSession, [1, 3, 2, 4, 8])\
            .then(myInformationSuccess).catch(myInformationFailed).wait()

    form = EditForm()
    if form.validate_on_submit():
        userUpdate = dict()
        userUpdate[1] = form.username.data
        userUpdate[3] = form.email.data
        userUpdate[2] = form.telephone.data
        userUpdate[4] = form.introduction.data
        userUpdate[4] = userUpdate[4].encode('utf-8')

        def changeMyInformationSuccess(a):
            print a

        def changeMyInformationFailed(errMesg):
            print errMesg

        aclClient = ACLClient(app.proto, app.pea.customHandle, 609)
        aclClient.changeMyInformation(loginSession, userUpdate)\
            .then(changeMyInformationSuccess).catch(changeMyInformationFailed).wait()
        flash('Your changes have been saved.')
        return redirect(url_for('user', nickname=user['name']))
    else:
        user['intro'] = user['intro'].decode('utf-8')
        return render_template('user.html', user=user, form=form)
示例#5
0
文件: views.py 项目: weijiayun/Json
def login():
    form = LoginForm()
    if form.validate_on_submit():
        uname = form.username.data
        pwd = form.password.data
        aclClient = ACLClient(app.proto, app.pea.customHandle, 609)
        configClient = ConfigureObjectClient(app.proto, app.pea.customHandle,
                                             612)
        loginResult = aclClient.login(uname, pwd)

        if loginResult is not None and loginResult.seqId > 0:
            session['uname'] = form.username.data
            session['seqId'] = loginResult.seqId
            session['userId'] = loginResult.userId
            global userClientBasket
            userClientBasket.registClient(session, aclClient, "aclClient")
            userClientBasket.registClient(session, loginResult, "session")
            userClientBasket.registClient(session, configClient,
                                          "configClient")

            return redirect(url_for("index"))

        flash('Invalid username or password!')
    return render_template('login.html', title='Sign In', form=form)
示例#6
0
def test(pea, proto):
    client123 = ACLClient(proto, pea.customHandle, 609)
    session = client123.login('bb', '1232')

    client = SecClient(proto, pea.customHandle, 609)

    #两对密钥对
    with open('tests/master-public.pem') as f:
        publicKey1 = f.read()
    with open('tests/master-private.pem') as f:
        privateKey1 = f.read()
    with open('tests/ghost-public.pem') as f:
        publicKey2 = f.read()
    with open('tests/ghost-private.pem') as f:
        privateKey2 = f.read()

    # t = "zhang hai xu 1234567890"
    # def putContentSeriesSuccess( result ):
    #     for k in result:
    #         print 'putSeriesContent success:name=%s : %s' % (k, result[k])
    # def putSeriesContentFailed(errMesg):
    #     print 'putSeriesContent  %s failed: %s' % (t, errMesg)
    # client.putSeriesContent( session, [['one',t, '1234567812345678'],['two',t, '1234567812345678']],publicKey1)\
    #         .then(putContentSeriesSuccess).catch(putSeriesContentFailed)

    # def getSeriesContentSuccess( content ):
    #     for k,v in content.items():
    #          print k,v
    #
    # def getSeriesContentFailed( errMesg):
    #     print 'GetsssContent failed: %s' % ( errMesg)
    # id=[['a',24],['b',25]]
    # client.getSeriesContent( session, id, privateKey1 )\
    #     .then(getSeriesContentSuccess).catch(getSeriesContentFailed)
    #
    #
    #
    #
    # contentIds={'a':27,'b':28,}
    # def getkeysuccess(a):
    #     print 'get key success'
    # def getKeyFailed(errMesg):
    #     print 'get key failed %s' % errMesg
    # def grantSeriesToOtherSuccess( keyId ):
    #     print 'grant contentId  to other Success success '
    # def grantSeriesToOtherFailed(errMesg):
    #     print 'grant  to other  failed: %s' % (errMesg)
    # client.grantSeriesToOther( session, contentIds, 1, privateKey1, publicKey2)\
    #         .then(getkeysuccess).catch(getKeyFailed)\
    #             .then(grantSeriesToOtherSuccess).catch(grantSeriesToOtherFailed)

    #
    # def revokeGrantSuccess( nouse ):
    #     print 'revokeGrant'
    # def revokeGrantFailed( errMesg):
    #     print 'revokeGrant failed: %s' % ( errMesg)
    # id={'a':27,'b':28}
    # otherUserId=1
    # client.revokeGrant( session, id, otherUserId )\
    #     .then(revokeGrantSuccess).catch(revokeGrantFailed)

    def revokeGrantSuccess(nouse):
        print 'revokeGrant'

    def revokeGrantFailed(errMesg):
        print 'revokeGrant failed: %s' % (errMesg)

    id = {'a': 27, 'b': 28}
    otherUserId = 1
    client.checkSharer(session, 28) \
        .then(revokeGrantSuccess).catch(revokeGrantFailed)

    # #
    # def listContentSuccess( contents ):
    #     print 'ListContent success:'
    #     for i in contents:
    #         print i
    # def listContentFailed(errMesg):
    #     print 'ListContent  failed: %s' % (errMesg[0])
    # client.listContent( session )\
    #     .then(listContentSuccess).catch(listContentFailed)
    #
    # contentId = [24,25]
    # def deleteContentSuccess(nouse ):
    #     print 'deleteContent  success '
    # def deleteContentFailed(errMesg):
    #     print 'deleteContent id= %s failed: %s' % (contentId, errMesg)
    # client.deleteContent(session, contentId )\
    #         .then(deleteContentSuccess).catch(deleteContentFailed)

    ######## 此线以上程序测试通过
    ##############################################################################

    # t = "zhang hai xu 1234567890"
    # def putContentSuccess( result ):
    #     print 'putContent  %s success:contentId=%d,keyId=%s' % (t, result[0], result[1])
    #     return client.putContent( session, t, '1234567812345678',publicKey1)
    # def putContentFailed( errMesg):
    #     print 'putContent  %s failed: %s' % (t, errMesg)
    # def put1Success(x):
    #     print 'haha:%d%d' % tuple(x)
    #     client.putContent(session, t, '1234567812345678',publicKey1)\
    #     .then(putContentSuccess).catch(putContentFailed)\
    #     .then(put1Success)
    #
    # contentId = 20
    # def deleteContentSuccess( ):
    #     print 'deleteContent id= %s success ' % (contentId)
    # def deleteContentFailed(errMesg):
    #     print 'deleteContent id= %s failed: %s' % (contentId, errMesg)
    # client.deleteContent(session, contentId )\
    #         .then(deleteContentSuccess).catch(deleteContentFailed)
    #
    #
    # id = 1
    # def getContentSuccess( content ):
    #     print 'GetContent %d  success:content = %s' % (id, content)
    # def getContentFailed( errMesg):
    #     print 'GetContent failed: %s' % ( errMesg)
    # client.getContent( session, id, privateKey1 )\
    #     .then(getContentSuccess).catch(getContentFailed)
    #
    #
    #
    # def listContentSuccess( contents ):
    #     print 'ListContent success:'
    #     for i in contents:
    #         print i
    # def listContentFailed(errMesg):
    #     print 'ListContent  failed: %s' % (errMesg[0])
    # client.listContent( session )\
    #     .then(listContentSuccess).catch(listContentFailed)
    #
    #
    # contentId = 1
    # def getkeysuccess(a):
    #     print 'get key success'
    # def getKeyFailed(errMesg):
    #     print 'get key failed %s' % errMesg
    #
    #
    # def grantToOtherSuccess( keyId ):
    #     print 'grant contentId =%s to other Success success: newKeyId= %s' % (contentId,keyId)
    # def grantToOtherFailed(errMesg):
    #     print 'grant contentId = %s to other  failed: %s' % (contentId, errMesg)
    # client.grantToOther( session, contentId, 1, privateKey1, publicKey2)\
    #         .then(getkeysuccess).catch(getKeyFailed)\
    #             .then(grantToOtherSuccess).catch(grantToOtherFailed)

    print 'SecClient test seccess!!!'
示例#7
0
文件: aclTest.py 项目: weijiayun/Json
def test(pea, proto):
    client = ACLClient(proto, pea.customHandle, 609)

    session = client.login('bb', '1232')
    print 'login %s' % session

    # from twisted.internet import reactor, defer

    def changePasswordSuccess():
        print 'changePassword  success'

    def changePasswordFailed(errMesg):
        print 'changePassword %s failed: %s' % (errMesg)
    client.changePassword( session,'1232')\
            .then(changePasswordSuccess).catch(changePasswordFailed)

    def changeUserNameSuccess(a):
        print 'changeUserName  success'

    def changeUserNameFailed(errMesg):
        print 'changeUserName  failed: %s' % (errMesg)

    client.changeUserName(session,'bb')\
            .then(changeUserNameSuccess).catch(changeUserNameFailed)

    def changeRoleNameSuccess(a):
        print 'changeRoleName  success'

    def changeRoleNameFailed(errMesg):
        print 'changeRoleName failed: %s' % (errMesg)

    client.changeRoleName(session,3,'ad')\
            .then(changeRoleNameSuccess).catch(changeRoleNameFailed)

    def changePublicKeySuccess(a):
        print 'changePublicKey success'

    def changePublicKeyFailed(errMesg):
        print 'changePublicKey %s failed: %s' % (errMesg)

    client.changePublicKey( session,'adddddddddd234')\
            .then(changePublicKeySuccess).catch(changePublicKeyFailed)

    def changePrivateKeySuccess(a):
        print 'changePrivateKey  success'

    def changePrivateKeyFailed(errMesg):
        print 'changePrivateKey failed: %s' % errMesg

    client.changePrivateKey( session,'adddddddddd234')\
            .then(changePrivateKeySuccess).catch(changePrivateKeyFailed)

    def myRoleSuccess(roles):
        print 'myRoleId-name  is %s -%s ' % (roles[0], roles[1])

    def myRoleFailed(errMesg):
        print 'myRole failed: %s' % (errMesg)

    client.myRole(session)\
            .then(myRoleSuccess).catch(myRoleFailed)

    print "begin logout"
    client.logout(session)

    print 'ACLClient test success!!! '
示例#8
0
def test(pea, proto):
    client = ACLClient(proto, pea.customHandle, 609)

    session = client.login('bb', '1232')
    print 'login %s'% session
    # from twisted.internet import reactor, defer

    # def changeMyInformationSuccess(information):
    #     print 'changeMyInformationSuccess : %s ' % information
    # def changeMyInformationFailed(errMesg):
    #     print 'changeMyInformation  failed:%s' % ( errMesg)
    # client.changeMyInformation(session,{6: 'fas123123',2:'12312312331'})\
    #         .then(changeMyInformationSuccess).catch(changeMyInformationFailed)




    # def myInformationSuccess(information):
    #     for k,v in information.items():
    #         print 'myInformationSuccess : %s-%s' % (k,v)
    # def myInformationFailed(errMesg):
    #     print 'myInformationFailed :%s' % ( errMesg)
    # client.myInformation(session,[1,2,3,4,5,6,7]).then(myInformationSuccess).catch(myInformationFailed)

    # def myInformationSuccess(information):
    #     for k,v in information.items():
    #         print 'myInformationSuccess : %s-%s' % (k,v)
    # def myInformationFailed(errMesg):
    #     print 'myInformationFailed :%s' % ( errMesg)
    # client.otherInformation(session,[1,2,3,4,5,6,7,8,9],1).then(myInformationSuccess).catch(myInformationFailed)


    # def myInformationSuccess(information):
    #     for k in information:
    #         print 'myInformationSuccess : %s' % (k)
    # def myInformationFailed(errMesg):
    #     print 'myInformationFailed :%s' % ( errMesg)
    # client.allUserInformation(session,[1,2,3,4,5,6,7,8,9]).then(myInformationSuccess).catch(myInformationFailed)

    # def myInformationSuccess(information):
    #     for k in information:
    #         print 'myInformationSuccess : %s' % (k)
    #
    # def myInformationFailed(errMesg):
    #     print 'myInformationFailed :%s' % (errMesg)
    #
    # client.allResourceInformation(session).then(myInformationSuccess).catch(
    #     myInformationFailed)






    # def addResourceTypeSuccess( id):
    #     print 'addResourceType success:%d' % ( id)
    # def addResourceTypeFailed( errMesg):
    #     print 'addaddResourceType %s failed:%s' % ( errMesg)
    # client.addResourceType( session,'reqq','qq',(['q','qq'],))\
    #         .then(addResourceTypeSuccess).catch(addResourceTypeFailed)
    #
    #
    def addResourceSuccess( id):
        print 'addResource success: %d' % ( id)
    def addResourceFailed( errMesg):
        print 'addResource  failed:%s' % ( errMesg)

    client.addResource( session,3,'zzz','zzzz')\
            .then(addResourceSuccess).catch(addResourceFailed)
    #
    #
    # def addRoleSuccess( id):
    #     print 'addRole %s success: %d' % ( id)
    # def addroleFailed( errMesg):
    #     print 'addRole %s failed: %s' % (errMesg)
    # client.addRole( session,'trader',((5,(8,14)),))\
    #         .then(addRoleSuccess).catch(addroleFailed)
    #
    # def addUserSuccess( id):
    #     print 'addUser  success: %d' % ( id)
    # def addUserFailed( errMesg):
    #     print 'addUser %s failed: %s' % ( errMesg)
    # client.addUser( session,'qq','12345678912','sdfs12','sdf12','sdf123')\
    #         .then(addUserSuccess).catch(addUserFailed)
    #
    # def grantRoleSuccess(a):
    #     print 'grantRole to userId=%s success'
    # def grantRoleFailed(errMesg):
    #     print 'grantRole to userId=%s failed: %s' % ( errMesg)
    # client.grantRole( session,4,1)\
    #         .then(grantRoleSuccess).catch(grantRoleFailed)
    #
    # def changePasswordSuccess():
    #     print 'changePassword  success'
    # def changePasswordFailed( errMesg):
    #     print 'changePassword %s failed: %s' % ( errMesg)
    # client.changePassword( session,'1232')\
    #         .then(changePasswordSuccess).catch(changePasswordFailed)
    #
    # def listResourceSuccess(resources):
    #     print 'listResource  success :'
    #     for i in  resources:
    #         print i
    # def listResourceFailed(errMesg):
    #     print 'listResource  failed: %s' % ( errMesg)
    # client.listResource( session)\
    #         .then(listResourceSuccess).catch(listResourceFailed)
    #
    #
    # def listOtherResourceSuccess(resources):
    #     print 'listotherResource   success: '
    #     for i in  resources:
    #         print i
    # def listOtherResourceFailed( errMesg):
    #     print 'listotherResource  failed: %s' % ( errMesg)
    # client.listOtherResource( session,1)\
    #         .then(listOtherResourceSuccess).catch(listOtherResourceFailed)
    #
    # def grantPermissionSuccess(a):
    #     print 'grantPermission to roleId success'
    # def grantPermissionFailed(errMesg):
    #     print 'grantPermission to  failed: %s' % ( errMesg)
    # client.grantPermission( session,2,1,2)\
    #         .then(grantPermissionSuccess).catch(grantPermissionFailed)
    #
    #
    # def listRoleSuccess(roles):
    #     print 'listRole  success :'
    #     for i in  roles:
    #         print i
    # def listRoleFailed(errMesg):
    #     print 'listRole failed: %s' % ( errMesg)
    # client.listRole(  session)\
    #         .then(listRoleSuccess).catch(listRoleFailed)
    #
    # def listUserSuccess(users):
    #     print 'listUser  success :'
    #     for i in  users:
    #         print i
    # def listUserFailed(errMesg):
    #     print 'listUser failed: %s' % ( errMesg)
    # client.listUser( session)\
    #         .then(listUserSuccess).catch(listUserFailed)
    #
    #
    # def listPermissionSuccess(permissions):
    #     print 'listPermission  success :'
    #     for i in  permissions:
    #         print i
    # def listPermissionFailed(errMesg):
    #     print 'listPermission failed: %s' % ( errMesg)
    # client.listPermission( session)\
    #         .then(listPermissionSuccess).catch(listPermissionFailed)
    #
    # def listOtherPermissionSuccess(permissions):
    #     print 'list roleId Permission  success :'
    #     for i in  permissions:
    #         print i
    # def listOtherPermissionFailed( errMesg):
    #     print 'list roleId Permission failed: %s' % ( errMesg)
    # client.listOtherPermission( session,2)\
    #         .then(listOtherPermissionSuccess).catch(listOtherPermissionFailed)
    #
    # def changeUserNameSuccess(a):
    #     print 'changeUserName  success'
    # def changeUserNameFailed( errMesg):
    #     print 'changeUserName  failed: %s' % ( errMesg)
    # client.changeUserName(session,'bb')\
    #         .then(changeUserNameSuccess).catch(changeUserNameFailed)
    #
    # def changeRoleNameSuccess(a):
    #     print 'changeRoleName  success'
    # def changeRoleNameFailed( errMesg):
    #     print 'changeRoleName failed: %s' % ( errMesg)
    # client.changeRoleName( session,3,'ad')\
    #         .then(changeRoleNameSuccess).catch(changeRoleNameFailed)
    #
    #
    # def changePublicKeySuccess(a):
    #     print 'changePublicKey success'
    # def changePublicKeyFailed( errMesg):
    #     print 'changePublicKey %s failed: %s' % ( errMesg)
    # client.changePublicKey( session,'adddddddddd234')\
    #         .then(changePublicKeySuccess).catch(changePublicKeyFailed)
    #
    #
    #
    # def changePrivateKeySuccess(a):
    #     print 'changePrivateKey  success'
    # def changePrivateKeyFailed( errMesg):
    #     print 'changePrivateKey failed: %s'  % errMesg
    # client.changePrivateKey( session,'adddddddddd234')\
    #         .then(changePrivateKeySuccess).catch(changePrivateKeyFailed)
    #
    # def deleteResourceSuccess(a):
    #     print 'deleteResource success'
    # def deleteResourceFailed( errMesg):
    #     print 'deleteResource  failed: %s' % ( errMesg)
    # client.deleteResource( session,4)\
    #         .then(deleteResourceSuccess).catch(deleteResourceFailed)
    #
    #
    # def deleteUserSuccess(a):
    #     print 'deleteUser  success'
    # def deleteUserFailed( errMesg):
    #     print 'deleteUser  failed: %s' % ( errMesg)
    # client.deleteUser( session,5)\
    #         .then(deleteUserSuccess).catch(deleteUserFailed)
    #
    #
    # def deleteRoleSuccess(a):
    #     print 'deleteRole  success'
    # def deleteRoleFailed( errMesg):
    #     print 'deleteRole  failed: %s' % ( errMesg)
    # client.deleteRole( session,5)\
    #         .then(deleteRoleSuccess).catch(deleteRoleFailed)
    #
    #
    # def listLoginSuccess(Logins):
    #     print 'listLogin  success :'
    #     for i in  Logins:
    #         print i
    # def listLoginFailed(errMesg):
    #     print 'listLogin failed: %s' % ( errMesg)
    # client.listLogin( session)\
    #         .then(listLoginSuccess).catch(listLoginFailed)
    #
    # def inheritPermissionSuccess():
    #     print 'inheritPermission from roleId  success :'
    # def inheritPermissionFailed( errMesg):
    #     print 'inheritPermission from roleId   failed: %s' % ( errMesg)
    # client.inheritPermission( session,2,3)\
    #         .then(inheritPermissionSuccess).catch(inheritPermissionFailed)
    #
    #
    # def releaseRoleSuccess():
    #     print 'releaseRole  success '
    # def releaseRoleFailed( errMesg):
    #     print 'releaseRole  failed: %s' % ( errMesg)
    # client.releaseRole(session,4)\
    #         .then(releaseRoleSuccess).catch(releaseRoleFailed)
    #
    #
    # def myRoleSuccess(roles):
    #     print 'myRoleId-name  is %s -%s '% (roles[0],roles[1])
    # def myRoleFailed( errMesg):
    #     print 'myRole failed: %s' % ( errMesg)
    # client.myRole( session)\
    #         .then(myRoleSuccess).catch(myRoleFailed)
    #
    #
    # def listResourceTypeSuccess(ResourceTypes):
    #     print 'listResourceType  success :'
    #     for i in  ResourceTypes:
    #         print i.name
    # def listResourceTypeFailed(errMesg):
    #     print 'listResourceType failed: %s' % ( errMesg)
    # client.listResourceType( session)\
    #         .then(listResourceTypeSuccess).catch(listResourceTypeFailed)
    #
    #
    # def hasPermissionSuccess( result):
    #     print 'hasPermission  id is %s '% (result)
    # def hasPermissionFailed( errMesg):
    #     print 'hasPermission  id failed: %s' % ( errMesg)
    # client.hasPermission( session, 1,1,1)\
    #         .then(hasPermissionSuccess).catch(hasPermissionFailed)
    #
    # def listTypeResourceSuccess(id,resources):
    #     print 'list TypeId= %s  success :' % id
    #     for i in  resources:
    #         print i
    # def listTypeResourceFailed(id, errMesg):
    #     print 'list TypeId= %s failed: %s' % (id, errMesg)
    # client.listTypeResource(session,4)\
    #         .then(listTypeResourceSuccess).catch(listTypeResourceFailed)
    print "begin logout"
    client.logout(session)

    print 'ACLClient test success!!! '
示例#9
0
def test(pea, proto):
    client123 = ACLClient(proto, pea.customHandle, 609)
    session = client123.login('aa', '1231')

    client = ConfigureObjectClient(proto, pea.customHandle, 612)

    with open('tests/master-public.pem') as f:
        publicKey1 = f.read()
    with open('tests/master-private.pem') as f:
        privateKey1 = f.read()
    with open('tests/ghost-public.pem') as f:
        publicKey2 = f.read()
    with open('tests/ghost-private.pem') as f:
        privateKey2 = f.read()


    def getObjectSuccess(content):
        print content
    def getObjectFailed(errMsg):
        print errMsg
    def success(msg):
        print msg
    def failed(msg):
        print msg

    #client.listCollections(session).then(getObjectSuccess).catch(getObjectFailed)

    # client.deleteObject(session, [['obj6', '20120812', 'v0.2'], ['obj7', '20120812', 'v0.2']]).then(
    #     success).catch(failed)
    # client.getObjects(session, [['obj6', '20120812', 'v0.2'],['obj7', '20120812', 'v0.2']]).then(
    #     success).catch(failed)
    objcontentlist = [
        ['obj1', '20120813', 'v0.2', "signal", "tmpl1", "col1", 'ccc2'],
        ['obj2', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj3', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj4', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj5', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj6', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj7', '20120813', 'v0.2',"signal","tmpl1","col1", 'ccc2'],
        ['obj8', '20120813', 'v0.2', "signal","tmpl1","col1",'ccc2'],
        ['obj1', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj2', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj3', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj4', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj5', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj6', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj7', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj8', '20120813', 'v0.3', "signal","tmpl1","col2",'ccc3'],
        ['obj1', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj2', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj3', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj4', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj5', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj6', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj7', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj8', '20120814', 'v0.2', "strategy","tmpl1","col1",'ccc2'],
        ['obj1', '20120814', 'v0.3', "strategy","tmpl1","col2",'ccc3'],
        ['obj2', '20120814', 'v0.3', "strategy","tmpl1","col2",'ccc3'],
        ['obj3', '20120814', 'v0.3', "strategy","tmpl1","col2",'ccc3'],
        ['obj4', '20120814', 'v0.3', "strategy","tmpl1","col",'ccc3'],
        ['obj5', '20120814', 'v0.3', "strategy","tmpl1","col1",'ccc3'],
    ]
    objlist = [
        # ['obj1', '20120813', 'v0.2'],
        # ['obj2', '20120813', 'v0.2'],
        # ['obj3', '20120813', 'v0.2'],
        # ['obj4', '20120813', 'v0.2'],
        # ['obj5', '20120813', 'v0.2'],
        # ['obj6', '20120813', 'v0.2'],
        # ['obj7', '20120813', 'v0.2'],
        # ['obj8', '20120813', 'v0.2'],
        # ['obj1', '20120813', 'v0.3'],
        # ['obj2', '20120813', 'v0.3'],
        # ['obj3', '20120813', 'v0.3'],
        # ['obj4', '20120813', 'v0.3'],
        # ['obj5', '20120813', 'v0.3'],
        # ['obj6', '20120813', 'v0.3'],
        # ['obj7', '20120813', 'v0.3'],
        # ['obj8', '20120813', 'v0.3']
        ['obj1', '20120814', 'v0.2'],
        ['obj2', '20120814', 'v0.2'],
        ['obj3', '20120814', 'v0.2'],
        ['obj4', '20120814', 'v0.2'],
        ['obj5', '20120814', 'v0.2'],
        ['obj6', '20120814', 'v0.2'],
        ['obj7', '20120814', 'v0.2'],
        ['obj8', '20120814', 'v0.2'],
        ['obj1', '20120814', 'v0.3'],
        ['obj2', '20120814', 'v0.3'],
        ['obj3', '20120814', 'v0.3'],
        ['obj4', '20120814', 'v0.3'],
        ['obj5', '20120814', 'v0.3'],
        ['obj6', '20120814', 'v0.3'],
        ['obj7', '20120814', 'v0.3'],
        ['obj8', '20120814', 'v0.3']
               ]
    col = []
    client.getCollection(session, '20120813', 'v0.2',"signal","tmpl1","col1").then(success).catch(failed)