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.