Beispiel #1
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'), getter=getHealth),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('User'),
                        getter=getUserName,
                        cell_formatter=fsearch_user_formatter),
        IctGetterColumn(title=_('Room'),
                        getter=lambda i, f: i.room,
                        cell_formatter=link('details.html')),
        DateGetterColumn(title=_('Modified'),
                         getter=getModifiedDate,
                         subsort=True,
                         cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4, 5]
Beispiel #2
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('Contract type')),
#                        getter=lambda i,f: i.type,
#                        cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('expiration date'),
                        getter=lambda i,f: i.expirationDate,
                        cell_formatter=link('details.html')),
        IctGetterColumn(title=_('annual charges'),
                        getter=lambda i,f: i.annualCharges,
                        cell_formatter=link('details.html')),
        DateGetterColumn(title=_('Modified'),
                        getter=getModifiedDate,
                        subsort=True,
                        cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
        )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4, 5]
Beispiel #3
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        IpGetterColumn(title=_('IP'),
                       getter=getIpAddr,
                       cell_formatter=link('overview.html')),
        IpGetterColumn(title=_('hostname'),
                       getter=getHostname,
                       cell_formatter=link('overview.html')),
        IctGetterColumn(title=_('User'),
                        getter=getUserName,
                        cell_formatter=fsearch_user_formatter),
        DateGetterColumn(title=_('Modified'),
                         getter=getModifiedDate,
                         subsort=True,
                         cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
Beispiel #4
0
class EvaluationsDoneDisplay(Overview):
    """for already done evaluations
    """
    label = _(u'evaluations done')
    columns = (
        GetterColumn(title=_('Requirement'),
                     getter=getEvaluationRequirementTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Evaluator'),
                     getter=getEvaluatorTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Value'),
                     getter=getEvaluationValue,
                     cell_formatter=evaluationValue_formatter),
        GetterColumn(title=_('Modified On'),
                     getter=getEvalModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getEvaluationBottons,
                     cell_formatter=raw_cell_formatter),
    )
    sort_columns = []
    status = None

    def objs(self):
        """List of Content objects"""
        retList = getEvaluations(self.context)
        return [ev[1] for ev in retList.items()]
Beispiel #5
0
class EvaluationsDoneDisplay(Overview):
    """for already done evaluations
    """
    label = _(u'evaluations done')
    columns = (
        GetterColumn(title=_('Requirement'),
                     getter=getEvaluationRequirementTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Component'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Evaluator'),
                     getter=getEvaluatorTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Value'),
                     getter=getEvaluationValue,
                     cell_formatter=evaluationValue_formatter),
        GetterColumn(title=_('Modified'),
                     getter=getEvalModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getEvaluationBottons,
                     cell_formatter=raw_cell_formatter),
    )
    sort_columns = []
    status = None
    firstSortOn = _("Component")

    def reqList1stLevel(self):
        """List of Content objects"""
        retList = []
        evaluations = self.context.getEvaluationsDone()
        for ev in evaluations:
            retList.append({"eval": ev, "obj": self.context})
        return retList

    def reqList2ndLevel(self):
        """List of Content objects"""
        evaluations1stLevel = self.context.getEvaluationsDone()
        attrs = self.context.getRefAttributeNames()
        retList = []
        for attr in attrs:
            objs = getattr(self.context, attr)
            if type(objs) is not list:
                objs = [objs]
            for obj in objs:
                if hasattr(obj, "requirements"):
                    evaluations = getEvaluationsDone(obj)
                    #evaluations = self.context.getEvaluationsDone()
                    for ev in evaluations:
                        retList.append({"eval": ev, "obj": self.context})
        return retList
Beispiel #6
0
class Overview(SuperclassOverview):
    """Overview Pagelet"""
    columns = (
        GetterColumn(title="",
                     getter=superclass.getStateIcon,
                     cell_formatter=superclass.raw_cell_formatter),
        GetterColumn(title=_('Title'),
                     getter=superclass.getTitle,
                     cell_formatter=superclass.link('')),
        GetterColumn(title=_('Modified'),
                     getter=superclass.getModifiedDate,
                     cell_formatter=superclass.raw_cell_formatter),
        GetterColumn(title=_('Size'), getter=superclass.getSize),
        GetterColumn(title=_('Actions'),
                     getter=superclass.getActionBottons,
                     cell_formatter=superclass.raw_cell_formatter),
    )

    def objs(self):
        """List of Content objects"""
        objWithPermisson = []
        #        allObj = getAllUtilitiesRegisteredFor(ISuperclass)
        #        allObj = getAllUtilitiesRegisteredFor(Interface, context=self.context)
        smFolder = self.context.getParent()
        allObj = smFolder.values()
        for obj in allObj:
            if ISuperclass.providedBy(obj):
                if canAccess(obj, 'ikName'):
                    myAdapter = zapi.queryMultiAdapter((obj, self.request),
                                                       name='details.html')
                    if myAdapter is not None and canAccess(
                            myAdapter, 'render'):
                        objWithPermisson.append(obj)
        return objWithPermisson
