diff --git a/ccm-cms-types-externallink/pdl/com/arsdigita/cms/contenttypes/ExternalLink.pdl b/ccm-cms-types-externallink/pdl/com/arsdigita/cms/contenttypes/ExternalLink.pdl
index 05a4364a2..93cf2e351 100644
--- a/ccm-cms-types-externallink/pdl/com/arsdigita/cms/contenttypes/ExternalLink.pdl
+++ b/ccm-cms-types-externallink/pdl/com/arsdigita/cms/contenttypes/ExternalLink.pdl
@@ -21,8 +21,10 @@ model com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.ContentPage;
object type ExternalLink extends ContentPage {
- String [0..1] url = ct_extLinks.url VARCHAR(2000);
- String [0..1] description = ct_extLinks.description;
+ String [0..1] url = ct_extLinks.url VARCHAR(2000);
+ String [0..1] comment = ct_extLinks.comment VARCHAR(4000);
+ String [0..1] showComment = ct_extLinks.show_comment VARCHAR(50);
+ String [0..1] targetWindow = ct_extLinks.target_window VARCHAR(50);
reference key (ct_extLinks.extLink_id);
}
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLink.java b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLink.java
index 34c6a77eb..9b9657994 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLink.java
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLink.java
@@ -38,11 +38,14 @@ import java.math.BigDecimal;
*/
public class ExternalLink extends ContentPage {
- /**
- * PDL property name for definition
- */
+ /** PDL property url */
public static final String URL = "url";
- public static final String DESCRIPTION = "description";
+ /** PDL property comment */
+ public static final String COMMENT = "comment";
+ /** PDL property showComment */
+ public static final String SHOW_COMMENT = "showComment";
+ /** PDL property targetWindow */
+ public static final String TARGET_WINDOW = "targetWindow";
/**
* Data object type for this domain object
@@ -127,24 +130,56 @@ public class ExternalLink extends ContentPage {
}
/**
- * Retrieve the description for the resource the URL is pointing to.
+ * Retrieve the comment for this ExternalLink object.
*
- * @return Description about the URL this ExternalLink is redirecting to.
+ * @return The COMMENT shown when opening this link.
*/
- @Override
- public String getDescription() {
- return (String) get(DESCRIPTION);
+ public String getComment() {
+ return (String) get(COMMENT);
}
/**
- * Set the description for the resource the URL is pointing to.
+ * Set the Comment for this ExternalLink object.
*
- * @param description The description about the URL this ExternalLink
- * is redirecting to.
+ * @param comment The COMMENT shown when opening this Link.
*/
- @Override
- public void setDescription(final String description) {
- set(DESCRIPTION, description);
+ public void setComment(final String comment) {
+ set(COMMENT, comment);
+ }
+
+ /**
+ * Retrieve the value weather the comment will be shown.
+ *
+ * @return the value weather the comment will be shown
+ */
+ public String getShowComment() {
+ return (String) get(SHOW_COMMENT);
}
-}
+ /**
+ * Set the value weather the comment should be shown.
+ *
+ * @param showComment The value weather the comment should be shown.
+ */
+ public void setShowComment(final String show) {
+ set(SHOW_COMMENT, show);
+ }
+
+ /**
+ * Returns the target Window of this ExternalLink
+ *
+ * @return The Target Window
+ */
+ public String getTargetWindow() {
+ return (String) get(TARGET_WINDOW);
+ }
+
+ /**
+ * Sets the target Window of this ExternalLink
+ *
+ * @param window The Target Window
+ */
+ public void setTargetWindow(String window) {
+ set(TARGET_WINDOW, window);
+ }
+}
\ No newline at end of file
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources.properties b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources.properties
index 918c17fe4..539ff8d9c 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources.properties
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources.properties
@@ -1,10 +1,16 @@
# ExternalLinkResources.properties
cms.contenttypes.ui.edit=Edit
-cms.contenttypes.ExternalLink.name=Name(URL stub):
-cms.contenttypes.ExternalLink.title=Title:
-cms.contenttypes.ExternalLink.location=Location (remote URL):
-cms.contenttypes.ExternalLink.description=Description:
-cms.contenttypes.ExternalLink.type_label=ExternalLink
-cms.contenttypes.ExternalLink.location_hint=The adress to an internetsite outside this safe environement. Through this contenttyp it is possible to use that external internetsite as a source or shortcut/link in other contenttypes.
-cms.contenttypes.ExternalLink.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
+cms.contenttypes.externallink.name=Name(URL stub):
+cms.contenttypes.externallink.title=Title:
+cms.contenttypes.externallink.location=Location (remote URL):
+cms.contenttypes.externallink.description=Description:
+cms.contenttypes.externallink.type_label=ExternalLink
+cms.contenttypes.externallink.location_hint=The adress to an internetsite outside this safe environement. Through this contenttyp it is possible to use that external internetsite as a source or shortcut/link in other contenttypes.
+cms.contenttypes.externallink.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
+cms.contenttypes.externallink.comment=Comment:
+cms.contenttypes.externallink.comment_hint=A short comment about the link. E.g. "You're about to leave the safe environement...". This can be show optionally, if the link is pressed.
+cms.contenttypes.externallink.show_comment=Show the comment in a pop-up window
+cms.contenttypes.externallink.target_window=Open the external Link in a new window
+cms.contenttypes.externallink.yes=Yes
+cms.contenttypes.externallink.no=No
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_de.properties b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_de.properties
index 4d006cc23..36f2a67b3 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_de.properties
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_de.properties
@@ -1,10 +1,16 @@
# ExternalLinkResources_de.properties
cms.contenttypes.ui.edit=Bearbeiten
-cms.contenttypes.ExternalLink.name=Name(als Teil-URL):
-cms.contenttypes.ExternalLink.title=Titel:
-cms.contenttypes.ExternalLink.location=Ort (Ziel URL):
-cms.contenttypes.ExternalLink.description=Beschreibung:
-cms.contenttypes.ExternalLink.type_label=ExternalLink
-cms.contenttypes.ExternalLink.location_hint=Die Adresse zu einer Internetseite, die au\u00dferhalb dieses gesichten Bereichs liegt. Dieses Dokument erm\u00f6glich es diese externe Internetseite als Quelle oder Verkn\u00fcpfung anderen Dokumenten hinzuzuf\u00fcgen.
-cms.contenttypes.ExternalLink.description_hint=Eine kurze Charakterisierung des Dokumentes, nach M\u00f6glichkeit nicht l\u00e4nger als 2-3 S\u00e4tze. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
+cms.contenttypes.externallink.name=Name(als Teil-URL):
+cms.contenttypes.externallink.title=Titel:
+cms.contenttypes.externallink.location=Ort (Ziel URL):
+cms.contenttypes.externallink.description=Beschreibung:
+cms.contenttypes.externallink.type_label=ExternalLink
+cms.contenttypes.externallink.location_hint=Die Adresse zu einer Internetseite, die au\u00dferhalb dieses gesichten Bereichs liegt. Dieses Dokument erm\u00f6glich es diese externe Internetseite als Quelle oder Verkn\u00fcpfung anderen Dokumenten hinzuzuf\u00fcgen.
+cms.contenttypes.externallink.description_hint=Eine kurze Charakterisierung des Dokumentes, nach M\u00f6glichkeit nicht l\u00e4nger als 2-3 S\u00e4tze. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
+cms.contenttypes.externallink.comment=Hinweistext:
+cms.contenttypes.externallink.comment_hint=Ein kurzer Hinweistext zum Link. Z.B. "Sie verlassen den gesicherten Bereich...". Dieser kann wahlweise angezeigt werden, wenn der Link angeklickt wird.
+cms.contenttypes.externallink.show_comment=Zeige den Hinweistext in einem pop-up Fenster
+cms.contenttypes.externallink.target_window=\u00d6ffne den externen Link in einem neuen Fenster
+cms.contenttypes.externallink.yes=Ja
+cms.contenttypes.externallink.no=Nein
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_en.properties b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_en.properties
index faeba78c6..aa51c0eaa 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_en.properties
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ExternalLinkResources_en.properties
@@ -1,10 +1,16 @@
# ExternalLinkResources_en.properties
cms.contenttypes.ui.edit=Edit
-cms.contenttypes.ExternalLink.name=Name(URL stub):
-cms.contenttypes.ExternalLink.title=Title:
-cms.contenttypes.ExternalLink.location=Location (remote URL):
-cms.contenttypes.ExternalLink.description=Description:
-cms.contenttypes.ExternalLink.type_label=ExternalLink
-cms.contenttypes.ExternalLink.location_hint=The adress to an internetsite outside this safe environement. Through this contenttyp it is possible to use that external internetsite as a source or shortcut/link in other contenttypes.
-cms.contenttypes.ExternalLink.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
+cms.contenttypes.externallink.name=Name(URL stub):
+cms.contenttypes.externallink.title=Title:
+cms.contenttypes.externallink.location=Location (remote URL):
+cms.contenttypes.externallink.description=Description:
+cms.contenttypes.externallink.type_label=ExternalLink
+cms.contenttypes.externallink.location_hint=The adress to an internetsite outside this safe environement. Through this contenttyp it is possible to use that external internetsite as a source or shortcut/link in other contenttypes.
+cms.contenttypes.externallink.description_hint=A short characterization of this item. You should limit the text to 2-3 senentces. By default the description is displayed along with the title in every item list.
+cms.contenttypes.externallink.comment=Comment:
+cms.contenttypes.externallink.comment_hint=A short comment about the link. E.g. "You're about to leave the safe environement...". This can be show optionally, if the link is pressed.
+cms.contenttypes.externallink.show_comment=Show the comment in a pop-up window
+cms.contenttypes.externallink.target_window=Open the external Link in a new window
+cms.contenttypes.externallink.yes=Yes
+cms.contenttypes.externallink.no=No
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertiesStep.java b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertiesStep.java
index 026861a7e..f426d37bc 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertiesStep.java
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertiesStep.java
@@ -79,13 +79,19 @@ public class ExternalLinkPropertiesStep extends SimpleEditStep {
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
sheet.add(ExternalLinkGlobalizationUtil.globalize(
- "cms.contenttypes.ExternalLink.name"), ExternalLink.NAME);
+ "cms.contenttypes.externallink.name"), ExternalLink.NAME);
sheet.add(ExternalLinkGlobalizationUtil.globalize(
- "cms.contenttypes.ExternalLink.title"), ExternalLink.TITLE);
+ "cms.contenttypes.externallink.title"), ExternalLink.TITLE);
sheet.add(ExternalLinkGlobalizationUtil.globalize(
- "cms.contenttypes.ExternalLink.location"), ExternalLink.URL);
+ "cms.contenttypes.externallink.description"), ExternalLink.DESCRIPTION);
sheet.add(ExternalLinkGlobalizationUtil.globalize(
- "cms.contenttypes.ExternalLink.description"), ExternalLink.DESCRIPTION);
+ "cms.contenttypes.externallink.location"), ExternalLink.URL);
+ sheet.add(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.comment"), ExternalLink.COMMENT);
+ //sheet.add(ExternalLinkGlobalizationUtil.globalize(
+ // "cms.contenttypes.externallink.show_comment"), ExternalLink.SHOW_COMMENT);
+ //sheet.add(ExternalLinkGlobalizationUtil.globalize(
+ // "cms.contenttypes.externallink.target_window"), ExternalLink.TARGET_WINDOW);
return sheet;
}
diff --git a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertyForm.java b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertyForm.java
index 4aa67e7b2..4c4a09655 100644
--- a/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertyForm.java
+++ b/ccm-cms-types-externallink/src/com/arsdigita/cms/contenttypes/ui/ExternalLinkPropertyForm.java
@@ -23,9 +23,12 @@ import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.event.FormInitListener;
import com.arsdigita.bebop.event.FormProcessListener;
import com.arsdigita.bebop.event.FormSectionEvent;
+import com.arsdigita.bebop.form.CheckboxGroup;
+import com.arsdigita.bebop.form.Option;
import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.bebop.form.TextField;
import com.arsdigita.bebop.parameters.TrimmedStringParameter;
+import com.arsdigita.cms.ContentPage;
import com.arsdigita.cms.contenttypes.ExternalLink;
import com.arsdigita.cms.contenttypes.util.ExternalLinkGlobalizationUtil;
import com.arsdigita.cms.ItemSelectionModel;
@@ -50,8 +53,10 @@ public class ExternalLinkPropertyForm extends BasicPageForm
public static final String ID = "externallinkform_edit";
// formerly "externalLinkEdit"
- private TextField url;
private TextArea description;
+ private TextField url;
+ private TextArea comment;
+ private CheckboxGroup showCommentCheckBox, targetWindowCheckBox;
/**
* Creates a new form to edit the ExternalLink object specified by the
@@ -71,20 +76,47 @@ public class ExternalLinkPropertyForm extends BasicPageForm
protected void addWidgets() {
super.addWidgets();
- final TextField urlWidget = new TextField(new TrimmedStringParameter(ExternalLink.URL));
- urlWidget.setLabel(ExternalLinkGlobalizationUtil.globalize("cms.contenttypes.ExternalLink.location"));
- urlWidget.setHint(ExternalLinkGlobalizationUtil.globalize("cms.contenttypes.ExternalLink.location_hint"));
- add(urlWidget);
- url = new TextField(ExternalLink.URL);
+ description = new TextArea(new TrimmedStringParameter(
+ ContentPage.DESCRIPTION), 5, 40, TextArea.SOFT);
+ description.setLabel(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.description"));
+ description.setHint(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.description_hint"));
+ add(description);
+
+
+ url = new TextField(new TrimmedStringParameter(ExternalLink.URL));
+ url.setLabel(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.location"));
+ url.setHint(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.location_hint"));
url.setSize(40);
add(url);
-
- final TextField descriptionWidget = new TextField(new TrimmedStringParameter(ExternalLink.DESCRIPTION));
- descriptionWidget.setLabel(ExternalLinkGlobalizationUtil.globalize("cms.contenttypes.ExternalLink.description"));
- descriptionWidget.setHint(ExternalLinkGlobalizationUtil.globalize("cms.contenttypes.ExternalLink.description_hint"));
- add(descriptionWidget);
- description = new TextArea(ExternalLink.DESCRIPTION, 5, 40, TextArea.SOFT);
- add(description);
+
+
+ comment = new TextArea(new TrimmedStringParameter(
+ ExternalLink.COMMENT), 5, 40, TextArea.SOFT);
+ comment.setLabel(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.comment"));
+ comment.setHint(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.comment_hint"));
+ add(comment);
+
+
+ Option showComment = new Option(ExternalLink.SHOW_COMMENT,
+ new Label(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.show_comment")));
+ showCommentCheckBox = new CheckboxGroup("showCommentCheckBox");
+ showCommentCheckBox.addOption(showComment);
+ add(showCommentCheckBox);
+
+
+ Option targetWindow = new Option(ExternalLink.TARGET_WINDOW,
+ new Label(ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.target_window")));
+ targetWindowCheckBox = new CheckboxGroup("targetWindowCheckBox");
+ targetWindowCheckBox.addOption(targetWindow);
+ add(targetWindowCheckBox);
}
/**
@@ -97,8 +129,19 @@ public class ExternalLinkPropertyForm extends BasicPageForm
final ExternalLink extLink = (ExternalLink) super.initBasicWidgets(fse);
final PageState state = fse.getPageState();
- url.setValue(state, extLink.getURL());
description.setValue(state, extLink.getDescription());
+ url.setValue(state, extLink.getURL());
+ comment.setValue(state, extLink.getComment());
+ String showComment = ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.yes").localize().equals(
+ extLink.getShowComment()) ?
+ extLink.SHOW_COMMENT : null;
+ showCommentCheckBox.setValue(state, showComment);
+ String newWindow = ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.yes").localize().equals(
+ extLink.getTargetWindow()) ?
+ extLink.TARGET_WINDOW : null;
+ targetWindowCheckBox.setValue(state, newWindow);
}
/**
@@ -108,15 +151,42 @@ public class ExternalLinkPropertyForm extends BasicPageForm
*/
@Override
public void process(final FormSectionEvent fse) {
- final ExternalLink site = (ExternalLink) super.processBasicWidgets(fse);
+ final ExternalLink extLink = (ExternalLink) super.processBasicWidgets(fse);
final PageState state = fse.getPageState();
// save only if save button was pressed
- if (site != null
- && getSaveCancelSection().getSaveButton().isSelected(state)) {
- site.setURL((String) url.getValue(state));
- site.setDescription((String) description.getValue(state));
+ if (extLink != null &&
+ getSaveCancelSection().getSaveButton().isSelected(state)) {
+ extLink.setDescription((String) description.getValue(state));
+ extLink.setURL((String) url.getValue(state));
+ extLink.setComment((String) comment.getValue(state));
+ // Process whether a comment will be shown
+ boolean showComment = false;
+ String[] value = (String[]) showCommentCheckBox.getValue(state);
+ if (value != null) {
+ showComment = extLink.SHOW_COMMENT.equals(value[0]);
+ }
+ if (showComment) {
+ extLink.setShowComment((String) ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.yes").localize());
+ } else {
+ extLink.setShowComment((String) ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.no").localize());
+ }
+ // Process whether the external link will be opened in a new
+ // window
+ boolean newWindow = false;
+ value = (String[]) targetWindowCheckBox.getValue(state);
+ if (value != null) {
+ newWindow = extLink.TARGET_WINDOW.equals(value[0]);
+ }
+ if (newWindow) {
+ extLink.setTargetWindow((String) ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.yes").localize());
+ } else {
+ extLink.setTargetWindow((String) ExternalLinkGlobalizationUtil.globalize(
+ "cms.contenttypes.externallink.no").localize());
+ }
}
}
-
}
diff --git a/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources.properties b/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources.properties
index d44c9f086..5a9389144 100644
--- a/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources.properties
+++ b/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources.properties
@@ -7,3 +7,4 @@ webpage.ui.no_such_contentsection=no such content section.
webpage.ui.illegal_portlet=Illegal portlet ID
webpage.ui.illegal_webpage_portlet=Illegal Webpage Portlet ID
webpage.ui.no_permission_edit=You do not have permission to edit this item.
+cms.webpage.webpage.type_label=Webpage
diff --git a/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources_de.properties b/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources_de.properties
index d6161a978..9d16cc521 100644
--- a/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources_de.properties
+++ b/ccm-webpage/src/com/arsdigita/cms/webpage/WebpageResources_de.properties
@@ -7,3 +7,4 @@ webpage.ui.no_such_contentsection=no such content section.
webpage.ui.illegal_portlet=Illegal portlet ID
webpage.ui.illegal_webpage_portlet=Illegal Webpage Portlet ID
webpage.ui.no_permission_edit=Sie haben nicht die Erlaubnis dieses Item zu editieren.
+cms.webpage.webpage.type_label=Internetseite