From c9dbcddbd9b4d4373fa3bef2d96bdb322412674f Mon Sep 17 00:00:00 2001 From: pb Date: Wed, 3 Jul 2013 12:05:38 +0000 Subject: [PATCH] Abschliessender Teil zur Korrektur Lokalisation Content Asset Related Link. git-svn-id: https://svn.libreccm.org/ccm/trunk@2242 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/contentassets/RelatedLink.xml | 7 +- .../cms/contentassets/RelatedLinkConfig.java | 59 ++++++++++++++- .../contentassets/RelatedLinkInitializer.java | 9 +-- .../RelatedLinkResources.properties | 9 +-- .../RelatedLinkResources_de.properties | 9 +-- .../arsdigita/cms/contentassets/package.html | 18 +++++ .../ui/RelatedLinkPropertiesStep.java | 27 +++++-- .../ui/RelatedLinkPropertyForm.java | 55 +++++++++----- .../contentassets/ui/RelatedLinkTable.java | 16 +++-- .../util/RelatedLinkGlobalizationUtil.java | 71 +++++++++++++++++++ ccm-cms/src/com/arsdigita/cms/CMSConfig.java | 14 ---- .../com/arsdigita/cms/CMSResources.properties | 1 + .../arsdigita/cms/CMSResources_de.properties | 1 + .../cms/CMSResources_en_GB.properties | 1 + .../arsdigita/cms/CMSResources_fr.properties | 1 + .../cms/contenttypes/ui/LinkDisplayTable.java | 10 ++- .../cms/contenttypes/ui/LinkPropertyForm.java | 25 ++++--- .../cms/contenttypes/ui/LinkTable.java | 3 +- 18 files changed, 269 insertions(+), 67 deletions(-) create mode 100755 ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/package.html create mode 100644 ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/util/RelatedLinkGlobalizationUtil.java diff --git a/ccm-cms-assets-relatedlink/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/RelatedLink.xml b/ccm-cms-assets-relatedlink/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/RelatedLink.xml index 74d8d0278..65b8323fb 100755 --- a/ccm-cms-assets-relatedlink/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/RelatedLink.xml +++ b/ccm-cms-assets-relatedlink/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contentassets/RelatedLink.xml @@ -1,10 +1,13 @@ - + + diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkConfig.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkConfig.java index 54bd80ec9..5a1e66e7f 100644 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkConfig.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkConfig.java @@ -1,10 +1,17 @@ package com.arsdigita.cms.contentassets; import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; /** + * A record containing server-session scoped configuration properties. + * + * Accessors of this class may return null. Developers should take care to trap + * null return values in their code. + * + * Don't instantiate using constructor! * * @author Jens Pelzetter * @version $Id$ @@ -13,18 +20,56 @@ public class RelatedLinkConfig extends AbstractConfig { private static RelatedLinkConfig INSTANCE; + + // ///////////////////////////////////////////////////////// + // Parameter Section + // ///////////////////////////////////////////////////////// + /** + * + */ private final Parameter assetStepSortKey = new IntegerParameter( - "com.arsdigita.cms.relatedlink.contentassets.asset_step_sortkey", + "com.arsdigita.cms.contentassets.relatedlink.asset_step_sortkey", Parameter.REQUIRED, 1); + /** + * Hide Additional Resource Fields on RelatedLinkPropertyForm anf + * RelatedLink table + */ + private final Parameter hideAdditionalResourceFields = + new BooleanParameter( + "com.arsdigita.cms.contentassets.relatedlink.hide_additional_resource_fields", + Parameter.REQUIRED, + Boolean.FALSE); + /** + * Hide Additional Resource Fields on RelatedLinkPropertyForm anf + * RelatedLink table + */ + private final Parameter hideNewTargetWindow = + new BooleanParameter( + "com.arsdigita.cms.contentassets.relatedlink.hide_new_target_window", + Parameter.REQUIRED, + Boolean.FALSE); + + /** + * Constructor, don't use to instantiate. + * Use getInstance() instead! + */ public RelatedLinkConfig() { register(assetStepSortKey); + register(hideAdditionalResourceFields); + register(hideNewTargetWindow); loadInfo(); } + /** + * Returns the singleton configuration record for the content section + * environment. + * + * @return The RelatedLinkConfig record; it cannot be null + */ public static final RelatedLinkConfig getInstance() { if (INSTANCE == null) { INSTANCE = new RelatedLinkConfig(); @@ -32,9 +77,21 @@ public class RelatedLinkConfig extends AbstractConfig { } return INSTANCE; } + + // ///////////////////////////////////////////////////////// + // Getter Section + // ///////////////////////////////////////////////////////// public Integer getAssetStepSortKey() { return (Integer) get(assetStepSortKey); } + + public final boolean isHideAdditionalResourceFields() { + return ((Boolean) get(hideAdditionalResourceFields)).booleanValue(); + } + + public final boolean isHideNewTargetWindow() { + return ((Boolean) get(hideNewTargetWindow)).booleanValue(); + } } diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkInitializer.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkInitializer.java index 6cb6dedbb..61370a052 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkInitializer.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkInitializer.java @@ -16,6 +16,7 @@ package com.arsdigita.cms.contentassets; import com.arsdigita.cms.contenttypes.ContentAssetInitializer; import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertiesStep; +import com.arsdigita.cms.contentassets.util.RelatedLinkGlobalizationUtil; import com.arsdigita.cms.ContentPage; import com.arsdigita.globalization.GlobalizedMessage; @@ -79,16 +80,16 @@ public class RelatedLinkInitializer extends ContentAssetInitializer { * The label for the authoring step */ public GlobalizedMessage getAuthoringStepLabel() { - return new GlobalizedMessage("com.arsdigita.cms.contentassets.related_link_label", - "com.arsdigita.cms.contentassets.RelatedLinkResources"); + return RelatedLinkGlobalizationUtil + .globalize("cms.contentassets.related_link.label"); } /** * The description for the authoring step */ public GlobalizedMessage getAuthoringStepDescription() { - return new GlobalizedMessage("com.arsdigita.cms.contentassets.related_link_description", - "com.arsdigita.cms.contentassets.RelatedLinkResources"); + return RelatedLinkGlobalizationUtil + .globalize("cms.contentassets.related_link.description"); } /** diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources.properties b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources.properties index e0568553a..711913f1f 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources.properties +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources.properties @@ -1,4 +1,5 @@ -com.arsdigita.cms.contentassets.related_link_label=Related Links -com.arsdigita.cms.contentassets.related_link_description=Related Links -com.arsdigita.cms.contentassets.related_link_resourceSize=Resource Size -com.arsdigita.cms.contentassets.related_link_resourceType=Resource Type +cms.contentassets.related_link.label=Add Related Links +cms.contentassets.related_link.description=Related Links +cms.contentassets.ui.related_link.resource_size=Resource Size +cms.contentassets.ui.related_link.resource_type=Resource Type +cms.contentassets.ui.related_link.resource_type_unknown=Unknown diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources_de.properties b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources_de.properties index 4cf7f26eb..1e01682d3 100644 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources_de.properties +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/RelatedLinkResources_de.properties @@ -1,4 +1,5 @@ -com.arsdigita.cms.contentassets.related_link_label=Weiterf\u00FChrende Links -com.arsdigita.cms.contentassets.related_link_description=Weiterf\u00FChrende Links -com.arsdigita.cms.contentassets.related_link_resourceSize=Gr\u00F6\u00DFe -com.arsdigita.cms.contentassets.related_link_resourceType=Typ +cms.contentassets.related_link.label=Weiterf\u00fchrende Links hinzuf\u00fcgen +cms.contentassets.related_link.description=Weiterf\u00fchrende Links +cms.contentassets.ui.related_link.resource_size=Gr\u00f6\u00dfe +cms.contentassets.ui.related_link.resource_type=Ressourcen Typ +cms.contentassets.ui.related_link.resource_type_unknown=Unbekannt diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/package.html b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/package.html new file mode 100755 index 000000000..269b00a21 --- /dev/null +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/package.html @@ -0,0 +1,18 @@ + + + + Content Management System API + + + +

