Index: branches/features/taskProcedureRework/grails-app/taglib/CustomTagLib.groovy
===================================================================
--- branches/features/taskProcedureRework/grails-app/taglib/CustomTagLib.groovy	(revision 795)
+++ branches/features/taskProcedureRework/grails-app/taglib/CustomTagLib.groovy	(revision 796)
@@ -1,2 +1,5 @@
+//import org.apache.commons.validator.UrlValidator
+import org.codehaus.groovy.grails.validation.routines.UrlValidator
+import org.codehaus.groovy.grails.validation.routines.RegexValidator
 
 /**
@@ -238,3 +241,56 @@
     } // jasperButtons
 
+    /**
+    * Easily create a link from a hopeful url string.
+    * If the supplied url is not considered a valid url the string is simply displayed.
+    *
+    * Fields:
+    *  url - String url to use.
+    *  body - If no body is supplied in the GSP then url.encodeAsHTML() is displayed.
+    *
+    * Example:
+    * <!--
+    * <custom:easyUrl url="${docRef.location}" />
+    * -->
+    */
+    def easyUrl = {attrs, body ->
+
+        def url = attrs.url
+
+        def html
+
+        body = body()
+        if(!body)
+            body = url.encodeAsHTML()
+
+        html = "${body}"
+
+        if(isURLValid(url)) {
+            html = """
+                        <a href="${url}">
+                            ${html}
+                        </a>
+                        """
+        }
+
+        out << html
+    }
+
+    /**
+    * Determine if a supplied string is considered a url or not.
+    * The scheme/protocol can be adjusted, file:// has been excluded here.
+    * A domainValidator regex is used to allow localhost domain.
+    * A Grails branched version of commons.validator is used, this should
+    * be compatible with the apache 1.4 version release.
+    * See: http://jira.codehaus.org/browse/GRAILS-1692 for more on Grails url validation.
+    */
+    private Boolean isURLValid(url) {
+
+        def schemes = ["http","https", "ftp"] as String[]
+        def domainValidator = new RegexValidator("localhost(:(\\d{1,5}))?")
+        def validator = new UrlValidator(schemes, domainValidator, UrlValidator.ALLOW_2_SLASHES)
+        return validator.isValid(url)
+
+    }
+
 } // end class
