Liferay Issues

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Test Sessions Access more options
    • Getting Started
PUBLIC - Liferay Portal Community Edition
  • PUBLIC - Liferay Portal Community Edition
  • LPS-20825

Calendar exports HTML tags

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 6.1.0 CE GA1
  • Fix Version/s: None
  • Component/s: Calendar
  • Labels:
    • calendar
    • community-verifier
    • iCal
  • Fix Priority:
    2
  • Similar Issues:
    Show 5 results 

    LPS-30912Exporting events with formatting in displays HTML tags in the Descriptions field when imported into any email application
    LPS-27094Prevent HTML tags at page meta content for calendar events
    LPS-1820Export calendar events saves as .ics.html in Safari
    LPS-23132Properties of a tag are not exported/imported
    LPS-14773Calendar export events to meetups portlet

Description

CalEventLocalServiceImpl.toICalVEvent() simply adds the description to the resulting iCal4j VEvent by calling new Description(event.getDescription()).

This leads to HTML markup embedded in the calendar export since the implementation of LPS-7966.

HTML markup needs to be removed from the description suring export or replaced with newlines/tabs in some cases.

The following code snippet could be an indication on what could be possibly done:

String descriptionStr = event.getDescription();
		
descriptionStr = StringUtil.trim(description);
descriptionStr = description.replaceAll("\r|\n|\t", StringPool.BLANK);
descriptionStr = description.replaceAll("(?i) ", StringPool.SPACE);
descriptionStr = description.replaceAll("(?i)<li>", "\n* ");
descriptionStr = description.replaceAll("(?i)<dd>", "\n\t");
descriptionStr = description.replaceAll("(?i)<td>", "\t");
descriptionStr = description.replaceAll("(?i)<a.+href=\"(.+)\"(?:/>|>.*</a>)", "$1");
descriptionStr = description.replaceAll("(?i)</?(?:br|p|div|h.|dt|tr)/?>(?!$)", StringPool.NEW_LINE);
descriptionStr = HtmlUtil.unescape(description);
descriptionStr = HtmlUtil.stripHtml(description);
descriptionStr = description.replaceAll("(?:\\n\\s*)+", StringPool.NEW_LINE);

Description description = new Description(descriptionStr);

In addition the HTML version of the description could be added in the X-ALT-DESC property to allow calendars like Outlook to still show the full HTML.

final XProperty altDesc = new XProperty("X-ALT-DESC", event.getDescription());
altDesc.getParameters().add(new XParameter("FMTTYPE", "text/html"));
eventProps.add(altDesc);

We have performed a short test in Outlook 2007 with this snippet.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions Summary
  • Commits
Hide
Permalink
Soeren Unruh added a comment - 06/Sep/11 3:26 AM

Maybe CalEventLocalServiceImpl.importICal4j() should also do some replacing of newlines in imported events' descriptions with BR tags.

Show
Soeren Unruh added a comment - 06/Sep/11 3:26 AM Maybe CalEventLocalServiceImpl.importICal4j() should also do some replacing of newlines in imported events' descriptions with BR tags.
Hide
Permalink
Drew Blessing added a comment - 23/Jan/12 8:42 PM

Soeren,

Thank you for your report. As part of the community verifier program I am taking a look at this issue.

Show
Drew Blessing added a comment - 23/Jan/12 8:42 PM Soeren, Thank you for your report. As part of the community verifier program I am taking a look at this issue.
Hide
Permalink
Drew Blessing added a comment - 23/Jan/12 8:47 PM

I was able to reproduce this in Liferay 6.1 GA1.

Steps:
1. Create a calendar event with rich text.
2. Export the calendar event and download the .ics file.
3. Import .ics into a calendar program such as iCal.

Observe the HTML tags in the description of the event.

Show
Drew Blessing added a comment - 23/Jan/12 8:47 PM I was able to reproduce this in Liferay 6.1 GA1. Steps: 1. Create a calendar event with rich text. 2. Export the calendar event and download the .ics file. 3. Import .ics into a calendar program such as iCal. Observe the HTML tags in the description of the event.
Hide
Permalink
Michael Saechang added a comment - 24/Jan/12 4:47 PM

Updated ticket as per Drew's comment. Thank you for verifying.

Show
Michael Saechang added a comment - 24/Jan/12 4:47 PM Updated ticket as per Drew's comment. Thank you for verifying.
Hide
Permalink
Eduardo Lundgren added a comment - 21/May/13 8:59 AM

Old calendar.

Show
Eduardo Lundgren added a comment - 21/May/13 8:59 AM Old calendar.

People

  • Assignee:
    SE Support
    Reporter:
    Soeren Unruh
    Participants of an Issue:
    Drew Blessing, Eduardo Lundgren, Michael Saechang, SE Support, Soeren Unruh
Vote (0)
Watch (4)

Dates

  • Created:
    06/Sep/11 3:22 AM
    Updated:
    Tuesday 8:59 AM
    Resolved:
    Tuesday 8:59 AM
    Days since last comment:
    1 day ago

Agile

  • View on Board
  • Atlassian JIRA (v5.2.11#854-sha1:ef00d61)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Liferay. Try JIRA - bug tracking software for your team.