You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gm...@apache.org on 2014/08/04 21:48:10 UTC
svn commit: r1615747 - in /roller/trunk/app/src/main:
java/org/apache/roller/weblogger/pojos/
java/org/apache/roller/weblogger/ui/struts2/admin/
java/org/apache/roller/weblogger/ui/struts2/core/
java/org/apache/roller/weblogger/ui/struts2/editor/ java/...
Author: gmazza
Date: Mon Aug 4 19:48:10 2014
New Revision: 1615747
URL: http://svn.apache.org/r1615747
Log:
Consolidation of EntryAdd into EntryEdit, more informative messaging provided on blog entry publishing and deleting.
Removed:
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
Modified:
roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor.java
roller/trunk/app/src/main/resources/ApplicationResources.properties
roller/trunk/app/src/main/resources/ApplicationResources_de.properties
roller/trunk/app/src/main/resources/ApplicationResources_es.properties
roller/trunk/app/src/main/resources/ApplicationResources_fr.properties
roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
roller/trunk/app/src/main/resources/ApplicationResources_ko.properties
roller/trunk/app/src/main/resources/ApplicationResources_ru.properties
roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties
roller/trunk/app/src/main/resources/struts.xml
roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/pojos/WeblogEntry.java Mon Aug 4 19:48:10 2014
@@ -888,8 +888,8 @@ public class WeblogEntry implements Seri
return Arrays.asList( StringUtils.split(getPlugins(), ",") );
}
return new ArrayList<String>();
- }
-
+ }
+
/** Convenience method for checking status */
public boolean isDraft() {
return getStatus().equals(PubStatus.DRAFT);
@@ -948,11 +948,7 @@ public class WeblogEntry implements Seri
boolean author = perm.hasAction(WeblogPermission.POST) || perm.hasAction(WeblogPermission.ADMIN);
boolean limited = !author && perm.hasAction(WeblogPermission.EDIT_DRAFT);
- if (author || (limited && (isDraft() || isPending()))) {
- return true;
- }
-
- return false;
+ return author || (limited && (status == PubStatus.DRAFT || status == PubStatus.PENDING));
}
/**
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java Mon Aug 4 19:48:10 2014
@@ -201,11 +201,11 @@ public class GlobalConfig extends UIActi
WebloggerFactory.getWeblogger().flush();
// notify user of our success
- addMessage("weblogEdit.changesSaved");
+ addMessage("generic.changes.saved");
} catch (WebloggerException ex) {
log.error("Error saving roller properties", ex);
- addError("error.update.rollerConfig");
+ addError("generic.error.check.logs");
}
return SUCCESS;
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java Mon Aug 4 19:48:10 2014
@@ -84,7 +84,7 @@ public class CreateWeblog extends UIActi
}
} catch (WebloggerException ex) {
log.error("error checking for existing weblogs count", ex);
- addError("generic.system.error");
+ addError("generic.error.check.logs");
return DISABLED_RETURN_CODE;
}
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java Mon Aug 4 19:48:10 2014
@@ -98,7 +98,7 @@ public class Register extends UIAction i
}
} catch (Exception e) {
log.error("Error checking user count", e);
- addError("generic.system.error");
+ addError("generic.error.check.logs");
return DISABLED_RETURN_CODE;
}
@@ -274,7 +274,7 @@ public class Register extends UIAction i
} catch (WebloggerException ex) {
log.error("Error adding new user", ex);
- addError("generic.system.error");
+ addError("generic.error.check.logs");
}
}
@@ -390,7 +390,7 @@ public class Register extends UIAction i
}
} catch (WebloggerException ex) {
log.error("error checking for user", ex);
- addError("generic.system.error");
+ addError("generic.error.check.logs");
}
}
}
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java Mon Aug 4 19:48:10 2014
@@ -27,6 +27,8 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.roller.util.DateUtil;
+import org.apache.roller.util.RollerConstants;
import org.apache.roller.weblogger.WebloggerException;
import org.apache.roller.weblogger.business.WebloggerFactory;
import org.apache.roller.weblogger.business.WeblogEntryManager;
@@ -47,27 +49,23 @@ import org.apache.roller.weblogger.util.
import org.apache.struts2.interceptor.validation.SkipValidation;
/**
- * Edit an existing entry.
+ * Edit a new or existing entry.
*/
public final class EntryEdit extends EntryBase {
- private static final long MINUTE_IN_MILLIS = 60000;
-
private static Log log = LogFactory.getLog(EntryEdit.class);
// bean for managing form data
private EntryBean bean = new EntryBean();
- // the entry we are editing
+ // the entry we are adding or editing
private WeblogEntry entry = null;
// url to send trackback to
private String trackbackUrl = null;
public EntryEdit() {
- this.actionName = "entryEdit";
this.desiredMenu = "editor";
- this.pageTitle = "weblogEdit.title.editEntry";
}
@Override
@@ -76,15 +74,14 @@ public final class EntryEdit extends Ent
}
public void myPrepare() {
- /*
- * Need to reset actionName as processing is chained from
- * EntryAdd via struts.xml and hence absorbs its value of "entryAdd"
- * which would negatively effect the processing in EntryEdit.jsp
- */
- this.actionName = "entryEdit";
-
- if (getBean().getId() != null) {
+ if (getBean().getId() == null) { // new entry?
+ // Create and initialize new, not-yet-saved Weblog Entry
+ entry = new WeblogEntry();
+ entry.setCreatorUserName(getAuthenticatedUser().getUserName());
+ entry.setWebsite(getActionWeblog());
+ } else { // already saved entry
try {
+ // retrieve from DB WeblogEntry based on ID
WeblogEntryManager wmgr = WebloggerFactory.getWeblogger()
.getWeblogEntryManager();
setEntry(wmgr.getWeblogEntry(getBean().getId()));
@@ -97,39 +94,63 @@ public final class EntryEdit extends Ent
}
/**
- * Show form for editing an existing entry.
+ * Show form for adding/editing weblog entry.
*
* @return String The result of the action.
*/
@SkipValidation
public String execute() {
- // make sure we have an entry to edit and it belongs to the action weblog
- if (getEntry() == null) {
- return ERROR;
- } else if (!getEntry().getWebsite().equals(getActionWeblog())) {
- return DENIED;
+ if (getActionName().equals("entryEdit")) {
+ // load bean with pojo data
+ getBean().copyFrom(getEntry(), getLocale());
+ } else {
+ // set weblog defaults
+ getBean().setLocale(getActionWeblog().getLocale());
+ getBean().setAllowComments(getActionWeblog().getDefaultAllowComments());
+ getBean().setCommentDays(getActionWeblog().getDefaultCommentDays());
}
- // load bean with pojo data
- getBean().copyFrom(getEntry(), getLocale());
-
return INPUT;
}
/**
- * Save weblog entry.
- *
+ * Save a draft entry.
+ *
* @return String The result of the action.
*/
- public String save() {
+ public String saveDraft() {
+ getBean().setStatus(PubStatus.DRAFT.name());
+ return save();
+ }
- // make sure we have an entry to edit and it belongs to the action weblog
- if (getEntry() == null) {
- return ERROR;
- } else if (!getEntry().getWebsite().equals(getActionWeblog())) {
- return DENIED;
+ /**
+ * Publish an entry.
+ *
+ * @return String The result of the action.
+ */
+ public String publish() {
+ if (getActionWeblog().hasUserPermission(
+ getAuthenticatedUser(), WeblogPermission.POST)) {
+ Timestamp pubTime = getBean().getPubTime(getLocale(),
+ getActionWeblog().getTimeZoneInstance());
+ if (pubTime != null && pubTime.after(
+ new Date(System.currentTimeMillis() + RollerConstants.MIN_IN_MS))) {
+ getBean().setStatus(PubStatus.SCHEDULED.name());
+ } else {
+ getBean().setStatus(PubStatus.PUBLISHED.name());
+ }
+ } else {
+ getBean().setStatus(PubStatus.PENDING.name());
}
+ return save();
+ }
+ /**
+ * Processing logic common for saving drafts and publishing entries
+ *
+ * @return String The result of the action.
+ */
+ private String save() {
if (!hasActionErrors()) {
try {
WeblogEntryManager weblogMgr = WebloggerFactory.getWeblogger()
@@ -146,27 +167,9 @@ public final class EntryEdit extends Ent
getBean().copyTo(weblogEntry);
// handle pubtime auto set
- if (weblogEntry.isPublished()) {
- if (weblogEntry.getPubTime() == null) {
- // no time specified, use current time
- weblogEntry.setPubTime(weblogEntry.getUpdateTime());
- }
-
- // if user does not have author perms then force PENDING
- // status
- if (!getActionWeblog().hasUserPermission(
- getAuthenticatedUser(), WeblogPermission.POST)) {
- weblogEntry.setStatus(PubStatus.PENDING);
- }
-
- // If the entry was published to future, set status as
- // SCHEDULED we only consider an entry future published if
- // it is scheduled more than 1 minute into the future
- if (weblogEntry.getPubTime().after(
- new Date(System.currentTimeMillis() + MINUTE_IN_MILLIS))) {
- getBean().setStatus(PubStatus.SCHEDULED.name());
- }
-
+ if (weblogEntry.isPublished() && weblogEntry.getPubTime() == null) {
+ // no time specified, use current time
+ weblogEntry.setPubTime(weblogEntry.getUpdateTime());
}
// if user is an admin then apply pinned to main value as well
@@ -195,7 +198,7 @@ public final class EntryEdit extends Ent
} catch (MediacastException ex) {
addMessage(getText(ex.getErrorKey()));
}
- } else {
+ } else if ("entryEdit".equals(actionName)) {
try {
// if MediaCast string is empty, clean out MediaCast
// attributes
@@ -225,7 +228,7 @@ public final class EntryEdit extends Ent
// notify search of the new entry
if (weblogEntry.isPublished()) {
reindexEntry(weblogEntry);
- } else {
+ } else if ("entryEdit".equals(actionName)) {
removeEntryIndex(weblogEntry);
}
@@ -238,27 +241,89 @@ public final class EntryEdit extends Ent
.queueApplicableAutoPings(weblogEntry);
}
- if (weblogEntry.isPending()) {
- // implies that entry just changed to pending
- if (MailUtil.isMailConfigured()) {
- MailUtil.sendPendingEntryNotice(weblogEntry);
- }
- addMessage("weblogEdit.submittedForReview");
+ if (weblogEntry.isPending() && MailUtil.isMailConfigured()) {
+ MailUtil.sendPendingEntryNotice(weblogEntry);
+ }
+ if ("entryEdit".equals(actionName)) {
+ addStatusMessage(getEntry().getStatus());
+ // continue in entryEdit mode
+ return INPUT;
} else {
- addMessage("weblogEdit.changesSaved");
+ // now that entry is saved we have an id value for it
+ // store it back in bean for use in next action
+ getBean().setId(weblogEntry.getId());
+ // flip over to entryEdit mode, as defined in struts.xml
+ return SUCCESS;
}
- return INPUT;
-
} catch (Exception e) {
log.error("Error saving new entry", e);
- addError("weblogEdit.error.saving");
+ addError("generic.error.check.logs");
}
}
-
+ if ("entryAdd".equals(actionName)) {
+ // if here on entryAdd, nothing saved, so reset status to null (unsaved)
+ getBean().setStatus(null);
+ }
return INPUT;
}
+ public EntryBean getBean() {
+ return bean;
+ }
+
+ public void setBean(EntryBean bean) {
+ this.bean = bean;
+ }
+
+ public WeblogEntry getEntry() {
+ return entry;
+ }
+
+ public void setEntry(WeblogEntry entry) {
+ this.entry = entry;
+ }
+
+ @SkipValidation
+ public String firstSave() {
+ addStatusMessage(getEntry().getStatus());
+ return execute();
+ }
+
+ private void addStatusMessage(PubStatus pubStatus) {
+ switch (pubStatus) {
+ case DRAFT:
+ addMessage("weblogEdit.draftSaved");
+ break;
+ case PUBLISHED:
+ addMessage("weblogEdit.publishedEntry");
+ break;
+ case SCHEDULED:
+ addMessage("weblogEdit.scheduledEntry", DateUtil.fullDate(getEntry().getPubTime()));
+ break;
+ case PENDING:
+ addMessage("weblogEdit.submittedForReview");
+ break;
+ }
+ }
+
+ public String getPreviewURL() {
+ return WebloggerFactory
+ .getWeblogger()
+ .getUrlStrategy()
+ .getPreviewURLStrategy(null)
+ .getWeblogEntryURL(getActionWeblog(), null,
+ getEntry().getAnchor(), true);
+ }
+
+ public String getTrackbackUrl() {
+ return trackbackUrl;
+ }
+
+ public void setTrackbackUrl(String trackbackUrl) {
+ this.trackbackUrl = trackbackUrl;
+ }
+
/**
* Send trackback to a specific url.
*/
@@ -316,7 +381,7 @@ public final class EntryEdit extends Ent
}
/**
- * Get the list of all categories for the action weblog, not including root.
+ * Get the list of all categories for the action weblog
*/
public List<WeblogCategory> getCategories() {
try {
@@ -331,37 +396,4 @@ public final class EntryEdit extends Ent
}
}
- public String getPreviewURL() {
- return WebloggerFactory
- .getWeblogger()
- .getUrlStrategy()
- .getPreviewURLStrategy(null)
- .getWeblogEntryURL(getActionWeblog(), null,
- getEntry().getAnchor(), true);
- }
-
- public EntryBean getBean() {
- return bean;
- }
-
- public void setBean(EntryBean bean) {
- this.bean = bean;
- }
-
- public WeblogEntry getEntry() {
- return entry;
- }
-
- public void setEntry(WeblogEntry entry) {
- this.entry = entry;
- }
-
- public String getTrackbackUrl() {
- return trackbackUrl;
- }
-
- public void setTrackbackUrl(String trackbackUrl) {
- this.trackbackUrl = trackbackUrl;
- }
-
}
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java Mon Aug 4 19:48:10 2014
@@ -101,13 +101,13 @@ public class EntryRemove extends EntryBa
WebloggerFactory.getWeblogger().flush();
// note to user
- addMessage("weblogEdit.entryRemoved");
+ addMessage("weblogEdit.entryRemoved", entry.getTitle());
return SUCCESS;
} catch (Exception e) {
log.error("Error removing entry " + getRemoveId(), e);
- addError("Error removing entry");
+ addError("generic.error.check.logs");
}
} else {
addError("weblogEntry.notFound");
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java Mon Aug 4 19:48:10 2014
@@ -172,7 +172,7 @@ public class ThemeEdit extends UIAction
} catch (WebloggerException re) {
log.error("Error saving weblog - "
+ getActionWeblog().getHandle(), re);
- addError("Error setting theme");
+ addError("generic.error.check.logs");
}
}
} else {
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor.java?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionPrepareInterceptor.java Mon Aug 4 19:48:10 2014
@@ -20,10 +20,6 @@ package org.apache.roller.weblogger.ui.s
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.roller.weblogger.ui.struts2.editor.EntryAdd;
-import org.apache.roller.weblogger.ui.struts2.editor.EntryAddWithMediaFile;
-import org.apache.roller.weblogger.ui.struts2.editor.EntryEdit;
-
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
@@ -43,7 +39,6 @@ public class UIActionPrepareInterceptor
}
final Object action = invocation.getAction();
- // final ActionContext context = invocation.getInvocationContext();
// is this one of our own UIAction classes?
if (action instanceof UIActionPreparable) {
@@ -52,23 +47,6 @@ public class UIActionPrepareInterceptor
log.debug("action is UIActionPreparable, calling myPrepare() method");
}
- // The EntryAdd->EntryEdit chain is the one place where we need
- // to pass a parameter along the chain, thus this somewhat ugly hack
- if (invocation.getStack().getRoot().size() > 1) {
- Object action0 = invocation.getStack().getRoot().get(0);
- Object action1 = invocation.getStack().getRoot().get(1);
- if (action0 instanceof EntryEdit && action1 instanceof EntryAdd) {
- EntryEdit editAction = (EntryEdit) action0;
- EntryAdd addAction = (EntryAdd) action1;
- editAction.getBean().setId(addAction.getBean().getId());
- } else if (action0 instanceof EntryAdd
- && action1 instanceof EntryAddWithMediaFile) {
- EntryAdd addAction = (EntryAdd) action0;
- EntryAddWithMediaFile mediaAction = (EntryAddWithMediaFile) action1;
- addAction.setBean(mediaAction.getBean());
- }
- }
-
UIActionPreparable theAction = (UIActionPreparable) action;
theAction.myPrepare();
}
Modified: roller/trunk/app/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources.properties Mon Aug 4 19:48:10 2014
@@ -33,7 +33,8 @@ generic.save=Save
generic.edit=Edit
generic.delete=Delete
generic.tagline=Tagline
-generic.system.error=Roller system error - Have administrator check Roller logs for more information.
+generic.error.check.logs=Roller system error - Have administrator check Roller logs for more information.
+generic.changes.saved=Changes saved
# ------------------------------------------------------------- BookmarkForm.jsp
@@ -1472,9 +1473,8 @@ weblogEdit.summary=Summary (optional)
weblogEdit.content=Content
weblogEdit.category=Category
-weblogEdit.changesSaved=Changes saved
weblogEdit.comments=Comments
-weblogEdit.entryRemoved=Entry removed
+weblogEdit.entryRemoved=Entry "{0}" deleted
weblogEdit.draft=Draft
weblogEdit.draftEntries=Recent Drafts
weblogEdit.deleteEntry=Delete Entry
@@ -1492,6 +1492,9 @@ weblogEdit.scheduled=Scheduled
weblogEdit.scheduledEntries=Scheduled Entries
weblogEdit.status=Status
weblogEdit.submitForReview=Submit for Review
+weblogEdit.draftSaved=Draft saved
+weblogEdit.publishedEntry=Blog entry published!
+weblogEdit.scheduledEntry=Blog entry scheduled for publication on {0}
weblogEdit.submittedForReview=Entry submitted for review
weblogEdit.tags=Tags
weblogEdit.title=Title
@@ -1541,13 +1544,13 @@ weblogEdit.mediaCastUrlMalformed=The enc
weblogEdit.mediaCastResponseError=The enclosure server returned an error. Do you have the right URL?
weblogEdit.mediaCastLacksContentTypeOrLength=Unable to use enclosure URL. Server provided no content type or no length.
weblogEdit.mediaCastErrorRemoving=Error removing MediaCast from weblog entry
-weblogEdit.error.saving=Error saving new entry
# errors from validation
Entry.error.titleNull=Title is a required field
Entry.error.titleSize=Title cannot be more than 255 characters
Entry.error.localeNull=Locale is a required field
+Entry.error.categoryNull=Category is required field
Entry.error.textNull=Content is a required field
@@ -1580,8 +1583,8 @@ weblogEntriesPager.month.dateFormat=MMM
# ---------------------------------------------------------- Weblog Entry Remove
-weblogEntryRemove.removeWeblogEntry=Remove Weblog Entry
-weblogEntryRemove.areYouSure=Are you sure you want to remove this Weblog Entry?
+weblogEntryRemove.removeWeblogEntry=Delete Weblog Entry
+weblogEntryRemove.areYouSure=Are you sure you want to delete this Weblog Entry?
weblogEntryRemove.entryTitle=Entry Title
weblogEntryRemove.entryId=Entry ID
Modified: roller/trunk/app/src/main/resources/ApplicationResources_de.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_de.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_de.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_de.properties Mon Aug 4 19:48:10 2014
@@ -744,7 +744,6 @@ userSettings.timeZone=Zeitzone
userSettings.username=Benutzerk\u00FCrzel
weblogEdit.allowComments=Erlaube Kommentare
weblogEdit.category=Kategorie
-weblogEdit.changesSaved=\u00C4nderungen gesichert
weblogEdit.commentDays=f\u00FCr
weblogEdit.comments=Kommentare
weblogEdit.content=Inhalt
@@ -767,7 +766,7 @@ weblogEdit.draftEntries=Aktuelle Entw\u0
weblogEdit.enclosureLength=L\u00E4nge
weblogEdit.enclosureType=Typ
weblogEdit.enclosureURL=Enclosure URL
-weblogEdit.entryRemoved=Eintrag gel\u00F6scht
+weblogEdit.entryRemoved=Eintrag "{0}" gel\u00F6scht
weblogEdit.fullPreviewMode=Volle Vorschau
weblogEdit.hasComments=<a href="{0}">Kommentare [{1}]</a>
weblogEdit.locale=Sprache
Modified: roller/trunk/app/src/main/resources/ApplicationResources_es.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_es.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_es.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_es.properties Mon Aug 4 19:48:10 2014
@@ -460,9 +460,8 @@ weblogEntry.pendingEntrySubject=Roller\:
weblogEntry.pendingEntryContent=Usuario [{0}] ha enviado una nueva entrada para revisi\u00F3n. Por favor, revise y no publique o guarde como borrador de modo que el usuario [{1}] puede editarlo otra vez. Enlace para editar el env\u00EDo pendiente\: <{2}>
weblogEntry.notFound=No se puede encontrar la entrada solicitada
weblogEdit.category=Categor\u00EDa
-weblogEdit.changesSaved=Cambios guardados
weblogEdit.comments=Comentarios
-weblogEdit.entryRemoved=Entrada eliminada
+weblogEdit.entryRemoved=Entrada "{0}" eliminada
weblogEdit.draft=Borrador
weblogEdit.draftEntries=Borradores recientes
weblogEdit.deleteEntry=Borrar entrada
Modified: roller/trunk/app/src/main/resources/ApplicationResources_fr.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_fr.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_fr.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_fr.properties Mon Aug 4 19:48:10 2014
@@ -944,9 +944,8 @@ weblogEdit.summary=Sommaire (facultatif)
weblogEdit.content=Contenu
weblogEdit.category=Catégorie
-weblogEdit.changesSaved=Changements enregistrés
weblogEdit.comments=Commentaires
-weblogEdit.entryRemoved=Publication effacée
+weblogEdit.entryRemoved=Publication "{0}" effacée
weblogEdit.draft=Brouillon
weblogEdit.draftEntries=Brouillons récents
weblogEdit.deleteEntry=Effacer cette entrée
Modified: roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties Mon Aug 4 19:48:10 2014
@@ -718,7 +718,6 @@ weblogEdit.summary=\u30B5\u30DE\u30EA(\u
weblogEdit.content=\u672C\u6587
weblogEdit.category=\u30AB\u30C6\u30B4\u30EA
-weblogEdit.changesSaved=\u5909\u66F4\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F
weblogEdit.comments=\u30B3\u30E1\u30F3\u30C8
weblogEdit.entryRemoved=\u30A8\u30F3\u30C8\u30EA\u3092\u524A\u9664
weblogEdit.draft=\u4E0B\u66F8\u304D
Modified: roller/trunk/app/src/main/resources/ApplicationResources_ko.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ko.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ko.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ko.properties Mon Aug 4 19:48:10 2014
@@ -1053,7 +1053,6 @@ weblogEdit.summary=\uc694\uc57d (\uc120\
weblogEdit.content=\ub0b4\uc6a9
weblogEdit.category=\uce74\ud14c\uace0\ub9ac
-weblogEdit.changesSaved=\ubcc0\uacbd \uc0ac\ud56d\uc774 \uc800\uc7a5\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
weblogEdit.comments=\uc758\uacac
weblogEdit.entryRemoved=\uae30\uc0ac\uac00 \uc0ad\uc81c\ub418\uc5c8\uc2b5\ub2c8\ub2e4.
weblogEdit.draft=\ucd08\uace0
Modified: roller/trunk/app/src/main/resources/ApplicationResources_ru.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ru.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ru.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ru.properties Mon Aug 4 19:48:10 2014
@@ -667,7 +667,6 @@ weblogEntry.pendingEntryContent=\u041f\u
weblogEntry.notFound=\u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0434\u043d\u0435\u0432\u043d\u0438\u043a\u0435
weblogEdit.category=\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f
-weblogEdit.changesSaved=\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b
weblogEdit.comments=\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439
weblogEdit.entryRemoved=\u0417\u0430\u043f\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0430
weblogEdit.draft = \u0427\u0435\u0440\u043d\u043e\u0432\u0438\u043a
Modified: roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties Mon Aug 4 19:48:10 2014
@@ -463,7 +463,6 @@ userSettings.timeZone=\u65f6\u533a
userSettings.username=\u7528\u6237\u540d
weblogEdit.allowComments=\u5141\u8bb8\u7559\u8a00
weblogEdit.category=\u5206\u7c7b
-weblogEdit.changesSaved=\u4fee\u6539\u5df2\u88ab\u4fdd\u5b58
weblogEdit.comment=\u7559\u8a00
# additions 20040606
weblogEdit.commentDays=\u5728
Modified: roller/trunk/app/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/struts.xml?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/struts.xml (original)
+++ roller/trunk/app/src/main/resources/struts.xml Mon Aug 4 19:48:10 2014
@@ -268,13 +268,21 @@
</action>
<action name="entryAdd!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.EntryAdd">
+ class="org.apache.roller.weblogger.ui.struts2.editor.EntryEdit">
+ <param name="actionName">entryAdd</param>
+ <param name="pageTitle">weblogEdit.title.newEntry</param>
<result name="input" type="tiles">.EntryEdit</result>
- <result name="success" type="chain">entryEdit</result>
+ <result name="success" type="redirectAction">
+ <param name="actionName">entryEdit!firstSave</param>
+ <param name="weblog">${weblog}</param>
+ <param name="bean.id">${bean.id}</param>
+ </result>
</action>
<action name="entryEdit!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.EntryEdit">
+ <param name="actionName">entryEdit</param>
+ <param name="pageTitle">weblogEdit.title.editEntry</param>
<result name="input" type="tiles">.EntryEdit</result>
<result name="error" type="chain">menu</result>
</action>
Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp?rev=1615747&r1=1615746&r2=1615747&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryEdit.jsp Mon Aug 4 19:48:10 2014
@@ -32,11 +32,11 @@
<%-- Titling, processing actions different between entry add and edit --%>
<s:if test="actionName == 'entryEdit'">
<s:set var="subtitleKey">weblogEdit.subtitle.editEntry</s:set>
- <s:set var="actionToRun">entryEdit!save</s:set>
+ <s:set var="mainAction">entryEdit</s:set>
</s:if>
<s:else>
<s:set var="subtitleKey">weblogEdit.subtitle.newEntry</s:set>
- <s:set var="actionToRun">entryAdd!save</s:set>
+ <s:set var="mainAction">entryAdd</s:set>
</s:else>
<p class="subtitle">
@@ -45,7 +45,7 @@
</s:text>
</p>
-<s:form id="entry" action="%{#actionToRun}">
+<s:form id="entry">
<s:hidden name="salt" />
<s:hidden name="weblog" />
<s:hidden name="bean.status" />
@@ -143,20 +143,21 @@
</tr>
<s:if test="actionWeblog.enableMultiLang">
- <tr>
- <td class="entryEditFormLabel">
- <label for="locale"><s:text name="weblogEdit.locale" /></label>
- </td>
- <td>
- <s:select name="bean.locale" size="1" list="localesList" listValue="displayName" />
- </td>
- </tr>
+ <tr>
+ <td class="entryEditFormLabel">
+ <label for="locale"><s:text name="weblogEdit.locale" /></label>
+ </td>
+ <td>
+ <s:select name="bean.locale" size="1" list="localesList" listValue="displayName" />
+ </td>
+ </tr>
+ </table>
</s:if>
<s:else>
+ </table>
<s:hidden name="bean.locale"/>
</s:else>
- </table>
<%-- ================================================================== --%>
<%-- Weblog edit or preview --%>
@@ -262,17 +263,17 @@
<br>
<div class="control">
<span style="padding-left:7px">
- <s:submit value="%{getText('weblogEdit.save')}" onclick="document.getElementById('entry_bean_status').value='DRAFT';" />
+ <s:submit value="%{getText('weblogEdit.save')}" action="%{#mainAction}!saveDraft" />
<s:if test="actionName == 'entryEdit'">
<input type="button" name="fullPreview"
value="<s:text name='weblogEdit.fullPreviewMode' />"
onclick="fullPreviewMode()" />
</s:if>
<s:if test="userAnAuthor">
- <s:submit value="%{getText('weblogEdit.post')}" onclick="document.getElementById('entry_bean_status').value='PUBLISHED';"/>
+ <s:submit value="%{getText('weblogEdit.post')}" action="%{#mainAction}!publish"/>
</s:if>
<s:else>
- <s:submit value="%{getText('weblogEdit.submitForReview')}" onclick="document.getElementById('entry_bean_status').value='PENDING';"/>
+ <s:submit value="%{getText('weblogEdit.submitForReview')}" action="%{#mainAction}!publish"/>
</s:else>
</span>