Thanks guys!

Cheers,
Seth

----- Original Message -----
From: "Steven Harper" <[EMAIL PROTECTED]>
To: "Spectra-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, December 05, 2001 3:58 AM
Subject: RE: content object type update problem


> Oh yes not to be too tight, here's an Admin Page to do it
>
> Thanks goes to : RUSSELL BROWN
>
>
****************************************************************************
> **************
>
> <cfsetting enablecfoutputonly="Yes">
> <!---
> Purpose :To fix bug in Spectra where new properties are synced accross
> Created On : 02/04/2001
> Original Developer :  Russell Brown
>
> --->
>
> <cfa_userGet
> userDirectory = "userDirectory"
> userName = "#request.cfa.activeuser#"
> r_stUser = "stUser"
> r_stGroups = "stGroups">
>
> <cfset lGroups = StructKeyList(stGroups)>
> <cfif ListContainsNoCase(lGroups, "administrator")>
> <cfset bIsAdmin = TRUE>
> <cfelse>
> <cfset bIsAdmin = FALSE>
> </cfif>
>
> <CFIF request.cfa.freeserve.mode NEQ "design" OR NOT variables.bIsAdmin>
> <cflocation url="/" addtoken="No">
> <cfelse>
>
> <cfif IsDefined("form.typeid")>
>
> <cfset versionerror = "Success Type #form.typeid#  Updated in version DB">
>
> <!--- Get all the properties in the object store for type --->
> <cftry>
> <cfa_objectTypeGetPropertyDefinitions
>     dataSource="#request.cfa.objectstore.dsn#"
>     typeID="#form.typeid#"
>     r_stTypePropertyDefinitions="stType">
> <cfcatch type="Any">
> <cfset versionError = "Failed
> :<br>#cfcatch.message#<p>#cfcatch.detail#</p>">
> <cfexit>
> </cfcatch>
> </cftry>
>
> <!--- Get All the Properties for the type in version Datastore --->
> <cftry>
> <cfa_objectTypeGetPropertyDefinitions
>     dataSource="#request.cfa.freeserve.versiondatasource#"
>     typeID="#form.typeid#"
>     r_stTypePropertyDefinitions="stVType">
> <cfcatch type="Any">
> <cfset versionError = "Failed :#cfcatch.message#<p>#cfcatch.detail#</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="#request.cfa.freeserve.versiondatasource#"
>     typeID="#form.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="FALSE">
> <cfcatch type="Any">
> <cfset versionError = "Failed :#cfcatch.message#<p>#cfcatch.detail#</p>">
> </cfcatch>
> </cftry>
> </cfif>
> </cfloop>
> <!--- REMOVE --->
> <cfloop collection="#stVType#" item="i">
> <cfif NOT StructKeyExists(stType, i)>
> <cftry>
> <cfa_objectTypeProperty
>     action="DELETE"
>    dataSource="#request.cfa.freeserve.versiondatasource#"
>     typeID="#form.typeid#"
>     propertyName="#i#"
> propertyDefinitionID = "#stType[i].propertyDefinitionID#">
> <cfcatch type="Any">
> <cfset versionError = "Failed :#cfcatch.message#<p>#cfcatch.detail#</p>">
> </cfcatch>
> </cftry>
> </cfif>
> </cfloop>
> <cfoutput>
> #Versionerror#<br>
> </cfoutput>
> </cfif>
> <cfoutput>
> <h1>Acme Version Synchroniser</h1></cfoutput>
> <cfa_objecttypegetmultiple dataSource="#request.cfa.objectstore.dsn#"
> r_stTypes="stTypes">
> <cfoutput><form action="#cgi.script_name#?#cgi.query_string#"
> method="post"></cfoutput>
> <cfloop collection=#sttypes# item="ID">
> <cfset label = stTypes[ID].label>
> <cfset handlerroot = stTypes[ID].handlerroot>
> <cfset typeid = stTypes[ID].typeid>
> <cfif stTypes[ID].NSYSATTRIBUTES IS 0 AND
> NOT(ListContainsNoCase(stTypes[ID].METADATA,"hidden"))>
> <cfoutput><input type="Radio" name="typeid" value="#Typeid#">
> #Label#:#handlerroot#:#Typeid#<br></cfoutput>
> </cfif>
> </cfloop>
> <cfoutput><input type="submit" Value="Synch Types!">
> </form></cfoutput>
> </cfif>
> <cfsetting enablecfoutputonly="No">
>
> -----Original Message-----
> From: Steven Harper [mailto:[EMAIL PROTECTED]]
> Sent: 05 December 2001 11:53
> To: Spectra-Talk
> Subject: RE: content object type update problem
>
>
> Yes we have seen this also and written a way round it.
>
> -----Original Message-----
> From: Aden, David [mailto:[EMAIL PROTECTED]]
> Sent: 04 December 2001 00:53
> To: Spectra-Talk
> Subject: RE: content object type update problem
>
>
> seth,
>
> if you're using the version DB at all, oddball errors like this can show
> up if you don't ALSO update the version DB.
>
> david
> webworld studios
>
> -----Original Message-----
> From: Seth Hodgson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 03, 2001 7:41 PM
> To: Spectra-Talk
> Subject: content object type update problem
>
>
> We added a property to an existing content object type in our
> development
> environment, updated handlers and then packaged the updated type for
> export
> to the production server.
>
> Importing the type definition and handlers using the 'Applications and
> Data
> > Type Import' form was successful and when we browse to and edit the
> type
> the new property along with its default value is displayed.
>
> However, when editing objects of this type the process fails with an
> error:
> "Object property cannot be updated. The property 'XXX' is not registered
> for
> the object type myObjectType (UUID).
> Object update failed.
>
> The property 'XXX' is not registered for the object type 'UUID'
> myObjectType.
> Such a property cannot be updated in the object 'content object UUID'
> that
> is derived from this type"
>
> Why would this new property be "not registered" following the type
> import
> and how can this be resolved?
> Seth
>
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.

Reply via email to