Closed Thread Icon

Topic awaiting preservation: Create .ics file (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=22200" title="Pages that link to Topic awaiting preservation: Create .ics file (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Create .ics file <span class="small">(Page 1 of 1)</span>\

 
Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-16-2004 02:00

I was trying to create a .ics icalender file when user click on a link.

How could I in JSP parsed a few parameters and a file could be created?

In ASP, this could be accomplished using:

code:
Response.ContentType = "text/x-vCalendar"
Response.AddHeader "Content-Disposition", _ "filename=Event.vcs;"
Response.Write starvCalendar
Response.End



I have also seen a much simplier example:

code:
<FORM method="post" name="vCalendar" action="http://www.cvent.com/EventManagement/Summary/eventInfo.ics">
<input type="hidden" name="planner" value="boston@yahoo.com">
<input type="hidden" name="title" value="Weekly Email - December 12, 2000">
<input type="hidden" name="start" value="20011215T010000Z">
<input type="hidden" name="end" value="20011215T030000Z">
<input type="hidden" name="loc" value="Caprice Club">
<input type="hidden" name="desc" value="Description bla bla bla ">
<input type="hidden" name="createdate" value="20010822T014533Z">

Friday, December 14, 2001 8:00 PM - 10:00 PM&nbsp;<a class=detailsLinks href="javascript:document.vCalendar.submit();">Add to my calendar</a>

</FORM>



My question is I am not sure about the line

<FORM method="post" name="vCalendar" action="http://www.cvent.com/EventManagement/Summary/eventInfo.ics">

if I create a similar file in my local directory, the entire code doesn't seem to work at all. I am very confused. I appreciate any assistance.

Thank you again.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-16-2004 07:14

I'm pretty sure that that form posts to an url that's internally redirected to some kind of scripting language (or cgi). Kinda like it's done in this place (look at the ->rssChanges for an example).

Sorry, but I can't help you with JSP, I haven't worked with it yet.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-17-2004 02:25

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-18-2004 03:07

Ini,

Have you done anything with regards to create an icalendar file? Thank you.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-22-2004 06:26

Ini,

I have not done anything yet as I am still trying to learn how to do this.

What I have found so far is if I have the parameter in the form (above) parsed into a Bean and the bean return a streams of strings into the browser then the MIME should pick it up. I have a javascript version which some one has kindly posted in the internet, but I do hope to have it in Java Bean.

Would you be able to assit me further in this?

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-22-2004 07:41

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 06-22-2004 07:46

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 06-23-2004 08:56

Thanks Ini.

I have learn the iCalander format. I reckon my current missing link is to learn how to do some basic I/O from a Java Bean or JSP so that the iCalendar Text file is created once someone click on "Add to my Calendar" in the form which I posted earlier.

I/O is something which I have not attempted at all. but will give it a good try.

Thanks.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 07-05-2004 07:06

Ini,

I am getting a bit confused after reading on some material and some simple test. I understand that the string which I need to to sent to a browser is :

code:
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Pacific
METHOD:PUBLISH
PRODID:-//Apple Computer\, Inc//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Example
VERSION:2.0
BEGIN:VEVENT
SEQUENCE:5
DTSTART;TZID=US/Pacific:20021028T140000
DTSTAMP:20021028T011706Z
SUMMARY:Coffee with Jason
UID:EC9439B1-FF65-11D6-9973-003065F99D04
DTEND;TZID=US/Pacific:20021028T150000
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-P1D
ACTION:DISPLAY
DESCRIPTION:Event reminder
END:VALARM
END:VEVENT
END:VCALENDAR



So I did a quick test with this JSP file:

code:
<%@ page import="java.io.*" %>
<%@ page import="java.net.*" %>
<%
response.setContentType("text/x-vCalendar");
response.setHeader("Content-Disposition","filename=event.ics");
%>
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
X-WR-TIMEZONE;VALUE=TEXT:US/Pacific
METHOD:PUBLISH
PRODID:-//Apple Computer\, Inc//iCal 1.0//EN
X-WR-CALNAME;VALUE=TEXT:Example
VERSION:2.0
BEGIN:VEVENT
SEQUENCE:5
DTSTART;TZID=US/Pacific:20021028T140000
DTSTAMP:20021028T011706Z
SUMMARY:Coffee with Jason
UID:EC9439B1-FF65-11D6-9973-003065F99D04
DTEND;TZID=US/Pacific:20021028T150000
BEGIN:VALARM
TRIGGER;VALUE=DURATION:-P1D
ACTION:DISPLAY
DESCRIPTION:Event reminder
END:VALARM
END:VEVENT
END:VCALENDAR
<% response.close %>



Somehow, it just print on the browser and does not involke outlook client.

Most of the example which I have come across involve a .ics file. Is this necessary as I understand you could also write to browser directly?

Thank you again.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-05-2004 08:46

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 07-06-2004 02:13

Ini,

What do you mean the "link to the output page"? I access the page directly from browser. ie
http://servername/test/icalendar.jsp

The source code of the output is in my previous posting.

One of the interesting article which I have found is this:

http://www.devx.com/getHelpOn/10MinuteSolution/20508

It's doing almost the same thing (only in ASP).

I greatly appreciate your assistance on this issue. Thanks again.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-06-2004 02:18

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Pimms One
Bipolar (III) Inmate

From: Australia
Insane since: Jun 2003

posted posted 07-08-2004 05:16

Ini,

The following works now. It also works with attachment in the setHeader. The following will prompt for user to "Open" or "Save". Do you know if that is a way to force it to Open and not Save?

Thank you.


code:
<%
response.setContentType("text/calendar");
response.setHeader("Content-Disposition","inline;filename=event.ics");
%>

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 9.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
ORGANIZER:MAILTO:boston@yahoo.com
DTSTART:20040701T010000Z
DTEND:20040701T030000Z
LOCATION:Caprice Bar & Club
TRANSP:OPAQUE
SEQUENCE:0
UID:040000008200E00074C5B7101A82E00800000000D0CEF827CB1CC001000000000000000010000000B7B8052D1CDECF4E887AA1942D58507E
DTSTAMP:20010822T014533Z
DESCRIPTION:DIRECTIONS TO DECEMBER HAPPY HOUR DIRECTIONS
SUMMARY:Weekly Email - December 12, 2000
PRIORITY:5
CLASS:PUBLIC
BEGIN:VALARM
TRIGGER:PT24H
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

<%response.flushBuffer();%>

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-08-2004 09:14

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu