cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neeme Praks" <ne...@one.lv>
Subject RE: recursive func in XSP?
Date Mon, 05 Jun 2000 21:04:03 GMT

> -----Original Message-----
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> Sent: Monday, June 05, 2000 2:09 PM
> 
> > One more question: is there somewhere some documentation about these
> > built-in variables?
> 
> No and you should not be aware of them!
> 
> People,
> 
> xsp were designed so that you didn't require to know how they are
> compiled to make them work. If you tie yourself to a particular XSP
> engine implementation, you're fucked!
> 
> So, use
> 
>  <xsp:expr>yourMethod()</xsp:expr>
> 
> and only this!

I understand and share your concern, this is the reason why I brought up
the issue in the first place. I would love to use the a standard way to
achieve this, but I have't got an answer to my question yet: how can I
make this kind of recursive function work with the standard XSP methods,
without tying myself to a particular XSP engine implementation?

Something like this:

<xsp:page>
	<xsp:logic>
		private ?? what does it return ?? BuildTree( FolderTree
tree) throws Exception
		{
			Folder folder = tree.getRoot();
			long ID = folder.getId();

			<folder>
			<xsp:attribute
name="ID"><xsp:expr>String.valueOf(ID)</xsp:expr></xsp:attribute>
	
<name><xsp:expr>folder.getName()</xsp:expr></name>

			if (tree.getNodes() != null)
			{
				for (int i = 0; i <
tree.getNodes().length; i++)
				{
	
<xsp:expr>BuildTree(tree.getNodes()[i])</xsp:expr>
				}
			</folder>
			}
		}
	</xsp:logic>
<page>
	<xsp:logic>
		int UserID = 1;
		FolderTree tree = FolderUtility.getTreeByUser(UserID,
UserID);
	</xsp:logic>
	<xsp:expr>BuildTree(tree)</xsp:expr>
</page>

</xsp:page>

The example is probably syntactically incorrect, but you should get the
basic idea what I'm aiming at...

Neeme

Mime
View raw message