Author: chathura
Date: Sun Dec  9 22:41:29 2007
New Revision: 10767

Log:


Added Impl to change tag cloud according to the tag count.



Modified:
   trunk/registry/modules/core/src/main/java/org/wso2/registry/Tag.java
   trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp

Modified: trunk/registry/modules/core/src/main/java/org/wso2/registry/Tag.java
==============================================================================
--- trunk/registry/modules/core/src/main/java/org/wso2/registry/Tag.java        
(original)
+++ trunk/registry/modules/core/src/main/java/org/wso2/registry/Tag.java        
Sun Dec  9 22:41:29 2007
@@ -20,6 +20,7 @@
 
     private String tagName;
     private long tagCount;
+    private int categary = 1;
 
     public String getTagName() {
         return tagName;
@@ -35,5 +36,25 @@
 
     public void setTagCount(long tagCount) {
         this.tagCount = tagCount;
+
+        if (tagCount <= 2) {
+            categary = 1;            
+        } else if (tagCount > 2 && tagCount < 8) {
+            categary = 2;
+        } else if (tagCount > 8 && tagCount < 20) {
+            categary = 3;
+        } else if (tagCount > 20 && tagCount < 50) {
+            categary = 4;
+        } else if (tagCount > 50) {
+            categary = 5;
+        }
+    }
+
+    public int getCategary() {
+        return categary;
+    }
+
+    public void setCategary(int categary) {
+        this.categary = categary;
     }
 }

Modified: 
trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp 
(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/registry-resources.jsp 
Sun Dec  9 22:41:29 2007
@@ -267,9 +267,9 @@
         <%
             Iterator iTags = details.getTags().iterator();
             while (iTags.hasNext()) {
-                Tag tag = (Tag) iTags.next();
+                Tag tag = (Tag) iTags.next();                                
         %>
-        <span style="font-size:19px;"><%=tag.getTagName()%></span>
+        <a href="#" 
class="cloud-x<%=tag.getCategary()%>"><%=tag.getTagName()%></a>
         <% } %>
     </div>
 

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to