[Bedework-commit] webapps r1251 - in releases/bedework-3.7:
webadmin/war/docs webadmin/war/docs/event
webcommon/src/org/bedework/webcommon
webcommon/src/org/bedework/webcommon/event
svnadmin at bedework.org
svnadmin at bedework.org
Mon Feb 14 10:32:42 EST 2011
Author: douglm
Date: 2011-02-14 10:32:41 -0500 (Mon, 14 Feb 2011)
New Revision: 1251
Modified:
releases/bedework-3.7/webadmin/war/docs/event/modEventPending.jsp
releases/bedework-3.7/webadmin/war/docs/tabPendingEvents.jsp
releases/bedework-3.7/webcommon/src/org/bedework/webcommon/BwWebUtil.java
releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/AttendeeAction.java
Log:
Some changes that didn't make it through for the last update.
In addition to the below changes to try to get a stack trace out of jsp when rendering fails.
Further changes to the build. Attempt to catch changed libraries and force a rebuild.
Also use outofdate to suppress running of apt when sources have not changed.
Minor but widespread change to remove debug parameter from a number of classes. For those debugging now depends on log4j level.
Modified: releases/bedework-3.7/webadmin/war/docs/event/modEventPending.jsp
===================================================================
--- releases/bedework-3.7/webadmin/war/docs/event/modEventPending.jsp 2011-02-14 15:21:18 UTC (rev 1250)
+++ releases/bedework-3.7/webadmin/war/docs/event/modEventPending.jsp 2011-02-14 15:32:41 UTC (rev 1251)
@@ -3,7 +3,9 @@
<html:xhtml/>
<%@include file="/docs/header.jsp"%>
-
+<%
+try {
+%>
<page>modEventPending</page>
<tab>pending</tab>
Modified: releases/bedework-3.7/webadmin/war/docs/tabPendingEvents.jsp
===================================================================
--- releases/bedework-3.7/webadmin/war/docs/tabPendingEvents.jsp 2011-02-14 15:21:18 UTC (rev 1250)
+++ releases/bedework-3.7/webadmin/war/docs/tabPendingEvents.jsp 2011-02-14 15:32:41 UTC (rev 1251)
@@ -4,7 +4,9 @@
<%@ taglib uri='struts-genurl' prefix='genurl' %>
<%@include file="header.jsp"%>
-
+<%
+try {
+%>
<page>tabPendingEvents</page>
<tab>pending</tab>
Modified: releases/bedework-3.7/webcommon/src/org/bedework/webcommon/BwWebUtil.java
===================================================================
--- releases/bedework-3.7/webcommon/src/org/bedework/webcommon/BwWebUtil.java 2011-02-14 15:21:18 UTC (rev 1250)
+++ releases/bedework-3.7/webcommon/src/org/bedework/webcommon/BwWebUtil.java 2011-02-14 15:32:41 UTC (rev 1251)
@@ -28,12 +28,12 @@
import org.bedework.appcommon.CheckData;
import org.bedework.calfacade.BwAttendee;
+import org.bedework.calfacade.BwContact;
import org.bedework.calfacade.BwDateTime;
import org.bedework.calfacade.BwEvent;
import org.bedework.calfacade.BwLocation;
import org.bedework.calfacade.BwLongString;
import org.bedework.calfacade.BwOrganizer;
-import org.bedework.calfacade.BwContact;
import org.bedework.calfacade.BwString;
import org.bedework.calfacade.BwSystem;
import org.bedework.calfacade.exc.CalFacadeException;
@@ -45,17 +45,18 @@
import edu.rpi.sss.util.Util;
import net.fortuna.ical4j.model.Dur;
-import net.fortuna.ical4j.model.property.Duration;
import net.fortuna.ical4j.model.property.DtEnd;
import net.fortuna.ical4j.model.property.DtStart;
+import net.fortuna.ical4j.model.property.Duration;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.Collection;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
/** Useful shared web utility routines
*
* @author Mike Douglass douglm at rpi.edu
@@ -75,7 +76,7 @@
* @param request Needed to locate session
* @return BwSession null on failure
*/
- public static BwSession getState(HttpServletRequest request) {
+ public static BwSession getState(final HttpServletRequest request) {
HttpSession sess = request.getSession(false);
if (sess != null) {
@@ -90,13 +91,28 @@
return null;
}
+ /** Drop the session state object embedded in
+ * the current session.
+ *
+ * @param request Needed to locate session
+ */
+ public static void dropState(final HttpServletRequest request) {
+ HttpSession sess = request.getSession(false);
+
+ if (sess == null) {
+ return;
+ }
+
+ sess.removeAttribute(sessStateAttr);
+ }
+
/** Set the session state object into the current session.
*
* @param request HttpServletRequest Needed to locate session
* @param s BwSession session object
*/
- public static void setState(HttpServletRequest request,
- BwSession s) {
+ public static void setState(final HttpServletRequest request,
+ final BwSession s) {
HttpSession sess = request.getSession(false);
if (sess != null) {
@@ -112,17 +128,26 @@
* @param request Needed to locate session
* @return CalSvcI null on failure
*/
- public static CalSvcI getCalSvcI(HttpServletRequest request) {
+ public static CalSvcI getCalSvcI(final HttpServletRequest request) {
return getCalSvcI(request.getSession(false));
}
- /** Try to get the CalSvcI object embedded in
+ /** Drop the CalSvcI object embedded in
* the current session.
*
+ * @param request Needed to locate session
+ */
+ public static void dropCalSvcI(final HttpServletRequest request) {
+ dropCalSvcI(request.getSession(false));
+ }
+
+ /** Try to get the CalSvcI object embedded in
+ * the given session.
+ *
* @param sess
* @return CalSvcI null on failure
*/
- public static CalSvcI getCalSvcI(HttpSession sess) {
+ public static CalSvcI getCalSvcI(final HttpSession sess) {
if (sess == null) {
noSession();
}
@@ -135,13 +160,26 @@
return null;
}
+ /** Drop the CalSvcI object embedded in
+ * the given session.
+ *
+ * @param sess
+ */
+ public static void dropCalSvcI(final HttpSession sess) {
+ if (sess == null) {
+ return;
+ }
+
+ sess.removeAttribute(sessCalSvcIAttr);
+ }
+
/** Set the CalSvcI object into the current session.
*
* @param request HttpServletRequest Needed to locate session
* @param svci CalSvcI object
*/
- public static void setCalSvcI(HttpServletRequest request,
- CalSvcI svci) {
+ public static void setCalSvcI(final HttpServletRequest request,
+ final CalSvcI svci) {
HttpSession sess = request.getSession(false);
if (sess != null) {
@@ -158,8 +196,8 @@
* @return boolean true for ok
* @throws CalFacadeException
*/
- public static boolean validateEventDates(BwActionFormBase form,
- BwEvent ev) throws CalFacadeException {
+ public static boolean validateEventDates(final BwActionFormBase form,
+ final BwEvent ev) throws CalFacadeException {
boolean ok = true;
/* ------------- Start, end and duration ------------------ */
@@ -207,10 +245,10 @@
* @return null for OK, validation errors otherwise.
* @throws CalFacadeException
*/
- public static Collection<ValidationError> validateEvent(CalSvcI svci,
- boolean prePublish,
- boolean publicAdmin,
- BwEvent ev)
+ public static Collection<ValidationError> validateEvent(final CalSvcI svci,
+ final boolean prePublish,
+ final boolean publicAdmin,
+ final BwEvent ev)
throws CalFacadeException {
Collection<ValidationError> ves = null;
@@ -324,14 +362,14 @@
return ves;
}
- private static Collection<ValidationError> addError(Collection<ValidationError> ves,
- String errorCode) {
+ private static Collection<ValidationError> addError(final Collection<ValidationError> ves,
+ final String errorCode) {
return addError(ves, errorCode, null);
}
private static Collection<ValidationError> addError(Collection<ValidationError> ves,
- String errorCode,
- String extra) {
+ final String errorCode,
+ final String extra) {
if (ves == null) {
ves = new ArrayList<ValidationError>();
}
@@ -351,8 +389,8 @@
* @return boolean true for ok
* @throws CalFacadeException
*/
- public static boolean validateUserHref(CalSvcI svci,
- String href) throws CalFacadeException {
+ public static boolean validateUserHref(final CalSvcI svci,
+ final String href) throws CalFacadeException {
AccessPrincipal p = svci.getDirectories().caladdrToPrincipal(href);
if (p == null) {
@@ -375,7 +413,7 @@
* @return ValidateResult
* @throws Throwable
*/
- public static ValidateResult validateLocation(BwActionFormBase form)
+ public static ValidateResult validateLocation(final BwActionFormBase form)
throws Throwable {
ValidateResult vr = new ValidateResult();
@@ -435,7 +473,7 @@
* @return ValidateResult
* @throws CalFacadeException
*/
- public static ValidateResult validateContact(BwActionFormBase form) throws CalFacadeException {
+ public static ValidateResult validateContact(final BwActionFormBase form) throws CalFacadeException {
ValidateResult vr = new ValidateResult();
BwContact contact = form.getContact();
@@ -500,7 +538,7 @@
* @param val String request parameter value
* @return String null for null or zero lengt val, val otherwise.
*/
- public static String checkNull(String val) {
+ public static String checkNull(final String val) {
if (val == null) {
return null;
}
Modified: releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/AttendeeAction.java
===================================================================
--- releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/AttendeeAction.java 2011-02-14 15:21:18 UTC (rev 1250)
+++ releases/bedework-3.7/webcommon/src/org/bedework/webcommon/event/AttendeeAction.java 2011-02-14 15:32:41 UTC (rev 1251)
@@ -59,6 +59,41 @@
* </ul>
*/
public class AttendeeAction extends EventActionBase {
+ /**
+ * @author douglm
+ */
+ public class JsonAttendee {
+ String uri;
+ String role;
+ String cn;
+ String cutype;
+
+ /**
+ *
+ */
+ public JsonAttendee() {}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("JsonAttendee{");
+
+ sb.append("uri=");
+ sb.append(uri);
+
+ sb.append(", role=");
+ sb.append(role);
+
+ sb.append(", cn=");
+ sb.append(cn);
+
+ sb.append(", cutype=");
+ sb.append(cutype);
+
+ sb.append("}");
+
+ return sb.toString();
+ }
+ }
/* (non-Javadoc)
* @see org.bedework.webcommon.BwAbstractAction#doAction(org.bedework.webcommon.BwRequest, org.bedework.webcommon.BwActionFormBase)
*/
@@ -82,34 +117,6 @@
// Try a bit of json
Gson gson = new Gson();
- class JsonAttendee {
- String uri;
- String role;
- String cn;
- String cutype;
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("JsonAttendee{");
-
- sb.append("uri=");
- sb.append(uri);
-
- sb.append(", role=");
- sb.append(role);
-
- sb.append(", cn=");
- sb.append(cn);
-
- sb.append(", cutype=");
- sb.append(cutype);
-
- sb.append("}");
-
- return sb.toString();
- }
- }
-
for (String s: attjson) {
debugMsg("json=" + s);
try {
More information about the Bedework-commit
mailing list