Spectra 1.5
According to the type definition for a container, it should have a method
called addrule. Un fortunately this doesn't exist anywhere in the handlers
directories (let alone under the publishing area). Any comments (Raymond
Camden)?
Tony Brett
Creative Developer
Circle.com, 100 Victoria Street, Bristol, BS1 6HE
tel: 0117 9146266
fax: 01179146125
mobile: 07773717420
icq: 62185107
-----Original Message-----
From: Raymond Camden [mailto:[EMAIL PROTECTED]]
Sent: 15 March 2001 18:20
To: Spectra-Talk
Subject: RE: Removing objects form a container
I had to deal with this yesterday. If you make certain assumptions, ie, the
container ONLY uses the basic schedule rule, then you can do this:
Container ID is the ID of the container. ObjectID is the id you jsut
deleted.
(p.s. This is first generation code for a set of tags to work with
containers. Do NOT consider this code to be perfect. If it works perfectly
for you, I will gladly accept your praise. If it doesn't work, it's a
Windows problem.)
<CFPARAM NAME="Attributes.DataSource">
<CFPARAM NAME="Attributes.ContainerID">
<CFPARAM NAME="Attributes.ObjectID">
<CFA_ContentObjectGet DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#" r_stObject="container">
<CFSET Group1 = Container.ARules[1].AStartOrder[1]>
<CFA_ContentObject DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#.aRules[1]" Method="GetInvocations"
r_stParams="gresults">
<!--- gresults should have one key. In our case, we get the first key, and
assume it's the only key --->
<!--- I use a list function just to be extra careful. --->
<CFSET Ob = ListFirst(StructKeyList(GResults))>
<CFSET Ainvocations = GResults[Ob].AInvocations>
<CFLOOP INDEX="X" FROM=1 TO="#ArrayLen(Ainvocations)#">
<CFIF AInvocations[X].objectID IS Attributes.objectID>
<CFSET KillStr = "#Group1#&#X#">
<CFBREAK>
</CFIF>
</CFLOOP>
<!--- Now kill it --->
<CFSET ParamsToKill = StructNew()>
<CFSET ParamsToKill.lInvocationKeys = KillStr>
<CFA_ContentObject DataSource="#Attributes.DataSource#"
ObjectID="#Attributes.ContainerID#.aRules[1]" Method="DeleteInvocations"
stParams="#ParamsToKill#">
=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Allaire
Email : [EMAIL PROTECTED]
ICQ UIN : 3679482
"My ally is the Force, and a powerful ally it is." - Yoda
> -----Original Message-----
> From: Margaret Cook [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 15, 2001 11:37 AM
> To: Spectra-Talk
> Subject: Removing objects form a container
>
>
> Hi all,
> Has anyone found a way to automatically delete an object and
> remove it from
> a container after a certain time span (ie, remove an object 60
> days after it
> was added). So in essence what you would need to do is find all of the
> containers an object is in, remove them from the container and
> then delete
> the object. Any tips or suggestions are welcomed! TIA
>
> maggie
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
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.