Asked by erikTsomik in ColdFusion Studio, Miscellaneous Web Development, Cold Fusion Markup Language
Tags: coldfusion
I am trying to extends the CF components internal.ulisting that provides with the list of item and also invold worrkflow processing. My extending madule looks exactly the same as the original module , the only different is I added a few stored procedure. Andwhen I ran the components I am getting the error: Database Exception - in C:\Hotbanana\hb50\display.cfc : line 2795
Error Executing Database Query.
The extended component:
<cfcomponent displayname="courseschedule2" extends="hb50.internal.ulisting">
<cfset this.DATATYPES = enum("item,category,config")>
<cfset this.ALIGN = enum("left,right")>
<cfset this.IMAGE_ALIGN = enum("left,right,inline")>
<cfset this.COLUMN_LAYOUT = enum("single,double")>
<cfset this.DISPLAY_TYPES = enum("full,memo,trimmed")>
<cfset this.DATE_LAYOUT_TYPES = enum("oneline,twolines")>
<cfset this.MAX_ITEMS = 5>
<cfset this.PRIVATE_IMAGE = '<img src="images/lock.gif" width="9" height="10" border="0" align="absmiddle">'>
<cffunction name="init" access="public" returntype="any" output="false">
<cfargument name="companyID" required="true" type="numeric">
<cfargument name="webid" required="false" default="0">
<cfargument name="datatype" required="false" default="0">
<cfset super.init(companyID, arguments.webID, arguments.datatype)>
<cfset this.slash = getFileSeparator()>
<!--- create objects --->
<cfset this.category = createObject("component", "hb50.category").init(companyID)>
<cfset this.workflow = getObject("hb50.workflow",companyID,true)>
<cfset this.display = getObject("hb50.display",companyID,true)>
<cfset this.media = getObject("hb50.media",companyID,true)>
<cfset this.navigation = getObject("hb50.navigation",companyID,true)>
<!--- configuration data --->
<cfxml casesensitive="no" variable="this.xmlConfigData">
<cfoutput>
<data>
<!--- <item varname="blnDescription" title="Description" type="#this.TYPES.BOOLEAN#" default="1" required="false"/> --->
<item varname="blnAbstract" title="Abstract" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnDate" title="Date" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnImage" title="Image" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnLink" title="Link" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnResource" title="Related Information" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnAddress" title="Address" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnPhone" title="Phone" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnFax" title="Fax" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnEmail" title="Email" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategoryListing" title="Category Listing" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategoryPageContent" title="Show Page Content" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategoryDescription" title="Show Category Description" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategorySearch" title="Show Category Search Form" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategoryImage" title="Show Category Image" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnCategoryImageWrap" title="Wrap Text" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intCategoryImageAlign" title="Category Image Alignment" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intCategoryImageWidth" title="Category Image width" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="intCategoryImageHeight" title="Category Image Height" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="intCategoryLayoutType" title="Category Layout" type="#this.TYPES.SELECT#" required="false"/>
<item varname="blnCategoryPagination" title="Show Pagination" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intCategoryDisplayItems" title="Items to Display" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="blnItemListingPageContent" title="Show Page Content" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemListingDescription" title="Show Item Description" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intItemListingDescriptionType" title="Item Description Type" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intItemListingDescriptionLength" title="Item Description Length" type="#this.TYPES.SELECT#" default="300" required="false"/>
<item varname="txtItemListingDescriptionAction" title="Call To Action" type="#this.TYPES.TEXT#" default="more..." required="false"/>
<item varname="blnItemListingSearch" title="Show Item Search Form" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemListingAnchor" title="Show Item Anchor" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemListingTitle" title="Show Item Title" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intItemListingDateLayoutType" title="Date Layout Type" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intItemListingLayoutType" title="Item Listing Layout" type="#this.TYPES.SELECT#" required="false"/>
<item varname="blnItemListingImage" title="Show Item Image" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemListingImageWrap" title="Wrap Text" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intItemListingImageWidth" title="Image Width" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="intItemListingImageHeight" title="Image Height" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="intItemListingImageAlign" title="Item Image Alignment" type="#this.TYPES.SELECT#" required="false"/>
<item varname="blnItemListingPagination" title="Show Pagination" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intItemListingDisplayItems" title="Items to Display" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="blnItemDetail" title="Item Detail Page" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemDetailPageContent" title="Show Page Content" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnItemDetailResource" title="Show Ralated Resources" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="txtItemDetailResourceCaption" title="Related Resource Caption" type="#this.TYPES.TEXT#" required="false"/>
<item varname="blnItemDetailImage" title="Show Image" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intItemDetailImageAlign" title="Item Image Alignment" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intItemDetailImageWidth" title="Item Image width" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="intItemDetailImageHeight" title="Item Image Height" type="#this.TYPES.NUMBER#" required="false"/>
<item varname="blnNotification" title="Send Notification" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="txtNotificationFromEmail" title="From Email" type="#this.TYPES.TEXT#" default="#this.qryCompany.txtEmail#" required="false"/>
<item varname="txtNotificationFromName" title="From Name" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtNotificationSubject" title="Notification Subject" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtNotificationMessage" title="Notification Message" type="#this.TYPES.HTML#" required="false"/>
<item varname="blnSecurityEnabled" title="Enable" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="intRoleIDs" title="Access Role(s)" type="#this.TYPES.SELECT#" required="false" insert="false" multiple="true"/>
<item varname="intWebID" title="Web ID" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intCompanyID" title="Company ID" type="#this.TYPES.SELECT#" required="false"/>
<item varname="blnDeleted" title="Deleted" type="#this.TYPES.BOOLEAN#" required="false"/>
</data>
</cfoutput>
</cfxml>
<cfscript>
this.configData = newFormData();
this.configData.itemname = "Config";
this.configData.itemsname = "Configs";
this.configData.tablename = "tblCourseListingSettings";
this.configData.datatype = this.DATATYPES.CONFIG;
this.configData.navid = this.navid;
this.configData.subid = this.subid;
this.configData.tabid = this.tabid;
this.configData.webid = this.webid;
this.configData.link = this.link;
this.configData.varID = "intID";
this.configData.columns = xmlDataToArray(this.xmlConfigData);
this.configData.tabs[1] = StructNew();
this.configData.tabs[1].caption = "Fields";
this.configData.tabs[1].columnlist = "blnAbstract,blnDate,blnImage,blnLink,blnResource,blnAddress,blnPhone,blnFax,blnEmail";
this.configData.tabs[2] = StructNew();
this.configData.tabs[2].caption ="Category Listing";
this.configData.tabs[2].columnlist = "blnCategoryListing,blnCategoryPageContent,blnCategoryDescription,blnCategorySearch,blnCategoryImage,blnCategoryImageWrap,blnCategoryImageAlign,intCategoryImageWidth,intCategoryImageHeight,blnCategoryPagination,intCategoryDisplayItems,intCategoryLayoutType";
this.configData.tabs[3] = StructNew();
this.configData.tabs[3].caption ="Item Listing";
this.configData.tabs[3].columnlist = "blnItemListingPageContent,blnItemListingTitle,intItemListingDateLayoutType,blnItemListingDescription,intItemListingDescriptionType,intItemListingDescriptionLength,txtItemListingDescriptionAction,blnItemListingSearch,blnItemListingAnchor,intItemListingLayoutType,blnItemListingImage,blnItemListingImageWrap,intItemListingImageWidth,intItemListingImageHeight,intItemListingImageAlign,blnItemListingPagination,intItemListingDisplayItems";
this.configData.tabs[4] = StructNew();
this.configData.tabs[4].caption ="Item Detail";
this.configData.tabs[4].columnlist = "blnItemDetail,blnItemDetailPageContent,blnItemDetailResource,txtItemDetailResourceCaption,blnItemDetailImage,intItemDetailImageAlign,intItemDetailImageWidth,intItemDetailImageHeight";
this.configData.tabs[5] = StructNew();
this.configData.tabs[5].caption ="Notification";
this.configData.tabs[5].columnlist = "blnNotification,txtNotificationFromEmail,txtNotificationFromName,txtNotificationSubject";
this.configData.tabs[6] = StructNew();
this.configData.tabs[6].caption = "Notification Message";
this.configData.tabs[6].columnList = "txtNotificationMessage";
this.configData.tabs[7] = StructNew();
this.configData.tabs[7].caption = "Security";
this.configData.tabs[7].columnList = "blnSecurityEnabled,intRoleIDs";
this.configData.blnWorkflow = false;
this.configData.blnApproval = false;
this.configData.blnLock = false;
this.configData.blnVersion = false;
this.configData.blnDelete = false;
this.configData.blnPreview = false;
this.configData.blnCategory = false;
this.configData.blnScheduling = false;
this.configData.blnMeta = false;
this.configData.blnResources = false;
this.configData.blnOrder = false;
this.configData.blnExtraColumns = false;
</cfscript>
<cfset this.workflow.verifyColumns(this.configData)>
<cfset qryConfig = getConfigQuery()>
<!--- form data --->
<cfxml casesensitive="no" variable="this.xmlData">
<cfoutput>
<data>
<!--- set required to false and changed type to hidden--->
<item varname="txtTitle" title="Title" type="#this.TYPES.HIDDEN#" required="false"/>
<item varname="intCategoryID" title="Category" type="#this.TYPES.CATEGORY#" required="true"/>
<!--- added field--->
<item varname="blnCCSSLink" title="Link to Course Schedule?" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="txtAbstract" title="Abstract" type="#this.TYPES.MEMO#" required="false"/>
<cfif qryConfig.blnDate is 1>
<item varname="dtDate" title="Date" type="#this.TYPES.DATE#" required="false"/>
</cfif>
<cfif qryConfig.blnImage is 1>
<item varname="intImageID" title="Image" type="#this.TYPES.MEDIA#" ext="jpeg,jpg,jpe,gif,png" required="true"/>
</cfif>
<cfif qryConfig.blnLink is 1>
<item varname="txtLink" title="Link" type="#this.TYPES.TEXT#" required="false"/>
</cfif>
<cfif qryConfig.blnAddress is 1>
<item varname="txtAddress" title="Address" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtCity" title="City" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtProvince" title="Province" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtCountry" title="Country" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtPostalCode" title="Postal Code" type="#this.TYPES.TEXT#" required="false"/>
</cfif>
<cfif qryConfig.blnPhone is 1>
<item varname="txtPhone" title="Phone" type="#this.TYPES.TEXT#" required="false"/>
<item varname="txtTollFree" title="Toll Free" type="#this.TYPES.TEXT#" required="false"/>
</cfif>
<cfif qryConfig.blnFax is 1>
<item varname="txtFax" title="Fax" type="#this.TYPES.TEXT#" required="false"/>
</cfif>
<cfif qryConfig.blnEmail is 1>
<item varname="txtEmail" title="Email" type="#this.TYPES.TEXT#" required="false"/>
</cfif>
<item varname="blnNotification" title="Send Notification" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="blnPrivate" title="Private" type="#this.TYPES.BOOLEAN#" required="false"/>
<!--- changed txtdescription required to false--->
<item varname="txtDescription" title="Description" type="#this.TYPES.HTML#" required="false"/>
</data>
</cfoutput>
</cfxml>
<cfif isDefined("this.xmlData.data.frontend.xmltext")>
<cfset this.frontendDisplay = this.xmlData.data.frontend.xmltext>
</cfif>
<!--- added stored procedure to pull course numbers, titles for drop-down--->
<cfstoredproc datasource='#this.datasource#' procedure='qryCourseNumbers'>
<cfprocresult name='qryCourseNumbers'>
<cfprocparam type='In' cfsqltype='CF_SQL_varCHAR' variable='@AY' value='07-08' null='no'></cfprocparam>
<cfswitch expression="#this.companyid#">
<cfcase value="2">
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept' value='PSL' null='no'></cfprocparam>
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept2' value='PSL' null='no'></cfprocparam>
</cfcase>
<cfcase value="9">
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept' value='business' null='no'></cfprocparam>
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept2' value='undergraduate' null='no'></cfprocparam>
</cfcase>
<cfcase value="10">
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept' value='education' null='no'></cfprocparam>
<cfprocparam type='in' cfsqltype='cf_sql_varchar' variable='@dept2' value='education' null='no'></cfprocparam>
</cfcase>
</cfswitch>
</cfstoredproc>
<cfscript>
this.formData = newFormData();
this.formData.columns = xmlDataToArray(this.xmlData);
this.formData.tablename = "tblCourseListing";
this.formData.title = "Course Details";
tabCount = 1;
x = StructNew();
x.title = 'Course Number/Title';
x.varname = 'intCourseID';
x.required = true;
x.type = TYPES.SELECT;
x.query = qryCourseNumbers;
x.displayVar = "CourseName";
x.valueVar = "CourseID";
x.onChange = "txtTitle.value=intCourseID.options[intCourseID.selectedIndex].text;";
ArrayPrepend(this.formData.columns, x);
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Details";
this.formData.tabs[tabCount].columnlist = "txtTitle,intCategoryID,intCourseID,blnCCSSLink";
if (qryConfig.blnImage is 1) {
this.formData.tabs[tabCount].columnlist = this.formData.tabs[tabCount].columnlist & ',intImageID';
}
if (qryConfig.blnLink is 1) {
this.formData.tabs[tabCount].columnlist = this.formData.tabs[tabCount].columnlist & ',txtLink';
}
if (qryConfig.blnSecurityEnabled is 1) {
this.formData.tabs[tabCount].columnlist = this.formData.tabs[tabCount].columnlist & ',blnPrivate';
}
if (qryConfig.blnDate is 1) {
tabCount = tabcount + 1;
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Date";
this.formData.tabs[tabCount].columnlist = 'dtDate';
}
if (qryConfig.blnAddress is 1 OR qryConfig.blnPhone is 1 OR qryConfig.blnFax is 1 OR qryConfig.blnEmail is 1) {
tabCount = tabCount + 1;
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Address";
this.formData.tabs[tabCount].columnlist = '';
}
if (qryConfig.blnAddress is 1) {
this.formData.tabs[tabCount].columnlist = ListAppend(this.formData.tabs[tabCount].columnlist,'txtAddress,txtCity,txtProvince,txtCountry,txtPostalCode');
}
if (qryConfig.blnPhone is 1) {
this.formData.tabs[tabCount].columnlist = ListAppend(this.formData.tabs[tabCount].columnlist,'txtPhone,txtTollFree');
}
if (qryConfig.blnFax is 1) {
this.formData.tabs[tabCount].columnlist = ListAppend(this.formData.tabs[tabCount].columnlist,'txtFax');
}
if (qryConfig.blnEmail is 1) {
this.formData.tabs[tabCount].columnlist = ListAppend(this.formData.tabs[tabCount].columnlist,'txtEmail');
}
if (qryConfig.blnAbstract is 1) {
tabCount = tabCount + 1;
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Abstract";
this.formData.tabs[tabCount].columnlist = "txtAbstract";
}
tabCount = tabCount + 1;
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Body";
this.formData.tabs[tabCount].columnlist = "txtDescription";
this.formData.notificationTabIndex = 0;
if (qryConfig.blnNotification is 1) {
tabCount = tabCount + 1;
this.formData.tabs[tabCount] = StructNew();
this.formData.tabs[tabCount].caption = "Notification";
this.formData.tabs[tabCount].columnlist = "blnNotification";
this.formData.notificationTabIndex = tabCount;
}
this.formData.webid = this.webid;
this.formData.datatype = this.DATATYPES.ITEM;
this.formData.navid = this.navid;
this.formData.subid = this.subid;
this.formData.tabid = this.tabid;
this.formData.link = this.link;
this.formData.varID = "intID";
this.formData.blnWorkflow = true;
this.formData.blnApproval = true;
this.formData.blnLock = true;
this.formData.blnVersion = true;
this.formData.blnDelete = true;
this.formData.blnPreview = true;
this.formData.blnCategory = true;
this.formData.blnScheduling = true;
this.formData.blnMeta = true;
this.formData.blnResources = true;
this.formData.blnTranslate = true;
this.formData.blnOrder = true;
</cfscript>
<!--- category data --->
<cfxml casesensitive="no" variable="this.xmlCatData">
<cfoutput>
<data>
<item varname="txtTitle" title="Title" type="#this.TYPES.TEXT#" required="true"/>
<item varname="intImageID" title="Image" type="#this.TYPES.MEDIA#" required="true" ext="jpeg,jpg,jpe,gif,png"/>
<item varname="blnShowCategoryTitle" title="Show Category Title?" type="#this.TYPES.BOOLEAN#" required="false"/>
<item varname="txtDescription" title="Description" type="#this.TYPES.HTML#" required="false"/>
<item varname="intCategoryID" title="Category" type="#this.TYPES.HIDDEN#" required="false" vartype="int"/>
</data>
</cfoutput>
</cfxml>
<cfscript>
this.catData = newFormData();
this.catData.itemname = "Category";
this.catData.itemsname = "Categories";
this.catData.tablename = "tblCourseListingCategory";
this.catData.datatype = this.DATATYPES.CATEGORY;
this.catData.navid = this.navid;
this.catData.subid = this.subid;
this.catData.tabid = this.tabid;
this.catData.webid = this.webid;
this.catData.link = this.link;
this.catData.varID = "intID";
this.catData.columns = xmlDataToArray(this.xmlCatData);
this.catData.tabs[1] = StructNew();
this.catData.tabs[1].caption = "Title";
this.catData.tabs[1].columnlist = "txtTitle,blnShowCategoryTitle,intCategoryID";
if (qryConfig.blnCategoryImage is 1) {
this.catData.tabs[1].columnlist = this.catData.tabs[1].columnlist & ",intImageID";
}
this.catData.tabs[2] = StructNew();
this.catData.tabs[2].caption = "Description";
this.catData.tabs[2].columnlist = "txtDescription";
this.catData.blnWorkflow = true;
this.catData.blnApproval = true;
this.catData.blnLock = true;
this.catData.blnVersion = true;
this.catData.blnDelete = true;
this.catData.blnPreview = false;
this.catData.blnCategory = false;
this.catData.blnScheduling = false;
this.catData.blnMeta = true;
this.catData.blnResources = false;
this.catData.blnOrder = true;
</cfscript>
<!--- notification list data --->
<cfxml casesensitive="no" variable="this.xmlListData">
<cfoutput>
<data>
<item varname="intItemID" title="" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intListID" title="" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intCompanyID" title="" type="#this.TYPES.SELECT#" required="false"/>
</data>
</cfoutput>
</cfxml>
<cfscript>
this.listData = newFormData();
this.listData.tablename = "tblCourseListingLists";
this.listData.blnExtraColumns = false;
this.listData.columns = xmlDataToArray(this.xmlListData);
</cfscript>
<!--- role data --->
<cfxml casesensitive="no" variable="this.xmlRoleData">
<cfoutput>
<data>
<item varname="intWebID" title="" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intCompanyID" title="" type="#this.TYPES.SELECT#" required="false"/>
<item varname="intRoleID" title="" type="#this.TYPES.SELECT#" required="false"/>
</data>
</cfoutput>
</cfxml>
<cfscript>
this.roleData = newFormData();
this.roleData.tablename = "tblCourseListingRole";
this.roleData.blnExtraColumns = false;
this.roleData.columns = xmlDataToArray(this.xmlRoleData);
</cfscript>
<cfreturn this />
</cffunction>
<!--- returns query of all data -- containing at least some minimal set of columns --->
<cffunction name="getQuery" access="private" returntype="query">
<cfif (this.datatype is this.DATATYPES.CATEGORY)>
<cfreturn this.workflow.getQuery(this.catData) />
<cfelse>
<cfreturn this.workflow.getQuery(this.formData) />
</cfif>
</cffunction>
<!--- return list of ulisting categories --->
<cffunction name="getCategoryQuery" access="private" returntype="query">
<cfset var qryCategory = ''>
<cfquery name="qryCategory" datasource="#this.datasource#" cachedwithin="#this.queryCache#">
SELECT NAV.intID, NAV.intOrder, ULCAT.blnShowCategoryTitle,
ULCAT.txtTitle, ULCAT.intCategoryID, ULCAT.blnLive, ULCAT.txtDescription, ULCAT.intImageID, ULCAT.intItemID
FROM tblNavigation AS NAV
LEFT JOIN #this.catData.tablename# AS ULCAT
ON ULCAT.intCategoryID = NAV.intID AND ULCAT.blnLive = 1
WHERE NAV.intParentID = #this.webid#
AND NAV.blnCategory = 1
AND ULCAT.blnLive = 1
AND NAV.blnDeleted = 0
<cfif isDefined('ckeywords')>
AND (ULCAT.txtTitle LIKE N'%#ckeywords#%' OR ULCAT.txtDescription LIKE N'%#ckeywords#%')
</cfif>
ORDER BY NAV.intOrder
</cfquery>
<cfreturn qryCategory />
</cffunction>
<cffunction name="getItemQuery" access="public" returntype="query" output="false">
<cfargument name="qryConfig" type="query" required="false">
<cfargument name="blnLive" type="boolean" default="false" required="no">
<cfset var qryItem = ''>
<cfquery name="qryItem" datasource="#this.datasource#" cachedwithin="#this.queryCache#">
SELECT
<cfif this.formData.blnCategory>
isnull(isnull(tblItem.intCategoryID, #this.formData.tablename#.intCategoryID), 0) AS intCategoryID,
</cfif>
#this.formData.tablename#.*, tblItem.intID, tblItem.intOrder as intItemOrder
FROM tblItem
INNER JOIN #this.formData.tablename#
ON tblItem.intID = #this.formData.tablename#.intItemID
<cfif arguments.blnLive>
AND #this.formData.tablename#.blnLive = 1
</cfif>
LEFT JOIN tblItemLock ON tblItem.intID = tblItemLock.intItemID
AND tblItemLock.intID IN (SELECT TOP 1 intID FROM tblItemLock WHERE intItemID = tblItem.intID)
LEFT JOIN tblNavigation ON tblItem.intWebID = tblNavigation.intID
WHERE tblItem.intDataType = #val(this.formData.datatype)#
AND tblNavigation.intCompanyID = #this.companyID#
AND tblItem.blnDeleted = 0
AND tblItem.intWebID = #this.formData.webid#
<cfif arguments.blnLive is true AND this.formData.blnScheduling>
AND (#this.formData.tablename#.dtStart IS NULL OR #this.formData.tablename#.dtStart <= #getODBCNow()#)
AND (#this.formData.tablename#.dtEnd IS NULL OR #this.formData.tablename#.dtEnd >= #getODBCNow()#)
</cfif>
<cfif isDefined("URL.c") and Val(URL.c)>
AND #this.formData.tablename#.intCategoryID = #URL.c#
</cfif>
<cfif isDefined("ikeywords") and Len(Trim(ikeywords))>
AND (#this.formData.tablename#.txtTitle LIKE N'%#ikeywords#%' OR #this.formData.tablename#.txtDescription LIKE '%#ikeywords#%'
<cfif qryConfig.blnAbstract is 1>OR #this.formData.tablename#.txtAbstract LIKE '%##ikeywords##%'</cfif>
<cfif qryConfig.blnAddress is 1>
OR #this.formData.tablename#.txtAddress LIKE N'%#ikeywords#%' OR #this.formData.tablename#.txtCity LIKE '%#ikeywords#%'
OR #this.formData.tablename#.txtProvince LIKE N'%#ikeywords#%' OR #this.formData.tablename#.txtProvince LIKE '%#ikeywords#%'
OR #this.formData.tablename#.txtCountry LIKE N'%#ikeywords#%' OR #this.formData.tablename#.txtCountry LIKE '%#ikeywords#%'
OR #this.formData.tablename#.txtPostalCode LIKE N'%#ikeywords#%' OR #this.formData.tablename#.txtPostalCode LIKE '%#ikeywords#%'
</cfif>
<cfif qryConfig.blnLink is 1>
OR #this.formData.tablename#.txtLink LIKE N'%#ikeywords#%'
</cfif>)
</cfif>
ORDER BY
<cfif qryConfig.blnDate is 1>
#this.formData.tablename#.dtDate DESC,
</cfif>
<cfif this.formData.blnOrder>
tblItem.intOrder
<cfelse>
#this.formData.tablename#.#this.formData.sortcolumn# #this.formData.sortdirection#
</cfif>
</cfquery>
<cfreturn qryItem />
</cffunction>
<!--- /getItemQuery --->
<!--- returns ulisting config settings --->
<cffunction name="getConfigQuery" access="public" returntype="query">
<cfset var qryConfig = ''>
<cfquery name="qryConfig" datasource="#this.datasource#" maxrows="1" cachedwithin="#this.queryCache#">
SELECT TOP 1 *
FROM #this.configData.tablename#
WHERE blnDeleted = 0 AND intCompanyID = #this.companyID# AND intWebID = #this.webid#
</cfquery>
<cfreturn qryConfig />
</cffunction>
<!--- returns ulisting roles used for accessing private items --->
<cffunction name="getRoleQuery" access="private" returntype="query">
<cfset var qryRoles = ''>
<cfquery name="qryRoles" datasource="#this.datasource#">
SELECT intWebID, intCompanyID, intRoleID
FROM #this.roleData.tablename#
WHERE intWebID = <cfqueryparam value="#this.webID#" cfsqltype="cf_sql_integer">
AND intCompanyID = <cfqueryparam value="#this.CompanyID#" cfsqltype="cf_sql_integer">
</cfquery>
<cfreturn qryRoles />
</cffunction>
<!--- returns ulisting roles as a comma-delimited list --->
<cffunction name="getListRoles" access="private" returntype="string" output="false">
<cfset var qryRoles = getRoleQuery()>
<cfset var listRoles = ValueList(qryRoles.intRoleID)>
<cfreturn listRoles />
</cffunction>
<!--- returns the URL of the login page for extranet --->
<cffunction name="getLoginURL" access="private" returntype="string" output="false">
<cfset var loginURL = ''>
<cfquery name="qryLoginPage" datasource="#this.datasource#">
SELECT TOP 1 tblNavigation.intID
FROM tblNavigation LEFT JOIN tblPlugin ON tblNavigation.intPluginID = tblPlugin.intID
WHERE tblPlugin.txtType = <cfqueryparam value='extranet login' cfsqltype="cf_sql_varchar">
AND tblNavigation.blnDeleted = <cfqueryparam value="0" cfsqltype="cf_sql_tinyint">
AND tblNavigation.blnActive = <cfqueryparam value="1" cfsqltype="cf_sql_tinyint">
AND intCompanyID = <cfqueryparam value="#this.CompanyID#" cfsqltype="cf_sql_integer">
</cfquery>
<cfif qryLoginPage.recordCount GT 0>
<cfset loginURL = this.qryCompany.txtWeb & "/" & this.navigation.getDirectory(qryLoginPage.intID) & "index.cfm">
&nb