Beispiel #1
0
    def Vocabulary(self, content_instance=None):
        """
        Returns a DisplayList.
        """
        # if there's a TALES override, return it as a DisplayList,
        # otherwise, build the DisplayList from fgVocabulary

        fieldContainer = content_instance.findFieldObjectByName(self.__name__)

        try:
            vl = fieldContainer.getFgTVocabulary()
        except AttributeError:
            vl = None
        if vl is not None:
            return DisplayList(data=vl)

        res = DisplayList()
        for line in fieldContainer.fgVocabulary:
            lsplit = line.split('|')
            if len(lsplit) == 2:
                key, val = lsplit
            else:
                key, val = (lsplit[0], lsplit[0])
            res.add(key, val)
        return res
 def getAttachmentSizes(self):
     voc = DisplayList()
     voc.add('10', '10 kilobyte')
     voc.add('100', '100 kilobyte')
     voc.add('1000', '1 megabyte')
     voc.add('10000', '10 megabyte')
     voc.add('-1', 'unlimited')
     return voc
 def attachments(self):
     dl = DisplayList()
     catalog = getToolByName(self, 'portal_catalog')
     path = '/'.join(self.getPhysicalPath())
     brains = catalog(
         portal_type=('File', 'Image',),
         path=dict(query=path, depth=1))
     for brain in brains:
         dl.add(brain.UID, brain.Title)
     return dl
    def getAvailableGetPaidForms(self):
        """
        We will provide a 'vocabulary' with the predefined form templates available
        It is not possible for the moment to do any kind of form without restriction
        """

        available_template_list = DisplayList()
        for field in self.available_templates.keys():
            available_template_list.add( field, field )
        return available_template_list
Beispiel #5
0
 def attachments(self):
     dl = DisplayList()
     catalog = getToolByName(self, 'portal_catalog')
     path = '/'.join(self.getPhysicalPath())
     brains = catalog(
         portal_type=('File', 'Image',),
         path=dict(query=path, depth=1))
     for brain in brains:
         dl.add(brain.UID, brain.Title)
     return dl
 def getAsDisplayList(self, instance, keyCol=0, valueCol=1, **kwargs):
     """Get two columns of each row as a DisplayList - the key columns is
     keyCol, and the value column is valueCol.
     """
     data = self.get(instance, **kwargs)
     lst = DisplayList()
     for d in data:
         cols = self._split(d)
         lst.add(cols[keyCol], cols[valueCol])
     return lst
 def displaySFObjectTypes(self):
     logger.debug('Calling displaySFObjectTypes()')
     """ returns vocabulary for available Salesforce Object Types
         we can create.
     """
     types = self._querySFObjectTypes()
     typesDisplay = DisplayList()
     for type in types:
         typesDisplay.add(type, type)
     return typesDisplay
Beispiel #8
0
 def getAsDisplayList(self, instance, keyCol=0, valueCol=1, **kwargs):
     """Get two columns of each row as a DisplayList - the key columns is
     keyCol, and the value column is valueCol.
     """
     data = self.get(instance, **kwargs)
     lst = DisplayList()
     for d in data:
         cols = self._split(d)
         lst.add(cols[keyCol], cols[valueCol])
     return lst
Beispiel #9
0
 def displaySFObjectTypes(self):
     logger.debug('Calling displaySFObjectTypes()')
     """ returns vocabulary for available Salesforce Object Types
         we can create.
     """
     types = self._querySFObjectTypes()
     typesDisplay = DisplayList()
     for type in types:
         typesDisplay.add(type, type)
     return typesDisplay
Beispiel #10
0
 def getListaInfografistas(self):
     """ Retorna a lista de membros presentes no grupo
     """
     pg = getToolByName(self, 'portal_groups')
     group = pg.getGroupById('infografistas')
     members = group.getGroupMembers()
     list = DisplayList()
     for member in members:
         memberId = member.getMemberId()
         fullname = member.getProperty('fullname', memberId)
         list.add(memberId, fullname)
     return list
Beispiel #11
0
 def getListaApresentadores(self):
     """ Retorna a lista de usuários do grupo reporteres
     """
     pg = getToolByName(self, 'portal_groups')
     group = pg.getGroupById('Apresentadores')
     members = group.getGroupMembers()
     list = DisplayList()
     for member in members:
         memberId = member.getMemberId()
         fullname = member.getProperty('fullname', memberId)
         list.add(memberId, fullname)
     return list
Beispiel #12
0
 def getListaInfografistas(self):
     """ Retorna a lista de membros presentes no grupo
     """
     pg = getToolByName(self, 'portal_groups')
     group = pg.getGroupById('infografistas')
     members = group.getGroupMembers()
     list = DisplayList()
     for member in members:
         memberId = member.getMemberId()
         fullname = member.getProperty('fullname', memberId)
         list.add(memberId, fullname)
     return list
Beispiel #13
0
    def fTodosIdiomasVocabulary(self, ):

        unDisplayList = DisplayList()

        unosCodigosYDisplayNames = self.fTodosIdiomasCodesAndDisplayNames()
        if not unosCodigosYDisplayNames:
            return unDisplayList

        for unCodigoIdioma, unDisplayName in unosCodigosYDisplayNames:
            unDisplayList.add(
                unCodigoIdioma,
                unDisplayName,
            )
        return unDisplayList
Beispiel #14
0
 def getStatusCabeca(self):
     """ Retorna a lista de status de Cabecas
     """
     list = DisplayList()
     list.add('Nao', 'Não Precisa')
     list.add('Solicitado', 'Solicitado')
     list.add('EmProducao', 'Em produção')
     list.add('Pronto', 'Pronto')
     return list
Beispiel #15
0
    def fTodosModulosVocabulary(self, ):

        unDisplayList = DisplayList()

        unDisplayList.add(
            '',
            self.fTranslateI18N('gvSIGi18n',
                                cNombreModuloNoEspecificadoLabel_MsgId,
                                cNombreModuloNoEspecificadoInputValue),
        )

        unosNombresModulos = self.fTodosNombresModulos()
        if not unosNombresModulos:
            return unDisplayList

        for unNombreModulo in unosNombresModulos:
            unDisplayList.add(
                unNombreModulo,
                unNombreModulo,
            )
        return unDisplayList
Beispiel #16
0
 def getStatusCabeca(self):
     """ Retorna a lista de status de Cabecas
     """
     list = DisplayList()
     list.add('Nao','Não Precisa')
     list.add('Solicitado', 'Solicitado')
     list.add('EmProducao','Em produção')
     list.add('Pronto', 'Pronto')
     return list
Beispiel #17
0
 def getSourceTypeVocabulary(self):
     """All supported repository types """
     d = DisplayList()
     for t in self.source_types:
         d.add(t, t)
     return d
Beispiel #18
0
 def getSourceTypeVocabulary(self):
     """All supported repository types """
     d = DisplayList()
     for t in self.source_types:
         d.add(t,t)
     return d