You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/08/04 20:30:55 UTC

svn commit: r428831 - in /geronimo/sandbox/svkmerge/m2migration/modules/system/src: ./ java/org/apache/geronimo/system/plugin/PluginMetadata.java

Author: jdillon
Date: Fri Aug  4 11:30:54 2006
New Revision: 428831

URL: http://svn.apache.org/viewvc?rev=428831&view=rev
Log:
 r622@jason-dillons-computer (orig r427991):  jdillon | 2006-08-02 07:13:42 -0700
  r607@dyn456093 (orig r427388):  ammulder | 2006-07-31 17:43:46 -0700
  Merge GERONIMO-2253 to trunk
  
 

Modified:
    geronimo/sandbox/svkmerge/m2migration/modules/system/src/   (props changed)
    geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java

Propchange: geronimo/sandbox/svkmerge/m2migration/modules/system/src/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Aug  4 11:30:54 2006
@@ -1 +1 @@
-13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/system/src:427989
+13f79535-47bb-0310-9956-ffa450edef68:/geronimo/sandbox/svkmerge/trunk/modules/system/src:427991

Modified: geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java?rev=428831&r1=428830&r2=428831&view=diff
==============================================================================
--- geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java (original)
+++ geronimo/sandbox/svkmerge/m2migration/modules/system/src/java/org/apache/geronimo/system/plugin/PluginMetadata.java Fri Aug  4 11:30:54 2006
@@ -18,6 +18,8 @@
 
 import java.io.Serializable;
 import java.net.URL;
+import java.util.List;
+import java.util.ArrayList;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.configuration.GBeanOverride;
 
@@ -96,6 +98,20 @@
     }
 
     /**
+     * Gets a description of this module in HTML format (with paragraph
+     * markers).
+     */
+    public String getHTMLDescription() {
+        String[] paras = splitParas(description);
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < paras.length; i++) {
+            String para = paras[i];
+            buf.append("<p>").append(para).append("</p>\n");
+        }
+        return buf.toString();
+    }
+
+    /**
      * Gets a category name for this configuration.  In a list, configurations
      * in the same category will be listed together.  There are no specific
      * allowed values, though each repository may have standards for that.
@@ -348,5 +364,53 @@
             }
             return buf.toString();
         }
+    }
+
+    private static String[] splitParas(String desc) {
+        int start = 0, last=0;
+        List list = new ArrayList();
+        boolean inSpace = false, multiple = false;
+        for(int i=0; i<desc.length(); i++) {
+            char c = desc.charAt(i);
+            if(inSpace) {
+                if(Character.isWhitespace(c)) {
+                    if(c == '\r' || c == '\n') {
+                        multiple = true;
+                        for(int j=i+1; j<desc.length(); j++) {
+                            char d = desc.charAt(j);
+                            if(d != c && (d == '\r' || d == '\n')) {
+                                i = j;
+                            } else {
+                                break;
+                            }
+                        }
+                    }
+                } else {
+                    if(multiple) {
+                        list.add(desc.substring(last, start).trim());
+                        last = i;
+                    }
+                    inSpace = false;
+                }
+            } else {
+                if(c == '\r' || c == '\n') {
+                    inSpace = true;
+                    multiple = false;
+                    start = i;
+                    for(int j=i+1; j<desc.length(); j++) {
+                        char d = desc.charAt(j);
+                        if(d != c && (d == '\r' || d == '\n')) {
+                            i = j;
+                        } else {
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        if(last < desc.length()) {
+            list.add(desc.substring(last).trim());
+        }
+        return (String[]) list.toArray(new String[list.size()]);
     }
 }