Changeset 302
- Timestamp:
- 03/27/06 13:44:59
- Files:
-
- trunk/calendar3/common/src/edu/rpi/sss/util/Util.java (modified) (2 diffs)
- trunk/calendar3/common/src/edu/rpi/sss/util/jsp/SessionListener.java (modified) (8 diffs)
- trunk/calendar3/config/configs/democal.properties (modified) (1 diff)
- trunk/calendar3/config/properties/default-bedework.properties (modified) (10 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/AbstractAction.java (modified) (3 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/Defs.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java (modified) (3 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Globals.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Modules.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Syspars.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java (modified) (2 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/props/CommentProperty.java (added)
- trunk/calendar3/config/src/org/bedework/webconfig/props/MultiProperty.java (modified) (3 diffs)
- trunk/calendar3/config/src/org/bedework/webconfig/props/OrderedListProperty.java (added)
- trunk/calendar3/config/src/org/bedework/webconfig/props/OrderedMultiListProperty.java (added)
- trunk/calendar3/config/war/WEB-INF/classes/servlet.properties (modified) (1 diff)
- trunk/calendar3/config/war/docs/main.jsp (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java (modified) (7 diffs)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSession.java (modified) (1 diff)
- trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSessionImpl.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/calendar3/common/src/edu/rpi/sss/util/Util.java
r2 r302 60 60 import java.text.MessageFormat; 61 61 import java.util.ArrayList; 62 import java.util.LinkedList; 63 import java.util.List; 62 64 import java.util.Properties; 63 65 import java.util.Random; 66 import java.util.StringTokenizer; 64 67 65 68 /** … … 403 406 return checkNull(val) != null; 404 407 } 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 } 405 443 } trunk/calendar3/common/src/edu/rpi/sss/util/jsp/SessionListener.java
r2 r302 61 61 62 62 import java.util.Enumeration; 63 import java.util.HashMap; 64 63 65 import org.apache.log4j.Logger; 64 66 … … 67 69 */ 68 70 public 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(); 71 77 private static boolean logActive = true; 72 private static String id = "";73 78 74 79 /** Name of the init parameter holding our name */ … … 83 88 */ 84 89 public void sessionCreated(HttpSessionEvent se) { 85 activeSessions++;86 totalSessions++;87 90 HttpSession session = se.getSession(); 88 91 ServletContext sc = session.getServletContext(); 92 String appname = getAppName(session); 93 Counts ct = getCounts(appname); 94 95 ct.activeSessions++; 96 ct.totalSessions++; 89 97 90 98 if (logActive) { 91 99 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)=(" + 95 103 Runtime.getRuntime().freeMemory()/(1024 * 1024) + "M, " + 96 104 Runtime.getRuntime().totalMemory()/(1024 * 1024) + "M)"); … … 111 119 /* Session Invalidation Event */ 112 120 public void sessionDestroyed(HttpSessionEvent se) { 113 if (activeSessions > 0) {114 activeSessions--;115 }116 121 HttpSession session = se.getSession(); 117 122 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 118 130 if (logActive) { 119 131 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)=(" + 122 134 Runtime.getRuntime().freeMemory()/(1024 * 1024) + "M, " + 123 135 Runtime.getRuntime().totalMemory()/(1024 * 1024) + "M)"); … … 130 142 public static void setLogActive(boolean val) { 131 143 logActive = val; 132 }133 134 /**135 * @return int num active sessions136 */137 public static int getActiveSessions() {138 return activeSessions;139 }140 141 /**142 * @return long total sessions143 */144 public static long getTotalSessions() {145 return totalSessions;146 }147 148 /**149 * @param val String id150 */151 public static void setId(String val) {152 if (val != null) {153 id = val;154 } else {155 id = "";156 }157 144 } 158 145 … … 166 153 Logger log = Logger.getLogger(this.getClass()); 167 154 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); 174 157 175 158 if (start) { … … 183 166 sb.append(appname); 184 167 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); 188 171 sb.append(":"); 189 172 sb.append(Runtime.getRuntime().freeMemory()/(1024 * 1024)); … … 193 176 194 177 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; 195 206 } 196 207 trunk/calendar3/config/configs/democal.properties
r297 r302 13 13 # Global options 14 14 # 15 org.bedework.install.admin.web=true16 org.bedework.install.public.web=true17 org.bedework.install.personal.web=true18 org.bedework.install.public.caldav=true19 org.bedework.install.personal.caldav=true20 15 21 16 # 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=NONE2 1 # 3 2 # -------------------------------------------------------------------- … … 14 13 # Global options 15 14 # 16 org.bedework.install.admin.web=true 17 org.bedework.install.public.web=true 18 org.bedework.install. personal.web=true19 org.bedework.install. public.caldav=true20 org.bedework.install.personal.caldav=true 15 16 # Define the names of the applications we want to build 17 org.bedework.install.app.names=bwconfig,CalAdmin,Events,UserCal,Pubcaldav,Usercaldav 18 org.bedework.install.app.types=webconfig,webadmin,webpublic,webuser,publiccaldav,usercaldav 19 21 20 # 22 21 # -------------------------------------------------------------------- … … 24 23 # 'environment' options used globally by the system. 25 24 # 26 org.bedework.global.version=3.027 25 org.bedework.global.hibernate.dialect=org.hibernate.dialect.HSQLDialect 28 org.bedework.global.systemid=demobedework@mysite.edu 26 org.bedework.global.system.name=bedework 27 org.bedework.global.calintfclass=org.bedework.calcore.hibernate.CalintfImpl 29 28 org.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 29 org.bedework.global.build.standalone.app=true 30 31 # uris to cross link apps - of dubious usefulness 32 org.bedework.global.public.admin.uri=/caladmin 33 org.bedework.global.public.calendar.uri=/cal 34 org.bedework.global.personal.calendar.uri=/ucal 35 36 # 37 # -------------------------------------------------------------------- 38 # 39 # System parameters used globally by the system and read from the db. 40 # 41 org.bedework.syspar.tzid=America/New_York 42 org.bedework.syspar.systemid=demobedework@mysite.edu 43 44 org.bedework.syspar.public.calroot=public 45 org.bedework.syspar.user.calroot=user 46 org.bedework.syspar.default.user.calendar=calendar 47 org.bedework.syspar.default.trash.calendar=Trash 48 org.bedework.syspar.default.user.inbox=Inbox 49 org.bedework.syspar.default.user.outbox=Outbox 50 org.bedework.syspar.default.user.view=All 51 52 org.bedework.syspar.public.user=public-user 53 54 org.bedework.syspar.http.connections.peruser=10 55 org.bedework.syspar.http.connections.perhost=50 56 org.bedework.syspar.http.connections=200 57 58 org.bedework.syspar.userauthclass=org.bedework.calcore.hibernate.UserAuthUWDbImpl 59 org.bedework.syspar.mailerclass=org.bedework.mail.DummyMailer 60 org.bedework.syspar.admingroupsclass=org.bedework.calcore.hibernate.AdminGroupsDbImpl 61 org.bedework.syspar.usergroupsclass=org.bedework.calcore.hibernate.GroupsDbImpl 44 62 # 45 63 # ------------------------------------------------------------------- … … 47 65 # Bedework config web client 48 66 # 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 67 org.bedework.app.bwconfig.version=3.0 68 org.bedework.app.bwconfig.default.contenttype=text/xml 69 org.bedework.app.bwconfig.war.name=bwconfig 70 org.bedework.app.bwconfig.context.root=bwconfig 71 org.bedework.app.bwconfig.root=/bwconfigrsrc 72 org.bedework.app.bwconfig.resources.dir=/webapps/ROOT/bwconfigrsrc 73 org.bedework.app.bwconfig.deploy.dir=/webapps 74 org.bedework.app.bwconfig.description=Bedework properties config application 75 org.bedework.app.bwconfig.display.name=Bedework Config 76 org.bedework.app.bwconfig.name=bwconfig 77 org.bedework.app.bwconfig.guestmode=true 78 org.bedework.app.bwconfig.publicadmin=false 79 org.bedework.app.bwconfig.logprefix=BwConfig 80 81 # 82 # -------------------------------------------------------------------- 83 # 84 # Admin Web Client 85 # 86 org.bedework.app.CalAdmin.version=3.0 87 org.bedework.app.CalAdmin.default.contenttype=text/xml 88 org.bedework.app.CalAdmin.nogroupallowed=false 89 90 org.bedework.app.CalAdmin.war.name=caladmin 91 org.bedework.app.CalAdmin.ear.name=caladmin 92 org.bedework.app.CalAdmin.context.root=caladmin 93 org.bedework.app.CalAdmin.root=/caladminrsrc 94 org.bedework.app.CalAdmin.resources.dir=/webapps/ROOT/caladminrsrc 95 org.bedework.app.CalAdmin.deploy.dir=/webapps 96 97 org.bedework.app.CalAdmin.security.domain=demo 98 org.bedework.app.CalAdmin.security.prefix=demo 99 org.bedework.app.CalAdmin.transport.guarantee=NONE 100 101 org.bedework.app.CalAdmin.description=Struts based version of the Bedework calendar public events admin client. 102 org.bedework.app.CalAdmin.display.name=Public Events Administration 103 org.bedework.app.CalAdmin.name=DemoCalAdmin 104 105 org.bedework.app.CalAdmin.autocreatesponsors=false 106 org.bedework.app.CalAdmin.autodeletesponsors=false 107 org.bedework.app.CalAdmin.autocreatelocations=false 108 org.bedework.app.CalAdmin.autodeletelocations=false 109 org.bedework.app.CalAdmin.allowEditAllCategories=false 110 org.bedework.app.CalAdmin.allowEditAllLocations=false 111 org.bedework.app.CalAdmin.allowEditAllSponsors=false 112 org.bedework.app.CalAdmin.categoryOptional=true 113 114 org.bedework.app.CalAdmin.hour24=true 115 org.bedework.app.CalAdmin.minincrement=5 116 org.bedework.app.CalAdmin.admingroupsidprefix=agrp_ 117 org.bedework.app.CalAdmin.guestmode=false 118 org.bedework.app.CalAdmin.publicadmin=true 119 org.bedework.app.CalAdmin.logprefix=PubEventsAdmin 120 org.bedework.app.CalAdmin.run.as.user=public-user 121 122 # 123 # -------------------------------------------------------------------- 124 # 125 # Public Web Client 126 # 127 org.bedework.app.Events.version=3.0 128 org.bedework.app.Events.default.contenttype=text/xml 129 org.bedework.app.Events.web.xml=guest/web.xml 130 131 org.bedework.app.Events.war.name=cal 132 org.bedework.app.Events.ear.name=cal 133 org.bedework.app.Events.context.root=cal 134 org.bedework.app.Events.root=/calrsrc 135 org.bedework.app.Events.resources.dir=/webapps/ROOT/calrsrc 136 org.bedework.app.Events.deploy.dir=/webapps 137 138 org.bedework.app.Events.description=Struts based XML version of the Bedework calendar client. It may have many skins, determined by the XSLT. 139 org.bedework.app.Events.display.name=Demo calendar 140 org.bedework.app.Events.name=DemoCal 141 org.bedework.app.Events.run.as.user=public-user 142 143 org.bedework.app.Events.hour24=true 144 org.bedework.app.Events.minincrement=5 145 org.bedework.app.Events.skinset.name=demoskins 146 org.bedework.app.Events.showyeardata=false 147 org.bedework.app.Events.default.view=week 148 org.bedework.app.Events.refresh.interval=300 149 org.bedework.app.Events.refresh.action=setup.do 150 org.bedework.app.Events.guestmode=true 151 org.bedework.app.Events.publicadmin=false 152 org.bedework.app.Events.logprefix=PubEvents 153 154 # 155 # -------------------------------------------------------------------- 156 # 157 # Personal Web Client 158 # 159 org.bedework.app.UserCal.version=3.0 160 org.bedework.app.UserCal.default.contenttype=text/xml 161 org.bedework.app.UserCal.web.xml=user/web.xml 162 163 org.bedework.app.UserCal.war.name=ucal 164 org.bedework.app.UserCal.deploy.j2ee=false 165 org.bedework.app.UserCal.ear.name=ucal 166 org.bedework.app.UserCal.context.root=ucal 167 org.bedework.app.UserCal.root=/ucalrsrc 168 org.bedework.app.UserCal.resources.dir=/webapps/ROOT/ucalrsrc 169 org.bedework.app.UserCal.deploy.dir=/webapps 170 171 org.bedework.app.UserCal.security.domain=demo 172 org.bedework.app.UserCal.security.prefix=demo 173 org.bedework.app.UserCal.transport.guarantee=NONE 174 175 org.bedework.app.UserCal.description=XML/XSLT version of the Bedework calendar client. 176 org.bedework.app.UserCal.display.name=Bedework 177 org.bedework.app.UserCal.name=DemoUserCal 178 179 org.bedework.app.UserCal.hour24=true 180 org.bedework.app.UserCal.minincrement=5 181 org.bedework.app.UserCal.skinset.name=demoskins 182 org.bedework.app.UserCal.showyeardata=false 183 org.bedework.app.UserCal.default.view=day 184 org.bedework.app.UserCal.refresh.interval=300 185 org.bedework.app.UserCal.refresh.action=setup.do 186 org.bedework.app.UserCal.guestmode=false 187 org.bedework.app.UserCal.publicadmin=false 188 org.bedework.app.UserCal.logprefix=PersonalCalendar 164 189 165 190 # … … 168 193 # Public Caldav Server 169 194 # 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 195 org.bedework.app.Pubcaldav.war.name=pubcaldav 196 org.bedework.app.Pubcaldav.ear.name=pubcaldav 197 org.bedework.app.Pubcaldav.context.root=pubcaldav 198 199 org.bedework.app.Pubcaldav.description=Bedework public caldav server. 200 org.bedework.app.Pubcaldav.display.name=Bedework public caldav 201 org.bedework.app.Pubcaldav.name=DemoPubcaldav 202 org.bedework.app.Pubcaldav.deploy.dir=/webapps 203 org.bedework.app.Pubcaldav.guestmode=true 204 org.bedework.app.Pubcaldav.publicadmin=false 205 org.bedework.app.Pubcaldav.run.as.user=public-user 206 org.bedework.app.Pubcaldav.logprefix=PubCalDav 180 207 181 208 # … … 184 211 # Personal Caldav Server 185 212 # 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 213 org.bedework.app.Usercaldav.war.name=ucaldav 214 org.bedework.app.Usercaldav.ear.name=ucaldav 215 org.bedework.app.Usercaldav.context.root=ucaldav 216 217 org.bedework.app.Usercaldav.security.domain=null 218 org.bedework.app.Usercaldav.security.prefix=null 219 org.bedework.app.Usercaldav.transport.guarantee=NONE 220 221 org.bedework.app.Usercaldav.description=Bedework user caldav server. 222 org.bedework.app.Usercaldav.display.name=Bedework usercaldav 223 org.bedework.app.Usercaldav.name=DemoUsrcaldav 224 org.bedework.app.Usercaldav.deploy.dir=/webapps 225 org.bedework.app.Usercaldav.guestmode=false 226 org.bedework.app.Usercaldav.publicadmin=false 227 org.bedework.app.Usercaldav.logprefix=UserCalDav 200 228 201 229 # … … 205 233 # 206 234 207 org.bedework. dumprestore.zip.name=bwdumpres208 org.bedework. dumprestore.description=Bedework dump/restore utility209 org.bedework. dumprestore.version=3.0210 org.bedework. dumprestore.jdbcdriver.jar=${appserver.jdbcdriver.jar}235 org.bedework.app.dumprestore.zip.name=bwdumpres 236 org.bedework.app.dumprestore.description=Bedework dump/restore utility 237 org.bedework.app.dumprestore.version=3.0 238 org.bedework.app.dumprestore.jdbcdriver.jar=${appserver.jdbcdriver.jar} 211 239 212 240 # -------------- dump parameters ------------------ … … 214 242 org.bedework.dump.arg.dumpfile=${user.home}/.bedework/caldata.xml 215 243 org.bedework.dump.arg.debug=-debug 216 org.bedework.restore.arg.hib=-nhib217 244 org.bedework.dump.arg.hibernate.dialect=org.hibernate.dialect.HSQLDialect 218 245 org.bedework.dump.arg.jdbcdriver=org.hsqldb.jdbcDriver … … 223 250 # -------------- restore parameters ------------------ 224 251 225 org.bedework.restore.arg.dumpfile=${calendar.dir}/db/initcaldata.xml 226 org.bedework.restore.arg.fixowner= 252 org.bedework.restore.arg.dumpfile=${calendar.dir}/dumprestore/initcaldata.xml 227 253 org.bedework.restore.arg.debug=-debug 228 org.bedework.restore.arg. hib=-nhib254 org.bedework.restore.arg.from2p3px= 229 255 org.bedework.restore.arg.fixcals=-nfixcals 230 org.bedework.restore.arg.calowner=caladmin 231 org.bedework.restore.arg.jdbc=-jdbc 256 org.bedework.restore.arg.defaultpubliccal= 232 257 org.bedework.restore.arg.hibernate.dialect=org.hibernate.dialect.HSQLDialect 233 258 org.bedework.restore.arg.jdbcdriver=org.hsqldb.jdbcDriver … … 235 260 org.bedework.restore.arg.jdbcid=sa 236 261 org.bedework.restore.arg.jdbcpw= 237 262 org.bedework.restore.arg.timezones= 263 trunk/calendar3/config/src/org/bedework/webconfig/AbstractAction.java
r293 r302 68 68 import org.bedework.webconfig.collections.Webpersonal; 69 69 import org.bedework.webconfig.collections.Webpublic; 70 import org.bedework.webconfig.props.BooleanProperty;71 70 import org.bedework.webconfig.props.ConfigProperty; 71 import org.bedework.webconfig.props.OrderedListProperty; 72 import org.bedework.webconfig.props.OrderedMultiListProperty; 72 73 73 74 import edu.rpi.sss.util.Util; 74 import edu.rpi.sss.util.jsp.JspUtil;75 75 import edu.rpi.sss.util.jsp.UtilAbstractAction; 76 76 import edu.rpi.sss.util.jsp.UtilActionForm; … … 170 170 form.addPropertyCollection(modules); 171 171 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 } 178 214 179 215 if (pr != null) { … … 278 314 } 279 315 280 String envPrefix = JspUtil.getReqProperty(frm.getMres(),281 "org.bedework.envprefix");282 283 316 env = new CalEnv(envPrefix, debug); 284 317 frm.assignEnv(env); trunk/calendar3/config/src/org/bedework/webconfig/Defs.java
r2 r302 60 60 */ 61 61 public 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 62 82 /** Default properties file (built in to application) */ 63 83 public final static String defaultProperties = "/properties/calendar/default-bedework.properties"; … … 79 99 /** Multi-value property - radio or select */ 80 100 public final static int typeMultiple = 4; 101 102 /** Comment */ 103 public final static int typeComment = 5; 81 104 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpersonal.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.ConfigProperty;59 60 57 /** Caldav public events server properties. 61 58 * … … 68 65 * @throws Throwable 69 66 */ 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); 72 69 73 addProperty(new ConfigProperty("war", "war.name", true));70 requiredText("war", "war.name"); 74 71 75 BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true);72 requiredText("context.root", "context.root"); 76 73 77 addProperty(j2ee);74 requiredText("deploy.dir", "deploy.dir"); 78 75 79 addProperty(new ConfigProperty("ear", "ear.name", true, j2ee));76 requiredText("security.domain", "app.security.domain"); 80 77 81 addProperty(new ConfigProperty("context.root", "context.root", true));78 requiredText("security.prefix", "app.security.prefix"); 82 79 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"); 92 81 93 82 // We really want this to set the value of the above to NONE or CONFIDENTIAL 94 83 //addProperty(new BooleanProperty("ssl", "use.ssl", true)); 95 84 96 addProperty(new ConfigProperty("description", "app.description", true));85 requiredText("description", "app.description"); 97 86 98 addProperty(new ConfigProperty("display.name", "app.display.name", true));87 requiredText("display.name", "app.display.name"); 99 88 100 addProperty(new ConfigProperty("name", "app.name", true));89 requiredText("name", "app.name"); 101 90 } 102 91 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Caldavpublic.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.ConfigProperty;59 60 57 /** Caldav public events server properties. 61 58 * … … 68 65 * @throws Throwable 69 66 */ 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); 72 69 73 addProperty(new ConfigProperty("war", "war.name", true));70 requiredText("war", "war.name"); 74 71 75 BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true);72 requiredText("context.root", "context.root"); 76 73 77 addProperty(j2ee);74 requiredText("deploy.dir", "deploy.dir"); 78 75 79 addProperty(new ConfigProperty("ear", "ear.name", true, j2ee));76 requiredText("description", "app.description"); 80 77 81 addProperty(new ConfigProperty("context.root", "context.root", true));78 requiredText("display.name", "app.display.name"); 82 79 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"); 92 81 } 93 82 } trunk/calendar3/config/src/org/bedework/webconfig/collections/ConfigCollection.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.Defs; 57 58 import org.bedework.webconfig.props.BooleanProperty; 59 import org.bedework.webconfig.props.CommentProperty; 58 60 import org.bedework.webconfig.props.ConfigProperty; 61 import org.bedework.webconfig.props.IntProperty; 62 import org.bedework.webconfig.props.OrderedListProperty; 63 import org.bedework.webconfig.props.OrderedMultiListProperty; 59 64 60 65 import edu.rpi.sss.util.log.MessageEmit; … … 77 82 * @author Mike Douglass 78 83 */ 79 public class ConfigCollection implements Serializable {84 public class ConfigCollection implements Defs, Serializable { 80 85 private String name; 81 86 private String prefix; … … 160 165 return properties; 161 166 } 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 } 162 282 163 283 /** Add a property to the collection trunk/calendar3/config/src/org/bedework/webconfig/collections/Globals.java
r64 r302 52 52 to the maximum extent the law permits. 53 53 */ 54 55 54 package org.bedework.webconfig.collections; 56 55 57 56 import org.bedework.webconfig.props.BooleanProperty; 58 import org.bedework.webconfig.props.ConfigProperty;59 57 60 58 /** Global properties. … … 70 68 super("globals", "global"); 71 69 72 addProperty(new ConfigProperty("system.name", "system.name", true));70 requiredText("system.name", "system.name"); 73 71 74 addProperty(new ConfigProperty("hibernate.dialect", "hibernate.dialect", true));72 requiredText("hibernate.dialect", "hibernate.dialect"); 75 73 76 addProperty(new ConfigProperty("calintfclass", "calintfclass", true));74 requiredText("calintfclass", "calintfclass"); 77 75 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"); 81 96 } 82 97 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Modules.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 59 57 /** The modules to build. 60 58 * … … 69 67 super("modules", "install"); 70 68 71 addProperty(new BooleanProperty("adminwebclient", "admin.web", true));69 requiredOrderedList("app.names", "app.names"); 72 70 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); 82 72 } 83 73 } 84 trunk/calendar3/config/src/org/bedework/webconfig/collections/Syspars.java
r64 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.IntProperty;58 import org.bedework.webconfig.props.ConfigProperty;59 60 57 /** Global properties. 61 58 * … … 70 67 super("syspar", "syspar"); 71 68 72 addProperty(new ConfigProperty("tzid", "tzid", true));69 requiredText("tzid", "tzid"); 73 70 74 addProperty(new ConfigProperty("systemid", "systemid", true));71 requiredText("systemid", "systemid"); 75 72 76 addProperty(new ConfigProperty("public.calroot", "public.calroot", 77 true, true)); 73 requiredText("public.calroot", "public.calroot"); 78 74 79 addProperty(new ConfigProperty("user.calroot", "user.calroot", 80 true, true)); 75 requiredText("user.calroot", "user.calroot"); 81 76 82 addProperty(new ConfigProperty("default.user.calendar",83 "default.user.calendar" , true));77 requiredText("default.user.calendar", 78 "default.user.calendar"); 84 79 85 addProperty(new ConfigProperty("default.trash.calendar",86 "default.trash.calendar" , true));80 requiredText("default.trash.calendar", 81 "default.trash.calendar"); 87 82 88 addProperty(new ConfigProperty("default.user.inbox",89 "default.user.inbox" , true));83 requiredText("default.user.inbox", 84 "default.user.inbox"); 90 85 91 addProperty(new ConfigProperty("default.user.outbox",92 "default.user.outbox" , true));86 requiredText("default.user.outbox", 87 "default.user.outbox"); 93 88 94 addProperty(new ConfigProperty("default.user.view",95 "default.user.view" , true));89 requiredText("default.user.view", 90 "default.user.view"); 96 91 97 addProperty(new ConfigProperty("public.user", "public.user", true, true));92 requiredText("public.user", "public.user"); 98 93 99 addProperty(new IntProperty("http.connections.peruser", "http connections per user", true, true));94 requiredInt("http.connections.peruser", "http connections per user"); 100 95 101 addProperty(new IntProperty("http.connections.perhost", "http connections per host", true, true));96 requiredInt("http.connections.perhost", "http connections per host"); 102 97 103 addProperty(new IntProperty("http.connections", "http connections", true, true));98 requiredInt("http.connections", "http connections"); 104 99 105 addProperty(new ConfigProperty("userauthclass", "userauthclass", true));100 requiredText("userauthclass", "userauthclass"); 106 101 107 addProperty(new ConfigProperty("mailerclass", "mailerclass", true));102 requiredText("mailerclass", "mailerclass"); 108 103 109 addProperty(new ConfigProperty("admingroupsclass", "admingroupsclass", true));104 requiredText("admingroupsclass", "admingroupsclass"); 110 105 111 addProperty(new ConfigProperty("usergroupsclass", "usergroupsclass", true));106 requiredText("usergroupsclass", "usergroupsclass"); 112 107 } 113 108 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Webadmin.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.IntProperty;59 import org.bedework.webconfig.props.ConfigProperty;60 61 57 /** Web admin client properties. 62 58 * … … 69 65 * @throws Throwable 70 66 */ 71 public Webadmin( BooleanProperty onlyIf) throws Throwable {72 super( "Webadmin", "webadmin", onlyIf);67 public Webadmin(String name) throws Throwable { 68 super(name, "app." + name); 73 69 74 addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true));70 requiredText("defaultContentType", "app.default.contenttype"); 75 71 76 addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true));72 requiredText("war", "war.name"); 77 73 78 BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 79 addProperty(jetspeedportlet); 74 requiredText("context.root", "context.root"); 80 75 81 addProperty(new ConfigProperty("jetspeed2.roles", "app.jetspeed2.roles", true, jetspeedportlet));76 requiredText("app.root", "app.root"); 82 77 83 BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 84 addProperty(uportalportlet); 78 requiredText("resources.dir", "app.resources.dir"); 85 79 86 addProperty(new ConfigProperty("war", "war.name", true));80 requiredText("deploy.dir", "deploy.dir"); 87 81 88 BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true);82 requiredText("security.domain", "app.security.domain"); 89 83 90 addProperty(j2ee);84 requiredText("security.prefix", "app.security.prefix"); 91 85 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"); 109 87 110 88 // We really want this to set the value of the above to NONE or CONFIDENTIAL 111 89 //addProperty(new BooleanProperty("ssl", "use.ssl", true)); 112 90 113 addProperty(new ConfigProperty("description", "app.description", true));91 requiredText("description", "app.description"); 114 92 115 addProperty(new ConfigProperty("display.name", "app.display.name", true));93 requiredText("display.name", "app.display.name"); 116 94 117 addProperty(new ConfigProperty("name", "app.name", true));95 requiredText("name", "app.name"); 118 96 119 addProperty(new BooleanProperty("noGroupAllowed", "app.nogroupallowed", true));97 requiredBoolean("noGroupAllowed", "app.nogroupallowed"); 120 98 121 addProperty(new BooleanProperty("autocreatesponsors", "app.autocreatesponsors", true));99 requiredBoolean("autocreatesponsors", "app.autocreatesponsors"); 122 100 123 addProperty(new BooleanProperty("autodeletesponsors", "app.autodeletesponsors", true));101 requiredBoolean("autodeletesponsors", "app.autodeletesponsors"); 124 102 125 addProperty(new BooleanProperty("autocreatelocations", "app.autocreatelocations", true));103 requiredBoolean("autocreatelocations", "app.autocreatelocations"); 126 104 127 addProperty(new BooleanProperty("autodeletelocations", "app.autodeletelocations", true));105 requiredBoolean("autodeletelocations", "app.autodeletelocations"); 128 106 129 addProperty(new BooleanProperty("allowEditAllCategories", "app.allowEditAllCategories", true));107 requiredBoolean("allowEditAllCategories", "app.allowEditAllCategories"); 130 108 131 addProperty(new BooleanProperty("allowEditAllLocations", "app.allowEditAllLocations", true));109 requiredBoolean("allowEditAllLocations", "app.allowEditAllLocations"); 132 110 133 addProperty(new BooleanProperty("allowEditAllSponsors", "app.allowEditAllSponsors", true));111 requiredBoolean("allowEditAllSponsors", "app.allowEditAllSponsors"); 134 112 135 addProperty(new BooleanProperty("categoryOptional", "app.categoryOptional", true));113 requiredBoolean("categoryOptional", "app.categoryOptional"); 136 114 137 addProperty(new BooleanProperty("hour24", "app.hour24", true));115 requiredBoolean("hour24", "app.hour24"); 138 116 139 addProperty(new IntProperty("minincrement", "app.minincrement", true));117 requiredInt("minincrement", "app.minincrement"); 140 118 141 addProperty(new ConfigProperty("admingroupsidprefix", "app.admingroupsidprefix", true));119 requiredText("admingroupsidprefix", "app.admingroupsidprefix"); 142 120 } 143 121 } 144 trunk/calendar3/config/src/org/bedework/webconfig/collections/Webconfig.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.ConfigProperty;59 60 57 /** Web config client properties. 61 58 * … … 67 64 * @throws Throwable 68 65 */ 69 public Webconfig( ) throws Throwable {70 super( "Webconfig", "webconfig", false);66 public Webconfig(String name) throws Throwable { 67 super(name, "app." + name, false); 71 68 72 addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true));69 requiredText("defaultContentType", "app.default.contenttype"); 73 70 74 addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true));71 requiredText("war", "war.name"); 75 72 76 addProperty(new ConfigProperty("war", "war.name", true));73 requiredText("context.root", "context.root"); 77 74 78 addProperty(new ConfigProperty("context.root", "context.root", true));75 requiredText("app.root", "app.root"); 79 76 80 addProperty(new ConfigProperty("app.root", "app.root", true));77 requiredText("resources.dir", "app.resources.dir"); 81 78 82 addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true));79 requiredText("deploy.dir", "deploy.dir"); 83 80 84 addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true));81 requiredText("envprefix", "env.prefix"); 85 82 86 addProperty(new ConfigProperty("envprefix", "env.prefix", true));83 requiredText("description", "app.description"); 87 84 88 addProperty(new ConfigProperty("description", "app.description", true));85 requiredText("display.name", "app.display.name"); 89 86 90 addProperty(new ConfigProperty("display.name", "app.display.name", true)); 91 92 addProperty(new ConfigProperty("name", "app.name", true)); 87 requiredText("name", "app.name"); 93 88 } 94 89 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpersonal.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.IntProperty;59 import org.bedework.webconfig.props.ConfigProperty;60 61 57 /** Web personal client properties. 62 58 * … … 69 65 * @throws Throwable 70 66 */ 71 public Webpersonal( BooleanProperty onlyIf) throws Throwable {72 super( "webpersonal", "webpersonal", onlyIf);67 public Webpersonal(String name) throws Throwable { 68 super(name, "app." + name); 73 69 74 addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true));70 requiredText("defaultContentType", "app.default.contenttype"); 75 71 76 addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true));72 requiredText("war", "war.name"); 77 73 78 BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 79 addProperty(jetspeedportlet); 74 requiredText("context.root", "context.root"); 80 75 81 BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 82 addProperty(uportalportlet); 76 requiredText("app.root", "app.root"); 83 77 84 addProperty(new ConfigProperty("war", "war.name", true));78 requiredText("resources.dir", "app.resources.dir"); 85 79 86 BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true);80 requiredText("deploy.dir", "deploy.dir"); 87 81 88 addProperty(j2ee);82 requiredText("web.xml", "app.web.xml"); 89 83 90 addProperty(new ConfigProperty("ear", "ear.name", true, j2ee));84 requiredText("security.domain", "app.security.domain"); 91 85 92 addProperty(new ConfigProperty("context.root", "context.root", true));86 requiredText("security.prefix", "app.security.prefix"); 93 87 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"); 109 89 110 90 // 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"); 112 92 113 addProperty(new ConfigProperty("description", "app.description", true));93 requiredText("description", "app.description"); 114 94 115 addProperty(new ConfigProperty("display.name", "app.display.name", true));95 requiredText("display.name", "app.display.name"); 116 96 117 addProperty(new ConfigProperty("name", "app.name", true));97 requiredText("name", "app.name"); 118 98 119 addProperty(new BooleanProperty("hour24", "app.hour24", true));99 requiredBoolean("hour24", "app.hour24"); 120 100 121 addProperty(new IntProperty("minincrement", "app.minincrement", true));101 requiredInt("minincrement", "app.minincrement"); 122 102 123 addProperty(new ConfigProperty("skinset.name", "app.skinset.name", true));103 requiredText("skinset.name", "app.skinset.name"); 124 104 125 addProperty(new BooleanProperty("showyeardata", "app.showyeardata", true));105 requiredBoolean("showyeardata", "app.showyeardata"); 126 106 127 addProperty(new ConfigProperty("default.view", "app.default.view", true));107 requiredText("default.view", "app.default.view"); 128 108 129 addProperty(new IntProperty("refresh.interval", "app.refresh.interval", true));109 requiredInt("refresh.interval", "app.refresh.interval"); 130 110 131 addProperty(new ConfigProperty("refresh.action", "app.refresh.action", true));111 requiredText("refresh.action", "app.refresh.action"); 132 112 } 133 113 } trunk/calendar3/config/src/org/bedework/webconfig/collections/Webpublic.java
r2 r302 55 55 package org.bedework.webconfig.collections; 56 56 57 import org.bedework.webconfig.props.BooleanProperty;58 import org.bedework.webconfig.props.IntProperty;59 import org.bedework.webconfig.props.ConfigProperty;60 61 57 /** Global properties. 62 58 * … … 69 65 * @throws Throwable 70 66 */ 71 public Webpublic( BooleanProperty onlyIf) throws Throwable {72 super( "webpublic", "webpubevents", onlyIf);67 public Webpublic(String name) throws Throwable { 68 super(name, "app." + name); 73 69 74 addProperty(new ConfigProperty("defaultContentType", "app.default.contenttype", true));70 requiredText("defaultContentType", "app.default.contenttype"); 75 71 76 addProperty(new BooleanProperty("standalone.app", "build.standalone.app", true));72 requiredText("war", "war.name"); 77 73 78 BooleanProperty jetspeedportlet = new BooleanProperty("jetspeedPortlet", "build.jetspeed.portlet", true); 79 addProperty(jetspeedportlet); 74 requiredText("context.root", "context.root"); 80 75 81 BooleanProperty uportalportlet = new BooleanProperty("uportalPortlet", "build.uportal.portlet", true); 82 addProperty(uportalportlet); 76 requiredText("app.root", "app.root"); 83 77 84 addProperty(new ConfigProperty("war", "war.name", true));78 requiredText("resources.dir", "app.resources.dir"); 85 79 86 BooleanProperty j2ee = new BooleanProperty("j2ee.deploy", "deploy.j2ee", true);80 requiredText("deploy.dir", "deploy.dir"); 87 81 88 addProperty(j2ee);82 requiredText("web.xml", "app.web.xml"); 89 83 90 addProperty(new ConfigProperty("ear", "ear.name", true, j2ee));84 requiredText("description", "app.description"); 91 85 92 addProperty(new ConfigProperty("context.root", "context.root", true));86 requiredText("display.name", "app.display.name"); 93 87 94 addProperty(new ConfigProperty("app.root", "app.root", true));88 requiredText("name", "app.name"); 95 89 96 addProperty(new ConfigProperty("resources.dir", "app.resources.dir", true));90 requiredText("run-as", "run.as.user"); 97 91 98 addProperty(new ConfigProperty("deploy.dir", "deploy.dir", true));92 requiredBoolean("hour24", "app.hour24"); 99 93 100 addProperty(new ConfigProperty("envprefix", "env.prefix", true));94 requiredInt("minincrement", "app.minincrement"); 101 95 102 addProperty(new ConfigProperty("web.xml", "app.web.xml", true));96 requiredText("skinset.name", "app.skinset.name"); 103 97 104 addProperty(new ConfigProperty("description", "app.description", true));98 requiredBoolean("showyeardata", "app.showyeardata"); 105 99 106 addProperty(new ConfigProperty("display.name", "app.display.name", true));100 requiredText("default.view", "app.default.view"); 107 101 108 addProperty(new ConfigProperty("name", "app.name", true));102 requiredInt("refresh.interval", "app.refresh.interval"); 109 103 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"); 125 105 } 126 106 } 127 trunk/calendar3/config/src/org/bedework/webconfig/props/MultiProperty.java
r2 r302 55 55 package org.bedework.webconfig.props; 56 56 57 import java.util.Arrays; 58 import java.util.Iterator; 59 import java.util.List; 60 61 import edu.rpi.sss.util.log.MessageEmit; 62 57 63 /** A property has a name - used by the web application for the tag, a value 58 64 * and a suffix which is appended to the prefix defined by the collection of … … 67 73 */ 68 74 public class MultiProperty extends ConfigProperty { 69 private String[]possibleValues;75 private List possibleValues; 70 76 71 77 /** Constructor … … 79 85 String[] possibleValues) { 80 86 super(name, suffix, required, false); 81 this.possibleValues = possibleValues;87 this.possibleValues = Arrays.asList(possibleValues); 82 88 } 83 89 84 /** Get the allowable values90 /** Called at update to set the error flag and emit a message 85 91 * 86 * @return String[] array of allowable values 92 * @param err MessageEmit object for error messages 93 * @return boolean true for ok 87 94 */ 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(); 90 116 } 91 117 } trunk/calendar3/config/war/WEB-INF/classes/servlet.properties
r2 r302 34 34 org.bedework.message.cancelled=Cancelled 35 35 36 # This value is defined in CalEnv - don't lose the '.' on the end37 org.bedework.envprefix=@ENV-PREFIX@38 trunk/calendar3/config/war/docs/main.jsp
r2 r302 15 15 <propertyGroup name="<%=bwpgname%>"> 16 16 <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> 28 32 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> 36 42 </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> 51 56 </logic:iterate> 52 57 </propertyGroup> trunk/calendar3/webcommon/src/org/bedework/webcommon/BwAbstractAction.java
r301 r302 79 79 import org.bedework.calsvci.CalSvcIPars; 80 80 81 //import edu.rpi.sss.util.jsp.JspUtil;82 import edu.rpi.sss.util.jsp.SessionListener;83 81 import edu.rpi.sss.util.jsp.UtilAbstractAction; 84 82 import edu.rpi.sss.util.jsp.UtilActionForm; … … 104 102 */ 105 103 public abstract class BwAbstractAction extends UtilAbstractAction { 104 /** Name of the init parameter holding our name */ 105 private static final String appNameInitParameter = "rpiappname"; 106 106 107 public String getId() { 107 108 return getClass().getName(); … … 713 714 BwSession s = BwWebUtil.getState(request); 714 715 HttpSession sess = request.getSession(false); 715 716 String appName = getAppName(sess); 717 716 718 if (s != null) { 717 719 if (debug) { … … 730 732 731 733 CalEnv env = getEnv(request, form); 732 String appName = env.getAppProperty("name");733 734 String appRoot = env.getAppProperty("root"); 734 735 … … 736 737 */ 737 738 s = new BwSessionImpl(form.getCurrentUser(), appRoot, appName, 738 form.getPresentationState(), messages,739 form.getSchemeHostPort(), debug);739 form.getPresentationState(), messages, 740 form.getSchemeHostPort(), debug); 740 741 741 742 BwWebUtil.setState(request, s); … … 765 766 String raddr = request.getRemoteAddr(); 766 767 String rhost = request.getRemoteHost(); 767 SessionListener.setId(appName); // First time will have no name768 768 info("===============" + appName + ": New session (" + 769 769 s.getSessionNum() + ") from " + … … 821 821 822 822 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; 823 834 } 824 835 trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSession.java
r2 r302 72 72 73 73 /** This may not be entirely correct so should be used with care. 74 *75 * @param val76 */77 public void setSessionNum(int val);78 79 /** This may not be entirely correct so should be used with care.80 74 * Really just provides some measure of use. 81 75 * 82 * @return insession number76 * @return long session number 83 77 */ 84 public intgetSessionNum();78 public long getSessionNum(); 85 79 86 80 /** The current user trunk/calendar3/webcommon/src/org/bedework/webcommon/BwSessionImpl.java
r2 r302 59 59 import java.net.URI; 60 60 import java.net.URISyntaxException; 61 import java.util.HashMap; 61 62 62 63 import org.apache.log4j.Logger; … … 66 67 * CalEnv to figure out which implementation to use. 67 68 * 68 * <p>This class represents a session for the UWCalweb interface.69 * <p>This class represents a session for the Bedework web interface. 69 70 * Some user state will be retained here. 70 71 * We also provide a number of methods which act as the interface between 71 72 * the web world and the calendar world. 72 73 * 73 * <p>The UW web interface has session support that may not be applicable74 * to all potential users of this application. We should try to interface to75 * it through this.76 *77 74 * @author Mike Douglass douglm@rpi.edu 78 75 */ 79 76 public 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; 83 85 84 86 /** True if we want debugging output … … 102 104 private PresentationState ps; 103 105 104 /** Constructor for a UWCalSession106 /** Constructor for a Session 105 107 * 106 108 * @param user String user id … … 161 163 } 162 164 163 se ssionNum++;165 setSessionNum(appName); 164 166 } 165 167 … … 169 171 170 172 /* (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)178 173 * @see org.bedework.webcommon.BwSession#getSessionNum() 179 174 */ 180 public intgetSessionNum() {175 public long getSessionNum() { 181 176 return sessionNum; 182 177 } … … 268 263 } 269 264 } 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 } 270 282 }