Beispiel #7
0
class AdmUtilRequirementDisplayAll(AdmUtilRequirementDisplay):
    """for all Requirements
    """
    label = _(u'display all requirements')
    columns = (
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Modified On'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Size'),
                     getter=getSize,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_colum_index = 3
    sort_columns = [0, 1, 2]
    status = None

    def objs(self):
        """List of Content objects"""
        retList = []
        for reqObj in self.context.values():
            if IRequirement.providedBy(reqObj):
                retList.extend(getRequirementList(reqObj))
        return retList
Beispiel #8
0
class DetailsAdmUtilRequirementForm(Overview):
    """ Display form for the object """

    label = _(u'settings of Requirement')
    columns = (
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Modified On'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Size'),
                     getter=getSize,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_colum_index = 3
    sort_columns = [1]
    status = None

    fields = field.Fields(IRequirement).omit(
        *AdmUtilRequirementDetails.omit_viewfields)

    def objs(self):
        """List of Content objects"""
        return [
            obj for obj in self.context.values()
            if IRequirement.providedBy(obj)
        ]
Beispiel #9
0
class AllEvaluationsTodoDisplay(Overview):
    """for evaluation which are open
    """
    label = _(u'All evaluations to do')
    columns = (
        GetterColumn(title=_('Component'),
                     getter=getTitle,
                     cell_formatter=link('details.html')),
        GetterColumn(title=_('Title'),
                     getter=getRequirementTitle,
                     cell_formatter=linkReq('details.html')),
        GetterColumn(title=_('Category'),
                     getter=getCategories,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getRequirementBottons,
                     cell_formatter=raw_cell_formatter),
    )
    sort_columns = []
    status = None

    def allReqsList(self):
        """List of Content objects"""
        retList = []
        objList = objectsWithInterface(IComponent)
        for obj in objList:
            evaluations = getEvaluationsTodo(obj)
            for ev in evaluations:
                retList.append({"req": ev, "obj": obj})
        return retList
