예제 #1
0
def AllObjectInstancesWithEventInputs(dummy_context):
    """Which objects are there
    """
    iid = zapi.getUtility(IIntIds, '')
    terms = []
    for (oid, oobj) in iid.items():
        if ISite.providedBy(oobj.object) or \
           IIpNet.providedBy(oobj.object) or \
           IHost.providedBy(oobj.object) or \
           IInterface.providedBy(oobj.object) or \
           IService.providedBy(oobj.object) or \
           ISnmpValue.providedBy(oobj.object) or \
           IEventLogic.providedBy(oobj.object):
            inpEventNames = oobj.object.getAllInpEventNames().keys()
            if len(inpEventNames) > 0:
                for inpEventName in inpEventNames:
                    myId = oobj.object.objectID + u'.' + inpEventName
                    terms.append(\
                        SimpleTerm(myId,
                                   str(myId),
                                   oobj.object.getDcTitle() + \
                                   u'->' + inpEventName))
    for iface in [INotifierEmail]:
        my_util = queryUtility(iface)
        if my_util is not None:
            inpEventNames = my_util.getAllInpEventNames().keys()
            if len(inpEventNames) > 0:
                for inpEventName in inpEventNames:
                    myId = my_util.objectID + u'.' + inpEventName
                    terms.append(\
                        SimpleTerm(myId,
                                   str(myId),
                                   my_util.getDcTitle()+ u'->' + inpEventName))
    return SimpleVocabulary(terms)
예제 #2
0
def AllObjectInstances(dummy_context):
    """Which objects are there
    """
    iid = zapi.getUtility(IIntIds, '')
    terms = []
    for (oid, oobj) in iid.items():
        if ISite.providedBy(oobj.object) or \
           IIpNet.providedBy(oobj.object) or \
           IHost.providedBy(oobj.object) or \
           IInterface.providedBy(oobj.object) or \
           IService.providedBy(oobj.object) or \
           ISnmpValue.providedBy(oobj.object) or \
           IEventLogic.providedBy(oobj.object):
            terms.append(\
                SimpleTerm(oobj.object.objectID,
                           str(oobj.object.objectID),
                           oobj.object.getDcTitle()))
    for iface in [INotifierEmail]:
        my_util = queryUtility(iface)
        if my_util is not None:
            terms.append(\
                SimpleTerm(my_util.objectID,
                           str(my_util.objectID),
                           my_util.getDcTitle()))
    return SimpleVocabulary(terms)
예제 #3
0
def getAllServices():
    """ get a list of all services
    """
    retList = []
    uidutil = getUtility(IIntIds)
    for (myid, myobj) in uidutil.items():
        if IService.providedBy(myobj.object):
            retList.append(myobj.object)
    return retList
예제 #4
0
 def __init__(self, **data):
     """
     constructor of the object
     """
     Component.__init__(self, **data)
     for (name, value) in data.items():
         if name in IService.names():
             setattr(self, name, value)
     self.ikRevision = __version__
예제 #5
0
def AllServiceTemplates(dummy_context):
    """Which MobilePhone templates exists
    """
    terms = []
    uidutil = getUtility(IIntIds)
    for (oid, oobj) in uidutil.items():
        if IService.providedBy(oobj.object) and \
        oobj.object.isTemplate:
            myString = u"%s [T]" % (oobj.object.getDcTitle())
            terms.append(SimpleTerm(oobj.object, token=oid, title=myString))
    return SimpleVocabulary(terms)
예제 #6
0
 def __init__(self, **data):
     """
     constructor of the object
     """
     Component.__init__(self, **data)
     refAttributeNames = getRefAttributeNames(Service)
     self.product = u""
     self.ipprotocol = None
     for (name, value) in data.items():
         if name in IService.names():
             if name not in refAttributeNames:
                 setattr(self, name, value)
     self.ikRevision = __version__
예제 #7
0
def AllObjectInstances(dummy_context):
    """Which objects are there
    """
    iid = zapi.getUtility(IIntIds, '')
    terms = []
    for (oid, oobj) in iid.items():
        if ISite.providedBy(oobj.object) or \
           INet.providedBy(oobj.object) or \
           IHost.providedBy(oobj.object) or \
           IInterface.providedBy(oobj.object) or \
           IService.providedBy(oobj.object) or \
           ISnmpValue.providedBy(oobj.object) or \
           IEventLogic.providedBy(oobj.object):
            terms.append(\
                SimpleTerm(oobj.object.objectID,
                           str(oobj.object.objectID),
                           oobj.object.getDcTitle()))
    my_util = zapi.getUtility(IAdmUtilTicker)
    terms.append(\
        SimpleTerm(my_util.objectID,
                   str(my_util.objectID),
                   my_util.getDcTitle()))
    return SimpleVocabulary(terms)