ccm-cms-types-externallink:
- Some enhancements
- Foundry now supports ExternalLink
git-svn-id: https://svn.libreccm.org/ccm/trunk@3505 8810af33-2d31-482b-a856-94f89814c4df
master
parent
a4a9ae414a
commit
4425bfd8df
|
|
@ -23,8 +23,8 @@ import com.arsdigita.cms.ContentPage;
|
||||||
object type ExternalLink extends ContentPage {
|
object type ExternalLink extends ContentPage {
|
||||||
String [0..1] url = ct_extLinks.url VARCHAR(2000);
|
String [0..1] url = ct_extLinks.url VARCHAR(2000);
|
||||||
String [0..1] comment = ct_extLinks.comment VARCHAR(4000);
|
String [0..1] comment = ct_extLinks.comment VARCHAR(4000);
|
||||||
String [0..1] showComment = ct_extLinks.show_comment VARCHAR(50);
|
Boolean [0..1] showComment = ct_extLinks.show_comment;
|
||||||
String [0..1] targetWindow = ct_extLinks.target_window VARCHAR(50);
|
Boolean [0..1] targetNewWindow = ct_extLinks.target_new_window;
|
||||||
|
|
||||||
reference key (ct_extLinks.extLink_id);
|
reference key (ct_extLinks.extLink_id);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,29 @@
|
||||||
xmlns:define="/WEB-INF/bebop-define.tld"
|
xmlns:define="/WEB-INF/bebop-define.tld"
|
||||||
xmlns:show="/WEB-INF/bebop-show.tld"
|
xmlns:show="/WEB-INF/bebop-show.tld"
|
||||||
version="1.2">
|
version="1.2">
|
||||||
<jsp:directive.page import="com.arsdigita.cms.contenttypes.ExternalLink"/>
|
<jsp:directive.page import="com.arsdigita.cms.contenttypes.ExternalLink"/>
|
||||||
<jsp:directive.page import="com.arsdigita.cms.CMS"/>
|
<jsp:directive.page import="com.arsdigita.cms.CMS"/>
|
||||||
<jsp:directive.page import="com.arsdigita.cms.CMSContext"/>
|
<jsp:directive.page import="com.arsdigita.cms.CMSContext"/>
|
||||||
<jsp:scriptlet>
|
<jsp:scriptlet>
|
||||||
CMSContext ctx = CMS.getContext();
|
CMSContext ctx = CMS.getContext();
|
||||||
if (ctx.hasContentItem()) {
|
if (ctx.hasContentItem()) {
|
||||||
ExternalLink extLink = (ExternalLink) ctx.getContentItem();
|
ExternalLink extLink = (ExternalLink) ctx.getContentItem();
|
||||||
String url = extLink.getURL();
|
String url = extLink.getURL();
|
||||||
if (url != null && url.length() > 0) {
|
if (url != null && !(url.isEmpty())
|
||||||
|
&& !(extLink.getShowComment())) {
|
||||||
response.sendRedirect(url);
|
response.sendRedirect(url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</jsp:scriptlet>
|
</jsp:scriptlet>
|
||||||
|
|
||||||
|
<define:page name="itemPage"
|
||||||
|
application="content"
|
||||||
|
title="CMS"
|
||||||
|
cache="true">
|
||||||
|
|
||||||
|
<define:component name="itemXML"
|
||||||
|
classname="com.arsdigita.cms.dispatcher.ContentPanel"/>
|
||||||
|
</define:page>
|
||||||
|
|
||||||
|
<show:all/>
|
||||||
</jsp:root>
|
</jsp:root>
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ public class ExternalLink extends ContentPage {
|
||||||
/** PDL property showComment */
|
/** PDL property showComment */
|
||||||
public static final String SHOW_COMMENT = "showComment";
|
public static final String SHOW_COMMENT = "showComment";
|
||||||
/** PDL property targetWindow */
|
/** PDL property targetWindow */
|
||||||
public static final String TARGET_WINDOW = "targetWindow";
|
public static final String TARGET_WINDOW = "targetNewWindow";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data object type for this domain object
|
* Data object type for this domain object
|
||||||
|
|
@ -152,8 +152,8 @@ public class ExternalLink extends ContentPage {
|
||||||
*
|
*
|
||||||
* @return the value weather the comment will be shown
|
* @return the value weather the comment will be shown
|
||||||
*/
|
*/
|
||||||
public String getShowComment() {
|
public Boolean getShowComment() {
|
||||||
return (String) get(SHOW_COMMENT);
|
return (Boolean) get(SHOW_COMMENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -161,7 +161,7 @@ public class ExternalLink extends ContentPage {
|
||||||
*
|
*
|
||||||
* @param show The value weather the comment should be shown.
|
* @param show The value weather the comment should be shown.
|
||||||
*/
|
*/
|
||||||
public void setShowComment(final String show) {
|
public void setShowComment(final Boolean show) {
|
||||||
set(SHOW_COMMENT, show);
|
set(SHOW_COMMENT, show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,8 +170,8 @@ public class ExternalLink extends ContentPage {
|
||||||
*
|
*
|
||||||
* @return The Target Window
|
* @return The Target Window
|
||||||
*/
|
*/
|
||||||
public String getTargetWindow() {
|
public Boolean getTargetNewWindow() {
|
||||||
return (String) get(TARGET_WINDOW);
|
return (Boolean) get(TARGET_WINDOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -179,7 +179,7 @@ public class ExternalLink extends ContentPage {
|
||||||
*
|
*
|
||||||
* @param window The Target Window
|
* @param window The Target Window
|
||||||
*/
|
*/
|
||||||
public void setTargetWindow(String window) {
|
public void setTargetNewWindow(Boolean window) {
|
||||||
set(TARGET_WINDOW, window);
|
set(TARGET_WINDOW, window);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -30,9 +30,9 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authoring step to view/edit the simple attributes of the
|
* Authoring step to view/edit the simple attributes of the ExternalLink content
|
||||||
* ExternalLink content type (and its subclasses).
|
* type (and its subclasses).
|
||||||
*
|
*
|
||||||
* @author Tobias Osmers <tosmers@uni-bremen.de>
|
* @author Tobias Osmers <tosmers@uni-bremen.de>
|
||||||
* @version $Revision: #1 $ $Date: 2015/02/22 $
|
* @version $Revision: #1 $ $Date: 2015/02/22 $
|
||||||
*/
|
*/
|
||||||
|
|
@ -49,8 +49,8 @@ public class ExternalLinkPropertiesStep extends SimpleEditStep {
|
||||||
* @param itemModel
|
* @param itemModel
|
||||||
* @param parent
|
* @param parent
|
||||||
*/
|
*/
|
||||||
public ExternalLinkPropertiesStep(final ItemSelectionModel itemModel,
|
public ExternalLinkPropertiesStep(final ItemSelectionModel itemModel,
|
||||||
final AuthoringKitWizard parent) {
|
final AuthoringKitWizard parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
final BasicPageForm editSheet = new ExternalLinkPropertyForm(itemModel);
|
final BasicPageForm editSheet = new ExternalLinkPropertyForm(itemModel);
|
||||||
|
|
@ -63,36 +63,45 @@ public class ExternalLinkPropertiesStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a component that displays the properties of the ExternalLink
|
* Returns a component that displays the properties of the ExternalLink
|
||||||
* content item specified by the ItemSelectionModel passed in.
|
* content item specified by the ItemSelectionModel passed in.
|
||||||
*
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use
|
* @param itemModel The ItemSelectionModel to use
|
||||||
*
|
*
|
||||||
* @pre itemModel != null
|
* @pre itemModel != null
|
||||||
* @return A component to display the state of the basic properties of the release
|
* @return A component to display the state of the basic properties of the
|
||||||
|
* release
|
||||||
*
|
*
|
||||||
* Method add deprecated, use add(GlobalizedMessage label, String attribute) instead (but
|
* Method add deprecated, use add(GlobalizedMessage label, String attribute)
|
||||||
* probably Camden doesn't use globalized strings).
|
* instead (but probably Camden doesn't use globalized strings).
|
||||||
*/
|
*/
|
||||||
public static Component getExternalLinkPropertySheet(final ItemSelectionModel itemModel) {
|
public static Component getExternalLinkPropertySheet(
|
||||||
|
final ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||||
|
itemModel);
|
||||||
|
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.name"), ExternalLink.NAME);
|
"cms.contenttypes.externallink.name"), ExternalLink.NAME);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.title"), ExternalLink.TITLE);
|
"cms.contenttypes.externallink.title"), ExternalLink.TITLE);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.description"), ExternalLink.DESCRIPTION);
|
"cms.contenttypes.externallink.description"),
|
||||||
|
ExternalLink.DESCRIPTION);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.location"), ExternalLink.URL);
|
"cms.contenttypes.externallink.location"),
|
||||||
|
ExternalLink.URL);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.comment"), ExternalLink.COMMENT);
|
"cms.contenttypes.externallink.comment"),
|
||||||
|
ExternalLink.COMMENT);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.show_comment"), ExternalLink.SHOW_COMMENT);
|
"cms.contenttypes.externallink.show_comment"),
|
||||||
|
ExternalLink.SHOW_COMMENT);
|
||||||
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
sheet.add(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.target_window"), ExternalLink.TARGET_WINDOW);
|
"cms.contenttypes.externallink.target_window"),
|
||||||
|
ExternalLink.TARGET_WINDOW);
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,17 +40,17 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
* Used by <code>ExternalLinkPropertiesStep</code> authoring kit step.
|
* Used by <code>ExternalLinkPropertiesStep</code> authoring kit step.
|
||||||
* <br />
|
* <br />
|
||||||
* This form can be extended to create forms for ExternalLink subclasses.
|
* This form can be extended to create forms for ExternalLink subclasses.
|
||||||
*
|
*
|
||||||
* @author Tobias Osmers <tosmers@uni-bremen.de>
|
* @author Tobias Osmers <tosmers@uni-bremen.de>
|
||||||
* @version $Revision: #1 $ $Date: 2015/02/22 $
|
* @version $Revision: #1 $ $Date: 2015/02/22 $
|
||||||
*/
|
*/
|
||||||
public class ExternalLinkPropertyForm extends BasicPageForm
|
public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
implements FormProcessListener, FormInitListener {
|
implements FormProcessListener, FormInitListener {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of this form
|
* Name of this form
|
||||||
*/
|
*/
|
||||||
public static final String ID = "externallinkform_edit";
|
public static final String ID = "externallinkform_edit";
|
||||||
// formerly "externalLinkEdit"
|
// formerly "externalLinkEdit"
|
||||||
|
|
||||||
private TextArea description;
|
private TextArea description;
|
||||||
|
|
@ -59,11 +59,11 @@ public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
private CheckboxGroup showCommentCheckBox, targetWindowCheckBox;
|
private CheckboxGroup showCommentCheckBox, targetWindowCheckBox;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new form to edit the ExternalLink object specified by the
|
* Creates a new form to edit the ExternalLink object specified by the item
|
||||||
* item selection model passed in.
|
* selection model passed in.
|
||||||
*
|
*
|
||||||
* @param itemModel The ItemSelectionModel to use to obtain the
|
* @param itemModel The ItemSelectionModel to use to obtain the ExternalLink
|
||||||
* ExternalLink to work on
|
* to work on
|
||||||
*/
|
*/
|
||||||
public ExternalLinkPropertyForm(final ItemSelectionModel itemModel) {
|
public ExternalLinkPropertyForm(final ItemSelectionModel itemModel) {
|
||||||
super(ID, itemModel);
|
super(ID, itemModel);
|
||||||
|
|
@ -77,43 +77,41 @@ public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
super.addWidgets();
|
super.addWidgets();
|
||||||
|
|
||||||
description = new TextArea(new TrimmedStringParameter(
|
description = new TextArea(new TrimmedStringParameter(
|
||||||
ContentPage.DESCRIPTION), 5, 40, TextArea.SOFT);
|
ContentPage.DESCRIPTION), 5, 40, TextArea.SOFT);
|
||||||
description.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
description.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.description"));
|
"cms.contenttypes.externallink.description"));
|
||||||
description.setHint(ExternalLinkGlobalizationUtil.globalize(
|
description.setHint(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.description_hint"));
|
"cms.contenttypes.externallink.description_hint"));
|
||||||
add(description);
|
add(description);
|
||||||
|
|
||||||
|
|
||||||
url = new TextField(new TrimmedStringParameter(ExternalLink.URL));
|
url = new TextField(new TrimmedStringParameter(ExternalLink.URL));
|
||||||
url.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
url.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.location"));
|
"cms.contenttypes.externallink.location"));
|
||||||
url.setHint(ExternalLinkGlobalizationUtil.globalize(
|
url.setHint(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.location_hint"));
|
"cms.contenttypes.externallink.location_hint"));
|
||||||
url.setSize(40);
|
url.setSize(40);
|
||||||
add(url);
|
add(url);
|
||||||
|
|
||||||
|
|
||||||
comment = new TextArea(new TrimmedStringParameter(
|
comment = new TextArea(new TrimmedStringParameter(
|
||||||
ExternalLink.COMMENT), 5, 40, TextArea.SOFT);
|
ExternalLink.COMMENT), 5, 40, TextArea.SOFT);
|
||||||
comment.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
comment.setLabel(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.comment"));
|
"cms.contenttypes.externallink.comment"));
|
||||||
comment.setHint(ExternalLinkGlobalizationUtil.globalize(
|
comment.setHint(ExternalLinkGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.externallink.comment_hint"));
|
"cms.contenttypes.externallink.comment_hint"));
|
||||||
add(comment);
|
add(comment);
|
||||||
|
|
||||||
|
Option showComment = new Option(ExternalLink.SHOW_COMMENT,
|
||||||
Option showComment = new Option(ExternalLink.SHOW_COMMENT,
|
new Label(ExternalLinkGlobalizationUtil
|
||||||
new Label(ExternalLinkGlobalizationUtil.globalize(
|
.globalize(
|
||||||
"cms.contenttypes.externallink.show_comment")));
|
"cms.contenttypes.externallink.show_comment")));
|
||||||
showCommentCheckBox = new CheckboxGroup("showCommentCheckBox");
|
showCommentCheckBox = new CheckboxGroup("showCommentCheckBox");
|
||||||
showCommentCheckBox.addOption(showComment);
|
showCommentCheckBox.addOption(showComment);
|
||||||
add(showCommentCheckBox);
|
add(showCommentCheckBox);
|
||||||
|
|
||||||
|
|
||||||
Option targetWindow = new Option(ExternalLink.TARGET_WINDOW,
|
Option targetWindow = new Option(ExternalLink.TARGET_WINDOW,
|
||||||
new Label(ExternalLinkGlobalizationUtil.globalize(
|
new Label(ExternalLinkGlobalizationUtil
|
||||||
"cms.contenttypes.externallink.target_window")));
|
.globalize(
|
||||||
|
"cms.contenttypes.externallink.target_window")));
|
||||||
targetWindowCheckBox = new CheckboxGroup("targetWindowCheckBox");
|
targetWindowCheckBox = new CheckboxGroup("targetWindowCheckBox");
|
||||||
targetWindowCheckBox.addOption(targetWindow);
|
targetWindowCheckBox.addOption(targetWindow);
|
||||||
add(targetWindowCheckBox);
|
add(targetWindowCheckBox);
|
||||||
|
|
@ -132,16 +130,19 @@ public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
description.setValue(state, extLink.getDescription());
|
description.setValue(state, extLink.getDescription());
|
||||||
url.setValue(state, extLink.getURL());
|
url.setValue(state, extLink.getURL());
|
||||||
comment.setValue(state, extLink.getComment());
|
comment.setValue(state, extLink.getComment());
|
||||||
String showComment = ExternalLinkGlobalizationUtil.globalize(
|
if (extLink.getShowComment()) {
|
||||||
"cms.contenttypes.externallink.yes").localize().equals(
|
showCommentCheckBox.setValue(
|
||||||
extLink.getShowComment()) ?
|
state, new String[]{ExternalLink.SHOW_COMMENT});
|
||||||
extLink.SHOW_COMMENT : null;
|
} else {
|
||||||
showCommentCheckBox.setValue(state, showComment);
|
showCommentCheckBox.setValue(state, null);
|
||||||
String newWindow = ExternalLinkGlobalizationUtil.globalize(
|
}
|
||||||
"cms.contenttypes.externallink.yes").localize().equals(
|
|
||||||
extLink.getTargetWindow()) ?
|
if (extLink.getTargetNewWindow()) {
|
||||||
extLink.TARGET_WINDOW : null;
|
targetWindowCheckBox.setValue(
|
||||||
targetWindowCheckBox.setValue(state, newWindow);
|
state, new String[]{ExternalLink.TARGET_WINDOW});
|
||||||
|
} else {
|
||||||
|
targetWindowCheckBox.setValue(state, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -151,12 +152,13 @@ public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void process(final FormSectionEvent fse) {
|
public void process(final FormSectionEvent fse) {
|
||||||
final ExternalLink extLink = (ExternalLink) super.processBasicWidgets(fse);
|
final ExternalLink extLink = (ExternalLink) super.processBasicWidgets(
|
||||||
|
fse);
|
||||||
|
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
// save only if save button was pressed
|
// save only if save button was pressed
|
||||||
if (extLink != null &&
|
if (extLink != null && getSaveCancelSection().getSaveButton()
|
||||||
getSaveCancelSection().getSaveButton().isSelected(state)) {
|
.isSelected(state)) {
|
||||||
extLink.setDescription((String) description.getValue(state));
|
extLink.setDescription((String) description.getValue(state));
|
||||||
extLink.setURL((String) url.getValue(state));
|
extLink.setURL((String) url.getValue(state));
|
||||||
extLink.setComment((String) comment.getValue(state));
|
extLink.setComment((String) comment.getValue(state));
|
||||||
|
|
@ -164,29 +166,22 @@ public class ExternalLinkPropertyForm extends BasicPageForm
|
||||||
boolean showComment = false;
|
boolean showComment = false;
|
||||||
String[] value = (String[]) showCommentCheckBox.getValue(state);
|
String[] value = (String[]) showCommentCheckBox.getValue(state);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
showComment = extLink.SHOW_COMMENT.equals(value[0]);
|
showComment = ExternalLink.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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extLink.setShowComment(showComment);
|
||||||
|
|
||||||
// Process whether the external link will be opened in a new
|
// Process whether the external link will be opened in a new
|
||||||
// window
|
// window
|
||||||
boolean newWindow = false;
|
boolean newWindow = false;
|
||||||
value = (String[]) targetWindowCheckBox.getValue(state);
|
value = (String[]) targetWindowCheckBox.getValue(state);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
newWindow = extLink.TARGET_WINDOW.equals(value[0]);
|
newWindow = ExternalLink.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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extLink.setTargetNewWindow(newWindow);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
<xsl:import href="content-items/bookmark.xsl"/>
|
<xsl:import href="content-items/bookmark.xsl"/>
|
||||||
<xsl:import href="content-items/contact.xsl"/>
|
<xsl:import href="content-items/contact.xsl"/>
|
||||||
<xsl:import href="content-items/decisiontree.xsl"/>
|
<xsl:import href="content-items/decisiontree.xsl"/>
|
||||||
|
<xsl:import href="content-items/external-link.xsl"/>
|
||||||
<xsl:import href="content-items/event.xsl"/>
|
<xsl:import href="content-items/event.xsl"/>
|
||||||
<xsl:import href="content-items/generic-orgaunit.xsl"/>
|
<xsl:import href="content-items/generic-orgaunit.xsl"/>
|
||||||
<xsl:import href="content-items/formitem.xsl"/>
|
<xsl:import href="content-items/formitem.xsl"/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,159 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
|
||||||
|
|
||||||
|
This file is part of the Foundry Theme Engine for LibreCCM
|
||||||
|
|
||||||
|
Foundry is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
Foundry 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 General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with Foundry If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
-->
|
||||||
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||||
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||||
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||||
|
xmlns:foundry="http://foundry.libreccm.org"
|
||||||
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||||
|
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||||
|
exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
|
||||||
|
version="2.0">
|
||||||
|
|
||||||
|
<foundry:doc-file>
|
||||||
|
<foundry:doc-title>Tags for ccm-cms-types-externallink</foundry:doc-title>
|
||||||
|
<foundry:doc-file-desc>
|
||||||
|
<p>
|
||||||
|
Tags for displaying the special properties of a ExternalLink
|
||||||
|
</p>
|
||||||
|
</foundry:doc-file-desc>
|
||||||
|
</foundry:doc-file>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Checks if the external link has a description and applies the
|
||||||
|
enclosed tags if there is one.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//if-extlink-description">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:if test="string-length($contentitem-tree/pageDescription) > 0">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Output the description of an ExternalLink.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//show-extlink-description">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:value-of disable-output-escaping="yes"
|
||||||
|
select="$contentitem-tree/pageDescription"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Checks if the <code>showComment</code> property of the
|
||||||
|
ExternalLink is <code>true</code> and if there is a comment
|
||||||
|
text. If both conditions are <code>true</code> the enclosed tags
|
||||||
|
are applied.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//if-extlink-comment">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:if test="foundry:boolean($contentitem-tree/showComment)
|
||||||
|
and string-length($contentitem-tree/comment) > 0">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Outputs the comment text.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//show-extlink-comment">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:value-of disable-output-escaping="yes"
|
||||||
|
select="$contentitem-tree/comment"/>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Checks if the <code>targetNewWindow</code> property of the
|
||||||
|
ExternalLink is set to <code>true</code> indicating that the
|
||||||
|
link should be opened in a new windows. This can be used to
|
||||||
|
integrate an JavaScript into the HTML for opening the new
|
||||||
|
window.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//if-extlink-new-window">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:if test="foundry:boolean($contentitem-tree/targetNewWindow)">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="/content-item-layout//if-extlink-not-new-window">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:if test="not(foundry:boolean($contentitem-tree/targetNewWindow))">
|
||||||
|
<xsl:apply-templates/>
|
||||||
|
</xsl:if>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<foundry:doc section="user" type="template-tag">
|
||||||
|
<foundry:doc-desc>
|
||||||
|
<p>
|
||||||
|
Puts the URL of the ExternalLink into the environment.
|
||||||
|
</p>
|
||||||
|
</foundry:doc-desc>
|
||||||
|
</foundry:doc>
|
||||||
|
<xsl:template match="/content-item-layout//extlink-target-url">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<xsl:apply-templates>
|
||||||
|
<xsl:with-param name="href"
|
||||||
|
tunnel="yes"
|
||||||
|
select="$contentitem-tree/url"/>
|
||||||
|
</xsl:apply-templates>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
<xsl:template match="/content-item-layout//extlink-data">
|
||||||
|
<xsl:param name="contentitem-tree" tunnel="yes"/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<xsl:attribute name="id" select="'extlink-data'"/>
|
||||||
|
<xsl:attribute name="data-new-window"
|
||||||
|
select="$contentitem-tree/targetNewWindow"/>
|
||||||
|
<xsl:attribute name="data-url"
|
||||||
|
select="$contentitem-tree/url"/>
|
||||||
|
</div>
|
||||||
|
</xsl:template>
|
||||||
|
|
||||||
|
</xsl:stylesheet>
|
||||||
|
|
@ -90,6 +90,12 @@
|
||||||
<code>type</code>
|
<code>type</code>
|
||||||
</dt>
|
</dt>
|
||||||
<dd>The media type of the link target.</dd>
|
<dd>The media type of the link target.</dd>
|
||||||
|
<dt>
|
||||||
|
<code>target</code>
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
The target window/frame for the link.
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</foundry:doc-desc>
|
</foundry:doc-desc>
|
||||||
<foundry:doc-attributes>
|
<foundry:doc-attributes>
|
||||||
|
|
@ -184,6 +190,10 @@
|
||||||
select="foundry:get-static-text('', ./@title-static)"/>
|
select="foundry:get-static-text('', ./@title-static)"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
<xsl:if test="./@target">
|
||||||
|
<xsl:attribute name="target" select="./@target"/>
|
||||||
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:call-template name="foundry:process-layouttree-attributes">
|
<xsl:call-template name="foundry:process-layouttree-attributes">
|
||||||
<xsl:with-param name="id" select="$id"/>
|
<xsl:with-param name="id" select="$id"/>
|
||||||
<xsl:with-param name="class" select="$class"/>
|
<xsl:with-param name="class" select="$class"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue