Oh dear attachment have been filtered
so two sends: this on is the custom tag version...
<cfsetting enablecfoutputonly="yes">
<!---
Copyright 2001 Freeserve.com , PLC
Purpose :To fix bug in Spectra where new properties are synced accross
Created On : 02/04/2001
Original Developer : Russell Brown [EMAIL PROTECTED]
Long Description : A Above
Usage : <cf_fsVersionSync typeid="objects TYPE ID"|objectid="objects ID,
type id is faster"
vdatasource="version datasource"
objdatasource="object/type datasource"
bSystemEnabled="FALSE|TRUE"
r_bSuccess="Variable to contain return code">
Requires : typeid | objectid (One or other, type ID is faster)
vdatasource="version datasource"
objdatasource="object/type datasource"
Returns : r_bSuccess TRUE|FALSE or USer specified var
also returns 'caller.versionerror' if an error occurs
* History :
*
--->
<!--- Check for required params --->
<cfscript>
vdatasource =
IIf(IsDefined("Attributes.vdatasource"),Attributes.vdatasource, "");
objdatasource =
IIf(IsDefined("Attributes.objdatasource"),Attributes.vdatasource, "");
r_bSuccess = IIf(IsDefined("Attributes.r_bSuccess"),Attributes.r_bSuccess,
"r_bSuccess");
typeid = IIf(IsDefined("Attributes.typeid"),Attributes.typeid, "");
objectid = IIf(IsDefined("Attributes.objectid"),Attributes.objectid, "");
</cfscript>
<cfif vdatasource EQ "" OR objdatasource EQ "">
<cfabort showerror="Please pass both object and version datasources">
</cfif>
<cfif typeid EQ "" AND objectid EQ "">
<cfabort showerror="You must pass either a TYPEID or an OBJECTID">
</cfif>
<cfparam name="attributes.bSystemEnabled" default="FALSE">
<cfset "#variables.r_bSuccess#" = 1>
<!--- Switch for type or object --->
<cfif variables.typeid EQ "">
<cftry>
<cfa_contentObjectGet
dataSource="#variables.objdatasource#"
objectID="#variables.objectid#"
r_stObject="stObj"
bUseCache="FALSE">
<cfcatch type="Any">
<cfset caller."#variables.r_bSuccess#" = 0>
<cfset caller.versionError =
"#cfcatch.message#<p>#cfcatch.details#</p>">
<cfexit>
</cfcatch>
</cftry>
<cfset variables.typeid = stObj.typeID>
</cfif>
<!--- Get all the properties in the object store for type --->
<cftry>
<cfa_objectTypeGetPropertyDefinitions
dataSource="#variables.objdatasource#"
typeID="#variables.typeid"
r_stTypePropertyDefinitions="stType">
<cfcatch type="Any">
<cfset caller."#variables.r_bSuccess#" = 0>
<cfset caller.versionError =
"#cfcatch.message#<p>#cfcatch.details#</p>">
<cfexit>
</cfcatch>
</cftry>
<!--- Get All the Properties for the type in version Datastore --->
<cftry>
<cfa_objectTypeGetPropertyDefinitions
dataSource="#variables.vdatasource#"
typeID="#variables.typeid"
r_stTypePropertyDefinitions="stVType">
<cfcatch type="Any">
<cfset caller."#variables.r_bSuccess#" = 0>
<cfset caller.versionError =
"#cfcatch.message#<p>#cfcatch.details#</p>">
<cfexit>
</cfcatch>
</cftry>
<!--- Compare the structures , add the missing ones form current datasource
to history db
And delete ones missing form current from History DB
---->
<!--- ADD --->
<cfloop collection="#stType#" item="i">
<cfif NOT StructKeyExists(stVType, i)>
<cftry>
<cfa_objectTypeProperty
action="UPDATE"
dataSource="#variable.vdatasource#"
typeID="#variables.typeid#"
propertyName="#i#"
alias = "#stType[i].Alias#"
propertyDefinitionID = "#stType[i].propertyDefinitionID#"
defaultValue="#stType[i].defaultValue#"
bSearchable="#stType[i].bSearchable#"
bRequired="#stType[i].bRequired#"
bIndexed="#stType[i].bIndexed#"
bArray="#stType[i].bArray#"
bSystemEnabled="#attributes.bSystemEnabled#">
<cfcatch type="Any">
<cfset caller."#variables.r_bSuccess#" = 0>
<cfset caller.versionError =
"#cfcatch.message#<p>#cfcatch.details#</p>">
<cfexit>
</cfcatch>
</cftry>
</cfif>
</cfloop>
<!--- REMOVE --->
<cfloop collection="#stVType#" item="i">
<cfif NOT StructKeyExists(stType, i)>
<cftry>
<cfa_objectTypeProperty
action="DELETE"
dataSource="#variable.vdatasource#"
typeID="#variables.typeid#"
propertyName="#i#"
propertyDefinitionID = "#stType[i].propertyDefinitionID#">
<cfcatch type="Any">
<cfset caller."#variables.r_bSuccess#" = 0>
<cfset caller.versionError =
"#cfcatch.message#<p>#cfcatch.details#</p>">
<cfexit>
</cfcatch>
</cftry>
</cfif>
</cfloop>
<cfset caller."#variables.r_bSuccess#" = 1>
<cfsetting enablecfoutputonly="no">
-----Original Message-----
From: Steven Harper [mailto:[EMAIL PROTECTED]]
Sent: 12 September 2001 13:47
To: Spectra-Talk
Subject: RE: updating versions
Here you go...
Credit goes to Russell Brown, the owner of this nice chunk of code....
Steven Harper
Senior Applications Developer
Freeserve.com
-----Original Message-----
From: Aden, David [mailto:[EMAIL PROTECTED]]
Sent: 11 September 2001 13:43
To: Spectra-Talk
Subject: updating versions
By any chance, has anyone written a 'cf_contentObjectVersionUpdate' (or
perhaps it should be 'cf_contentObjectVersionData') tag that they are
willing to share?
I'm looking for something that takes the object data (using the
original's UUID), the name (or number) of the version and updates the
version in the Version DB.
Shouldn't be tough to build, but figured I'd check if it had already
been done.
Thanks!
David
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
------------------------------------------------------------------------------
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.