Beispiel #10
0
class AdmUtilEvalTodo(Overview):
    """for all Evaluations
    """
    label = _(u'display all Evaluations Todo')
    columns = (
        GetterColumn(title=_('Component'),
                     getter=getTupleObjTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Requirement'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        #GetterColumn(title=_('Modified'),
        #getter=getModifiedDate,
        #subsort=True,
        #cell_formatter=raw_cell_formatter),
        #GetterColumn(title=_('Size'),
        #getter=getSize,
        #cell_formatter=raw_cell_formatter),
        #GetterColumn(title=_('Actions'),
        #getter=getActionBottons,
        #cell_formatter=raw_cell_formatter),
    )
    #pos_colum_index = 3
    #sort_columns = [0, 1, 2]
    status = None
    sort_columns = [0, 1]
    pos_colum_index = 0
    firstSortOn = _('Component')

    def objs(self):
        #import pdb
        #pdb.set_trace()
        retList = []
        uidutil = getUtility(IIntIds)
        for (myid, myobj) in uidutil.items():
            if IComponent.providedBy(myobj.object):
                base_reqs = getEvaluationsTodo(myobj.object)
                for req in base_reqs:
                    retList.append({'obj': req, 'component': myobj.object})
                    #retList.append((req, myobj.object))
        return retList
Beispiel #11
0
class EvaluationsTodoDisplay(Overview):
    """for evaluation which are open
    """
    label = _(u'evaluations to do')
    columns = (
        GetterColumn(title=_('Title'),
                     getter=getRequirementTitle,
                     cell_formatter=linkReq('overview.html')),
        GetterColumn(title=_('Component'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Modified'),
                     getter=getReqModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        #GetterColumn(title=_('Size'),
        #getter=getSize,
        #cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getRequirementBottons,
                     cell_formatter=raw_cell_formatter),
    )
    sort_columns = []
    status = None

    def reqList1stLevel(self):
        """List of Content objects"""
        retList = []
        evaluations = self.context.getEvaluationsTodo()
        for ev in evaluations:
            retList.append({"req": ev, "obj": self.context})
        return retList

    def reqList2ndLevel(self):
        """List of Content objects"""
        attrs = self.context.getRefAttributeNames()
        retList = []
        for attr in attrs:
            objs = getattr(self.context, attr)
            if type(objs) is not list:
                objs = [objs]
            for obj in objs:
                if hasattr(obj, "requirements"):
                    evaluations = self.context.getEvaluationsTodo()
                    for ev in evaluations:
                        retList.append({"req": ev, "obj": self.context})
        return retList
Beispiel #12
0
class Overview(SuperclassOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('used nr.'), getter=getUsedCounter),
        GetterColumn(title=_('Modified'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
Beispiel #13
0
class Overview(BrowserPagelet):
    """Overview Pagelet"""
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )

    def update(self):
        self.title = _(u"Overview Linux HA")

    def objs(self):
        """List of Content objects"""
        retList = []
        #self.context.connect2HaCluster()
        ##try:
        ##for obj in self.context.values():
        ##if ISuperclass.providedBy(obj):
        ##retList.append(obj)
        ##except:
        ##pass
        for obj in self.context.values():
            #if ILinuxHaObj.providedBy(obj):
            retList.append(obj)
        return retList
        #return [obj
        #for obj in self.context.values()
        #if ISuperclass.providedBy(obj)]

    def table(self):
        """ Properties of table are defined here"""
        directlyProvides(self.columns[1], ISortableColumn)
        formatter = StandaloneFullFormatter(self.context,
                                            self.request,
                                            self.objs(),
                                            columns=self.columns,
                                            sort_on=((_('Title'), False), ))
        formatter.cssClasses['table'] = 'listing'
        return formatter()
Beispiel #14
0
class FSearchForm(Overview):
    """ Search Form """
    #    form.extends(form.Form)
    label = _(u"Search for what?")
    fsearchText = None
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'), getter=getHealth),
        #TitleGetterColumn(title=_('Title'),
        #getter=getTitle),
        GetterColumn(title=_('Type'),
                     getter=getTypeName,
                     cell_formatter=raw_cell_formatter),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        GetterColumn(title=_('Modified'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
    status = None
    firstSortOn = _('Title')

    def objs(self):
        """List of Content objects"""
        retList = []
        if self.fsearchText is not None and \
            len(self.fsearchText) > 0:
            my_catalog = zapi.getUtility(ICatalog)
            try:
                res = my_catalog.searchResults(
                    all_fulltext_index=self.fsearchText)
                for obj in res:
                    retList.append(obj)
            except ParseError, errText:
                self.status = u"Error: '%s'" % errText
        return retList
Beispiel #15
0
class Overview(SuperOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Health'), getter=getHealth),
        IctGetterColumn(title=_('Title'),
                        getter=getTitle,
                        cell_formatter=link('overview.html')),
        DateGetterColumn(title=_('Modified'),
                         getter=getModifiedDate,
                         subsort=True,
                         cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4, 5]
Beispiel #16
0
class Overview(SuperclassOverview):
    columns = (
        GetterColumn(title="",
                     getter=getStateIcon,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(_('Counter'), lambda i, f: i.counter),
        GetterColumn(_('Step'), lambda i, f: i.step),
        GetterColumn(title=_('Modified'),
                     getter=getModifiedDate,
                     subsort=True,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
    )
    pos_column_index = 1
    sort_columns = [1, 2, 3, 4]
Beispiel #17
0
class Overview(SuperclassOverview):
    """Overview Pagelet"""
    columns = (
        GetterColumn(title="",
                     getter=superclass.getStateIcon,
                     cell_formatter=superclass.raw_cell_formatter),
        GetterColumn(title=_('Title'),
                     getter=superclass.getTitel,
                     cell_formatter=superclass.link('')),
        GetterColumn(title=_('Modified On'),
                     getter=superclass.getModifiedDate,
                     cell_formatter=superclass.raw_cell_formatter),
        GetterColumn(title=_('Size'), getter=superclass.getSize),
        GetterColumn(title=_('Actions'),
                     getter=superclass.getActionBottons,
                     cell_formatter=superclass.raw_cell_formatter),
    )

    def objs(self):
        """List of Content objects"""
        return getAllUtilitiesRegisteredFor(ISuperclass)
Beispiel #18
0
class AdmUtilRequirementDisplay(Overview):
    """for 1st level Requirements
    """
    label = _(u'display requirements')
    columns = (
        GetterColumn(title=_('Title'),
                     getter=getTitle,
                     cell_formatter=link('overview.html')),
        GetterColumn(title=_('Size'),
                     getter=getSize,
                     cell_formatter=raw_cell_formatter),
        GetterColumn(title=_('Actions'),
                     getter=getActionBottons,
                     cell_formatter=raw_cell_formatter),
        )
    sort_columns = [0, 1]
    status = None
    
    def objs(self):
        """List of Content objects"""
        return [obj
                for obj in self.context.values()
                if IRequirement.providedBy(obj)]