getMainObject() ok quelque soit l'admin
This commit is contained in:
parent
c66e41a86b
commit
f87235b9a3
|
@ -78,13 +78,12 @@ register(Rubric)
|
||||||
|
|
||||||
|
|
||||||
class RubricsServer(RubricsCommonMixin, ObjectsServer):
|
class RubricsServer(RubricsCommonMixin, ObjectsServer):
|
||||||
def getMainObjectXmlRpc(self):
|
def getMainObjectId(self):
|
||||||
virtualServerId = context.getVar('applicationId')
|
virtualServerId = context.getVar('applicationId')
|
||||||
virtualServer = self.getVirtualServer(virtualServerId)
|
virtualServer = self.getVirtualServer(virtualServerId)
|
||||||
if virtualServer.admin.mainRubricId is None:
|
if virtualServer.admin.mainRubricId is None:
|
||||||
raise faults.MissingMainRubric()
|
raise faults.MissingMainRubric()
|
||||||
result = self.getObjectXmlRpc(virtualServer.admin.mainRubricId)
|
return virtualServer.admin.mainRubricId
|
||||||
return result
|
|
||||||
|
|
||||||
def getObjectIdsWithContent(self, objectId):
|
def getObjectIdsWithContent(self, objectId):
|
||||||
virtualServerId = context.getVar('applicationId')
|
virtualServerId = context.getVar('applicationId')
|
||||||
|
@ -97,8 +96,7 @@ class RubricsServer(RubricsCommonMixin, ObjectsServer):
|
||||||
|
|
||||||
def registerPublicMethods(self):
|
def registerPublicMethods(self):
|
||||||
ObjectsServer.registerPublicMethods(self)
|
ObjectsServer.registerPublicMethods(self)
|
||||||
self.registerPublicMethod('getMainObject',
|
self.registerPublicMethod('getMainObjectId')
|
||||||
self.getMainObjectXmlRpc)
|
|
||||||
self.registerPublicMethod('getObjectIdsWithContent')
|
self.registerPublicMethod('getObjectIdsWithContent')
|
||||||
|
|
||||||
def repairVirtualServer(self, virtualServer, version):
|
def repairVirtualServer(self, virtualServer, version):
|
||||||
|
|
|
@ -66,11 +66,19 @@ register(Rubric)
|
||||||
|
|
||||||
class RubricsProxy(RubricsCommonMixin, ObjectsProxy):
|
class RubricsProxy(RubricsCommonMixin, ObjectsProxy):
|
||||||
def getMainObject(self, serverId = None):
|
def getMainObject(self, serverId = None):
|
||||||
objectId = self.getAdmin(serverId = serverId).mainRubricId
|
objectId = self.getMainObjectId(serverId = serverId)
|
||||||
if not objectId:
|
if not objectId:
|
||||||
raise faults.MissingMainRubric()
|
raise faults.MissingMainRubric()
|
||||||
return getObject(objectId)
|
return getObject(objectId)
|
||||||
|
|
||||||
|
def getMainObjectId(self, serverId = None):
|
||||||
|
userToken = context.getVar('userToken', default = '')
|
||||||
|
serverId = self.getServerId(serverId = serverId)
|
||||||
|
return callServer(
|
||||||
|
serverId,
|
||||||
|
'getMainObjectId',
|
||||||
|
[serverId, getApplicationToken(), userToken])
|
||||||
|
|
||||||
def getObjectIdsWithContent(self, objectId, indirect = 0, serverId = None):
|
def getObjectIdsWithContent(self, objectId, indirect = 0, serverId = None):
|
||||||
userToken = context.getVar('userToken', default = '')
|
userToken = context.getVar('userToken', default = '')
|
||||||
serverId = self.getServerId(serverId = serverId)
|
serverId = self.getServerId(serverId = serverId)
|
||||||
|
|
Reference in New Issue