1 16 17 package org.apache.jetspeed.portal.portlets.admin; 18 19 import org.apache.ecs.html.*; 21 import org.apache.ecs.ElementContainer; 22 23 import org.apache.jetspeed.portal.portlets.AbstractPortlet; 25 import org.apache.jetspeed.portal.PortletException; 26 import org.apache.jetspeed.services.resources.JetspeedResources; 27 28 import org.apache.turbine.util.RunData; 30 31 import java.util.Iterator ; 33 34 40 public class JetspeedPropertiesPortlet extends AbstractPortlet { 41 42 public static final String INPUT_SIZE = "70"; 43 44 46 public void init() throws PortletException { 47 48 this.setTitle("Properties"); 49 this.setDescription("Jetspeed Properties"); 50 51 52 ElementContainer root = new ElementContainer(); 53 Table table = new Table().setWidth("100%"); 54 55 Iterator i = JetspeedResources.getKeys(); 56 57 root.addElement( new B( "Jetspeed properties: " ) ); 58 59 while ( i.hasNext() ) { 60 String key = (String )i.next(); 61 try { 62 Object value = JetspeedResources.getString(key); 63 TR row = new TR(); 64 row.addElement( new TD().addElement( key ) ); 65 66 if (value == null) { 67 value = ""; 68 } 69 row.addElement( new TD() 70 .addElement( new Input( "text", 71 "nothing", 72 value.toString() ) 73 .setSize( INPUT_SIZE ) ) ); 74 75 table.addElement( row ); 76 } catch (Throwable t) { 77 78 } 79 80 } 81 82 root.addElement( new Center( table ) ); 83 84 this.setContent( new Form( root ) ); 87 88 } 89 90 92 public boolean getAllowEdit( RunData rundata ) { 93 return false; 94 } 95 96 98 public boolean getAllowMaximize( RunData rundata ) { 99 return false; 100 } 101 102 103 } 104 | Popular Tags |