Ticket #1184: Sprache-Tab funktioniert nur mit JavaScript

Geändert:
 * getRelativeItemURL als deprecated markiert. Die beiden Aufrufe in ContentSoonExpiredPane und ItemLanguagesTable ersetzt durch getItemURL

git-svn-id: https://svn.libreccm.org/ccm/trunk@2186 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2013-06-07 19:30:46 +00:00
parent 59dde5434e
commit 528508b556
3 changed files with 57 additions and 60 deletions

View File

@ -73,29 +73,27 @@ import org.apache.log4j.Logger;
*/ */
public class ContentItemPage extends CMSPage implements ActionListener { public class ContentItemPage extends CMSPage implements ActionListener {
/** Private Logger instance for debugging purpose. */ /**
* Private Logger instance for debugging purpose.
*/
private static final Logger s_log = Logger.getLogger(ContentItemPage.class); private static final Logger s_log = Logger.getLogger(ContentItemPage.class);
/** /**
* The URL parameter that must be passed in in order to set * The URL parameter that must be passed in in order to set the current tab.
* the current tab. This is a KLUDGE right now because the * This is a KLUDGE right now because the TabbedDialog's current tab is
* TabbedDialog's current tab is selected with a local * selected with a local state parameter
* state parameter
*/ */
public static final String SET_TAB = "set_tab"; public static final String SET_TAB = "set_tab";
/** /**
* The name of the global state parameter that holds * The name of the global state parameter that holds the item id
* the item id
*/ */
public static final String ITEM_ID = "item_id"; public static final String ITEM_ID = "item_id";
/** /**
* The name of the global state parameter which holds the * The name of the global state parameter which holds the return URL
* return URL
*/ */
public static final String RETURN_URL = "return_url"; public static final String RETURN_URL = "return_url";
/** /**
* The name of the global state parameter that determines whether * The name of the global state parameter that determines whether or not to
* or not to use the streamlined authoring process (assuming the * use the streamlined authoring process (assuming the option is turned on).
* option is turned on).
* *
*/ */
public static final String STREAMLINED_CREATION = "streamlined_creation"; public static final String STREAMLINED_CREATION = "streamlined_creation";
@ -107,11 +105,11 @@ public class ContentItemPage extends CMSPage implements ActionListener {
*/ */
public static final int SUMMARY_TAB = s_tabOrder++; public static final int SUMMARY_TAB = s_tabOrder++;
/** /**
* <p>The name of the state parameter which indicates the content * <p>The name of the state parameter which indicates the content type of
* type of the item the user wishes to create. or edit.</p> * the item the user wishes to create. or edit.</p>
* *
* <p>The parameter must be a BigDecimalParameter which encodes * <p>The parameter must be a BigDecimalParameter which encodes the id of
* the id of the content type.</p> * the content type.</p>
*/ */
public static final String CONTENT_TYPE = "content_type"; public static final String CONTENT_TYPE = "content_type";
public static final int AUTHORING_TAB = s_tabOrder++; public static final int AUTHORING_TAB = s_tabOrder++;
@ -185,7 +183,6 @@ public class ContentItemPage extends CMSPage implements ActionListener {
// Validate the item ID parameter (caches the validation). // Validate the item ID parameter (caches the validation).
getStateModel().addValidationListener(new FormValidationListener() { getStateModel().addValidationListener(new FormValidationListener() {
public void validate(FormSectionEvent event) public void validate(FormSectionEvent event)
throws FormProcessException { throws FormProcessException {
validateItemID(event.getPageState()); validateItemID(event.getPageState());
@ -231,7 +228,6 @@ public class ContentItemPage extends CMSPage implements ActionListener {
m_templatesPane); m_templatesPane);
m_tabbedPane.addActionListener(new ActionListener() { m_tabbedPane.addActionListener(new ActionListener() {
public final void actionPerformed(final ActionEvent e) { public final void actionPerformed(final ActionEvent e) {
final PageState state = e.getPageState(); final PageState state = e.getPageState();
final Component pane = m_tabbedPane.getCurrentPane(state); final Component pane = m_tabbedPane.getCurrentPane(state);
@ -245,7 +241,6 @@ public class ContentItemPage extends CMSPage implements ActionListener {
// Build the preview link. // Build the preview link.
m_previewLink = new Link(new Label(gz("cms.ui.preview")), m_previewLink = new Link(new Label(gz("cms.ui.preview")),
new PrintListener() { new PrintListener() {
public final void prepare(final PrintEvent e) { public final void prepare(final PrintEvent e) {
final Link link = (Link) e.getTarget(); final Link link = (Link) e.getTarget();
link.setTarget(getPreviewURL(e.getPageState())); link.setTarget(getPreviewURL(e.getPageState()));
@ -259,7 +254,6 @@ public class ContentItemPage extends CMSPage implements ActionListener {
// Add validation to make sure we are not attempting to edit a live item // Add validation to make sure we are not attempting to edit a live item
getStateModel().addValidationListener(new FormValidationListener() { getStateModel().addValidationListener(new FormValidationListener() {
public void validate(FormSectionEvent e) throws FormProcessException { public void validate(FormSectionEvent e) throws FormProcessException {
PageState s = e.getPageState(); PageState s = e.getPageState();
FormData data = e.getFormData(); FormData data = e.getFormData();
@ -296,7 +290,8 @@ public class ContentItemPage extends CMSPage implements ActionListener {
/** /**
* Fetch the request-local content section. * Fetch the request-local content section.
* *
* @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection() instead * @deprecated use com.arsdigita.cms.CMS.getContext().getContentSection()
* instead
* @param request The HTTP request * @param request The HTTP request
* @return The current content section * @return The current content section
*/ */
@ -409,6 +404,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
return url.toString(); return url.toString();
} }
@deprecated use getItemURL(BigDecimal itemId, int tab) instead
public static String getRelativeItemURL(BigDecimal itemId, int tab) { public static String getRelativeItemURL(BigDecimal itemId, int tab) {
StringBuffer url = new StringBuffer(); StringBuffer url = new StringBuffer();
url.append(PageLocations.ITEM_PAGE).append("?").append(ITEM_ID).append("=").append(itemId. url.append(PageLocations.ITEM_PAGE).append("?").append(ITEM_ID).append("=").append(itemId.
@ -453,8 +449,8 @@ public class ContentItemPage extends CMSPage implements ActionListener {
} }
/** /**
* Redirect back to wherever the user came from, using the value * Redirect back to wherever the user came from, using the value of the
* of the return_url parameter. * return_url parameter.
* *
* @param state The current page state * @param state The current page state
*/ */

View File

@ -214,7 +214,8 @@ public class ContentSoonExpiredPane extends SimpleContainer {
} }
Link l = (Link) threadLocal.get(); Link l = (Link) threadLocal.get();
l.setTarget(ContentItemPage.getRelativeItemURL(ContentSoonExpiredPane.getItemDraft(id.toString()), ContentItemPage.AUTHORING_TAB)); // l.setTarget(ContentItemPage.getRelativeItemURL(ContentSoonExpiredPane.getItemDraft(id.toString()), ContentItemPage.AUTHORING_TAB));
l.setTarget(ContentItemPage.getItemURL(ContentSoonExpiredPane.getItemFromIdString(id.toString()), ContentItemPage.AUTHORING_TAB));
((Label) l.getChild()).setLabel(GlobalizationUtil.globalize("cms.ui.cse.editLink")); ((Label) l.getChild()).setLabel(GlobalizationUtil.globalize("cms.ui.cse.editLink"));
return l; return l;

View File

@ -140,7 +140,7 @@ public class ItemLanguagesTable extends DataTable {
classes.append("primaryInstance"); classes.append("primaryInstance");
} }
String target = ContentItemPage.getRelativeItemURL(id, ContentItemPage.AUTHORING_TAB); String target = ContentItemPage.getItemURL(cp, ContentItemPage.AUTHORING_TAB);
Label langLabel = new Label(LanguageUtil.getLangFull((String) value)); Label langLabel = new Label(LanguageUtil.getLangFull((String) value));
langLabel.setFontWeight(fontWeight.toString().trim()); langLabel.setFontWeight(fontWeight.toString().trim());