Changeset 302

Show
Ignore:
Timestamp:
03/27/06 13:44:59
Author:
douglm
Message:

Two sets of changes - bwconfig and session stuff

BwConfig?: very out of date.
Started on changes to bring it up to date with all the property changes that took place.
Still broken but does build. More to follow.

Sessions - packaging the suite as one ear file revealed a number of problems with tracking session counts.
Though only intended as a guide to usage they are useful and the single static field became
an accumulation of all applications use. Switched to a table based approach using the
app name as a key.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/calendar3/common/src/edu/rpi/sss/util/Util.java

    r2 r302  
    6060import java.text.MessageFormat; 
    6161import java.util.ArrayList; 
     62import java.util.LinkedList; 
     63import java.util.List; 
    6264import java.util.Properties; 
    6365import java.util.Random; 
     66import java.util.StringTokenizer; 
    6467 
    6568/** 
     
    403406    return checkNull(val) != null; 
    404407  } 
     408 
     409  /** Turn a comma separated list into a List. 
     410   * Throws exception for invalid list. 
     411   *  
     412   * @param val     String comma separated list 
     413   * @param emptyOk Empty elements are OK 
     414   * @return List of elements, never null 
     415   * @throws Throwable for invalid list 
     416   */ 
     417  public static List getList(String val, boolean emptyOk) throws Throwable { 
     418    List l = new LinkedList(); 
     419 
     420    if ((val == null) || (val.length() == 0)) { 
     421      return l; 
     422    } 
     423 
     424    StringTokenizer st = new StringTokenizer(val, ",", false); 
     425    while (st.hasMoreTokens()) { 
     426      String token = st.nextToken().trim(); 
     427 
     428      if ((token == null) || (token.length() == 0)) { 
     429        if (!emptyOk) { 
     430          // No empty strings 
     431 
     432          throw new Exception("List has an empty element."); 
     433        } 
     434        l.add(""); 
     435      } else { 
     436        // Got non-empty element 
     437        l.add(token); 
     438      } 
     439    } 
     440 
     441    return l; 
     442  } 
    405443} 
  • trunk/calendar3/common/src/edu/rpi/sss/util/jsp/SessionListener.java

    r2 r302  
    6161 
    6262import java.util.Enumeration; 
     63import java.util.HashMap; 
     64 
    6365import org.apache.log4j.Logger; 
    6466 
     
    6769 */ 
    6870public class SessionListener implements HttpSessionListener { 
    69   private static volatile int activeSessions = 0; 
    70   private static volatile long totalSessions = 0; 
     71  private static class Counts { 
     72    int activeSessions = 0; 
     73    long totalSessions = 0; 
     74  } 
     75   
     76  private static volatile HashMap countsMap = new HashMap(); 
    7177  private static boolean logActive = true; 
    72   private static String id = ""; 
    7378 
    7479  /** Name of the init parameter holding our name */ 
     
    8388   */ 
    8489  public void sessionCreated(HttpSessionEvent se) { 
    85     activeSessions++; 
    86     totalSessions++; 
    8790    HttpSession session = se.getSession(); 
    8891    ServletContext sc = session.getServletContext(); 
     92    String appname = getAppName(session); 
     93    Counts ct = getCounts(appname); 
     94     
     95    ct.activeSessions++; 
     96    ct.totalSessions++; 
    8997 
    9098    if (logActive) { 
    9199      logSessionCounts(session, true); 
    92       sc.log("========= New session(" + id
    93              "): " + activeSessions + " active, " + 
    94              totalSessions + " total. vm(used, max)=(" + 
     100      sc.log("========= New session(" + appname
     101             "): " + ct.activeSessions + " active, " + 
     102             ct.totalSessions + " total. vm(used, max)=(" + 
    95103            Runtime.getRuntime().freeMemory()/(1024 * 1024) + "M, " + 
    96104            Runtime.getRuntime().totalMemory()/(1024 * 1024) + "M)"); 
     
    111119  /* Session Invalidation Event */ 
    112120  public void sessionDestroyed(HttpSessionEvent se) { 
    113     if (activeSessions > 0) { 
    114       activeSessions--; 
    115     } 
    116121    HttpSession session = se.getSession(); 
    117122    ServletContext sc = session.getServletContext(); 
     123    String appname = getAppName(session); 
     124    Counts ct = getCounts(appname); 
     125     
     126    if (ct.activeSessions > 0) { 
     127      ct.activeSessions--; 
     128    } 
     129     
    118130    if (logActive) { 
    119131      logSessionCounts(session, false); 
    120       sc.log("========= Session destroyed(" + id
    121              "): " + activeSessions + " active. vm(used, max)=(" + 
     132      sc.log("========= Session destroyed(" + appname
     133             "): " + ct.activeSessions + " active. vm(used, max)=(" + 
    122134            Runtime.getRuntime().freeMemory()/(1024 * 1024) + "M, " + 
    123135            Runtime.getRuntime().totalMemory()/(1024 * 1024) + "M)"); 
     
    130142  public static void setLogActive(boolean val) { 
    131143    logActive = val; 
    132   } 
    133  
    134   /** 
    135    * @return int num active sessions 
    136    */ 
    137   public static int getActiveSessions() { 
    138     return activeSessions; 
    139   } 
    140  
    141   /** 
    142    * @return long total sessions 
    143    */ 
    144   public static long getTotalSessions() { 
    145     return totalSessions; 
    146   } 
    147  
    148   /** 
    149    * @param val String id 
    150    */ 
    151   public static void setId(String val) { 
    152     if (val != null) { 
    153       id = val; 
    154     } else { 
    155       id = ""; 
    156     } 
    157144  } 
    158145 
     
    166153    Logger log = Logger.getLogger(this.getClass()); 
    167154    StringBuffer sb; 
    168     ServletContext sc = sess.getServletContext(); 
    169  
    170     String appname = sc.getInitParameter(appNameInitParameter); 
    171     if (appname == null) { 
    172       appname = "?"; 
    173     } 
     155    String appname = getAppName(sess); 
     156    Counts ct = getCounts(appname); 
    174157 
    175158    if (start) { 
     
    183166    sb.append(appname); 
    184167    sb.append(":"); 
    185     sb.append(activeSessions); 
    186     sb.append(":"); 
    187     sb.append(totalSessions); 
     168    sb.append(ct.activeSessions); 
     169    sb.append(":"); 
     170    sb.append(ct.totalSessions); 
    188171    sb.append(":"); 
    189172    sb.append(Runtime.getRuntime().freeMemory()/(1024 * 1024)); 
     
    193176 
    194177    log.info(sb.toString()); 
     178  } 
     179   
     180  private Counts getCounts(String name) { 
     181    try { 
     182      synchronized (countsMap) { 
     183        Counts c = (Counts)countsMap.get(name); 
     184         
     185        if (c == null) { 
     186          c = new Counts(); 
     187          countsMap.put(name, c); 
     188        } 
     189         
     190        return c; 
     191      } 
     192    } catch (Throwable t) { 
     193      return new Counts(); 
     194    } 
     195  } 
     196   
     197  private String getAppName(HttpSession sess) { 
     198    ServletContext sc = sess.getServletContext(); 
     199 
     200    String appname = sc.getInitParameter(appNameInitParameter); 
     201    if (appname == null) { 
     202      appname = "?"; 
     203    } 
     204     
     205    return appname; 
    195206  } 
    196207 
  • trunk/calendar3/config/configs/democal.properties

    r297 r302  
    1313# Global options 
    1414# 
    15 org.bedework.install.admin.web=true 
    16 org.bedework.install.public.web=true 
    17 org.bedework.install.personal.web=true 
    18 org.bedework.install.public.caldav=true 
    19 org.bedework.install.personal.caldav=true 
    2015 
    2116# Define the names of the applications we want to build 
  • trunk/calendar3/config/properties/default-bedework.properties

    r2 r302  
    1 org.bedework.webadmin.app.transport.guarantee=NONE 
    21# 
    32# -------------------------------------------------------------------- 
     
    1413# Global options 
    1514# 
    16 org.bedework.install.admin.web=true 
    17 org.bedework.install.public.web=true 
    18 org.bedework.install.personal.web=true 
    19 org.bedework.install.public.caldav=true 
    20 org.bedework.install.personal.caldav=true 
     15 
     16# Define the names of the applications we want to build 
     17org.bedework.install.app.names=bwconfig,CalAdmin,Events,UserCal,Pubcaldav,Usercaldav 
     18org.bedework.install.app.types=webconfig,webadmin,webpublic,webuser,publiccaldav,usercaldav 
     19 
    2120# 
    2221# -------------------------------------------------------------------- 
     
    2423# 'environment' options used globally by the system. 
    2524# 
    26 org.bedework.global.version=3.0 
    2725org.bedework.global.hibernate.dialect=org.hibernate.dialect.HSQLDialect 
    28 org.bedework.global.systemid=demobedework@mysite.edu 
     26org.bedework.global.system.name=bedework 
     27org.bedework.global.calintfclass=org.bedework.calcore.hibernate.CalintfImpl 
    2928org.bedework.global.directory.browsing.disallowed=false 
    30  
    31 org.bedework.global.public.calroot=public 
    32 org.bedework.global.user.calroot=user 
    33 org.bedework.global.default.user.calendar=calendar 
    34 org.bedework.global.public.user=public-user 
    35 #org.bedework.global.timezoneroot=timezones 
    36  
    37 org.bedework.global.userauthclass=org.bedework.calcore.hibernate.UserAuthUWDbImpl 
    38 org.bedework.global.mailerclass=org.bedework.mail.DummyMailer 
    39 org.bedework.global.calintfclass=org.bedework.calcore.hibernate.CalintfImpl 
    40 org.bedework.global.update.check.interval=5000 
    41 org.bedework.global.admingroupsclass=org.bedework.calcore.hibernate.AdminGroupsDbImpl 
    42 org.bedework.global.usergroupsclass=org.bedework.calcore.hibernate.GroupsDbImpl 
    43  
     29org.bedework.global.build.standalone.app=true 
     30 
     31# uris to cross link apps - of dubious usefulness 
     32org.bedework.global.public.admin.uri=/caladmin 
     33org.bedework.global.public.calendar.uri=/cal 
     34org.bedework.global.personal.calendar.uri=/ucal 
     35 
     36
     37# -------------------------------------------------------------------- 
     38
     39# System parameters used globally by the system and read from the db. 
     40
     41org.bedework.syspar.tzid=America/New_York 
     42org.bedework.syspar.systemid=demobedework@mysite.edu 
     43 
     44org.bedework.syspar.public.calroot=public 
     45org.bedework.syspar.user.calroot=user 
     46org.bedework.syspar.default.user.calendar=calendar 
     47org.bedework.syspar.default.trash.calendar=Trash 
     48org.bedework.syspar.default.user.inbox=Inbox 
     49org.bedework.syspar.default.user.outbox=Outbox 
     50org.bedework.syspar.default.user.view=All 
     51 
     52org.bedework.syspar.public.user=public-user 
     53 
     54org.bedework.syspar.http.connections.peruser=10 
     55org.bedework.syspar.http.connections.perhost=50 
     56org.bedework.syspar.http.connections=200 
     57 
     58org.bedework.syspar.userauthclass=org.bedework.calcore.hibernate.UserAuthUWDbImpl 
     59org.bedework.syspar.mailerclass=org.bedework.mail.DummyMailer 
     60org.bedework.syspar.admingroupsclass=org.bedework.calcore.hibernate.AdminGroupsDbImpl 
     61org.bedework.syspar.usergroupsclass=org.bedework.calcore.hibernate.GroupsDbImpl 
    4462# 
    4563# ------------------------------------------------------------------- 
     
    4765# Bedework config web client 
    4866# 
    49 org.bedework.webconfig.app.default.contenttype=text/xml 
    50 org.bedework.webconfig.build.standalone.app=true 
    51 org.bedework.webconfig.war.name=bwconfig 
    52 org.bedework.webconfig.context.root=bwconfig 
    53 org.bedework.webconfig.app.root=/bwconfigrsrc 
    54 org.bedework.webconfig.app.resources.dir=/webapps/ROOT/bwconfigrsrc 
    55 org.bedework.webconfig.deploy.dir=/webapps 
    56 org.bedework.webconfig.env.prefix=org.bedework.webconfig. 
    57  
    58 org.bedework.webconfig.app.description=Bedework properties config application 
    59 org.bedework.webconfig.app.display.name=Bedework Config 
    60 org.bedework.webconfig.app.name=bwconfig 
    61  
    62 
    63 # -------------------------------------------------------------------- 
    64 
    65 # Standalone Admin Web Client 
    66 
    67 org.bedework.webadmin.app.default.contenttype=text/xml 
    68 org.bedework.webadmin.build.standalone.app=true 
    69 org.bedework.webadmin.war.name=caladmin 
    70 org.bedework.webadmin.deploy.j2ee=false 
    71 org.bedework.webadmin.ear.name=caladmin 
    72 org.bedework.webadmin.context.root=caladmin 
    73 org.bedework.webadmin.app.root=/caladminrsrc 
    74 org.bedework.webadmin.app.resources.dir=/webapps/ROOT/caladminrsrc 
    75 org.bedework.webadmin.deploy.dir=/webapps 
    76 org.bedework.webadmin.env.prefix=org.bedework.webadmin. 
    77  
    78 org.bedework.webadmin.app.security.domain=demo 
    79 org.bedework.webadmin.app.security.prefix=demo 
    80 org.bedework.webadmin.app.transport.guarantee=NONE 
    81  
    82 org.bedework.webadmin.app.description=Struts based version of the Bedework calendar public events admin client. 
    83 org.bedework.webadmin.app.display.name=Public Events Administration 
    84 org.bedework.webadmin.app.name=DemoCalAdmin 
    85  
    86 org.bedework.webadmin.app.nogroupallowed=false 
    87  
    88 org.bedework.webadmin.app.autocreatesponsors=false 
    89 org.bedework.webadmin.app.autodeletesponsors=false 
    90 org.bedework.webadmin.app.autocreatelocations=false 
    91 org.bedework.webadmin.app.autodeletelocations=false 
    92 org.bedework.webadmin.app.allowEditAllCategories=false 
    93 org.bedework.webadmin.app.allowEditAllLocations=false 
    94 org.bedework.webadmin.app.allowEditAllSponsors=false 
    95 org.bedework.webadmin.app.categoryOptional=true 
    96  
    97 org.bedework.webadmin.app.hour24=true 
    98 org.bedework.webadmin.app.minincrement=5 
    99 org.bedework.webadmin.app.admingroupsidprefix=agrp_ 
    100  
    101 
    102 # -------------------------------------------------------------------- 
    103 
    104 # Standalone Public Web Client 
    105 
    106 org.bedework.webpubevents.app.default.contenttype=text/xml 
    107 org.bedework.webpubevents.build.standalone.app=true 
    108 org.bedework.webpubevents.war.name=cal 
    109 org.bedework.webpubevents.deploy.j2ee=false 
    110 org.bedework.webpubevents.ear.name=cal 
    111 org.bedework.webpubevents.context.root=cal 
    112 org.bedework.webpubevents.app.root=/calrsrc 
    113 org.bedework.webpubevents.app.resources.dir=/webapps/ROOT/calrsrc 
    114 org.bedework.webpubevents.deploy.dir=/webapps 
    115 org.bedework.webpubevents.env.prefix=org.bedework.webpubevents. 
    116  
    117 org.bedework.webpubevents.app.web.xml=guest/web.xml 
    118  
    119 org.bedework.webpubevents.app.description=Struts based XML version of the Bedework calendar client. It may have many skins, determined by the XSLT. 
    120 org.bedework.webpubevents.app.display.name=Demo calendar 
    121 org.bedework.webpubevents.app.name=DemoCal 
    122  
    123 org.bedework.webpubevents.app.hour24=true 
    124 org.bedework.webpubevents.app.minincrement=5 
    125 org.bedework.webpubevents.app.skinset.name=demoskins 
    126 org.bedework.webpubevents.app.showyeardata=false 
    127 org.bedework.webpubevents.app.default.view=week 
    128 org.bedework.webpubevents.app.refresh.interval=300 
    129 org.bedework.webpubevents.app.refresh.action=setup.do 
    130  
    131 
    132 # -------------------------------------------------------------------- 
    133 
    134 # Standalone Personal Web Client 
    135 
    136 org.bedework.webpersonal.app.default.contenttype=text/xml 
    137 org.bedework.webpersonal.build.standalone.app=true 
    138 org.bedework.webpersonal.war.name=ucal 
    139 org.bedework.webpersonal.deploy.j2ee=false 
    140 org.bedework.webpersonal.ear.name=ucal 
    141 org.bedework.webpersonal.context.root=ucal 
    142 org.bedework.webpersonal.app.root=/ucalrsrc 
    143 org.bedework.webpersonal.app.resources.dir=/webapps/ROOT/ucalrsrc 
    144 org.bedework.webpersonal.deploy.dir=/webapps 
    145 org.bedework.webpersonal.env.prefix=org.bedework.webpersonal. 
    146  
    147 org.bedework.webpersonal.app.web.xml=user/web.xml 
    148  
    149 org.bedework.webpersonal.app.security.domain=demo 
    150 org.bedework.webpersonal.app.security.prefix=demo 
    151 org.bedework.webpersonal.app.transport.guarantee=NONE 
    152  
    153 org.bedework.webpersonal.app.description=XML/XSLT version of the Bedework calendar client. 
    154 org.bedework.webpersonal.app.display.name=Bedework 
    155 org.bedework.webpersonal.app.name=DemoUserCal 
    156  
    157 org.bedework.webpersonal.app.hour24=true 
    158 org.bedework.webpersonal.app.minincrement=5 
    159 org.bedework.webpersonal.app.skinset.name=demoskins 
    160 org.bedework.webpersonal.app.showyeardata=false 
    161 org.bedework.webpersonal.app.default.view=day 
    162 org.bedework.webpersonal.app.refresh.interval=300 
    163 org.bedework.webpersonal.app.refresh.action=setup.do 
     67org.bedework.app.bwconfig.version=3.0 
     68org.bedework.app.bwconfig.default.contenttype=text/xml 
     69org.bedework.app.bwconfig.war.name=bwconfig 
     70org.bedework.app.bwconfig.context.root=bwconfig 
     71org.bedework.app.bwconfig.root=/bwconfigrsrc 
     72org.bedework.app.bwconfig.resources.dir=/webapps/ROOT/bwconfigrsrc 
     73org.bedework.app.bwconfig.deploy.dir=/webapps 
     74org.bedework.app.bwconfig.description=Bedework properties config application 
     75org.bedework.app.bwconfig.display.name=Bedework Config 
     76org.bedework.app.bwconfig.name=bwconfig 
     77org.bedework.app.bwconfig.guestmode=true 
     78org.bedework.app.bwconfig.publicadmin=false 
     79org.bedework.app.bwconfig.logprefix=BwConfig 
     80 
     81
     82# -------------------------------------------------------------------- 
     83
     84# Admin Web Client 
     85
     86org.bedework.app.CalAdmin.version=3.0 
     87org.bedework.app.CalAdmin.default.contenttype=text/xml 
     88org.bedework.app.CalAdmin.nogroupallowed=false 
     89 
     90org.bedework.app.CalAdmin.war.name=caladmin 
     91org.bedework.app.CalAdmin.ear.name=caladmin 
     92org.bedework.app.CalAdmin.context.root=caladmin 
     93org.bedework.app.CalAdmin.root=/caladminrsrc 
     94org.bedework.app.CalAdmin.resources.dir=/webapps/ROOT/caladminrsrc 
     95org.bedework.app.CalAdmin.deploy.dir=/webapps 
     96 
     97org.bedework.app.CalAdmin.security.domain=demo 
     98org.bedework.app.CalAdmin.security.prefix=demo 
     99org.bedework.app.CalAdmin.transport.guarantee=NONE 
     100 
     101org.bedework.app.CalAdmin.description=Struts based version of the Bedework calendar public events admin client. 
     102org.bedework.app.CalAdmin.display.name=Public Events Administration 
     103org.bedework.app.CalAdmin.name=DemoCalAdmin 
     104 
     105org.bedework.app.CalAdmin.autocreatesponsors=false 
     106org.bedework.app.CalAdmin.autodeletesponsors=false 
     107org.bedework.app.CalAdmin.autocreatelocations=false 
     108org.bedework.app.CalAdmin.autodeletelocations=false 
     109org.bedework.app.CalAdmin.allowEditAllCategories=false 
     110org.bedework.app.CalAdmin.allowEditAllLocations=false 
     111org.bedework.app.CalAdmin.allowEditAllSponsors=false 
     112org.bedework.app.CalAdmin.categoryOptional=true 
     113 
     114org.bedework.app.CalAdmin.hour24=true 
     115org.bedework.app.CalAdmin.minincrement=5 
     116org.bedework.app.CalAdmin.admingroupsidprefix=agrp_ 
     117org.bedework.app.CalAdmin.guestmode=false 
     118org.bedework.app.CalAdmin.publicadmin=true 
     119org.bedework.app.CalAdmin.logprefix=PubEventsAdmin 
     120org.bedework.app.CalAdmin.run.as.user=public-user 
     121 
     122
     123# -------------------------------------------------------------------- 
     124
     125# Public Web Client 
     126
     127org.bedework.app.Events.version=3.0 
     128org.bedework.app.Events.default.contenttype=text/xml 
     129org.bedework.app.Events.web.xml=guest/web.xml 
     130 
     131org.bedework.app.Events.war.name=cal 
     132org.bedework.app.Events.ear.name=cal 
     133org.bedework.app.Events.context.root=cal 
     134org.bedework.app.Events.root=/calrsrc 
     135org.bedework.app.Events.resources.dir=/webapps/ROOT/calrsrc 
     136org.bedework.app.Events.deploy.dir=/webapps 
     137 
     138org.bedework.app.Events.description=Struts based XML version of the Bedework calendar client. It may have many skins, determined by the XSLT. 
     139org.bedework.app.Events.display.name=Demo calendar 
     140org.bedework.app.Events.name=DemoCal 
     141org.bedework.app.Events.run.as.user=public-user 
     142 
     143org.bedework.app.Events.hour24=true 
     144org.bedework.app.Events.minincrement=5 
     145org.bedework.app.Events.skinset.name=demoskins 
     146org.bedework.app.Events.showyeardata=false 
     147org.bedework.app.Events.default.view=week 
     148org.bedework.app.Events.refresh.interval=300 
     149org.bedework.app.Events.refresh.action=setup.do 
     150org.bedework.app.Events.guestmode=true 
     151org.bedework.app.Events.publicadmin=false 
     152org.bedework.app.Events.logprefix=PubEvents 
     153 
     154
     155# -------------------------------------------------------------------- 
     156
     157# Personal Web Client 
     158
     159org.bedework.app.UserCal.version=3.0 
     160org.bedework.app.UserCal.default.contenttype=text/xml 
     161org.bedework.app.UserCal.web.xml=user/web.xml 
     162 
     163org.bedework.app.UserCal.war.name=ucal 
     164org.bedework.app.UserCal.deploy.j2ee=false 
     165org.bedework.app.UserCal.ear.name=ucal 
     166org.bedework.app.UserCal.context.root=ucal 
     167org.bedework.app.UserCal.root=/ucalrsrc 
     168org.bedework.app.UserCal.resources.dir=/webapps/ROOT/ucalrsrc 
     169org.bedework.app.UserCal.deploy.dir=/webapps 
     170 
     171org.bedework.app.UserCal.security.domain=demo 
     172org.bedework.app.UserCal.security.prefix=demo 
     173org.bedework.app.UserCal.transport.guarantee=NONE 
     174 
     175org.bedework.app.UserCal.description=XML/XSLT version of the Bedework calendar client. 
     176org.bedework.app.UserCal.display.name=Bedework 
     177org.bedework.app.UserCal.name=DemoUserCal 
     178 
     179org.bedework.app.UserCal.hour24=true 
     180org.bedework.app.UserCal.minincrement=5 
     181org.bedework.app.UserCal.skinset.name=demoskins 
     182org.bedework.app.UserCal.showyeardata=false 
     183org.bedework.app.UserCal.default.view=day 
     184org.bedework.app.UserCal.refresh.interval=300 
     185org.bedework.app.UserCal.refresh.action=setup.do 
     186org.bedework.app.UserCal.guestmode=false 
     187org.bedework.app.UserCal.publicadmin=false 
     188org.bedework.app.UserCal.logprefix=PersonalCalendar 
    164189 
    165190# 
     
    168193# Public Caldav Server 
    169194# 
    170 org.bedework.caldav.public.war.name=pubcaldav 
    171 org.bedework.caldav.public.deploy.j2ee=false 
    172 org.bedework.caldav.public.ear.name=pubcaldav 
    173 org.bedework.caldav.public.context.root=pubcaldav 
    174 org.bedework.caldav.public.deploy.dir=/webapps 
    175 org.bedework.caldav.public.env.prefix=org.bedework.caldav.public. 
    176  
    177 org.bedework.caldav.public.app.description=Bedework calendar caldav server. 
    178 org.bedework.caldav.public.app.display.name=UW Calendar 
    179 org.bedework.caldav.public.app.name=DemoPubcaldav 
     195org.bedework.app.Pubcaldav.war.name=pubcaldav 
     196org.bedework.app.Pubcaldav.ear.name=pubcaldav 
     197org.bedework.app.Pubcaldav.context.root=pubcaldav 
     198 
     199org.bedework.app.Pubcaldav.description=Bedework public caldav server. 
     200org.bedework.app.Pubcaldav.display.name=Bedework public caldav 
     201org.bedework.app.Pubcaldav.name=DemoPubcaldav 
     202org.bedework.app.Pubcaldav.deploy.dir=/webapps 
     203org.bedework.app.Pubcaldav.guestmode=true 
     204org.bedework.app.Pubcaldav.publicadmin=false 
     205org.bedework.app.Pubcaldav.run.as.user=public-user 
     206org.bedework.app.Pubcaldav.logprefix=PubCalDav 
    180207 
    181208# 
     
    184211# Personal Caldav Server 
    185212# 
    186 org.bedework.caldav.user.war.name=ucaldav 
    187 org.bedework.caldav.user.deploy.j2ee=false 
    188 org.bedework.caldav.user.ear.name=ucaldav 
    189 org.bedework.caldav.user.context.root=ucaldav 
    190 org.bedework.caldav.user.deploy.dir=/webapps 
    191 org.bedework.caldav.user.env.prefix=org.bedework.caldav.user. 
    192  
    193 org.bedework.caldav.user.app.security.domain=null 
    194 org.bedework.caldav.user.app.security.prefix=null 
    195 org.bedework.caldav.user.app.transport.guarantee=NONE 
    196  
    197 org.bedework.caldav.user.app.description=Bedework calendar caldav server. 
    198 org.bedework.caldav.user.app.display.name=UW Calendar 
    199 org.bedework.caldav.user.app.name=DemoUsrcaldav 
     213org.bedework.app.Usercaldav.war.name=ucaldav 
     214org.bedework.app.Usercaldav.ear.name=ucaldav 
     215org.bedework.app.Usercaldav.context.root=ucaldav 
     216 
     217org.bedework.app.Usercaldav.security.domain=null 
     218org.bedework.app.Usercaldav.security.prefix=null 
     219org.bedework.app.Usercaldav.transport.guarantee=NONE 
     220 
     221org.bedework.app.Usercaldav.description=Bedework user caldav server. 
     222org.bedework.app.Usercaldav.display.name=Bedework usercaldav 
     223org.bedework.app.Usercaldav.name=DemoUsrcaldav 
     224org.bedework.app.Usercaldav.deploy.dir=/webapps 
     225org.bedework.app.Usercaldav.guestmode=false 
     226org.bedework.app.Usercaldav.publicadmin=false 
     227org.bedework.app.Usercaldav.logprefix=UserCalDav 
    200228 
    201229# 
     
    205233# 
    206234 
    207 org.bedework.dumprestore.zip.name=bwdumpres 
    208 org.bedework.dumprestore.description=Bedework dump/restore utility 
    209 org.bedework.dumprestore.version=3.0 
    210 org.bedework.dumprestore.jdbcdriver.jar=${appserver.jdbcdriver.jar} 
     235org.bedework.app.dumprestore.zip.name=bwdumpres 
     236org.bedework.app.dumprestore.description=Bedework dump/restore utility 
     237org.bedework.app.dumprestore.version=3.0 
     238org.bedework.app.dumprestore.jdbcdriver.jar=${appserver.jdbcdriver.jar} 
    211239 
    212240# -------------- dump parameters ------------------ 
     
    214242org.bedework.dump.arg.dumpfile=${user.home}/.bedework/caldata.xml 
    215243org.bedework.dump.arg.debug=-debug 
    216 org.bedework.restore.arg.hib=-nhib 
    217244org.bedework.dump.arg.hibernate.dialect=org.hibernate.dialect.HSQLDialect 
    218245org.bedework.dump.arg.jdbcdriver=org.hsqldb.jdbcDriver 
     
    223250# -------------- restore parameters ------------------ 
    224251 
    225 org.bedework.restore.arg.dumpfile=${calendar.dir}/db/initcaldata.xml 
    226 org.bedework.restore.arg.fixowner= 
     252org.bedework.restore.arg.dumpfile=${calendar.dir}/dumprestore/initcaldata.xml 
    227253org.bedework.restore.arg.debug=-debug 
    228 org.bedework.restore.arg.hib=-nhib 
     254org.bedework.restore.arg.from2p3px= 
    229255org.bedework.restore.arg.fixcals=-nfixcals 
    230 org.bedework.restore.arg.calowner=caladmin 
    231 org.bedework.restore.arg.jdbc=-jdbc 
     256org.bedework.restore.arg.defaultpubliccal= 
    232257org.bedework.restore.arg.hibernate.dialect=org.hibernate.dialect.HSQLDialect 
    233258org.bedework.restore.arg.jdbcdriver=org.hsqldb.jdbcDriver 
     
    235260org.bedework.restore.arg.jdbcid=sa 
    236261org.bedework.restore.arg.jdbcpw= 
    237  
     262org.bedework.restore.arg.timezones= 
     263 
  • trunk/calendar3/config/src/org/bedework/webconfig/AbstractAction.java

    r293 r302  
    6868import org.bedework.webconfig.collections.Webpersonal; 
    6969import org.bedework.webconfig.collections.Webpublic; 
    70 import org.bedework.webconfig.props.BooleanProperty; 
    7170import org.bedework.webconfig.props.ConfigProperty; 
     71import org.bedework.webconfig.props.OrderedListProperty; 
     72import org.bedework.webconfig.props.OrderedMultiListProperty; 
    7273 
    7374import edu.rpi.sss.util.Util; 
    74 import edu.rpi.sss.util.jsp.JspUtil; 
    7575import edu.rpi.sss.util.jsp.UtilAbstractAction; 
    7676import edu.rpi.sss.util.jsp.UtilActionForm; 
     
    170170    form.addPropertyCollection(modules); 
    171171    form.addPropertyCollection(new Globals()); 
    172     form.addPropertyCollection(new Webconfig()); 
    173     form.addPropertyCollection(new Webadmin((BooleanProperty)modules.findProperty("adminwebclient"))); 
    174     form.addPropertyCollection(new Webpublic((BooleanProperty)modules.findProperty("publicwebclient"))); 
    175     form.addPropertyCollection(new Webpersonal((BooleanProperty)modules.findProperty("personalwebclient"))); 
    176     form.addPropertyCollection(new Caldavpublic((BooleanProperty)modules.findProperty("publiccaldav"))); 
    177     form.addPropertyCollection(new Caldavpersonal((BooleanProperty)modules.findProperty("personalcaldav"))); 
     172     
     173    /* Ensure module names and types same size */ 
     174     
     175    OrderedListProperty moduleNames =  
     176      (OrderedListProperty)modules.findProperty("app.names"); 
     177     
     178    OrderedMultiListProperty moduleTypes =  
     179      (OrderedMultiListProperty)modules.findProperty("app.types"); 
     180       
     181    debugMsg("sizes - names=" + moduleNames.size() + " types=" + moduleTypes.size()); 
     182     
     183    if (moduleNames.size() != moduleTypes.size()) { 
     184      form.getErr().emit("org.bedework.config.error.badmodulenames",  
     185                         moduleNames.getValue(), moduleTypes.getValue()); 
     186      return; 
     187    } 
     188     
     189    Iterator nmit = moduleNames.iterateValues(); 
     190    Iterator typeit = moduleTypes.iterateValues(); 
     191     
     192    while (nmit.hasNext()) { 
     193      String nm = (String)nmit.next(); 
     194      String type = (String)typeit.next(); 
     195       
     196      debugMsg("generate app properties - name=" + nm + " type=" + type); 
     197       
     198      if (type.equals(webconfigType)) { 
     199        form.addPropertyCollection(new Webconfig(nm)); 
     200      } else if (type.equals(webadminType)) { 
     201        form.addPropertyCollection(new Webadmin(nm)); 
     202      } else if (type.equals(webpublicType)) { 
     203        form.addPropertyCollection(new Webpublic(nm)); 
     204      } else if (type.equals(webuserType)) { 
     205        form.addPropertyCollection(new Webpersonal(nm)); 
     206      } else if (type.equals(publiccaldavType)) { 
     207        form.addPropertyCollection(new Caldavpublic(nm)); 
     208      } else if (type.equals(usercaldavType)) { 
     209        form.addPropertyCollection(new Caldavpersonal(nm)); 
     210      } else { 
     211        form.getErr().emit("org.bedework.config.error.application", type); 
     212      } 
     213    } 
    178214 
    179215    if (pr != null) { 
     
    278314    } 
    279315 
    280     String envPrefix = JspUtil.getReqProperty(frm.getMres(), 
    281                                               "org.bedework.envprefix"); 
    282  
    283316    env = new CalEnv(envPrefix, debug); 
    284317    frm.assignEnv(env); 
  • trunk/calendar3/config/src/org/bedework/webconfig/Defs.java

    r2 r302  
    6060 */ 
    6161public interface Defs { 
     62  /** This prefix never changes */ 
     63  public static final String envPrefix = "org.bedework.app.bwconfig."; 
     64   
     65  public static final String webconfigType = "webconfig"; 
     66  public static final String webadminType = "webadmin"; 
     67  public static final String webpublicType = "webpublic"; 
     68  public static final String webuserType = "webuser"; 
     69  public static final String publiccaldavType = "publiccaldav"; 
     70  public static final String usercaldavType = "usercaldav"; 
     71   
     72  /** Valid types of application */ 
     73  public static final String[] appTypes = { 
     74    webconfigType, 
     75    webadminType, 
     76    webpublicType, 
     77    webuserType, 
     78    publiccaldavType, 
     79    usercaldavType 
     80  }; 
     81   
    6282  /** Default properties file (built in to application) */ 
    6383  public final static String defaultProperties = "/properties/calendar/default-bedework.properties";  
     
    7999  /** Multi-value property - radio or select */ 
    80100  public final static int typeMultiple = 4;  
     101   
     102  /** Comment */ 
     103  public final static int typeComment = 5;  
    81104} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.ConfigProperty; 
    59  
    6057/** Caldav public events server properties. 
    6158 * 
     
    6865   * @throws Throwable 
    6966   */ 
    70   public Caldavpersonal(BooleanProperty onlyIf) throws Throwable { 
    71     super("calDAV-personal", "caldav.user", onlyIf); 
     67  public Caldavpersonal(String name) throws Throwable { 
     68    super(name, "app." + name); 
    7269 
    73     addProperty(new ConfigProperty("war", "war.name", true)); 
     70    requiredText("war", "war.name"); 
    7471 
    75     BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true); 
     72    requiredText("context.root", "context.root"); 
    7673 
    77     addProperty(j2ee); 
     74    requiredText("deploy.dir", "deploy.dir"); 
    7875 
    79     addProperty(new ConfigProperty("ear", "ear.name", true, j2ee)); 
     76    requiredText("security.domain", "app.security.domain"); 
    8077 
    81     addProperty(new ConfigProperty("context.root", "context.root", true)); 
     78    requiredText("security.prefix", "app.security.prefix"); 
    8279 
    83     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
    84  
    85     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
    86  
    87     addProperty(new ConfigProperty("security.domain", "app.security.domain", true)); 
    88  
    89     addProperty(new ConfigProperty("security.prefix", "app.security.prefix", true)); 
    90  
    91     addProperty(new ConfigProperty("transport.guarantee", "app.transport.guarantee", true)); 
     80    requiredText("transport.guarantee", "app.transport.guarantee"); 
    9281 
    9382    // We really want this to set the value of the above to NONE or CONFIDENTIAL 
    9483    //addProperty(new BooleanProperty("ssl", "use.ssl", true)); 
    9584 
    96     addProperty(new ConfigProperty("description", "app.description", true)); 
     85    requiredText("description", "app.description"); 
    9786 
    98     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
     87    requiredText("display.name", "app.display.name"); 
    9988 
    100     addProperty(new ConfigProperty("name", "app.name", true)); 
     89    requiredText("name", "app.name"); 
    10190  } 
    10291} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.ConfigProperty; 
    59  
    6057/** Caldav public events server properties. 
    6158 * 
     
    6865   * @throws Throwable 
    6966   */ 
    70   public Caldavpublic(BooleanProperty onlyIf) throws Throwable { 
    71     super("calDAV-public", "caldav.public", onlyIf); 
     67  public Caldavpublic(String name) throws Throwable { 
     68    super(name, "app." + name); 
    7269 
    73     addProperty(new ConfigProperty("war", "war.name", true)); 
     70    requiredText("war", "war.name"); 
    7471 
    75     BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true); 
     72    requiredText("context.root", "context.root"); 
    7673 
    77     addProperty(j2ee); 
     74    requiredText("deploy.dir", "deploy.dir"); 
    7875 
    79     addProperty(new ConfigProperty("ear", "ear.name", true, j2ee)); 
     76    requiredText("description", "app.description"); 
    8077 
    81     addProperty(new ConfigProperty("context.root", "context.root", true)); 
     78    requiredText("display.name", "app.display.name"); 
    8279 
    83     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
    84  
    85     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
    86  
    87     addProperty(new ConfigProperty("description", "app.description", true)); 
    88  
    89     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
    90  
    91     addProperty(new ConfigProperty("name", "app.name", true)); 
     80    requiredText("name", "app.name"); 
    9281  } 
    9382} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
     57import org.bedework.webconfig.Defs; 
    5758import org.bedework.webconfig.props.BooleanProperty; 
     59import org.bedework.webconfig.props.CommentProperty; 
    5860import org.bedework.webconfig.props.ConfigProperty; 
     61import org.bedework.webconfig.props.IntProperty; 
     62import org.bedework.webconfig.props.OrderedListProperty; 
     63import org.bedework.webconfig.props.OrderedMultiListProperty; 
    5964 
    6065import edu.rpi.sss.util.log.MessageEmit; 
     
    7782 * @author Mike Douglass 
    7883 */ 
    79 public class ConfigCollection implements Serializable { 
     84public class ConfigCollection implements Defs, Serializable { 
    8085  private String name; 
    8186  private String prefix; 
     
    160165    return properties; 
    161166  } 
     167   
     168  /** Add a required boolean property to the collection 
     169   * 
     170   * @param name 
     171   * @param suffix 
     172   * @return  BooleanProperty 
     173   * @throws Throwable 
     174   */ 
     175  public BooleanProperty requiredBoolean(String name, String suffix) throws Throwable { 
     176    BooleanProperty prop = new BooleanProperty(name, suffix, true); 
     177    addProperty(prop); 
     178     
     179    return prop; 
     180  } 
     181   
     182  /** Add an optional boolean property to the collection 
     183   * 
     184   * @param name 
     185   * @param suffix 
     186   * @return  BooleanProperty 
     187   * @throws Throwable 
     188   */ 
     189  public BooleanProperty optBoolean(String name, String suffix) throws Throwable { 
     190    BooleanProperty prop = new BooleanProperty(name, suffix, false); 
     191    addProperty(prop); 
     192     
     193    return prop; 
     194  } 
     195   
     196  /** Add a required int property to the collection 
     197   * 
     198   * @param name 
     199   * @param suffix 
     200   * @return  IntProperty 
     201   * @throws Throwable 
     202   */ 
     203  public IntProperty requiredInt(String name, String suffix) throws Throwable { 
     204    IntProperty prop = new IntProperty(name, suffix, true); 
     205    addProperty(prop); 
     206     
     207    return prop; 
     208  } 
     209   
     210  /** Add a required text property to the collection 
     211   * 
     212   * @param name 
     213   * @param suffix 
     214   * @return  ConfigProperty 
     215   * @throws Throwable 
     216   */ 
     217  public ConfigProperty requiredText(String name, String suffix) throws Throwable { 
     218    ConfigProperty prop = new ConfigProperty(name, suffix, true); 
     219    addProperty(prop); 
     220     
     221    return prop; 
     222  } 
     223   
     224  /** Add a required text property to the collection 
     225   * 
     226   * @param name 
     227   * @param suffix 
     228   * @param onlyIf     BooleanProperty - if true this field is displayed and used 
     229   * @return  ConfigProperty 
     230   * @throws Throwable 
     231   */ 
     232  public ConfigProperty requiredText(String name, String suffix, 
     233                                     BooleanProperty onlyIf) throws Throwable { 
     234    ConfigProperty prop = new ConfigProperty(name, suffix, true, onlyIf); 
     235    addProperty(prop); 
     236     
     237    return prop; 
     238  } 
     239   
     240  /** Add a required ordered list property to the collection 
     241   * 
     242   * @param name 
     243   * @param suffix 
     244   * @return 
     245   * @throws Throwable 
     246   */ 
     247  public OrderedListProperty requiredOrderedList(String name,  
     248                                                 String suffix) throws Throwable { 
     249    OrderedListProperty prop = new OrderedListProperty(name, suffix, true); 
     250    addProperty(prop); 
     251     
     252    return prop; 
     253  } 
     254   
     255  /** Add a required ordered multi list property to the collection 
     256   * 
     257   * @param name 
     258   * @param suffix 
     259   * @param possibleValues String[] array of allowable values 
     260   * @return 
     261   * @throws Throwable 
     262   */ 
     263  public OrderedMultiListProperty requiredOrderedMultiList(String name,  
     264                                                           String suffix, 
     265                                                           String[] possibleValues)  
     266               throws Throwable { 
     267    OrderedMultiListProperty prop = new OrderedMultiListProperty(name, suffix, true,  
     268                                                                 possibleValues); 
     269    addProperty(prop); 
     270     
     271    return prop; 
     272  } 
     273  
     274  /** Add a comment to the collection 
     275   * 
     276   * @param val 
     277   * @throws Throwable 
     278   */ 
     279  public void comment(String val) throws Throwable { 
     280    addProperty(new CommentProperty(val)); 
     281  } 
    162282 
    163283  /** Add a property to the collection 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Globals.java

    r64 r302  
    5252    to the maximum extent the law permits. 
    5353*/ 
    54  
    5554package org.bedework.webconfig.collections; 
    5655 
    5756import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.ConfigProperty; 
    5957 
    6058/** Global properties. 
     
    7068    super("globals", "global"); 
    7169 
    72     addProperty(new ConfigProperty("system.name", "system.name", true)); 
     70    requiredText("system.name", "system.name"); 
    7371 
    74     addProperty(new ConfigProperty("hibernate.dialect", "hibernate.dialect", true)); 
     72    requiredText("hibernate.dialect", "hibernate.dialect"); 
    7573 
    76     addProperty(new ConfigProperty("calintfclass", "calintfclass", true)); 
     74    requiredText("calintfclass", "calintfclass"); 
    7775 
    78     addProperty(new BooleanProperty("dirbrowsingDisallowed", 
    79                                          "directory.browsing.disallowed", 
    80                                          true)); 
     76    requiredBoolean("dirbrowsingDisallowed", "directory.browsing.disallowed"); 
     77 
     78    optBoolean("buildStandaloneApp", "build.standalone.app"); 
     79     
     80    BooleanProperty jetspeedportlet = optBoolean("jetspeedPortlet",  
     81                                                 "build.jetspeed.portlet"); 
     82 
     83    requiredText("jetspeed2.roles", "app.jetspeed2.roles", jetspeedportlet); 
     84 
     85    optBoolean("uportalPortlet", "build.uportal.portlet"); 
     86 
     87    BooleanProperty j2ee = optBoolean("j2ee.deploy", "deploy.j2ee"); 
     88 
     89    requiredText("ear", "ear.name", j2ee); 
     90 
     91    comment("uris to cross link apps - of dubious usefulness"); 
     92     
     93    requiredText("public.admin.uri", "public.admin.uri"); 
     94    requiredText("public.calendar.uri", "public.calendar.uri"); 
     95    requiredText("personal.calendar.uri", "personal.calendar.uri"); 
    8196  } 
    8297} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Modules.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58  
    5957/** The modules to build. 
    6058 * 
     
    6967    super("modules", "install"); 
    7068 
    71     addProperty(new BooleanProperty("adminwebclient", "admin.web", true)); 
     69    requiredOrderedList("app.names", "app.names"); 
    7270 
    73     addProperty(new BooleanProperty("publicwebclient", "public.web", true)); 
    74  
    75     addProperty(new BooleanProperty("personalwebclient", "personal.web", true)); 
    76  
    77     addProperty(new BooleanProperty("publiccaldav", "public.caldav", true)); 
    78  
    79     addProperty(new BooleanProperty("personalcaldav", "personal.caldav", true)); 
    80  
    81     addProperty(new BooleanProperty("advanced", "advanced", true)); 
     71    requiredOrderedMultiList("app.types", "app.types", appTypes); 
    8272  } 
    8373} 
    84  
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Syspars.java

    r64 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.IntProperty; 
    58 import org.bedework.webconfig.props.ConfigProperty; 
    59  
    6057/** Global properties. 
    6158 * 
     
    7067    super("syspar", "syspar"); 
    7168 
    72     addProperty(new ConfigProperty("tzid", "tzid", true)); 
     69    requiredText("tzid", "tzid"); 
    7370 
    74     addProperty(new ConfigProperty("systemid", "systemid", true)); 
     71    requiredText("systemid", "systemid"); 
    7572 
    76     addProperty(new ConfigProperty("public.calroot", "public.calroot", 
    77                                    true, true)); 
     73    requiredText("public.calroot", "public.calroot"); 
    7874 
    79     addProperty(new ConfigProperty("user.calroot", "user.calroot", 
    80                                    true, true)); 
     75    requiredText("user.calroot", "user.calroot"); 
    8176 
    82     addProperty(new ConfigProperty("default.user.calendar", 
    83                                    "default.user.calendar", true)); 
     77    requiredText("default.user.calendar", 
     78                                   "default.user.calendar"); 
    8479 
    85     addProperty(new ConfigProperty("default.trash.calendar", 
    86                                    "default.trash.calendar", true)); 
     80    requiredText("default.trash.calendar", 
     81                                   "default.trash.calendar"); 
    8782 
    88     addProperty(new ConfigProperty("default.user.inbox", 
    89                                    "default.user.inbox", true)); 
     83    requiredText("default.user.inbox", 
     84                                   "default.user.inbox"); 
    9085 
    91     addProperty(new ConfigProperty("default.user.outbox", 
    92                                    "default.user.outbox", true)); 
     86    requiredText("default.user.outbox", 
     87                                   "default.user.outbox"); 
    9388 
    94     addProperty(new ConfigProperty("default.user.view", 
    95                                    "default.user.view", true)); 
     89    requiredText("default.user.view", 
     90                                   "default.user.view"); 
    9691 
    97     addProperty(new ConfigProperty("public.user", "public.user", true, true)); 
     92    requiredText("public.user", "public.user"); 
    9893 
    99     addProperty(new IntProperty("http.connections.peruser", "http connections per user", true, true)); 
     94    requiredInt("http.connections.peruser", "http connections per user"); 
    10095 
    101     addProperty(new IntProperty("http.connections.perhost", "http connections per host", true, true)); 
     96    requiredInt("http.connections.perhost", "http connections per host"); 
    10297 
    103     addProperty(new IntProperty("http.connections", "http connections", true, true)); 
     98    requiredInt("http.connections", "http connections"); 
    10499 
    105     addProperty(new ConfigProperty("userauthclass", "userauthclass", true)); 
     100    requiredText("userauthclass", "userauthclass"); 
    106101 
    107     addProperty(new ConfigProperty("mailerclass", "mailerclass", true)); 
     102    requiredText("mailerclass", "mailerclass"); 
    108103 
    109     addProperty(new ConfigProperty("admingroupsclass", "admingroupsclass", true)); 
     104    requiredText("admingroupsclass", "admingroupsclass"); 
    110105 
    111     addProperty(new ConfigProperty("usergroupsclass", "usergroupsclass", true)); 
     106    requiredText("usergroupsclass", "usergroupsclass"); 
    112107  } 
    113108} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.IntProperty; 
    59 import org.bedework.webconfig.props.ConfigProperty; 
    60  
    6157/** Web admin client properties. 
    6258 * 
     
    6965   * @throws Throwable 
    7066   */ 
    71   public Webadmin(BooleanProperty onlyIf) throws Throwable { 
    72     super("Webadmin", "webadmin", onlyIf); 
     67  public Webadmin(String name) throws Throwable { 
     68    super(name, "app." + name); 
    7369 
    74     addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true)); 
     70    requiredText("defaultContentType", "app.default.contenttype"); 
    7571 
    76     addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true)); 
     72    requiredText("war", "war.name"); 
    7773 
    78     BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 
    79     addProperty(jetspeedportlet); 
     74    requiredText("context.root", "context.root"); 
    8075 
    81     addProperty(new ConfigProperty("jetspeed2.roles", "app.jetspeed2.roles", true, jetspeedportlet)); 
     76    requiredText("app.root", "app.root"); 
    8277 
    83     BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 
    84     addProperty(uportalportlet); 
     78    requiredText("resources.dir", "app.resources.dir"); 
    8579 
    86     addProperty(new ConfigProperty("war", "war.name", true)); 
     80    requiredText("deploy.dir", "deploy.dir"); 
    8781 
    88     BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true); 
     82    requiredText("security.domain", "app.security.domain"); 
    8983 
    90     addProperty(j2ee); 
     84    requiredText("security.prefix", "app.security.prefix"); 
    9185 
    92     addProperty(new ConfigProperty("ear", "ear.name", true, j2ee)); 
    93  
    94     addProperty(new ConfigProperty("context.root", "context.root", true)); 
    95  
    96     addProperty(new ConfigProperty("app.root", "app.root", true)); 
    97  
    98     addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true)); 
    99  
    100     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
    101  
    102     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
    103  
    104     addProperty(new ConfigProperty("security.domain", "app.security.domain", true)); 
    105  
    106     addProperty(new ConfigProperty("security.prefix", "app.security.prefix", true)); 
    107  
    108     addProperty(new ConfigProperty("transport.guarantee", "app.transport.guarantee", true)); 
     86    requiredText("transport.guarantee", "app.transport.guarantee"); 
    10987 
    11088    // We really want this to set the value of the above to NONE or CONFIDENTIAL 
    11189    //addProperty(new BooleanProperty("ssl", "use.ssl", true)); 
    11290 
    113     addProperty(new ConfigProperty("description", "app.description", true)); 
     91    requiredText("description", "app.description"); 
    11492 
    115     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
     93    requiredText("display.name", "app.display.name"); 
    11694 
    117     addProperty(new ConfigProperty("name", "app.name", true)); 
     95    requiredText("name", "app.name"); 
    11896 
    119     addProperty(new BooleanProperty("noGroupAllowed", "app.nogroupallowed", true)); 
     97    requiredBoolean("noGroupAllowed", "app.nogroupallowed"); 
    12098 
    121     addProperty(new BooleanProperty("autocreatesponsors", "app.autocreatesponsors", true)); 
     99    requiredBoolean("autocreatesponsors", "app.autocreatesponsors"); 
    122100 
    123     addProperty(new BooleanProperty("autodeletesponsors", "app.autodeletesponsors", true)); 
     101    requiredBoolean("autodeletesponsors", "app.autodeletesponsors"); 
    124102 
    125     addProperty(new BooleanProperty("autocreatelocations", "app.autocreatelocations", true)); 
     103    requiredBoolean("autocreatelocations", "app.autocreatelocations"); 
    126104 
    127     addProperty(new BooleanProperty("autodeletelocations", "app.autodeletelocations", true)); 
     105    requiredBoolean("autodeletelocations", "app.autodeletelocations"); 
    128106 
    129     addProperty(new BooleanProperty("allowEditAllCategories", "app.allowEditAllCategories", true)); 
     107    requiredBoolean("allowEditAllCategories", "app.allowEditAllCategories"); 
    130108 
    131     addProperty(new BooleanProperty("allowEditAllLocations", "app.allowEditAllLocations", true)); 
     109    requiredBoolean("allowEditAllLocations", "app.allowEditAllLocations"); 
    132110 
    133     addProperty(new BooleanProperty("allowEditAllSponsors", "app.allowEditAllSponsors", true)); 
     111    requiredBoolean("allowEditAllSponsors", "app.allowEditAllSponsors"); 
    134112 
    135     addProperty(new BooleanProperty("categoryOptional", "app.categoryOptional", true)); 
     113    requiredBoolean("categoryOptional", "app.categoryOptional"); 
    136114 
    137     addProperty(new BooleanProperty("hour24", "app.hour24", true)); 
     115    requiredBoolean("hour24", "app.hour24"); 
    138116 
    139     addProperty(new IntProperty("minincrement", "app.minincrement", true)); 
     117    requiredInt("minincrement", "app.minincrement"); 
    140118 
    141     addProperty(new ConfigProperty("admingroupsidprefix", "app.admingroupsidprefix", true)); 
     119    requiredText("admingroupsidprefix", "app.admingroupsidprefix"); 
    142120  } 
    143121} 
    144  
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.ConfigProperty; 
    59  
    6057/** Web config client properties. 
    6158 * 
     
    6764   * @throws Throwable 
    6865   */ 
    69   public Webconfig() throws Throwable { 
    70     super("Webconfig", "webconfig", false); 
     66  public Webconfig(String name) throws Throwable { 
     67    super(name, "app." + name, false); 
    7168 
    72     addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true)); 
     69    requiredText("defaultContentType", "app.default.contenttype"); 
    7370 
    74     addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true)); 
     71    requiredText("war", "war.name"); 
    7572 
    76     addProperty(new ConfigProperty("war", "war.name", true)); 
     73    requiredText("context.root", "context.root"); 
    7774 
    78     addProperty(new ConfigProperty("context.root", "context.root", true)); 
     75    requiredText("app.root", "app.root"); 
    7976 
    80     addProperty(new ConfigProperty("app.root", "app.root", true)); 
     77    requiredText("resources.dir", "app.resources.dir"); 
    8178 
    82     addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true)); 
     79    requiredText("deploy.dir", "deploy.dir"); 
    8380 
    84     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
     81    requiredText("envprefix", "env.prefix"); 
    8582 
    86     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
     83    requiredText("description", "app.description"); 
    8784 
    88     addProperty(new ConfigProperty("description", "app.description", true)); 
     85    requiredText("display.name", "app.display.name"); 
    8986 
    90     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
    91  
    92     addProperty(new ConfigProperty("name", "app.name", true)); 
     87    requiredText("name", "app.name"); 
    9388  } 
    9489} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.IntProperty; 
    59 import org.bedework.webconfig.props.ConfigProperty; 
    60  
    6157/** Web personal client properties. 
    6258 * 
     
    6965   * @throws Throwable 
    7066   */ 
    71   public Webpersonal(BooleanProperty onlyIf) throws Throwable { 
    72     super("webpersonal", "webpersonal", onlyIf); 
     67  public Webpersonal(String name) throws Throwable { 
     68    super(name, "app." + name); 
    7369 
    74     addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true)); 
     70    requiredText("defaultContentType", "app.default.contenttype"); 
    7571 
    76     addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true)); 
     72    requiredText("war", "war.name"); 
    7773 
    78     BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 
    79     addProperty(jetspeedportlet); 
     74    requiredText("context.root", "context.root"); 
    8075 
    81     BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 
    82     addProperty(uportalportlet); 
     76    requiredText("app.root", "app.root"); 
    8377 
    84     addProperty(new ConfigProperty("war", "war.name", true)); 
     78    requiredText("resources.dir", "app.resources.dir"); 
    8579 
    86     BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true); 
     80    requiredText("deploy.dir", "deploy.dir"); 
    8781 
    88     addProperty(j2ee); 
     82    requiredText("web.xml", "app.web.xml"); 
    8983 
    90     addProperty(new ConfigProperty("ear", "ear.name", true, j2ee)); 
     84    requiredText("security.domain", "app.security.domain"); 
    9185 
    92     addProperty(new ConfigProperty("context.root", "context.root", true)); 
     86    requiredText("security.prefix", "app.security.prefix"); 
    9387 
    94     addProperty(new ConfigProperty("app.root", "app.root", true)); 
    95  
    96     addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true)); 
    97  
    98     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
    99  
    100     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
    101  
    102     addProperty(new ConfigProperty("web.xml", "app.web.xml", true)); 
    103  
    104     addProperty(new ConfigProperty("security.domain", "app.security.domain", true)); 
    105  
    106     addProperty(new ConfigProperty("security.prefix", "app.security.prefix", true)); 
    107  
    108     addProperty(new ConfigProperty("transport.guarantee", "app.transport.guarantee", true)); 
     88    requiredText("transport.guarantee", "app.transport.guarantee"); 
    10989 
    11090    // We really want this to set the value of the above to NONE or CONFIDENTIAL 
    111     //addProperty(new BooleanProperty("ssl", "use.ssl", true)); 
     91    //addProperty(new BooleanProperty("ssl", "use.ssl"); 
    11292 
    113     addProperty(new ConfigProperty("description", "app.description", true)); 
     93    requiredText("description", "app.description"); 
    11494 
    115     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
     95    requiredText("display.name", "app.display.name"); 
    11696 
    117     addProperty(new ConfigProperty("name", "app.name", true)); 
     97    requiredText("name", "app.name"); 
    11898 
    119     addProperty(new BooleanProperty("hour24", "app.hour24", true)); 
     99    requiredBoolean("hour24", "app.hour24"); 
    120100 
    121     addProperty(new IntProperty("minincrement", "app.minincrement", true)); 
     101    requiredInt("minincrement", "app.minincrement"); 
    122102 
    123     addProperty(new ConfigProperty("skinset.name", "app.skinset.name", true)); 
     103    requiredText("skinset.name", "app.skinset.name"); 
    124104 
    125     addProperty(new BooleanProperty("showyeardata", "app.showyeardata", true)); 
     105    requiredBoolean("showyeardata", "app.showyeardata"); 
    126106 
    127     addProperty(new ConfigProperty("default.view", "app.default.view", true)); 
     107    requiredText("default.view", "app.default.view"); 
    128108 
    129     addProperty(new IntProperty("refresh.interval", "app.refresh.interval", true)); 
     109    requiredInt("refresh.interval", "app.refresh.interval"); 
    130110 
    131     addProperty(new ConfigProperty("refresh.action", "app.refresh.action", true)); 
     111    requiredText("refresh.action", "app.refresh.action"); 
    132112  } 
    133113} 
  • trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java

    r2 r302  
    5555package org.bedework.webconfig.collections; 
    5656 
    57 import org.bedework.webconfig.props.BooleanProperty; 
    58 import org.bedework.webconfig.props.IntProperty; 
    59 import org.bedework.webconfig.props.ConfigProperty; 
    60  
    6157/** Global properties. 
    6258 * 
     
    6965   * @throws Throwable 
    7066   */ 
    71   public Webpublic(BooleanProperty onlyIf) throws Throwable { 
    72     super("webpublic", "webpubevents", onlyIf); 
     67  public Webpublic(String name) throws Throwable { 
     68    super(name, "app." + name); 
    7369 
    74     addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true)); 
     70    requiredText("defaultContentType", "app.default.contenttype"); 
    7571 
    76     addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true)); 
     72    requiredText("war", "war.name"); 
    7773 
    78     BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 
    79     addProperty(jetspeedportlet); 
     74    requiredText("context.root", "context.root"); 
    8075 
    81     BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 
    82     addProperty(uportalportlet); 
     76    requiredText("app.root", "app.root"); 
    8377 
    84     addProperty(new ConfigProperty("war", "war.name", true)); 
     78    requiredText("resources.dir", "app.resources.dir"); 
    8579 
    86     BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true); 
     80    requiredText("deploy.dir", "deploy.dir"); 
    8781 
    88     addProperty(j2ee); 
     82    requiredText("web.xml", "app.web.xml"); 
    8983 
    90     addProperty(new ConfigProperty("ear", "ear.name", true, j2ee)); 
     84    requiredText("description", "app.description"); 
    9185 
    92     addProperty(new ConfigProperty("context.root", "context.root", true)); 
     86    requiredText("display.name", "app.display.name"); 
    9387 
    94     addProperty(new ConfigProperty("app.root", "app.root", true)); 
     88    requiredText("name", "app.name"); 
    9589 
    96     addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true)); 
     90    requiredText("run-as", "run.as.user"); 
    9791 
    98     addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true)); 
     92    requiredBoolean("hour24", "app.hour24"); 
    9993 
    100     addProperty(new ConfigProperty("envprefix", "env.prefix", true)); 
     94    requiredInt("minincrement", "app.minincrement"); 
    10195 
    102     addProperty(new ConfigProperty("web.xml", "app.web.xml", true)); 
     96    requiredText("skinset.name", "app.skinset.name"); 
    10397 
    104     addProperty(new ConfigProperty("description", "app.description", true)); 
     98    requiredBoolean("showyeardata", "app.showyeardata"); 
    10599 
    106     addProperty(new ConfigProperty("display.name", "app.display.name", true)); 
     100    requiredText("default.view", "app.default.view"); 
    107101 
    108     addProperty(new ConfigProperty("name", "app.name", true)); 
     102    requiredInt("refresh.interval", "app.refresh.interval"); 
    109103 
    110     addProperty(new ConfigProperty("run-as", "run.as.user", true)); 
    111  
    112     addProperty(new BooleanProperty("hour24", "app.hour24", true)); 
    113  
    114     addProperty(new IntProperty("minincrement", "app.minincrement", true)); 
    115  
    116     addProperty(new ConfigProperty("skinset.name", "app.skinset.name", true)); 
    117  
    118     addProperty(new BooleanProperty("showyeardata", "app.showyeardata", true)); 
    119  
    120     addProperty(new ConfigProperty("default.view", "app.default.view", true)); 
    121  
    122     addProperty(new IntProperty("refresh.interval", "app.refresh.interval", true)); 
    123  
    124     addProperty(new ConfigProperty("refresh.action", "app.refresh.action", true)); 
     104    requiredText("refresh.action", "app.refresh.action"); 
    125105  } 
    126106} 
    127  
  • trunk/calendar3/config/src/org/bedework/webconfig/props/MultiProperty.java

    r2 r302  
    5555package org.bedework.webconfig.props; 
    5656 
     57import java.util.Arrays; 
     58import java.util.Iterator; 
     59import java.util.List; 
     60 
     61import edu.rpi.sss.util.log.MessageEmit; 
     62 
    5763/** A property has a name - used by the web application for the tag, a value 
    5864 * and a suffix which is appended to the prefix defined by the collection of 
     
    6773 */ 
    6874public class MultiProperty extends ConfigProperty { 
    69   private String[] possibleValues; 
     75  private List possibleValues; 
    7076 
    7177  /** Constructor 
     
    7985                             String[] possibleValues) { 
    8086    super(name, suffix, required, false); 
    81     this.possibleValues = possibleValues
     87    this.possibleValues = Arrays.asList(possibleValues)
    8288  } 
    8389 
    84   /** Get the allowable values 
     90  /** Called at update to set the error flag and emit a message 
    8591   * 
    86    * @return String[] array of allowable values 
     92   * @param err    MessageEmit object for error messages 
     93   * @return boolean true for ok 
    8794   */ 
    88   public String[] getPossibleValues() { 
    89     return possibleValues; 
     95  public boolean validate(MessageEmit err) { 
     96    goodValue = true; 
     97 
     98    if (!getShow()) { 
     99      return true; 
     100    } 
     101 
     102    if (!possibleValues.contains(getValue())) { 
     103      err.emit("org.bedework.config.error.badvalue", getName(), getValue()); 
     104      goodValue = false; 
     105    } 
     106 
     107    return goodValue; 
     108  } 
     109 
     110  /** Iterate over the allowable values 
     111   * 
     112   * @return Iterator over allowable values 
     113   */ 
     114  public Iterator getPossibleValues() { 
     115    return possibleValues.iterator(); 
    90116  } 
    91117} 
  • trunk/calendar3/config/war/WEB-INF/classes/servlet.properties

    r2 r302  
    3434org.bedework.message.cancelled=Cancelled 
    3535 
    36 # This value is defined in CalEnv - don't lose the '.' on the end 
    37 org.bedework.envprefix=@ENV-PREFIX@ 
    38  
  • trunk/calendar3/config/war/docs/main.jsp

    r2 r302  
    1515        <propertyGroup name="<%=bwpgname%>"> 
    1616          <logic:iterate id="prop" name="pgroup" property="properties" > 
    17             <logic:equal name="prop" property="show" value="true" > 
    18               <bean:define id="ptype" name="prop" property="type" /> 
    19               <bean:define id="bwpname" name="prop" property="name" /> 
    20               <property name="<%=bwpname%>" type="<%=ptype%>"> 
    21                 <required><bean:write name="prop" property="required"/></required> 
    22                 <ok><bean:write name="prop" property="goodValue"/></ok> 
    23                 <fieldName><bean:write name="pgroup" property="name" />.<bean:write name="prop" property="name" /></fieldName> 
    24                 <fieldValue><bean:write name="prop" property="value" /></fieldValue> 
    25                 <logic:equal name="prop" property="type" value="2" > 
    26                   <checked><bean:write name="prop" property="booleanValAndFlag"/></checked> 
    27                 </logic:equal> 
     17            <logic:equal name="prop" property="type" value="5" > 
     18              <comment><bean:write name="prop" property="value"/></comment> 
     19            </logic:equal> 
     20            <logic:notEqual name="prop" property="type" value="5" > 
     21              <logic:equal name="prop" property="show" value="true" > 
     22                <bean:define id="ptype" name="prop" property="type" /> 
     23                <bean:define id="bwpname" name="prop" property="name" /> 
     24                <property name="<%=bwpname%>" type="<%=ptype%>"> 
     25                  <required><bean:write name="prop" property="required"/></required> 
     26                  <ok><bean:write name="prop" property="goodValue"/></ok> 
     27                  <fieldName><bean:write name="pgroup" property="name" />.<bean:write name="prop" property="name" /></fieldName> 
     28                  <fieldValue><bean:write name="prop" property="value" /></fieldValue> 
     29                  <logic:equal name="prop" property="type" value="2" > 
     30                    <checked><bean:write name="prop" property="booleanValAndFlag"/></checked> 
     31                  </logic:equal> 
    2832 
    29                 <%-- /* 
    30                  ORIGINAL JSP: 
    31                 <% String nm = String.valueOf(bwpgname) + "." + String.valueOf(bwpname); %> 
    32                 <logic:equal name="prop" property="type" value="2" > 
    33                   <% String checked = ""; %> 
    34                   <logic:equal name="prop" property="booleanValAndFlag" value="true" > 
    35                     <% checked = "CHECKED"; %> 
     33                  <%-- /* 
     34                   ORIGINAL JSP: 
     35                  <% String nm = String.valueOf(bwpgname) + "." + String.valueOf(bwpname); %> 
     36                  <logic:equal name="prop" property="type" value="2" > 
     37                    <% String checked = ""; %> 
     38                    <logic:equal name="prop" property="booleanValAndFlag" value="true" > 
     39                      <% checked = "CHECKED"; %> 
     40                    </logic:equal> 
     41                    <field><input type="checkbox" name="<%=nm%>" <%=checked%> value="true" /></field> 
    3642                  </logic:equal> 
    37                   <field><input type="checkbox" name="<%=nm%>" <%=checked%> value="true" /></field> 
    38                 </logic:equal> 
    39                 <logic:notEqual name="prop" property="type" value="2" > 
    40                   <logic:present name="prop" property="value" > 
    41                     <bean:define id="bwpval" name="prop" property="value" /> 
    42                     <% String val = String.valueOf(bwpval); %> 
    43                     <input type="text" name="<%=nm%>" value="<%=val%>" /> 
    44                   </logic:present> 
    45                   <logic:notPresent name="prop" property="value" > 
    46                     <input type="text" name="<%=nm%>" /> 
    47                   </logic:notPresent> 
    48                 </logic:notEqual> */ --%> 
    49               </property> 
    50             </logic:equal> 
     43                  <logic:notEqual name="prop" property="type" value="2" > 
     44                    <logic:present name="prop" property="value" > 
     45                      <bean:define id="bwpval" name="prop" property="value" /> 
     46                      <% String val = String.valueOf(bwpval); %> 
     47                      <input type="text" name="<%=nm%>" value="<%=val%>" /> 
     48                    </logic:present> 
     49                    <logic:notPresent name="prop" property="value" > 
     50                      <input type="text" name="<%=nm%>" /> 
     51                    </logic:notPresent> 
     52                  </logic:notEqual> */ --%> 
     53                </property> 
     54              </logic:equal> 
     55            </logic:notEqual> 
    5156          </logic:iterate> 
    5257        </propertyGroup> 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java

    r301 r302  
    7979import org.bedework.calsvci.CalSvcIPars; 
    8080 
    81 //import edu.rpi.sss.util.jsp.JspUtil; 
    82 import edu.rpi.sss.util.jsp.SessionListener; 
    8381import edu.rpi.sss.util.jsp.UtilAbstractAction; 
    8482import edu.rpi.sss.util.jsp.UtilActionForm; 
     
    104102 */ 
    105103public abstract class BwAbstractAction extends UtilAbstractAction { 
     104  /** Name of the init parameter holding our name */ 
     105  private static final String appNameInitParameter = "rpiappname"; 
     106   
    106107  public String getId() { 
    107108    return getClass().getName(); 
     
    713714    BwSession s = BwWebUtil.getState(request); 
    714715    HttpSession sess = request.getSession(false); 
    715  
     716    String appName = getAppName(sess); 
     717     
    716718    if (s != null) { 
    717719      if (debug) { 
     
    730732 
    731733      CalEnv env = getEnv(request, form); 
    732       String appName = env.getAppProperty("name"); 
    733734      String appRoot = env.getAppProperty("root"); 
    734735 
     
    736737       */ 
    737738      s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, 
    738                                form.getPresentationState(), messages, 
    739                                form.getSchemeHostPort(), debug); 
     739                            form.getPresentationState(), messages, 
     740                            form.getSchemeHostPort(), debug); 
    740741 
    741742      BwWebUtil.setState(request, s); 
     
    765766      String raddr = request.getRemoteAddr(); 
    766767      String rhost = request.getRemoteHost(); 
    767       SessionListener.setId(appName); // First time will have no name 
    768768      info("===============" + appName + ": New session (" + 
    769769                       s.getSessionNum() + ") from " + 
     
    821821 
    822822    return s; 
     823  } 
     824   
     825  private String getAppName(HttpSession sess) { 
     826    ServletContext sc = sess.getServletContext(); 
     827 
     828    String appname = sc.getInitParameter(appNameInitParameter); 
     829    if (appname == null) { 
     830      appname = "?"; 
     831    } 
     832     
     833    return appname; 
    823834  } 
    824835 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSession.java

    r2 r302  
    7272 
    7373  /** This may not be entirely correct so should be used with care. 
    74    * 
    75    * @param val 
    76    */ 
    77   public void setSessionNum(int val); 
    78  
    79   /** This may not be entirely correct so should be used with care. 
    8074   * Really just provides some measure of use. 
    8175   * 
    82    * @return in session number 
     76   * @return long session number 
    8377   */ 
    84   public int getSessionNum(); 
     78  public long getSessionNum(); 
    8579 
    8680  /** The current user 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSessionImpl.java

    r2 r302  
    5959import java.net.URI; 
    6060import java.net.URISyntaxException; 
     61import java.util.HashMap; 
    6162 
    6263import org.apache.log4j.Logger; 
     
    6667 * CalEnv to figure out which implementation to use. 
    6768 * 
    68  * <p>This class represents a session for the UWCal web interface. 
     69 * <p>This class represents a session for the Bedework web interface. 
    6970 * Some user state will be retained here. 
    7071 * We also provide a number of methods which act as the interface between 
    7172 * the web world and the calendar world. 
    7273 * 
    73  * <p>The UW web interface has session support that may not be applicable 
    74  * to all potential users of this application. We should try to interface to 
    75  * it through this. 
    76  * 
    7774 * @author Mike Douglass   douglm@rpi.edu 
    7875 */ 
    7976public class BwSessionImpl implements BwSession { 
    80   /** Not valid in the j2ee world but it's only used to count sessions. 
    81    */ 
    82   private static int sessionNum = 0; 
     77  /** Not completely valid in the j2ee world but it's only used to count sessions. 
     78   */ 
     79  private static class Counts { 
     80    long totalSessions = 0; 
     81  } 
     82   
     83  private static volatile HashMap countsMap = new HashMap(); 
     84  private long sessionNum = 0; 
    8385 
    8486  /** True if we want debugging output 
     
    102104  private PresentationState ps; 
    103105 
    104   /** Constructor for a UWCalSession 
     106  /** Constructor for a Session 
    105107   * 
    106108   * @param user       String user id 
     
    161163    } 
    162164 
    163     sessionNum++
     165    setSessionNum(appName)
    164166  } 
    165167 
     
    169171 
    170172  /* (non-Javadoc) 
    171    * @see org.bedework.webcommon.BwSession#setSessionNum(int) 
    172    */ 
    173   public void setSessionNum(int val) { 
    174     sessionNum = val; 
    175   } 
    176  
    177   /* (non-Javadoc) 
    178173   * @see org.bedework.webcommon.BwSession#getSessionNum() 
    179174   */ 
    180   public int getSessionNum() { 
     175  public long getSessionNum() { 
    181176    return sessionNum; 
    182177  } 
     
    268263    } 
    269264  } 
     265   
     266  private void setSessionNum(String name) { 
     267    try { 
     268      synchronized (countsMap) { 
     269        Counts c = (Counts)countsMap.get(name); 
     270         
     271        if (c == null) { 
     272          c = new Counts(); 
     273          countsMap.put(name, c); 
     274        } 
     275         
     276        sessionNum = c.totalSessions; 
     277        c.totalSessions++; 
     278      } 
     279    } catch (Throwable t) { 
     280    } 
     281  } 
    270282}