Blog   About   Contact

JS Calendar - ColdBox plugin

I've created a ColdBox plugin which makes use of JS Calendar of Dynarch.

 

datepicker

 

LIVE SAMPLE (requested by Sana):

JS Calendar Sample

Usage:


<!--- input field 1 --->
<input type="text" id="startDate" name="startDate" value="" />
<img src="includes/img/icons/calendar.gif"
    id="startDate_trigger" style="cursor:pointer;" title="Date selector" />


<!--- input field 2 --->
<input type="text" id="endDate" name="endDate" value="" />
<img src="includes/img/icons/calendar.gif"
    id="endDate_trigger" style="cursor:pointer;" title="Date selector" />

    
<!--- Setup Calender --->
<cfset calendar = getPlugin("Calendar",1)>
<cfset calendar.setInputField('startDate','startDate_trigger','T1')>
<cfset calendar.setInputField('endDate','endDate_trigger')>

<cfoutput>#calendar.render()#</cfoutput>

Downloads:

JS Calendar (unzip and place it in your includes directory. It should look like this: {YOURAPP}/includes/jscalendar/..)

ColdBox Plugin (without JS Calendar!)

ColdBox Spry Plugin 2.0 Released

I've updated the ColdBox Spry Plugin to version 2.0

spryexample

New implementations due many user requests:

  • TextField Validation
  • TextArea Validation
  • Radio Validation
  • Checkbox Validation
  • Select Validation
  • Password Validation
  • Confirm Validation

I also added effect examples to the Spry live sample application.

Download Spry Plugin + Sample App

Finally Bought a REAL Keyboard: 'Das Keyboard'

Remember those keyboards from the old days, like the IBM Model M?
Just bought it and I can't wait for delivery.

daskeyboard

Das Keyboard

Ant + Subversion - How to list revision numbers

Today I needed a way to list all revision numbers of a repository.

I came up with the following solution:

Notes:
- svnant required;
- subversion called from command line.


<project name="buildexample" basedir="." default="svn.revisions">
        
    <!-- Setup svnant -->
    <import file="svnant.xml"/>
    
    <!-- Temp -->
    <property name="tempDir" value="C:\\DATA\\TEMP\\${ant.project.name}" />
    
    <!-- svn repo url -->
    <property name="svn.url" value="YOUR REPO URL HERE" />

    <target name="prepare">
        <!-- Create temp directory -->
<mkdir dir="${tempDir}" />
    </target>

    <!-- Set svn.revisions property -->
    <target name="svn.revisions" description="Sets property: svn.revisions" depends="prepare">

        <!-- creates log.xml for reading revisions -->
        <exec executable="svn" outputproperty="svnlog.out" output="${tempDir}\\log.xml" >
            <arg line="log --xml -v ${svn.url}" />
        </exec>
        <xmlproperty file="${tempDir}\\log.xml" collapseattributes="true" />     
        
        <property name="svn.revisions" value="${log.logentry.revision}" />
    
        <echo>${svn.revisions}</echo>
    
        <input message="Select Start Revision" validargs="${svn.revisions}" addproperty="svn.startRevision" />
        <input message="Select End Revision" validargs="${svn.revisions}" addproperty="svn.endRevision" />
    
    </target>

</project>

Please let me know if you think there's better way to list revision numbers.

Railo CFVIDEOPLAYER 'borrowed' from JW FLV MEDIA PLAYER?

Railo doesn't mention anything on their site/blog about 'borrowing' the flv-player from Jeroen Wijering.

So please let me know if you see any difference between these flv-players:

RAILO

http://www.railo-technologies.com/en/index.cfm?treeID=360

railoplayer

JEROEN WIJERING

http://www.jeroenwijering.com/?item=JW_FLV_Media_Player

jwplayer

Goodbye Launchy, goodbye UltraExplorer (Windows)

Just replaced , Launchy with Executer and UltraExplorer with Free Commander .

image image

ColdBoxProxy and JSON

If you work a lot with JSON and remote calls like me, the following coldboxproxy.cfc code could be handy for you.

<cfcomponent name="coldboxproxy" output="false" extends="coldbox.system.extras.ColdboxProxy">

    <cffunction name="process" output="true" access="remote" returntype="any" hint="Process a remote call and return data/objects back.">
        <cfset var results = "">

            <cftry>
                <!--- Call the actual proxy --->
                <cfset results = super.process(argumentCollection=arguments)>
        
                <!--- JSON ? --->
                <cfif isDefined('arguments.json')>
                    <cfheader name="expires" value="Mon, 03 Sep 1973 00:00:01 GMT">
                    <cfheader name="pragma" value="no-cache">
                    <cfheader name="cache-control" value="no-cache">
                    <cfcontent type="text/html">
                    #getPlugin("JSON").encode(data:results,queryKeyCase:"upper")#     
                <cfelse>
                    <cfreturn results>
                </cfif>

                <cfcatch type="any">#processException(cfcatch)#</cfcatch>
            </cftry>

    </cffunction>
    
    <cffunction name="processException" output="false" access="private" returntype="string" hint="Process exception and returns bugReport">
        <cfargument name="Exception" type="any" required="true" hint="The exception structure (cfcatch)">
        
        <cfset var exceptionService = "">
        <cfset var ExceptionBean = "">        
        <cfset var interceptData = StructNew()>        
        
        <!--- Get Exception Service --->
        <cfset ExceptionService = getController().getExceptionService()>
        
        <!--- Intercept The Exception --->
        <cfset interceptData.exception = arguments.exception>
        <cfset announceInterception('onException',interceptData)>
        
        <!--- Handle The Exception --->
        <cfset ExceptionBean = ExceptionService.ExceptionHandler(arguments.exception,"coldboxproxy","ColdBox Proxy Exception")>                    
        
        <!--- Return rendered bugreport --->
        <cfreturn exceptionService.renderBugReport(ExceptionBean)>
    </cffunction>
    
</cfcomponent>

The URL of your remote call will be something like this:

coldboxproxy.cfc?method=process&json&event=ehCompany.getCompanies

Find a letter on a position in the Alphabet

Just needed a quick way to find a letter in the alphabet on a postion.

So for example, postion 1 returns 'A' and position 26 returns 'Z'.

Step 1: Function

<cffunction name="getAlphabetLetter" access="public" returntype="string">
    <cfargument name="position" type="numeric" required="true">
    
    <!--- Thanks to Ryan and Shane..... --->
    <cfif arguments.position gte 1 and arguments.position lte 26>
     <cfreturn chr(64+arguments.position) />
    <cfelse>
        <cfreturn "not in alphabet">
    </cfif>
    
</cffunction>

 Step 2: Call function

<cfoutput>#getAlphabetLetter(26)#</cfoutput>

returns: Z

BOOKMARKS in Eclipse,OPENS frequently used FILES!

Just stumbled upon on article of Luis de la Rosa which explains how to use bookmarks in Eclipse to track important lines of code.

This feaure is really handy for fast opening frequently used files in Eclipse e.g. Transfer.xml.cfm or i18n files.

Am I the only one who never used bookmarks in Eclipse before?

ColdBox SideBar, Proud To Be a ColdBox Team Member!

Luis released ColdBox 2.6.1. which includes the ColdBox SideBar I developed the last two weeks.

The ColdBox SideBar uses NEW nifty interceptor output buffers, which are absolutely useful !

Don't forget to skin the SideBar and send your screenshot ( evdlinden@gmail.com )!

Thanks again Luis!

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.004.