Revision: 13757
          http://gate.svn.sourceforge.net/gate/?rev=13757&view=rev
Author:   valyt
Date:     2011-04-26 11:00:19 +0000 (Tue, 26 Apr 2011)

Log Message:
-----------
Changed the name of the attribute that can be supplied to override the IndexURL 
(we're now calling it urlBase as it includes scheme and port name as well as 
the server name).

Modified Paths:
--------------
    
mimir/trunk/grails-plugin-mimir/grails-app/taglib/gate/mimir/web/MimirTagLib.groovy

Modified: 
mimir/trunk/grails-plugin-mimir/grails-app/taglib/gate/mimir/web/MimirTagLib.groovy
===================================================================
--- 
mimir/trunk/grails-plugin-mimir/grails-app/taglib/gate/mimir/web/MimirTagLib.groovy
 2011-04-26 10:39:59 UTC (rev 13756)
+++ 
mimir/trunk/grails-plugin-mimir/grails-app/taglib/gate/mimir/web/MimirTagLib.groovy
 2011-04-26 11:00:19 UTC (rev 13757)
@@ -62,16 +62,21 @@
    * Creates an Index URL value by generating a link to the "index" 
    * action of the "indexManagement" controller.
    * 
-   * If provided, the <code>serverName</code> attribute is used to override 
the 
-   * the host name part of the produced URL.
+   * If provided, the <code>urlBase</code> attribute is used to override the 
+   * the scheme, host name, and port parts of the produced URL.
    */
   def createIndexUrl = { attrs, body ->
-    out << request.scheme
-    out << "://"
-    out << attrs?.serverName?: request.serverName
-    if((request.scheme == "https" && request.serverPort != 443) ||
-       (request.scheme == "http" && request.severPort != 80)) {
-      out << ":${request.serverPort}"
+    if(attrs.urlBase) {
+      String urlBase = attrs.urlBase.toString()
+      out << urlBase.endsWith('/') ? urlBase.substring(0, urlBase.length() -1) 
: urlBase
+    } else {
+      out << request.scheme
+      out << "://"
+      out << attrs?.serverName?: request.serverName
+      if((request.scheme == "https" && request.serverPort != 443) ||
+         (request.scheme == "http" && request.severPort != 80)) {
+        out << ":${request.serverPort}"
+      }
     }
     out << g.createLink(controller:"indexManagement", action:"index",
                         params:[indexId:attrs.indexId])


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to