UBBFriend: Email This Page to Someone!
  CalendarScript Support Forum
  Hacks and Mods
  Import Events Using csxport files

Post New Topic  Post A Reply
profile | register | preferences | search

next newest topic | next oldest topic
Author Topic:   Import Events Using csxport files
musicvid
Member
posted May 18, 2004 10:56 AM     Click Here to See the Profile for musicvid     Edit/Delete Message
Problem: How to cross-populate selected groups of events from calendars on different domains.

One solution: Use the csxport beta plugin to make a text db, then use the Import Events function in the other calendar.

Works very well if I twiddle the text file to make it import correctly. In order to make things fully compatible, I would need to accomplish three things:

1) Eliminate the extra space following the delimiter in the csxport output.
2) Change the start_time and end_time (24 hr.) from hhmm to hh:mm OR change the Import Events to accept hhmm
3) Preserve the line breaks from textarea fields in the output.

I know the csxport plugin was mostly abandoned, but we are going to use it extensively for creating end-of-year reports and the use described above. Can someone point me in the right direction on these mods?

TIA

IP: Logged

DanO
Member
posted May 18, 2004 03:33 PM     Click Here to See the Profile for DanO   Click Here to Email DanO     Edit/Delete Message
quote:
1) Eliminate the extra space following the delimiter in the csxport output.
2) Change the start_time and end_time (24 hr.) from hhmm to hh:mm OR change the Import Events to accept hhmm
Both of those should be able to be accomplished using the search and replace feature of a text editor and regular expressions.

I have not delved into that plug-in to be able to tell you what parts of the plug-in code would need to be modified to accomplish those tasks automatically. Sorry.

Dan O.

------------------

IP: Logged

musicvid
Member
posted May 19, 2004 01:27 PM     Click Here to See the Profile for musicvid     Edit/Delete Message
Got the hh:mm problem solved.

Still can't eliminate the leading white space (it leads the data rather than trailing the delimiter). I've been trying $whatever =~ s/^\s*//; in various places to no avail.

Will post all the solutions once I've got them all; I believe several people could benefit from them judging by the questions regarding importing events.

Any guidance gratefully appreciated.


------------------

IP: Logged

musicvid
Member
posted May 21, 2004 01:10 PM     Click Here to See the Profile for musicvid     Edit/Delete Message
Woohoo! Got the whitespace thing solved. Two down, one to go. Details forthcoming.

------------------

IP: Logged

musicvid
Member
posted May 23, 2004 10:05 PM     Click Here to See the Profile for musicvid     Edit/Delete Message
OK, here it is.
Allows no-hassle export/import between calendars by using the csxport beta plugin to create an intermediate database.
I will put it into a new thread after a few people have had a chance to try it out and post improvements or simplifications.

Back up your admin.pl file.

In admin.pl find two instances of
=~/(\d\d?) : (\d\d?)/); (Remove the spaces before and after the : to search for this line)
Remove the : in both instances
This should not create a problem unless you are also importing events from Version 2 calendars.

In import_events.html find two instances of
HH:MM
Replace both with
hhmm

In the csxport display_after_search.pl find the line
flock(FILE, 2);
Immediately after that line paste these three lines
$csx_data =~ s/\n |\r $/\n/g;
$csx_data =~ s/\| /|/g;
$csx_fieldnames =~ s/\| /|/g;
This assumes you will be using a pipe "|" delimiter. For other delimiters the last two lines will have to be altered accordingly.

Also in the csxport display_after_search.pl find the line
$csvc_eventkey =~ s/\n|\r//mg;
Replace with
$csvc_eventkey =~ s/\n|\r/\\n/mg;
This will preserve line breaks in the event descriptions, etc. if you are using the preserve line breaks mod. in your templates.

All suggestions welcomed.
------------------

[This message has been edited by musicvid (edited May 28, 2004).]

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

CalendarScript Home