Author: agilliland
Date: Mon May 7 11:18:40 2007
New Revision: 535940
URL: http://svn.apache.org/viewvc?view=rev&rev=535940
Log:
update to UIAction to have an actual attribute for 'weblog' which defines the
handle of the action weblog we are working on. this allows us to rely on the
framework to actually set this attribute on our action directly rather than
having us pull it directly from the request object in the UIActionInterceptor,
which is important for supporting parameters on multipart form submissions.
Modified:
roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
Modified: roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java?view=diff&rev=535940&r1=535939&r2=535940
==============================================================================
--- roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java
(original)
+++ roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIAction.java Mon
May 7 11:18:40 2007
@@ -53,6 +53,9 @@
// the weblog this action is intended to work on, or null if no weblog
specified
private WebsiteData actionWeblog = null;
+ // the weblog handle of the action weblog
+ private String weblog = null;
+
// action name (used by tabbed menu utility)
protected String actionName = null;
@@ -188,6 +191,14 @@
this.actionWeblog = workingWeblog;
}
+ public String getWeblog() {
+ return weblog;
+ }
+
+ public void setWeblog(String weblog) {
+ this.weblog = weblog;
+ }
+
public String getPageTitle() {
return getText(pageTitle);
}
Modified:
roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
URL:
http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java?view=diff&rev=535940&r1=535939&r2=535940
==============================================================================
---
roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
(original)
+++
roller/trunk/src/org/apache/roller/ui/core/util/struts2/UIActionInterceptor.java
Mon May 7 11:18:40 2007
@@ -63,16 +63,19 @@
theAction.setAuthenticatedUser(rses.getAuthenticatedUser());
// extract the work weblog and set it
- String weblogHandle =
request.getParameter(RequestConstants.WEBLOG);
+ String weblogHandle = theAction.getWeblog();
+ //String weblogHandle =
request.getParameter(RequestConstants.WEBLOG);
if(!StringUtils.isEmpty(weblogHandle)) {
WebsiteData weblog = null;
try {
UserManager mgr =
RollerFactory.getRoller().getUserManager();
weblog = mgr.getWebsiteByHandle(weblogHandle);
+ if(weblog != null) {
+ theAction.setActionWeblog(weblog);
+ }
} catch(Exception e) {
-
+ log.error("Error looking up action weblog -
"+weblogHandle, e);
}
- theAction.setActionWeblog(weblog);
}
}