Gregory's Blog

Picture test

This is a picture test... test.

This entry was posted on December 31, 2018 at 1:55 PM and has received 116 views.

Coldfish Formatter Test

I probably will rewrite the code formatting to use another library, such as prism.js, as suggested by Ray Camden. For now however, I have re-purposed the original Coldfish library that was used in the original blogCfc.

view plain about
1<!--- There are two types of routing titles. The original design used an routing title that was used to populate a contract and this title was not the official title, but something more generic that was easily identifiable on a written contract. The other title is the official title that is coming from the workday database We will use the original routing title if the user was assigned a routing title that is found in the routing database, otherwise, we will use the official workday title. --->
2<cffunction name="getTitleByEmail" access="remote" returntype="struct" hint="Determines the approver title. This will be either the routing title that was used in previous contracts, or the official title found in workday. We need to return multiple values, so this returns a one dimension array instead of a string.">
3<cfargument name="email" type="string" required="yes" hint="Supply the email.">
4
5<cfparam name="title" default="">
6
7<!---Format the email--->
8<cfinvoke component="#WorkdayUsersObj#" method="formatUwEmail" returnvariable="uwEmail">
9 <cfinvokeargument name="email" value="#arguments.email#">
10 </cfinvoke>
11
12<!--- Query the Approval database to see if the title exists. --->
13<cfquery name="approvalTitle" datasource="Contracts">
14 SELECT TOP (1)
15 ApproverTitle
16 FROM dbo.Approval
17 WHERE (Email = <cfqueryparam value="#uwEmail#" cfsqltype="cf_sql_varchar">)
18</cfquery>
19<!---Set the ApproverTitle--->
20<cfset ApproverTitle = approvalTitle.ApproverTitle>
21 <!---Get the workday job title. --->
22 <cfinvoke component="#WorkdayUsersObj#" method="getEmployeeJobTitle" returnvariable="workdayTitle">
23 <cfinvokeargument name="email" value="#email#">
24 </cfinvoke>
25
26<!---Build the shorthand struct --->
27<cfset titleStruct = {workdayTitle = #workdayTitle#, ApproverTitle = #ApproverTitle#}>
28
29<cfreturn titleStruct>
30
31</cffunction>

This entry was posted on December 15, 2018 at 7:09 PM and has received 139 views.

Removed style tags

I'm removing most of the style tags that were coded in the original blogCfc interface. there are hundreds of custom styles applied to UI elements that are conflicting with the Kendo .css themes. I also need to complete a complete re-write of Jason Delmore's logic to format the text within the &l;tcode> blocks. Additionally, I need to apply the 'k-content' class to all links.

This entry was posted on December 15, 2018 at 1:32 AM and has received 135 views.

Shorthand struct return

There are many ways to return multiple values from a cfc. Typically we return a query object, a json string, an array, or a structure, but one of my favorite ways to return multiple bits of data is using a shorthand structure. It is much easier and intuitive to use on both the back and front end than using an array. Here is a simple example:

Cfc:

view plain about
1<!--- There are two types of routing titles. The original design used an routing title that was used to populate a contract and this title was not the official title, but something more generic that was easily identifiable on a written contract. The other title is the official title that is coming from the workday database We will use the original routing title if the user was assigned a routing title that is found in the routing database, otherwise, we will use the official workday title. --->
2 <cffunction name="getTitleByEmail" access="remote" returntype="struct" hint="Determines the approver title. This will be either the routing title that was used in previous contracts, or the official title found in workday. We need to return multiple values, so this returns a one dimension array instead of a string.">
3 <cfargument name="email" type="string" required="yes" hint="Supply the email.">
4
5 <cfparam name="title" default="">
6
7 <!---Format the email--->
8 <cfinvoke component="#WorkdayUsersObj#" method="formatUwEmail" returnvariable="uwEmail">
9     <cfinvokeargument name="email" value="#arguments.email#">
10        </cfinvoke>
11
12 <!--- Query the Approval database to see if the title exists. --->
13 <cfquery name="approvalTitle" datasource="Contracts">
14     SELECT TOP (1)
15                ApproverTitle
16                FROM dbo.Approval
17                WHERE (Email = <cfqueryparam value="#uwEmail#" cfsqltype="cf_sql_varchar">)
18 </cfquery>
19 <!---Set the ApproverTitle--->
20 <cfset ApproverTitle = approvalTitle.ApproverTitle>
21         <!---Get the workday job title. --->
22         <cfinvoke component="#WorkdayUsersObj#" method="getEmployeeJobTitle" returnvariable="workdayTitle">
23            <cfinvokeargument name="email" value="#email#">
24         </cfinvoke>
25
26 <!---Build the shorthand struct --->
27 <cfset titleStruct = {workdayTitle = #workdayTitle#, ApproverTitle = #ApproverTitle#}>
28
29 <cfreturn titleStruct>
30
31 </cffunction>

On the client side, simply use the following to output the value:

view plain about
1<cfset thisRoutingTitle = getTitleByEmail(thisApproverEmail).ApproverTitle>
2<cfset thisWorkdayTitle = getTitleByEmail(thisApproverEmail).WorkdayTitle>

This entry was posted on December 14, 2018 at 12:34 PM and has received 107 views.

BlogCfc administration

Unfortunately, there is a conflict with BlogCfc's original jQuery UI and Kendo libraries, so I will not be able to incorporate Kendo into the administration section in a timely manner without a complete administration re-write.

This decision has an impact the preview of the pods in the administration section. The pods can't be rendered correctly as the Kendo and new jQuery libraries are not available on the administration interface.

While I do intend to re-writing the admin section, it is my intention on this first version to focus on different themes, and launch the new BlogCfc with a minimum amount of change. I am hoping that others can quickly install the new blog software and hopefully provide some feedback before the next version. I am going to continue to focus on the client UI and hope to release a .75 version soon without an administrator re-write.

This entry was posted on December 13, 2018 at 10:44 PM and has received 167 views.

Localization Support Dropped

I am going to forgo using Raymond's localization support for this version. To incorporate a few languages, Raymond uses the resourceBundle.cfc template that was originally coded by Paul Hastings. I believe that it supports two variants Dutch and German languages, along with English of course. Raymond labels his buttons and text messages in the different languages in 4 different .properties files, and uses the 'rb('message var') function to display the text and messages. I have decided not to incorporate the localization as I can't translate between English and the other languages, and this blog is also intended to be a living example how to use Kendo with ColdFusion. Using 'rb('pleaseWait') in my code will be confusing to the reader wanting to know how I am using ColdFusion and Kendo. It is much easier to read:

view plain about
1'$.when(kendo.ui.ExtWaitDialog.show({ title: "Please wait...", message: "Searching.", icon: "k-ext-information" }));'
than
view plain about
1'$.when(kendo.ui.ExtWaitDialog.show({ title: "<cfoutput>#rb(pleaseWait)#</cfoutput>", message: "<cfoutput>#rb(searching)#</cfoutput>", icon: "k-ext-information" }));'
for example. In one of the next versions, if someone wants to assist me in translating the English into the supported languages, I may revisit this decision and incorporate localization into the code.

This entry was posted on December 8, 2018 at 11:15 PM and has received 135 views.




Footer Logo

Your input and contributions are welcomed!

If you have an idea, BlogCfc based code, or a theme that you have built using this site that you want to share, please contribute by making a post here or share it by contacting us! This community can only thrive if we continue to work together.

Images and Photography:

Gregory Alexander either owns the copyright, or has the rights to use, all images and photographs on the site. If an image is not part of the "Galaxie Blog" open sourced distribution package, and instead is part of a personal blog post or a comment, please contact us and the author of the post or comment to obtain permission if you would like to use a personal image or photograph found on this site.

Credits:

Portions of Galaxie Blog are powered on the server side by BlogCfc, an open source blog developed by Raymond Camden. Revitalizing BlogCfc was a part of my orginal inspiration that prompted me to design this site. Some of the major open source contributers to BlogCfc include:

  1. Peter Farrell: the author of 'Lyla Captcha' that is used on this blog.
  2. Pete Freitag: the author of the 'ColdFish' code formatter that is also used on this blog.

Version:

Galaxie Blog Version 1.45 October 9 2019