You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2006/03/09 09:33:12 UTC

svn commit: r384461 - /cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java

Author: cziegeler
Date: Thu Mar  9 00:33:11 2006
New Revision: 384461

URL: http://svn.apache.org/viewcvs?rev=384461&view=rev
Log:
Remove "external" attribute from coplet links.

Modified:
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java?rev=384461&r1=384460&r2=384461&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/transformation/HTMLEventLinkTransformer.java Thu Mar  9 00:33:11 2006
@@ -67,10 +67,12 @@
     throws SAXException {
         boolean processed = false;
         if ("a".equals(name) ) {
+            final AttributesImpl a = this.getMutableAttributes(attr);
+            attr = a;
             boolean convert = false;
             final boolean isRemoteAnchor = this.isRemoteAnchor(attr);
             if ( isRemoteAnchor ) {
-                convert = !this.isExternalLink(attr);
+                convert = !this.isExternalLink(a);
             }
             this.stack.push(convert ? Boolean.TRUE: Boolean.FALSE);
             if ( convert ) {
@@ -78,7 +80,9 @@
                 processed = true;
             }
         } else if ("form".equals(name) ) {
-            boolean convert = !this.isExternalForm(attr);
+            final AttributesImpl a = this.getMutableAttributes(attr);
+            attr = a;
+            boolean convert = !this.isExternalForm(a);
             this.stack.push(convert ? Boolean.TRUE: Boolean.FALSE);
             if ( convert ) {
                 this.createFormEvent(attr);
@@ -200,8 +204,12 @@
      * @param attributes attributes of the node
      * @return true if the attribute 'external' is 'true'
      */
-    private boolean isExternalLink (Attributes attributes) {        
+    private boolean isExternalLink (AttributesImpl attributes) {        
         final String external = attributes.getValue("external");
+        // remote attribute
+        if ( external != null ) {
+            attributes.removeAttribute("external");
+        }
         // links to external documents will be not transformed to portal links
         if (external != null && external.trim().length() > 0 
             && external.trim().toLowerCase().equals ("true") ) {            
@@ -224,8 +232,12 @@
      * @param attributes attributes of the node
      * @return True if the action is external.
      */
-    private boolean isExternalForm(Attributes attributes) {        
+    private boolean isExternalForm(AttributesImpl attributes) {        
         final String external = attributes.getValue("external");
+        // remote attribute
+        if ( external != null ) {
+            attributes.removeAttribute("external");
+        }
         // links to external documents will be not transformed to portal links
         if (external != null && external.trim().length() > 0 
             && external.trim().toLowerCase().equals ("true") ) {