1.1 --- a/EventAggregatorSupport/Types.py Wed May 01 15:50:34 2013 +0200
1.2 +++ b/EventAggregatorSupport/Types.py Wed May 01 17:38:06 2013 +0200
1.3 @@ -708,9 +708,35 @@
1.4
1.5 def getEventURL(self):
1.6
1.7 - "Return the URL of this event."
1.8 + """
1.9 + Return the URL of this event, fixing any misinterpreted or incorrectly
1.10 + formatted value in the event definition or returning the resource URL in
1.11 + the absence of any URL in the event details.
1.12 + """
1.13 +
1.14 + return self.details.get("url") and \
1.15 + self.valueToString(self.details["url"]) or \
1.16 + self.page.getPageURL()
1.17 +
1.18 + def getSummary(self, event_parent=None):
1.19
1.20 - return self.details.get("url") or self.page.getPageURL()
1.21 + """
1.22 + Return the event summary, fixing any misinterpreted or incorrectly
1.23 + formatted value in the event definition.
1.24 + """
1.25 +
1.26 + return self.valueToString(self.details["summary"])
1.27 +
1.28 + def valueToString(self, value):
1.29 +
1.30 + "Return the given 'value' converted to a string."
1.31 +
1.32 + if isinstance(value, list):
1.33 + return ",".join(value)
1.34 + elif isinstance(value, tuple):
1.35 + return ";".join(value)
1.36 + else:
1.37 + return value
1.38
1.39 def linkToEvent(self, request, text, query_string=None, anchor=None):
1.40