Example #1
0
    def getInfoData(self):
        """ Get the data needed to create an ActionInfo.
        """
        category_path = []
        lazy_keys = []
        lazy_map = {}

        lazy_map['id'] = self.getId()

        parent = aq_parent(self)
        while parent is not None and parent.getId() != 'portal_actions':
            category_path.append(parent.getId())
            parent = aq_parent(parent)
        lazy_map['category'] = '/'.join(category_path[::-1])

        for id, val in self.propertyItems():
            if id.endswith('_expr'):
                id = id[:-5]
                if val:
                    val = getattr(self, '%s_expr_object' % id)
                    lazy_keys.append(id)
                elif id == 'available':
                    val = True
            elif id == 'i18n_domain':
                continue
            elif self.i18n_domain and id in ('title', 'description'):
                val = MessageID(val, self.i18n_domain)
            lazy_map[id] = val

        return (lazy_map, lazy_keys)
Example #2
0
 def Description(self):
     """
         Textual description of the class of objects (intended
         for display in a "constructor list").
     """
     if self.description and self.i18n_domain:
         return MessageID(self.description, self.i18n_domain)
     else:
         return self.description
Example #3
0
 def Title(self):
     """
         Return the "human readable" type name (note that it
         may not map exactly to the 'portal_type', e.g., for
         l10n/i18n or where a single content class is being
         used twice, under different names.
     """
     if self.title and self.i18n_domain:
         return MessageID(self.title, self.i18n_domain)
     else:
         return self.title or self.getId()
Example #4
0
 def factory(self, msgid, default=None, mapping={}, domain=None):
     m = MessageID(msgid, default=default, domain=domain)
     m.mapping = mapping
     return m
Example #5
0
 def factory(self, msgid, default=None, mapping={}):
     m = MessageID(msgid, default=default)
     m.mapping = mapping
     return m