I read the 4 blog posts and comments and I don't see a way to call the
original built-in tag/function.
I want to do a wrapper on the existing function, not reinvent it.
Can someone provide docs or tell me if the feature doesn't exist?
I used cfc approach and dumped the init function arguments, the super
scope and the this scope and there was no reference to the original
built-in object.
It seems like the init function should get passed a value that
references the original tag/function allow me to to extend my
component from the railo base classes and call super the methods.
Is this documented somewhere? Are the inside one of the railo jars or
something? I don't know where this information is coming from.
Stuff like this would be hard to recreate:
<name>File</name>
<tag-class>railo.runtime.tag.FileTag</tag-class>
<tte-class>railo.transformer.cfml.evaluator.impl.File</tte-class>
Any chance of making it a feature?
I commented and put 3 votes on your feature request.
Do you have an RC file in your patches directory?
If so, you can open that with a zip application and look in
resource/tld to find the .tld file that (looks like it) contains all
the tags.
Do I need to modify the patch zip with a new version number and
manually apply the patch?
The next question would be how do you do a custom update provider url
so I can apply my custom rc or does it work just having it exist in
the filesystem?
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE func-lib PUBLIC "-//Railo//DTD CFML Function Library 1.0//
EN"
"dtd/web-cfmfunctionlibrary_1_0.dtd">
<func-lib>
<flib-version>1.00</flib-version>
<short-name>fbase2</short-name>
<uri>http://www.railo-technologies.com/cf-fld-3-1</uri>
<display-name>Railo Core Function Library2</display-name>
<description>All build in Functions of Railo2</description>
<!-- fileCopy2 -->
<function>
<name>fileCopy2</name>
<class>railo.runtime.functions.file.FileCopy</class>
<description>Copies the specified on-disk or in-memory source file
to the specified destination file.</description>
<argument>
<name>source</name>
<type>any</type>
<required>Yes</required>
<description>path to copy.</description>
</argument>
<argument>
<name>destination</name>
<type>any</type>
<required>Yes</required>
<description>Pathname of the destination file.</description>
</argument>
<return>
<type>void</type>
</return>
</function>
</func-lib>
It appears that this is a feature after all. I guess todd must be
wanting a way to do this without restarting railo perhaps?
I found that I was unable to override fileCopy until I renamed the
original in the fld file in the /opt/railo/lib/railo-server/patches/
3.3.1.000.rc file.
I extracted and edited the xml in web-cfmfunctionlibrary_1_0 from
resource/functions/ and then put the new file back in the zip.
The way to extend built-in functions / tags is to rename them first
using the xml file in the current patch. Then you can call
fileCopy2 inside your custom filecopy.
Here is an example of my custom filecopy function:
<cffunction name="filecopy" output="yes">
<cfargument name="arg1" type="string" required="yes">
<cfargument name="arg2" type="string" required="yes">
test output
<cfscript>
return filecopy2(arg1, arg2);
</cfscript>
</cffunction>
The file did get copied and the output message also occured.
This works but will be overwritten the next time you apply a railo update.
A new rc file will replace the ones you are hacking now and you will have to repply your chnages.
Andrea
Andrea Campolonghi
and...@getrailo.org
I guess Micha can confirm if that's intended behaviour or not.
What Todd is asking for is to be able to do this without FLD/TLD files at all.
<cffunction name="FileCopy" output="false">
<cfif SomeCondition>
... Do Something Different ...
<cfelse>
<!--- Somehow call standard version. --->
<cfreturn FileCopy(ArgumentCollection=Arguments) />
</cfif>
</cffunction>
Oh, and just to highlight there ArgumentCollection=Arguments -
whenever you're just shifting args around you should do that, because
it makes your code more futureproof against the arrival of new
arguments.