Hi Matt,
Here is what I have and I think it's really close to working but I'm
missing something small :-)

Thanks,
Charlie

/WEB-INF/
Application.cfm:
<cfapplication name="OpenBDAdminConsole" sessionmanagement="true" />

Server.cfc:
<cfcomponent output="false">
  <cffunction name="onServerStart">
        <cffile action="read" file="/Library/MyApp/Server/conf/etc/
siteconfig.xml" variable="xml">
        <cfxml variable="xmlData"><cfoutput>#xml#</cfoutput></cfxml>
        <cfset dbObj = xmlData.settings.database.prod>

        <!--- Set session login data --->
        <cfscript>
            session.auth.password = "MyAdminPass";
            session.auth.loggedIn = true;
        </cfscript>
        <cftry>
        <!--- Remove Datasource, before adding it a new, incase of any
changes. --->
        <cfscript>
            local = StructNew();
            local.datasource = createObject("component",
"bluedragon.adminapi.Datasource");
            local.datasource.deleteDatasource(dbObj.dsName.XmlText);
        </cfscript>
        <cfcatch type="any">
            <cfoutput>
                <cflog application="yes" file="MPServer" type="error"
text="#cfcatch.message#">
                cfcatch.detail = #cfcatch.detail#<br><br>
                cfcatch.message = #cfcatch.message#<br><br>
            </cfoutput>
        </cfcatch>
        </cftry>
        <!--- Add the Datasource --->
        <cftry>
        <cfscript>
            ds = CreateObject("component", "bluedragon.adminapi.Datasource");

            dsinfo = StructNew();
            dsinfo.name = "#dbObj.dsName.XmlText#";
            dsinfo.databasename = "#dbObj.databasename.XmlText#";
            dsinfo.server = "#dbObj.dbHostname.XmlText#";
            dsinfo.port = #VAL(dbObj.dbPort.XmlText)#;
            dsinfo.username = "#dbObj.username.XmlText#";
            dsinfo.password = "#dbObj.password.XmlText#";
            dsinfo.drivername = "#dbObj.drivername.XmlText#";
            ds.setDatasource(argumentcollection = dsinfo);
        </cfscript>
        <cfcatch type="any">
            <cfoutput>
                <cflog application="yes" file="MPServer" type="error"
text="#cfcatch.message#">
                cfcatch.detail = #cfcatch.detail#<br>
                cfcatch.message = #cfcatch.message#<br>
            </cfoutput>
        </cfcatch>
        </cftry>
  </cffunction>
</cfcomponent>

So the error in the log is ...

20/01/11 18:35.07: -] BlueDragon has initialised. Ready for requests.
20/01/11 18:35.07: -] Server.cfc found: /WEB-INF/server.cfc
20/01/11 18:35.07: -] Server.cfc Execution Error: The requested
SESSION scope is not enabled.


On Jan 23, 9:10 am, Matthew Woodward <[email protected]> wrote:
> On Sun, Jan 23, 2011 at 8:54 AM, Charles Heizer <[email protected]> wrote:
> > Matt,
> > Thanks. I'm trying to create the datasource even if it exists when the
> > server starts.
>
> OK, but you realize if you try to create the datasource and it already
> exists the create will fail right? Just making sure that's clear.
>
> > I was finally able to get the server.cfc to load but I now see session not
> > available error in the obd log file.
>
> Session not available? Or is this the same thing you were mentioning earlier
> with the login issue on the admin CFCs?
>
>
>
> > I was using the datasourcecreate function but I was running in to issues
> > with it since the purpopse of this app is its a web services only, and it
> > can have around 3000 clients hitting it all at once.
>
> You'd have to elaborate on this--not sure why the number of clients comes
> into play here.
>
>
>
> > So if you have any examp,e source that would add a mysql datasource using
> > the server.cfc that would be great.
>
> http://groups.google.com/group/openbd/msg/7da8ad7ff202bccd
>
> Let me know if that doesn't do the trick.
> --
> Matthew Woodward
> [email protected]http://blog.mattwoodward.com
> identi.ca / Twitter: @mpwoodward
>
> Please do not send me proprietary file formats such as Word, PowerPoint,
> etc. as attachments.http://www.gnu.org/philosophy/no-word-attachments.html

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 official manual: http://www.openbluedragon.org/manual/
 Ready2Run CFML http://www.openbluedragon.org/openbdjam/

 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to