From 6d53376d19db672e0a90f389349263df5517d436 Mon Sep 17 00:00:00 2001 From: Ken ISHIMOTO Date: Sat, 19 Jan 2013 19:35:00 +0100 Subject: [PATCH 1/3] add 'target' Binding to ERAttachment --- .../ERAttachment/Components/ERAttachmentLink.api | 3 ++- .../er/attachment/components/ERAttachmentLink.java | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentLink.api b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentLink.api index 6726018b62d..d8ce19f7537 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentLink.api +++ b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentLink.api @@ -1,4 +1,4 @@ - + @@ -11,5 +11,6 @@ + diff --git a/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/components/ERAttachmentLink.java b/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/components/ERAttachmentLink.java index 7f0507b8658..b94c4584180 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/components/ERAttachmentLink.java +++ b/Frameworks/BusinessLogic/ERAttachment/Sources/er/attachment/components/ERAttachmentLink.java @@ -16,6 +16,7 @@ import er.attachment.processors.ERAttachmentProcessor; import er.extensions.components.ERXComponentUtilities; import er.extensions.foundation.ERXMutableURL; +import er.extensions.foundation.ERXStringUtilities; /** * ERAttachmentLink is like a WOHyperlink that points to an attachment's contents. @@ -30,6 +31,7 @@ */ public class ERAttachmentLink extends WODynamicGroup { private WOAssociation _attachment; + private WOAssociation _target; private WOAssociation _configurationName; private NSMutableDictionary _associations; private WOAssociation _download; @@ -39,6 +41,7 @@ public ERAttachmentLink(String name, NSDictionary associa _associations = associations.mutableClone(); _attachment = _associations.removeObjectForKey("attachment"); _download = _associations.removeObjectForKey("download"); + _target = _associations.removeObjectForKey("target"); if (_attachment == null) { throw new WODynamicElementCreationException(" The 'attachment' binding is required."); } @@ -73,6 +76,14 @@ public void appendToResponse(WOResponse response, WOContext context) { } response.appendContentString(attachmentUrl); response.appendContentString("\""); + + if (_target != null) { + String sTarget = (String) _target.valueInComponent(component); + if(!ERXStringUtilities.stringIsNullOrEmpty(sTarget)) { + response.appendContentString(" target=\"" + sTarget +"\""); + } + } + ERXComponentUtilities.appendHtmlAttributes(_associations, response, component); response.appendContentString(">"); super.appendToResponse(response, context); From 0972dab0c791b7e7f864a11bb80054769a99476c Mon Sep 17 00:00:00 2001 From: Ken ISHIMOTO Date: Sat, 19 Jan 2013 19:40:03 +0100 Subject: [PATCH 2/3] Add 'viewTarget' Binding to ERAttchmentFlixibleEditor --- .../ERAttachment/Components/ERAttachmentFlexibleEditor.api | 3 ++- .../ERAttachmentFlexibleEditor.wod | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.api b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.api index bba03100329..2061a0b4933 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.api +++ b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.api @@ -1,4 +1,4 @@ - + @@ -40,5 +40,6 @@ + diff --git a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod index 6c7af1c3607..1c92e603cc5 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod +++ b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod @@ -59,6 +59,7 @@ ERAttachmentLink : ERAttachmentLink { attachment = viewerAttachment; download = allowDownload; configurationName = ^configurationName; + target = ^viewLinkTarget; } OriginalFileName : WOString { From 5069fd32bf25e4d0db2039af6c1cc3f46578374c Mon Sep 17 00:00:00 2001 From: Ken ISHIMOTO Date: Sat, 19 Jan 2013 19:43:46 +0100 Subject: [PATCH 3/3] fix Binding to viewTarget because that was a requirment from JW. --- .../ERAttachmentFlexibleEditor.wod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod index 1c92e603cc5..5930ba8b37c 100644 --- a/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod +++ b/Frameworks/BusinessLogic/ERAttachment/Components/ERAttachmentFlexibleEditor.wo/ERAttachmentFlexibleEditor.wod @@ -59,7 +59,7 @@ ERAttachmentLink : ERAttachmentLink { attachment = viewerAttachment; download = allowDownload; configurationName = ^configurationName; - target = ^viewLinkTarget; + target = ^viewTarget; } OriginalFileName : WOString {