python in xslt Options
berndroessl
Posted: Sunday, August 06, 2006 2:23:07 AM
Rank: Devotee

Joined: 7/20/2006
Posts: 39
hey folks,

i just created a little dll that enables umbraco to use python in xslt files. calls like

<xsl:value-of select="python:execute('dir()')"/>

or

<xsl:value-of select="python:executeFile('/media/786/helloworld.py')"/>

unfortunatly i have no idea what i can do with this feature ;) the benefit would be much more bigger if it is possible to create macros in python or calling python scripts directly from a client side javasript...

maybe next weekend

<b style="font-weight: normal;"">I'm not fat, my chest has slipped a bit!</b>
hartvig
Posted: Thursday, August 10, 2006 10:54:01 PM

Rank: Addict

Joined: 3/17/2008
Posts: 952
Location: Nyborg, Denmark
Bernd - this is really cool. I've been dreaming of Python or Ruby support in umbraco for a long time as an alternative to xslt.

It could be really neat to have:
- .NET Controls (for the advanced stuff)
- XSLT for processing lists
- Ruby/Python scripting for the in-between

I imagined it should work just like xslt's, wrapped by a macro and editable for the browser. Wouldn't it be nice?

Jeeeez, did I really start this :-)
berndroessl
Posted: Friday, August 11, 2006 12:24:31 AM
Rank: Devotee

Joined: 7/20/2006
Posts: 39
hey Niels, thanks for your answer. yes, your idea is realy great! i thought about creating 'python-macros' to complicated. release follows ;)

regards, bernd

<b style="font-weight: normal;"">I'm not fat, my chest has slipped a bit!</b>
berndroessl
Posted: Saturday, August 12, 2006 1:35:32 AM
Rank: Devotee

Joined: 7/20/2006
Posts: 39
for my intention i studied a little bit the macro mechanism of umbraco and unfortunately i come to the resolution i have to make some heavy changes in the core code :(

why:
the decision how a macro will be treated is realized by the hard coded switch-case throu eMacroType in method renderMacro. would it be a radical intrusion to exchange the enumeration mechanism with the usage of something like macro types implemented by an interface and concrete types? i know, this will affect the database, interfaces.dll, umbraco.macro, editMacro.aspx, and so on

anyway, since ironPython claims .NET2.0 this is no topic for umbraco2.x.

is the umbraco core team willing to make life heavier than it is with changes like this?

regards, bernd

ps: just seen, umbraco is now on codeplex.com but no code is available. when can i get the code for 3.0 ?


<b style="font-weight: normal;"">I'm not fat, my chest has slipped a bit!</b>
berndroessl
Posted: Tuesday, August 15, 2006 3:42:29 AM
Rank: Devotee

Joined: 7/20/2006
Posts: 39
my little python-project is still in progress :) i've implemented the edit-mechanism for python files by the browser like xslt files. error control included...it wasn't that difficult ;) but as i told you one post before now i have to execute this files each time a macro get rendered. so my changes i've to make are very dramaticly for the class umbraco.macro but if there are architectural changes in this class while developing version 3.0 i'll wait till next release. can anyone of you tell me if it's better for me to wait or if the macro mechanism will be allmost untouched from version 2.1x to 3.0?

regards, bernd

<b style="font-weight: normal;"">I'm not fat, my chest has slipped a bit!</b>
hartvig
Posted: Tuesday, August 15, 2006 8:37:34 AM

Rank: Addict

Joined: 3/17/2008
Posts: 952
Location: Nyborg, Denmark
Hi Bernd!

Awesome! That's really great! I'll e-mail you directly about implementing it into the core. I think we could live with adding another harcoded type to the enum, as this is almost never going to be expanded and even though we had an interface there would still be a lot of manual work updating the gui.

/n

Jeeeez, did I really start this :-)
rtk
Posted: Tuesday, November 21, 2006 12:14:37 AM

Rank: Devotee

Joined: 7/24/2006
Posts: 59
Hi Niels, you spoke about implementing python/ruby into Umbraco, but didn't you forget to mention Perl. I would really like Perl integrated as well, python and perl is very equal and in my eyes you can't choose one of them, they both need to be implemented :-)

// RTK
hartvig
Posted: Tuesday, November 21, 2006 12:22:50 AM

Rank: Addict

Joined: 3/17/2008
Posts: 952
Location: Nyborg, Denmark
I don't see any reason to implement "all" languages.

For me Python and Ruby stands for a new breed of very dynamic languages (Ruby is still not ready for .NET though, but the man behind RubyCLR recently got hired by Microsoft so there's hope).

But nothing blocks a Perl package if any one wants to take a shot...

Jeeeez, did I really start this :-)
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.