From the admin control panel, you can choose which fields from your Events and Schedule DB's will be exported (and which fields won't). You can also set the delimiter to TAB, COMMA or PIPE.
The function appears at the top of the SEARCH RESULTS page. If there are "No Matches", the link will not appear. The plug in uses the same results from a "just completed" search to populate the exported file.
You can check it out at http://www.estigoy.com/csremind/calendar.cgi . Click on "Search" and find some events (just enter the letter 't' in the Title field). On the results page, you'll notice the CSXport link at the top.
If you go to the control panel, select CSXport Setup to play with the parameters.
Epoch's are converted to YYYYMMDD. All other data is left unchanged.
I'm packaging it up and will release it (in beta) soon.
- Michael
------------------ michael@estigoy.com http://www.estigoy.com/csremind
[This message has been edited by michaelest (edited December 30, 2002).]
Dan O.
------------------
quote:I gotta work on not opening this window - didn't have time to address this yet.
I would think just not opening a new window with your JavaScript code would do that. Just using a window.location.href = "http://...csx_export=yes&ids=5+6" should work provided your mod is returning the proper HTTP headers to initiate the download (like it appears to be).
quote: window.open('h t t p ://www.estigoy.com/csremind/calendar.cgi?command=search&view=Search&csx_export=yes&ids=5 6', 'csxport',
I think you're going to run into problems with the space between the events IDs (highlighted above) in some browsers though.
[This message has been edited by DanO (edited December 31, 2002).]
Thanks for the feedback and tips.
Explorer, NS7.0, and Opera 6.5 tend to do o.k., but NS4.7 doesn't like the spaces. I orignally had the ID's listed as a visual reference to the info I should be expecting in the data file, and, well, just left it there.
I tried the window.location and it still results in a new window. I was hopeful though.
The way the script works, it first parses the initial search returns to get a list of the matching event ID's. The actual data for the events, doesn't get parsed until the user clicks on the link and sends the parameter back to the script(&csr_export=yes). This results in a new window. I use a new window because I do not want to lose the current state of the screen output.
I have to separately parse the DBfiles (to address the arbitrary field selections, and to get information not normally displayed in the typical results), generate temp file, and then pass a reference to a supporting script (which initiates a new session/new mime type). I can't change mime types in the current session since that is already declared as "text/html" and the browser will parse all output generated by the script as a web page.
I'm just getting started with perl and javascript and welcome the information.
Your feedback and existing plug ins have aided immensely in creating these.
Thanks,
Michael
[This message has been edited by michaelest (edited December 31, 2002).]
Let me know if you run into any problems.
Read the release notes in the package. -Not tested in a Windows Server environment. -Not Netscape 4.7 friendly yet. -Internet Explorer, Netscape7.0 and Opera 6.5 seem to work fine. http://www.estigoy.com/csremind/csxport06b.zip
[This message has been edited by michaelest (edited January 01, 2003).]
There is a variable $no_header in calendar.pl that negates output of the standard Content-type headers. In fact it is used by the script when called via SSI.
I would think it should be possible to set that variable to 1 and add a routine to output the appropriate headers to initialize downloading of whatever is output after that? That way the download box would popup and the current calendar view not be affected.
What a great tip!
I was able to implement it, but it took me awhile to figure out the correct method. New beta available at http://www.estigoy.com/csremind/csxport06b.zip .
However, I still need a secondary script. Since CSX is an "AFTER" routine, I had to create a small script that executed at the getInput() stage, prior to the $no_header/$no_session variables being set.
I took me a bit longer than I thought it would, but with window.location=href and the new routine executing at the getInput stage, I was able to pull it off.
Thanks again for your assistance!
I downloaded the file which was titled "event.txt" in the download box but it is an HTML page with the calendar display but with the error message:
quote:Search query must not be blank!Error requiring custom function file '/u/web/estigo/csremind/calendarscript/plugins/csxport/display_after_search.pl'. The error is: [Can't modify constant item in list assignment at /u/web/estigo/csremind/calendarscript/plugins/csxport/display_after_search.pl line 156, near "))" Compilation failed in require at (eval 5) line 1. ]
PS. You might also want to consider sending a header to suggest the file name to be saved and incorporate the date into it somehow. Eg. file-01022003.txt
[This message has been edited by DanO (edited January 02, 2003).]
Try it again. should work fine (even in Netscape 4.7).
BTW, I added a "get all" keyword feature. If you enter '!allevents' in either the title or description, All Events (within the date restrictions) can be exported (note: the search results will be null, but the link at the top will say "export all to file").
There's one other issue I'm working on, and it has to do with retrieving ALL occurrences of an event. Right now, csxport only retrieves the first occurrence.
Seems to work now Ok. Good work!
When you're working on the ALL occurrences, how about the file name thing I mentioned. I know it's a little thing but while you're there...
Good idea.
Still working on all occurrences, although it seems as though this is a bug that Matt might be working on? I've read some earlier posts and responses - CS doesn't include the recurring events in the search results if the first occurrence of the event falls outside of the date boundaries. If this is already being looked at, maybe I should just wait?
07b available at http://www.estigoy.com/csremind/csxport07b.zip .
[This message has been edited by michaelest (edited January 02, 2003).]
I just noticed a couple of other things that could use some work before a final release.
It looks like you're just printing the link from the script but that causes it to be printed at the very top of the calendar page, even before the <HTML> tag. That really isn't really good. I believe there is a method that if used will print the code in an appropriate place in the page code, maybe something like:
$Template::userMessage .= $link_code_here. "<B>";
Secondly, since the download popup box is displaying and the calendar is not being replaced when that link is clicked, the link doesn't need to be JavaScript any more. Just a thought.
Keep up the good work!
[This message has been edited by DanO (edited January 03, 2003).]
I think the display_before_search.pl calendar script hook would be better suited and outputting the results directly to the browser a better way to go.
I have some ideas on implementing that if you're interested in hearing them.
I'm also wrapping up some new fixes and mods to the CSXport plug in - ETA 2 days. There was a time bug (I was using local and should have used gmtime in a a sub) and I've managed to get All Occurrences of an Event to be returned as well.
I'll pick up our discussion in a couple of days.
Great. I look forward to seeing how you accomplished that.