The security factory looks like this:
<bean id="securityFactory"
class="components.factories.securityFactory" singleton="false">
<constructor-arg name="passwordConfig">
<ref bean="passwordConfig" />
</constructor-arg>
<constructor-arg name="databaseConfig">
<ref bean="databaseConfig" />
</constructor-arg>
<constructor-arg name="environmentConfig">
<ref bean="environmentConfig" />
</constructor-arg>
</bean>
I checked out the _pocService.cfc and I think the problem "might" lay
there (there's a series of queries contained in this CFC and I'm
guessing that if they aren't successfully connecting to the database
that no POCSERVICE is passed, check it out:
_pocSerivce.cfc:::
<cfcomponent
displayname="pocService service"
hint="I am a service component."
extends="components.framework.service">
<!--- INITIALIZATION / CONFIGURATION --->
<cffunction name="init" access="public" returntype="any"
output="false" displayname="Object Constructor" hint="I initialize a
perUser service.">
<cfargument name="databaseConfig" type="any" required="true" />
<cfargument name="legacyIncludesGateway" type="any" required="true" /
>
<cfargument name="securityService" type="any" required="true" />
<cfset setLegacyIncludesGateway(arguments.legacyIncludesGateway) />
<cfset setSecurityService(arguments.securityService) />
<cfset setDatabaseConfig(arguments.databaseConfig) />
<cfset setCache(structNew())>
<cfreturn this />
</cffunction>
<!--- PUBLIC FUNCTIONS --->
<cffunction name="userHasRole" access="public" output="false"
returntype="boolean">
<cfargument name="personnelID" type="numeric" required="true" />
<cfargument name="roleID" type="numeric" required="true" />
<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
SELECT COUNT(personnelId) AS hasRole
FROM per_personnelrole ppr
LEFT OUTER JOIN per_role pr ON ppr.roleId = pr.roleId
WHERE ppr.PersonnelId = <cfqueryparam cfsqltype="cf_sql_integer"
value="#arguments.personnelID#">
AND ppr.RoleId = <cfqueryparam cfsqltype="cf_sql_integer"
value="#arguments.roleID#">
</cfquery>
<cfreturn qry.hasRole />
</cffunction>
<cffunction name="getPlatformIDsByUser" access="public"
output="false" returntype="array">
<cfargument name="personnelID" type="numeric" required="true" />
<cfset var qry = getPlatformSeriesIdQueryByUser
(arguments.personnelID)>
<cfset var raw_platformIDs = valueList(qry.platformID)>
<cfset var platformIDs = "">
<!--- Return a list of unique platforms. --->
<cfloop list="#raw_platformIDs#" index="platformID">
<cfif NOT listFindNoCase(platformIDs, platformID)>
<cfset platformIDs = listAppend(platformIDs, platformID)>
</cfif>
</cfloop>
<cfreturn listToArray(platformIDs) />
</cffunction>
<cffunction name="getPlatformSeriesIDsByUser" access="public"
output="false" returntype="array">
<cfargument name="personnelID" type="numeric" required="true" />
<cfset var qry = getPlatformSeriesIdQueryByUser
(arguments.personnelID)>
<cfreturn listToArray(valueList(qry.platformSeriesID))>
</cffunction>
<cffunction name="expireCache" access="public" output="false"
returntype="void"
hint="I expire a personnelId's cached data.">
<cfargument name="personnelId" required="true" type="numeric">
<cfset c = getCache()>
<cfset structDelete(c,"personnelId#arguments.personnelId#")>
<cfset setCache(c)>
</cffunction>
<cffunction name="getFacilitatorAcList" access="public"
output="false" returntype="string"
hint="I provide a list of platformSeriesIDs associated with the
user's Airworthiness Facilitaor Role">
<cfargument name="personnelId" required="true" type="numeric">
<cfset qry = qryFacilitatorAcList(arguments.personnelId) />
<cfreturn valueList(qry.platformSeriesId) />
</cffunction>
<cffunction name="qryFacilitatorAcList" access="public"
output="false" returntype="query"
hint="I provide a query of platformSeriesID associated with the
user's Airworthiness Facilitaor Role">
<cfargument name="personnelId" required="true" type="numeric">
<cfset c = getCache()>
<cfset personnelKey = "personnelId#arguments.personnelId#" />
<!--- make sure user cache exists --->
<cfset initUserCache(arguments.personnelId)>
<!--- check cached query --->
<cfif structKeyExists(c[personnelKey],"qryFacilitatorAcList")>
<cfset qry = c[personnelKey]['qryFacilitatorAcList'] />
<cfelse>
<!--- get query from legacyIncludesGateway and store in cache --->
<cfset qry = getLegacyIncludesGateway().qryFacilitatorAcList
(arguments.personnelId)>
<cfset c[personnelKey]['qryFacilitatorAcList'] = qry />
</cfif>
<cfreturn qry />
</cffunction>
<cffunction name="getClassDeskAcList" access="public" output="false"
returntype="string"
hint="I provide a list of Aircraft IDs (platformSeriesId)
associated with the user's Airworthiness Facilitator Role">
<cfargument name="personnelId" required="true" type="numeric">
<cfset qry = qryClassDeskAcList(arguments.personnelId) />
<cfreturn valueList(qry.platformSeriesId) />
</cffunction>
<cffunction name="qryClassDeskAcList" access="public" output="false"
returntype="query"
hint="I provide a list of Aircraft IDs (platformSeriesId)
associated with the user's Airworthiness Facilitator Role">
<cfargument name="personnelId" required="true" type="numeric">
<cfset c = getCache()>
<cfset personnelKey = "personnelId#arguments.personnelId#" />
<!--- make sure user cache exists --->
<cfset initUserCache(arguments.personnelId)>
<!--- check cached query --->
<cfif structKeyExists(c[personnelKey],"qryClassDeskAcList")>
<cfset qry = c[personnelKey]['qryClassDeskAcList'] />
<cfelse>
<!--- get query from legacyIncludesGateway and store in cache --->
<cfset qry = getLegacyIncludesGateway().qryClassDeskAcList
(arguments.personnelId)>
<cfset c[personnelKey]['qryClassDeskAcList'] = qry />
</cfif>
<cfreturn qry />
</cffunction>
<cffunction name="qryCompetencyCodeList" access="public"
output="false" returntype="string"
hint="I return a list of a user's Assigned competency codes">
<cfargument name="personnelID" type="numeric" default="-1" />
<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
select
ved.competencyCode
from
per_personnel pp
join per_personnelrole ppr on pp.personnelId = ppr.personnelId
join per_supporteddiscipline psd on ppr.personnelroleid =
psd.personnelroleid
join val_engdiscipline ved on psd.EngDcpId = ved.EngDisciplineId
where
pp.personnelId = #arguments.personnelId#
and ppr.roleId in (3,4,81)
group by ved.competencyCode
</cfquery>
<cfreturn valuelist(qry.competencyCode)>
</cffunction>
<!--- PRIVATE FUNCTIONS --->
<!---
Function: getPlatformSeriesIdQueryByUser
Purpose: Return a query object containing a recordset having the
platformseriesid and platformmodelid
of all aircraft supported by the person identified with the
argument personnelID.
--->
<cffunction name="getPlatformSeriesIdQueryByUser" access="private"
returntype="query" output="false">
<cfargument name="personnelID" type="numeric" required="true" />
<!--- 03/10/2008, Task 1364, Fred Frazier, query rewritten for
performance gains. --->
<cfquery name="qry" datasource="#getDatabaseConfig().getDsn()#">
SELECT per_supportedaircraft.PlatformSeriesId,
val_platformseries.PlatformModelId AS platformID
FROM per_personnelrole
JOIN per_supportedaircraft ON per_supportedaircraft.personnelroleid
= per_personnelrole.personnelroleid
AND per_supportedaircraft.IsRemoved = 'N'
JOIN val_platformseries ON val_platformseries.PlatformSeriesId =
per_supportedaircraft.PlatformSeriesId
AND (val_platformseries.inactive = 'N'
OR val_platformseries.inactive IS NULL)
JOIN val_platformmodel ON val_platformmodel.PlatformModelId =
val_platformseries.PlatformModelId
WHERE per_personnelrole.personnelID = <cfqueryparam
cfsqltype="cf_sql_integer" value="#arguments.personnelID#">
AND per_personnelrole.isRemoved = 'N'
ORDER BY PlatformModel, PlatformSeries
</cfquery>
<cfreturn qry>
</cffunction>
<cffunction name="initUserCache" access="private" returntype="void"
output="false"
hint="I am a private method to initialize a user/personnel record's
cache.">
<cfargument name="personnelId" required="true" type="numeric">
<cfset c = getCache() />
<cfset personnelKey = "personnelId#arguments.personnelId#" />
<!--- check to see if user/personnel cache exists --->
<cfif not structKeyExists(c,personnelKey)>
<!--- create user/personnel cache --->
<cfset c[personnelKey] = structNew() />
</cfif>
</cffunction>
<cffunction name="setCache" access="private" returntype="void"
output="false"
hint="I am a private method to save the Cache variable to the
variables.instance scope.">
<cfargument name="cache" type="struct" required="true" />
<cfset variables.instance.cache = arguments.cache />
</cffunction>
<cffunction name="getCache" access="private" returntype="struct"
output="false"
hint="I am a private method to return the Cache variable from the
variables.instance scope.">
<cfreturn variables.instance.cache />
</cffunction>
<cffunction name="setLegacyIncludesGateway" access="private"
returntype="void" output="false"
hint="I am a private method to save the LegacyIncludesGateway
component to the variables.instance scope.">
<cfargument name="LegacyIncludesGateway" type="struct"
required="true" />
<cfset variables.instance.LegacyIncludesGateway =
arguments.LegacyIncludesGateway />
</cffunction>
<cffunction name="getLegacyIncludesGateway" access="private"
returntype="any" output="false"
hint="I am a private method to return the LegacyIncludesGateway
component from the variables.instance scope.">
<cfreturn variables.instance.LegacyIncludesGateway />
</cffunction>
<cffunction name="setSecurityService" access="private"
returntype="void" output="false"
hint="I am a private method to save the SecurityService component
to the variables.instance scope.">
<cfargument name="SecurityService" type="struct" required="true" />
<cfset variables.instance.SecurityService =
arguments.SecurityService />
</cffunction>
<cffunction name="getSecurityService" access="private"
returntype="any" output="false"
hint="I am a private method to return the SecurityService component
from the variables.instance scope.">
<cfreturn variables.instance.SecurityService />
</cffunction>
</cfcomponent>
thoughts?
> > > - Show quoted text -- Hide quoted text -