[Yanel-commits] rev 50852 -
public/yanel/trunk/src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce
michi at wyona.com
michi at wyona.com
Thu Jul 1 13:20:05 CEST 2010
Author: michi
Date: 2010-07-01 13:20:04 +0200 (Thu, 01 Jul 2010)
New Revision: 50852
Modified:
public/yanel/trunk/src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce/TinyMCEResource.java
Log:
thanks to Simon Litwan one can set now the continue-path as request parameter
Modified: public/yanel/trunk/src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce/TinyMCEResource.java
===================================================================
--- public/yanel/trunk/src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce/TinyMCEResource.java 2010-07-01 09:40:16 UTC (rev 50851)
+++ public/yanel/trunk/src/resources/tinymce/src/java/org/wyona/yanel/impl/resources/tinymce/TinyMCEResource.java 2010-07-01 11:20:04 UTC (rev 50852)
@@ -132,17 +132,19 @@
}
if (hasErrors() || !checkPreconditions()) {
- String editPath = getEditPath();
- String continuePath;
- String referer = getEnvironment().getRequest().getHeader("referer");
- if (editPath != null && editPath.length() > 1) {
- continuePath = PathUtil.backToRealm(getPath()) + editPath.substring(1);
- } else if (referer != null) {
- continuePath = referer;
- } else {
- continuePath = PathUtil.backToRealm(getPath());
+ if (getParameter(PARAMETER_CONTINUE_PATH) == null) {
+ String editPath = getEditPath();
+ String continuePath;
+ String referer = getEnvironment().getRequest().getHeader("referer");
+ if (editPath != null && editPath.length() > 1) {
+ continuePath = PathUtil.backToRealm(getPath()) + editPath.substring(1);
+ } else if (referer != null) {
+ continuePath = referer;
+ } else {
+ continuePath = PathUtil.backToRealm(getPath());
+ }
+ setParameter(PARAMETER_CONTINUE_PATH, continuePath);
}
- setParameter(PARAMETER_CONTINUE_PATH, continuePath);
return generateView(VIEW_CANCEL);
}
@@ -283,7 +285,9 @@
} else {
addError("Could not save the document, because resource is not ModifiableV2!");
}
- setParameter(PARAMETER_CONTINUE_PATH, PathUtil.backToRealm(getPath()) + getEditPath().substring(1)); // allow jelly template to show link to new event
+ if (getParameter(PARAMETER_CONTINUE_PATH) == null) {
+ setParameter(PARAMETER_CONTINUE_PATH, PathUtil.backToRealm(getPath()) + getEditPath().substring(1)); // allow jelly template to show link to new event
+ }
}
/* (non-Javadoc)
@@ -302,7 +306,9 @@
addInfoMessage("Releasing of lock failed because of: " + resToEdit.getPath() + " " + e.getMessage() + ". ");
}
}
- setParameter(PARAMETER_CONTINUE_PATH, PathUtil.backToRealm(getPath()) + getEditPath().substring(1)); // allow jelly template to show link to new event
+ if (getParameter(PARAMETER_CONTINUE_PATH) == null) {
+ setParameter(PARAMETER_CONTINUE_PATH, PathUtil.backToRealm(getPath()) + getEditPath().substring(1)); // allow jelly template to show link to new event
+ }
}
/**
More information about the Yanel-commits
mailing list