roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eli...@apache.org
Subject svn commit: r470144 - in /incubator/roller/trunk: src/org/apache/roller/util/URLUtilities.java web/WEB-INF/jsps/authoring/WeblogEdit.jsp
Date Thu, 02 Nov 2006 00:36:57 GMT
Author: eliast
Date: Wed Nov  1 16:36:53 2006
New Revision: 470144

URL: http://svn.apache.org/viewvc?view=rev&rev=470144
Log:
- Re-added getWeblogTagsJsonURL to URLUtilities
- Re-added call to getWeblogTagsJsonURL in WeblogEdit.jsp

Modified:
    incubator/roller/trunk/src/org/apache/roller/util/URLUtilities.java
    incubator/roller/trunk/web/WEB-INF/jsps/authoring/WeblogEdit.jsp

Modified: incubator/roller/trunk/src/org/apache/roller/util/URLUtilities.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/util/URLUtilities.java?view=diff&rev=470144&r1=470143&r2=470144
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/util/URLUtilities.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/util/URLUtilities.java Wed Nov  1 16:36:53
2006
@@ -357,6 +357,32 @@
     
     
     /**
+     * Get url to JSON tags service url, optionally for a given weblog.
+     */
+    public static final String getWeblogTagsJsonURL(WebsiteData weblog,
+                                                    boolean absolute) {
+        
+        StringBuffer url = new StringBuffer();
+        
+        if(absolute) {
+            url.append(RollerRuntimeConfig.getAbsoluteContextURL());
+        } else {
+            url.append(RollerRuntimeConfig.getRelativeContextURL());
+        }
+        
+        // json tags service base
+        url.append("/roller-services/json/tags/");
+        
+        // is this for a specific weblog or site-wide?
+        if(weblog != null) {
+            url.append(weblog.getHandle()).append("/");
+        }
+        
+        return url.toString();
+    }
+    
+    
+    /**
      * Get root url for a given *preview* weblog.  
      * Optionally for a certain locale.
      */

Modified: incubator/roller/trunk/web/WEB-INF/jsps/authoring/WeblogEdit.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/web/WEB-INF/jsps/authoring/WeblogEdit.jsp?view=diff&rev=470144&r1=470143&r2=470144
==============================================================================
--- incubator/roller/trunk/web/WEB-INF/jsps/authoring/WeblogEdit.jsp (original)
+++ incubator/roller/trunk/web/WEB-INF/jsps/authoring/WeblogEdit.jsp Wed Nov  1 16:36:53 2006
@@ -17,6 +17,7 @@
 -->
 <%@ include file="/taglibs.jsp" %>
 <%@ page import="org.apache.roller.pojos.*" %>
+<%@ page import="org.apache.roller.util.URLUtilities" %>
 <%@ page import="org.apache.roller.ui.authoring.struts.formbeans.WeblogEntryFormEx" %>
 <%@ page import="org.apache.roller.ui.authoring.struts.actions.WeblogEntryPageModel" %>
 <%
@@ -173,7 +174,7 @@
 		<br/>
         <script type="text/javascript">
         <!--
-		new RollerTagsAutoCompleter("entryEditTags", "entryEditTagsChoices", "<%= request.getContextPath()
%>/roller-services/json/tags/<%= model.getWeblogEntry().getWebsite().getHandle() %>",
{ tokens : [' ',','], minChars: 2 });
+		new RollerTagsAutoCompleter("entryEditTags", "entryEditTagsChoices", "<%= URLUtilities.getWeblogTagsJsonURL(model.getWeblogEntry().getWebsite(),
false) %>", { tokens : [' ',','], minChars: 2 });
         // --></script>
     </td></tr> 
     



Mime
View raw message