Jaci,
Attached is a very simple template to batch create calendar events. Nothing fancy and not a very complete solution, but could provide a useful guide for you.
It uses a CSV file as input, this was created from an excel spreadsheet and then uses the cfx_text2Query tag to convert this CSV file to a CF Query. You can get the cfx_text2Query from http://www.emerle.net/programming/display.cfm/t/cfx_text2query
Chris.
Jaci Chesnes wrote:
On April 10^th we are going live with our first site rolled into Farcry. We are now looking at rolling two more of our sites into the farcry. The two sites are currently in a content management system in a proprietary database. If we can manage to get the data out and into a useable format is there some way to do a batch/semibatch upload of the data directly into the farcry database. What would I need to consider to do this? My main concern is the primary key that the system uses for its object ID’s. I’ve never really worked with that format before and I’m not sure what I need to be aware of? Will this automatically generate the same format if left undefined when doing an excel import? Any help would be appreciated. I want to know what I’m in for or if I should even bother trying to access the data in the old system. It dates back to 2000 and would be an enormous endeavor to manually reinput into farcry.
<cfx_text2Query
file="#expandPath('.')#\files\Calendar.csv"
firstRowIsHeader="true"
qualifier="#chr(34)#"
delimiter=","
startrow=1
rQuery="qCalUpload">
<cfdump var="#qCalUpload#">
<table cellspacing="0">
<tr>
<th>Title</th>
<th>Teaser</th>
<th>Location</th>
<th>Body</th>
<th>startDate</th>
<th>endDate</th>
</tr>
<cfoutput query="qCalUpload" startrow="1">
<cfset startDateTime = ParseDateTime("#qCalUpload.startDate#
#qCalUpload.startTime#")>
<tr>
<td>#qCalUpload.Title#</td>
<td>#qCalUpload.Title#</td>
<td>#qCalUpload.Title#</td>
<td>#qCalUpload.Title#</td>
<td>#ParseDateTime("#qCalUpload.startDate# #qCalUpload.startTime#")#</td>
<td>#ParseDateTime("#qCalUpload.endDate# #qCalUpload.endTime#")#</td>
</tr>
</cfoutput>
</table>
<cfset oType = createobject("component", application.types['myEvent'].typePath)>
<cfloop query="qCalUpload">
<cfset stProperties = structNew()>
<cfset stProperties.objectID = createUUID()>
<cfset stProperties.datetimecreated = Now()>
<cfset stProperties.createdby = session.dmSec.authentication.userlogin>
<cfset stProperties.datetimelastupdated = Now()>
<cfset stProperties.lastupdatedby =
session.dmSec.authentication.userlogin>
<cfset stProperties.displayMethod = "displayPageStandard">
<cfset stProperties.status = "approved">
<cfset stProperties.locked = 0>
<cfset stProperties.label = qCalUpload.Title>
<cfset stProperties.Title = qCalUpload.Title>
<cfset stProperties.Teaser = qCalUpload.Title>
<cfset stProperties.Body = qCalUpload.Title>
<cfset stProperties.startDate =
CreateODBCDateTime(ParseDateTime("#qCalUpload.startDate#
#qCalUpload.startTime#"))>
<cfset stProperties.endDate =
CreateODBCDateTime(ParseDateTime("#qCalUpload.endDate# #qCalUpload.endTime#"))>
<cfset stProperties.publishDate = CreateODBCDateTime(now())>
<cfset stProperties.expiryDate =
CreateODBCDateTime(dateAdd("yyyy",1,now()))>
</cfloop>
--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/
