Пример #1
0
    def createChatroom(cls, obj, params):
        """ Inserts the object in the database according to all the kind of indexing types, in this case:
        -Chat rooms by conference
        -Chat rooms by user
        -Chat rooms by name (to check if there's already a chat room with that name in our XMPP server)
        -Chat rooms by ID (to access faster to the object when querying)
        """
        room = params['room']

        conference = params['conference']

        # index by conference id
        confIndex = IndexByConf()
        room.setId(DBHelpers.newID())
        confIndex.index(conference.getId(), room)

        # Index by chat room's name
        crNameIndex = IndexByCRName()
        crNameIndex.index(room)

        # Index by id
        idIndex = IndexByID()
        idIndex.index(room)

        # Index by room creator
        userIndex = IndexByUser()
        userIndex.index(room.getOwner().getId(), room)
Пример #2
0
    def createChatroom(cls, obj, params):
        """ Inserts the object in the database according to all the kind of indexing types, in this case:
        -Chat rooms by conference
        -Chat rooms by user
        -Chat rooms by name (to check if there's already a chat room with that name in our XMPP server)
        -Chat rooms by ID (to access faster to the object when querying)
        """
        room = params['room']

        conference = params['conference']

        # index by conference id
        confIndex = IndexByConf()
        room.setId(DBHelpers.newID())
        confIndex.index(conference.getId(), room)

        # Index by chat room's name
        crNameIndex = IndexByCRName()
        crNameIndex.index(room)

        # Index by id
        idIndex = IndexByID()
        idIndex.index(room)

        # Index by room creator
        userIndex = IndexByUser()
        userIndex.index(room.getOwner().getId(), room)
Пример #3
0
 def addConference2Room(cls, obj, params):
     """ When we re use a chat room for another conference(s), this is the method called.
         It may be called from the AJAX service, but also from the clone event. Since we
         don't know it, we have to check the parameters accordingly"""
     room = params['room']
     confId = params['conf']
     room.setConference(ConferenceHolder().getById(confId))
     confIndex = IndexByConf()
     confIndex.index(confId, room)
Пример #4
0
 def addConference2Room(cls, obj, params):
     """ When we re use a chat room for another conference(s), this is the method called.
         It may be called from the AJAX service, but also from the clone event. Since we
         don't know it, we have to check the parameters accordingly"""
     room = params['room']
     confId = params['conf']
     room.setConference(ConferenceHolder().getById(confId))
     confIndex = IndexByConf()
     confIndex.index(confId, room)