+ The content asset related links provides facilities to make + the CMS Link class available as configurable asset authoring step. +

+

+ Most of its logic is delegatged to the CMS Link classes, including + ui +

+ + + diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java index 720489c53..41d4fe55e 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertiesStep.java @@ -19,6 +19,7 @@ import com.arsdigita.bebop.FormSection; import com.arsdigita.bebop.SimpleContainer; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.contentassets.RelatedLinkConfig; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.contenttypes.ui.LinkPropertiesStep; @@ -26,6 +27,9 @@ import com.arsdigita.cms.contenttypes.ui.LinkTable; /** * Authoring step to create a RelatedLink and change ordering. + * + * It is just a front end to the cms Link asset and makes RelatedLink accessible + * as installable add related link authoring step */ public class RelatedLinkPropertiesStep extends LinkPropertiesStep { @@ -58,20 +62,31 @@ public class RelatedLinkPropertiesStep extends LinkPropertiesStep { } /** - * Returns a RelatedLinkTable as the - * display component for this authoring step. + * Returns a RelatedLinkTable as the display component for this authoring + * step. * + * Uses CMS LinkTable and its display facilities. + * * @return The display component to use for the authoring step */ @Override public Component getDisplayComponent() { + SimpleContainer container = new SimpleContainer(); + LinkTable table; - if (ContentSection.getConfig().isHideAdditionalResourceFields()) { - table = new LinkTable(getItemSelectionModel(), getLinkSelectionModel()); - table.setModelBuilder(new RelatedLinkTableModelBuilder(getItemSelectionModel(), linkListName)); + if (RelatedLinkConfig.getInstance().isHideAdditionalResourceFields()) { + // CMS LinkTable it it's standard form + table = new LinkTable(getItemSelectionModel(), + getLinkSelectionModel()); + table.setModelBuilder(new + RelatedLinkTableModelBuilder(getItemSelectionModel(), + linkListName)); } else { - table = new RelatedLinkTable(getItemSelectionModel(), getLinkSelectionModel(), linkListName); + // Add columns to standard CMS LinkTable + table = new RelatedLinkTable(getItemSelectionModel(), + getLinkSelectionModel(), + linkListName); } container.add(table); diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java index 5fa1fa497..215487762 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkPropertyForm.java @@ -28,10 +28,12 @@ import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentType; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contentassets.RelatedLink; +import com.arsdigita.cms.contentassets.RelatedLinkConfig; +import com.arsdigita.cms.contentassets.util.RelatedLinkGlobalizationUtil; import com.arsdigita.cms.contenttypes.Link; import com.arsdigita.cms.contenttypes.ui.LinkPropertyForm; import com.arsdigita.cms.contenttypes.ui.LinkSelectionModel; -import com.arsdigita.cms.contentassets.RelatedLink; import com.arsdigita.globalization.GlobalizedMessage; import com.arsdigita.mimetypes.MimeType; import com.arsdigita.mimetypes.MimeTypeCollection; @@ -51,8 +53,11 @@ import org.apache.log4j.Logger; */ public class RelatedLinkPropertyForm extends LinkPropertyForm { - private static final Logger logger = Logger.getLogger(RelatedLinkPropertyForm.class); - private static boolean isHideAdditionalResourceFields = ContentSection.getConfig().isHideAdditionalResourceFields(); + private static final Logger logger = Logger.getLogger( + RelatedLinkPropertyForm.class); + private static boolean isHideAdditionalResourceFields = + RelatedLinkConfig.getInstance() + .isHideAdditionalResourceFields(); private String m_linkListName; /** @@ -80,28 +85,43 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm { @Override protected void addWidgets() { + // Add default widgets from CMS Link class super.addWidgets(); + // NewTargetWindow option should be moved from CMS Link class to this + // asset and made optional. Current HTML doesn't allow this option + // anymore. + if (isHideAdditionalResourceFields) { +// /* Single option whether to open in new window, strongly discouraged!*/ +// Option m_selectWindow = new Option( +// Link.TARGET_WINDOW, +// new Label(GlobalizationUtil.globalize( +// "cms.contenttyes.link.ui.option.new_window"))); +// // "Open URL in new window"); +// m_URIOption = new CheckboxGroup("openOption"); +// m_URIOption.addOption(m_selectWindow); +// add(m_URIOption, ColumnPanel.FULL_WIDTH); + } + if (isHideAdditionalResourceFields) { // Do nothing except protect the poor users from themselves. } else { - //Hack to get the form layout right. - add(new Label("")); - add(new Label( - new GlobalizedMessage("com.arsdigita.cms.contentassets.related_link_resourceSize", - "com.arsdigita.cms.contentassets.RelatedLinkResources"))); - TextField resSize = new TextField(new StringParameter(RelatedLink.RESOURCE_SIZE)); + add(new Label(RelatedLinkGlobalizationUtil.globalize( + "cms.contentassets.ui.related_link.resource_size"))); + TextField resSize = new TextField(new + StringParameter(RelatedLink.RESOURCE_SIZE)); add(resSize); - add(new Label( - new GlobalizedMessage("com.arsdigita.cms.contentassets.related_link_resourceType", - "com.arsdigita.cms.contentassets.RelatedLinkResources"))); - SingleSelect resType = new SingleSelect(new StringParameter(RelatedLink.RESOURCE_TYPE)); + add(new Label(RelatedLinkGlobalizationUtil.globalize( + "cms.contentassets.ui.related_link.resource_type"))); + SingleSelect resType = new SingleSelect(new + StringParameter(RelatedLink.RESOURCE_TYPE)); addMimeOptions(resType); add(resType); } - Hidden linkListName = new Hidden(new StringParameter(RelatedLink.LINK_LIST_NAME)); + Hidden linkListName = new Hidden(new StringParameter( + RelatedLink.LINK_LIST_NAME)); add(linkListName); } @@ -160,7 +180,8 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm { rl = (RelatedLink) getLinkSelectionModel().getSelectedLink(ps); data.put(RelatedLink.RESOURCE_SIZE, rl.getResourceSize()); if (rl.getResourceType() != null) { - data.put(RelatedLink.RESOURCE_TYPE, rl.getResourceType().getMimeType()); + data.put(RelatedLink.RESOURCE_TYPE, + rl.getResourceType().getMimeType()); } data.put(RelatedLink.LINK_LIST_NAME, rl.getLinkListName()); } else { @@ -192,7 +213,9 @@ public class RelatedLinkPropertyForm extends LinkPropertyForm { } rl.setLinkListName((String) data.get(RelatedLink.LINK_LIST_NAME)); - DataCollection links = RelatedLink.getRelatedLinks(getContentItem(fse.getPageState()), m_linkListName); + DataCollection links = RelatedLink.getRelatedLinks( + getContentItem(fse.getPageState()), + m_linkListName); rl.setOrder((int) links.size() + 1); super.setLinkProperties(link, fse); diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java index dc49248e1..2f662698c 100755 --- a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/ui/RelatedLinkTable.java @@ -22,12 +22,15 @@ import com.arsdigita.bebop.table.TableCellRenderer; import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; import com.arsdigita.cms.contentassets.RelatedLink; +import com.arsdigita.cms.contentassets.util.RelatedLinkGlobalizationUtil; import com.arsdigita.cms.contenttypes.ui.LinkTable; import com.arsdigita.cms.contenttypes.ui.LinkSelectionModel; import com.arsdigita.cms.ItemSelectionModel; /** - * Bebop table to display a list of RelatedLinks associated with a ContentItem + * Bebop table to display a list of RelatedLinks associated with a ContentItem. + * + * It uses parent's class facilities but adds 2 additional columns. * * @version $Revision: #3 $ $Date: 2004/03/30 $ * @author Scott Seago (sseago@redhat.com) @@ -70,9 +73,13 @@ public class RelatedLinkTable extends LinkTable { super.addColumns(); TableColumnModel model = getColumnModel(); - m_typeCol = new TableColumn(model.size() , "Resource Type"); + m_typeCol = new TableColumn(model.size() , + new Label(RelatedLinkGlobalizationUtil.globalize( + "cms.contentassets.ui.related_link.resource_type"))); model.add(m_typeCol); - m_sizeCol = new TableColumn(model.size() , "Size"); + m_sizeCol = new TableColumn(model.size() , + new Label(RelatedLinkGlobalizationUtil.globalize( + "cms.contentassets.ui.related_link.resource_size"))); model.add(m_sizeCol); } @@ -108,7 +115,8 @@ public class RelatedLinkTable extends LinkTable { if(link.getResourceType() != null){ l = new Label(link.getResourceType().getMimeType()); } else{ - l = new Label("Unknown"); + l = new Label(RelatedLinkGlobalizationUtil.globalize( + "cms.contentassets.ui.related_link.resource_type_unknown")); } return l; } else { diff --git a/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/util/RelatedLinkGlobalizationUtil.java b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/util/RelatedLinkGlobalizationUtil.java new file mode 100644 index 000000000..c00706922 --- /dev/null +++ b/ccm-cms-assets-relatedlink/src/com/arsdigita/cms/contentassets/util/RelatedLinkGlobalizationUtil.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2013 Peter Boy, University of Bremen. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +package com.arsdigita.cms.contentassets.util; + +import com.arsdigita.globalization.Globalized; +import com.arsdigita.globalization.GlobalizedMessage; + +/** + * Compilation of methods to simplify the handling of globalizing keys. + * Basically it adds the name of package's resource bundle files to the + * globalize methods and forwards to GlobalizedMessage, shortening the + * method invocation in the various application classes. + * + * @author pb + */ +public class RelatedLinkGlobalizationUtil implements Globalized { + + /** Name of Java resource files to handle RelatedLink's globalisation. */ + final public static String BUNDLE_NAME = + "com.arsdigita.cms.contentassets.RelatedLinkResources"; + + /** Name of Java resource files to handle CMS globalisation. */ + final public static String ALTERNATE_BUNDLE_NAME = + "com.arsdigita.cms.CMSResources"; + + /** + * Returns a globalized message using the appropriate bundle. + * If the key string contains the modules name agenda the package specific + * bundle is used, otherwise the CMS ResourceBundle. + */ + public static GlobalizedMessage globalize(String key) { + if (key.indexOf(".related_link.") > 0) { + return new GlobalizedMessage(key, BUNDLE_NAME); + } else { + return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME); + } + } + + /** + * Returns a globalized message object, using the approprate bundle, + * takeing in an Object[] of arguments to interpolate into the retrieved + * message using the MessageFormat class. + * If the key string contains the modules name agenda the package specific + * bundle is used, otherwise the CMS ResourceBundle. + */ + public static GlobalizedMessage globalize(String key, Object[] args) { + if (key.indexOf(".related_link.") > 0) { + return new GlobalizedMessage(key, BUNDLE_NAME, args); + } else { + return new GlobalizedMessage(key, ALTERNATE_BUNDLE_NAME, args); + } + } + +} diff --git a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java index bfd9b05e8..69954ddc9 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSConfig.java +++ b/ccm-cms/src/com/arsdigita/cms/CMSConfig.java @@ -269,15 +269,6 @@ public final class CMSConfig extends AbstractConfig { "com.arsdigita.cms.save_text_cleans_word_tags", Parameter.OPTIONAL, Boolean.FALSE); - /** - * Hide Additional Resource Fields on RelatedLinkPropertyForm - */ - private final Parameter m_hideAdditionalResourceFields = - new BooleanParameter( - "com.arsdigita.cms.contentassets.ui." - + "RelatedLinkPropertyForm.hideAdditionalResourceFields", - Parameter.REQUIRED, - Boolean.FALSE); /** * Get the search indexing not to process FileAssets, eg to avoid PDF * slowdowns @@ -703,7 +694,6 @@ public final class CMSConfig extends AbstractConfig { register(m_publishLifecycleListenerClass); register(m_notifyAuthorOnLifecycle); register(m_saveTextCleansWordTags); - register(m_hideAdditionalResourceFields); register(m_disableFileAssetExtraction); register(m_deleteWorkflowAfterPublication); register(m_soonExpiredTimespanMonths); @@ -886,10 +876,6 @@ public final class CMSConfig extends AbstractConfig { return ((Boolean) get(m_saveTextCleansWordTags)).booleanValue(); } - public final boolean isHideAdditionalResourceFields() { - return ((Boolean) get(m_hideAdditionalResourceFields)).booleanValue(); - } - public final boolean getDisableFileAssetExtraction() { return ((Boolean) get(m_disableFileAssetExtraction)).booleanValue(); } diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties index ba47a01d9..467e95008 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources.properties @@ -1035,3 +1035,4 @@ cms.contenttyes.link.ui.button_create=Create cms.contenttyes.link.ui.button_save=Save cms.contenttyes.link.ui.button_reset=Reset cms.contenttyes.link.ui.button_cancel=Cancel +cms.contenttyes.link.ui.table_no_entries=There are no links for this content item diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index f9d016f5c..ed1a7e519 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -1030,3 +1030,4 @@ cms.contenttyes.link.ui.button_create=Erstellen cms.contenttyes.link.ui.button_save=Sichern cms.contenttyes.link.ui.button_reset=Zur\u00fccksetzen cms.contenttyes.link.ui.button_cancel=Abbruch +cms.contenttyes.link.ui.table_no_entries=Es sind noch keine Links zugeordnet. diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties index 628204533..33793a169 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties @@ -83,3 +83,4 @@ cms.contenttyes.link.ui.button_create=Create cms.contenttyes.link.ui.button_save=Save cms.contenttyes.link.ui.button_reset=Reset cms.contenttyes.link.ui.button_cancel=Cancel +cms.contenttyes.link.ui.table_no_entries=There are no links for this content item diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties index 6ed4d77f4..c8eefcba2 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties @@ -557,3 +557,4 @@ cms.contenttyes.link.ui.button_create=Create cms.contenttyes.link.ui.button_save=Save cms.contenttyes.link.ui.button_reset=Reset cms.contenttyes.link.ui.button_cancel=Cancel +cms.contenttyes.link.ui.table_no_entries=There are no links for this content item diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkDisplayTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkDisplayTable.java index 6c236b3ad..900caa774 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkDisplayTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkDisplayTable.java @@ -34,11 +34,19 @@ import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.Assert; + import java.math.BigDecimal; import java.io.IOException; + import org.apache.log4j.Logger; -/** Displays target url that redirects and description */ + +// NOTE: as of 2013-07-13 this class is not used by any other class of the system. +// Should be removed. + +/** + * Displays target url that redirects and description + */ public class LinkDisplayTable extends LinkTable { private static final Logger s_log = Logger.getLogger(LinkDisplayTable.class); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java index 046329c95..7550cd427 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java @@ -203,15 +203,6 @@ public class LinkPropertyForm extends FormSection "cms.contenttyes.link.ui.option_group.link_type.internal"))); m_internal.setOnClick("enableItemFields()"); - /* Single option whether to open in new window, strongly discouraged!*/ - Option m_selectWindow = new Option( - Link.TARGET_WINDOW, - new Label(GlobalizationUtil.globalize( - "cms.contenttyes.link.ui.option.new_window"))); - // "Open URL in new window"); - m_URIOption = new CheckboxGroup("openOption"); - m_URIOption.addOption(m_selectWindow); - m_linkType.addOption(m_external); m_linkType.addOption(m_internal); m_linkType.setOptionSelected(m_external); @@ -219,7 +210,6 @@ public class LinkPropertyForm extends FormSection add(new Label(GlobalizationUtil.globalize( "cms.contenttyes.link.ui.option_group.link_type.label"))); add(m_linkType); - add(m_URIOption, ColumnPanel.FULL_WIDTH); /* External target */ m_targetURI = new TextField("targetURI"); @@ -247,6 +237,21 @@ public class LinkPropertyForm extends FormSection "cms.contenttyes.link.ui.target_parameters_hint") ); add(m_itemParams); +// TODO: +// Move this option to contentasset related link for bacvkwards compatibility +// because this option is no longer compatible with current HTML +// Requires database modification (move field target_window from +// cms_links to cms_related_links which shoud become ca_related_links + /* Single option whether to open in new window, strongly discouraged!*/ + Option m_selectWindow = new Option( + Link.TARGET_WINDOW, + new Label(GlobalizationUtil.globalize( + "cms.contenttyes.link.ui.option.new_window"))); + // "Open URL in new window"); + m_URIOption = new CheckboxGroup("openOption"); + m_URIOption.addOption(m_selectWindow); + add(m_URIOption, ColumnPanel.FULL_WIDTH); + add(new Label( "