Member Avatar

kloupe

I would like to implement the Galleon Forum on my website but my hosting company does not allow createObject tag. If someone has converted the Galleon coldfusion forum to use on goaddy hosting please let me know how.

Can someone please let me know how to convert this statement to use cfinvoke?

<cfset application.factory = createObject("component","cfcs.objectfactory").init(settings)>

Thanks for any help!

It'll only work for components. But something like the code below. See the docs for more details on cfinvoke.
http://livedocs.adobe.com/coldfusion/8/Tags_i_10.html

<cfinvoke
    component="cfcs.objectfactory"
    method="init"
    returnVariable="objFactory"
    argumentCollection="#settings#"
    >
<cfset aplication.factory = objFactory>
Member Avatar

kloupe

Thanks for your help.
Do you know how I can replace createObject in javascript?

Here is my code but I cannot use createObject.

    switch(arguments.objName) {
            case "conference":
                obj = createObject('component','conference').init();
                    if (arguments.singleton) { // scope singleton
                        addSingleton(arguments.objName, obj);
                    }
                    // inject dependencies through setter
                    obj.setSettings( get('galleonSettings', arguments.singleton) );
                    obj.setForum( get('forum', arguments.singleton) );
                    obj.setUtils( get('utils', arguments.singleton) );
                return obj;
            break;

            case "forum":
                obj = createObject('component','forum').init();
                    if (arguments.singleton) { // scope singleton
                        addSingleton(arguments.objName, obj);
                    }
                    // inject dependencies through setter
                    obj.setSettings( get('galleonSettings', arguments.singleton) );
                    obj.setThread( get('thread', arguments.singleton) );
                    obj.setConference( get('conference', arguments.singleton) );                        
                    obj.setUtils( get('utils', arguments.singleton) );
                return obj;
            break;

That's not javascript. It's cfscript. You can't use CF <tags> in cfscript. Either rewrite the code to use tags OR write a wrapper cffunction that you can call from cfscript.

This isn't for cfinvoke. But here's an example of a wrapper function for a tag
http://www.cflib.org/udf/Abort