Hi Kyle
I like the concept of using xml for navigation - use it for our
corporate (non Farcry) site, and am very interested to see your
implementation for Farcry!

Bryce :-)


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kyle
Singer
Sent: Wednesday, 11 May 2005 9:25 AM
To: FarCry Developers
Subject: [farcry-dev] An optional replacement for nested_tree_objects
and tree.cfc?

For some reason, over the last month, I've had to run the "Fix Tree  
Levels" function 5 times. We had been running smooth for quite awhile  
and I still can't figure out the cause. I'm not sure if we're having  
issues with our database, ColdFusion or FarCry itself so I thought  
I'd try an experiment. I've created a new tree.cfc that uses a simple  
xml file to store the tree structure. The idea is now FarCry doesn't  
have to worry about calculating nleft, nright and nlevel, and  
creating, moving and deleting nodes is much easier.

Right now I have a new tree.cfc that matches the API from the current  
tree.cfc. It uses another component, XmlTree.cfc, stored in  
application memory that handles the actual xml calls--moving  
branches, etc. So far the site tree is working well on my development  
instance, including moving, copying and deleting branches. Also our  
navigation custom tags seem to be handling it as well. To keep things  
safe, all methods that modify the data do so on a copy of the xml  
inside a <cflock> tag and then saves it back if successful.

A few caveats:

     I haven't tuned it. I'm sure it's probably slower than using the  
database.
     It doesn't return "parentid"  or "nright" in the query objects  
and "nleft" is just the currentrecord in the query for ordering  
purposes.

So, first question, is this a stupid idea?

Second, is anyone interested? I could get the files packaged up if  
anyone is curious.

Third, why didn't I look into XPath long ago? It's pretty cool! :)

The xml file is pretty basic. An xsl file is used to tack on the  
depth attributes.

<trees>
     <tree typename="dmNavigation>
         <node objectid="..." name="root" depth="0">
             <node objectid="..." name="Home" depth="1">
                 ...
             </node>
         </node>
     </tree>
     <tree typename="categories">
         ...
     </tree>
</trees>


--Kyle


Kyle Singer
Lead Web Developer
Whitman College
Technology Services
[EMAIL PROTECTED]




---
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/



*********** Confidentiality and Disclaimer Statement *****************
The information in this e-mail and any attachments are confidential 
and may be subject to legal professional privilege. It is intended 
solely for the attention and use of the named addressee(s). If you are 
not the intended recipient, or person responsible for delivering this 
information to the intended recipient, please notify the sender 
immediately. Unless you are the intended recipient or his/her 
representative you are not authorised to, and must not read, copy, 
distribute, use or retain this message or any part of it.

Opinions, conclusions and other information expressed in this message 
are not given or endorsed by NCC unless otherwise indicated by an 
authorised officer independent of this message.

NCC has implemented anti-virus software, and whilst all care is taken, 
it is the recipient's responsibility to ensure that the message and 
any attachments are scanned for viruses prior to use.

This footnote also confirms this e-mail message has been read 
electronically by an e-mail content breakdown system.

Newcastle City Council
Home Page: http://www.newcastle.nsw.gov.au
E-mail: mailto:[EMAIL PROTECTED]
**********************************************************************


---
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/

Reply via email to