ICEfaces
  1. ICEfaces
  2. ICE-1974

Page-specific javascriptBlockedRedirectURI

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 1.6
    • Fix Version/s: None
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      n/a

      Description

      New component that could be included on a page to specify a page-specific javascriptBlockedRedirectURI

        Issue Links

          Activity

          Hide
          Philip Breau added a comment -

          suggested impl:

          Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java
          ===================================================================
          — D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java (revision 0)
          +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java (revision 0)
          @@ -0,0 +1,55 @@
          +package com.icesoft.faces.component.noscript;
          +
          +import javax.faces.component.UIComponentBase;
          +import javax.faces.el.ValueBinding;
          +
          +public class OutputNoScript extends UIComponentBase {
          +
          + public static final String COMPONENT_TYPE = "com.icesoft.faces.OutputNoScriptComp";
          + public static final String COMPONENT_FAMILY = "com.icesoft.faces.OutputNoScript";
          + public static final String DEFAULT_RENDERER_TYPE = "com.icesoft.faces.noscript.OutputNoScriptRenderer";
          +
          + private String href;
          +
          + public OutputNoScript()

          { + super(); + }

          +
          + public String getFamily()

          { + return COMPONENT_FAMILY; + }

          +
          + public String getRendererType()

          { + return DEFAULT_RENDERER_TYPE; + }

          +
          + /**
          + * Returns the href value of the link element that is rendered.
          + */
          + public String getHref() {
          + if (href != null)

          { + return href; + }

          + ValueBinding vb = getValueBinding("href");
          + if (vb != null)

          { + return (String) vb.getValue(getFacesContext()); + }

          + return null;
          + }
          +
          +
          + /**
          + * Sets the href value of the link element that is rendered. <p/> The href
          + * value of the link element that is rendered. An additional link element is
          + * rendered for internet explorer and Safari browsers. An additional style
          + * sheet is specifed when in design time in Studio Creator. The IE style
          + * sheet must end with '_ie.css', and the Safari style sheet must end with
          + * '_safari.css'. Design Time is '_dt.css' For example if the href value is
          + * 'style.css' then the IE style sheet needs to be named 'style_ie.css'
          + * </p>
          + */
          + public void setHref(String href)

          { + this.href = href; + }

          +
          +}
          Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java
          ===================================================================
          — D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java (revision 0)
          +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java (revision 0)
          @@ -0,0 +1,43 @@
          +package com.icesoft.faces.component.noscript;
          +
          +import java.io.IOException;
          +
          +import javax.faces.component.UIComponent;
          +import javax.faces.context.FacesContext;
          +
          +import org.apache.commons.logging.Log;
          +import org.apache.commons.logging.LogFactory;
          +import org.w3c.dom.Element;
          +
          +import com.icesoft.faces.context.DOMContext;
          +import com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer;
          +
          +public class OutputNoScriptRenderer extends DomBasicRenderer {
          +
          + private static Log log = LogFactory.getLog(OutputNoScriptRenderer.class);
          +
          + public void encodeEnd(FacesContext facesContext, UIComponent uiComponent)
          + throws IOException {
          + validateParameters(facesContext, uiComponent, OutputNoScript.class);
          + try {
          + DOMContext domContext =
          + DOMContext.attachDOMContext(facesContext, uiComponent);
          + if (!domContext.isInitialized())

          { + OutputNoScript outputNoScript = (OutputNoScript) uiComponent; + Element noScriptEle = domContext.createElement("noscript"); + Element metaEle = domContext.createElement("meta"); + noScriptEle.appendChild(metaEle); + String href = outputNoScript.getHref(); + metaEle.setAttribute("content", "0;url=" + getResourceURL(facesContext,href)); + metaEle.setAttribute("http-equiv", "refresh"); + + domContext.setRootNode(noScriptEle); + }

          + domContext.stepOver();
          + domContext.streamWrite(facesContext, uiComponent);
          + } catch (Exception e)

          { + log.error("Error in OutputNoScriptRenderer", e); + }

          + }
          +
          +}

          Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml
          ===================================================================
          — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml (revision 14627)
          +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml (working copy)
          @@ -354,7 +354,10 @@

          <!ENTITY outputDeclaration-component SYSTEM "custom/outputDeclaration-component.xml">
          <!ENTITY outputDeclaration-renderer SYSTEM "custom/outputDeclaration-renderer.xml">

          • +
            + <!ENTITY outputnoscript-component SYSTEM "custom/outputnoscript-component.xml">
            + <!ENTITY outputnoscript-renderer SYSTEM "custom/outputnoscript-renderer.xml">
            +
            <!ENTITY outputstyle-component SYSTEM "custom/outputstyle-component.xml">
            <!ENTITY outputstyle-renderer SYSTEM "custom/outputstyle-renderer.xml">

          @@ -440,6 +443,7 @@
          &selectinputtext-component;
          &panelSeries-component;
          &outputDeclaration-component;
          + &outputnoscript-component;
          &outputstyle-component;
          &panelPositioned-component;
          &rowselector-component;
          @@ -502,6 +506,7 @@
          &selectinputtext-renderer;
          &panelSeries-renderer;
          &outputDeclaration-renderer;
          + &outputnoscript-renderer;
          &outputstyle-renderer;
          &panelPositioned-renderer;
          &rowselector-renderer;
          Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml
          ===================================================================
          — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml (revision 0)
          +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml (revision 0)
          @@ -0,0 +1,53 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +
          +<!--
          + ~ Version: MPL 1.1/GPL 2.0/LGPL 2.1
          + ~
          + ~ "The contents of this file are subject to the Mozilla Public License
          + ~ Version 1.1 (the "License"); you may not use this file except in
          + ~ compliance with the License. You may obtain a copy of the License at
          + ~ http://www.mozilla.org/MPL/
          + ~
          + ~ Software distributed under the License is distributed on an "AS IS"
          + ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
          + ~ License for the specific language governing rights and limitations under
          + ~ the License.
          + ~
          + ~ The Original Code is ICEfaces 1.5 open source software code, released
          + ~ November 5, 2006. The Initial Developer of the Original Code is ICEsoft
          + ~ Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
          + ~ 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
          + ~
          + ~ Contributor(s): _____________________.
          + ~
          + ~ Alternatively, the contents of this file may be used under the terms of
          + ~ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
          + ~ License), in which case the provisions of the LGPL License are
          + ~ applicable instead of those above. If you wish to allow use of your
          + ~ version of this file only under the terms of the LGPL License and not to
          + ~ allow others to use your version of this file under the MPL, indicate
          + ~ your decision by deleting the provisions above and replace them with
          + ~ the notice and other provisions required by the LGPL License. If you do
          + ~ not delete the provisions above, a recipient may use your version of
          + ~ this file under either the MPL or the LGPL License."
          + ~
          + -->
          +
          +<renderer>
          + <description>
          + <![CDATA[
          +
          + ]]>
          + </description>
          + <component-family>com.icesoft.faces.OutputNoScript</component-family>
          + <renderer-type>com.icesoft.faces.noscript.OutputNoScriptRenderer</renderer-type>
          +
          + <renderer-extension>
          + <instance-name>outputNoScript</instance-name>
          + <is-container>false</is-container>
          + <renders-children>false</renders-children>
          + <tag-name>outputNoScript</tag-name>
          + <taglib-prefix>@taglib-prefix@</taglib-prefix>
          + <taglib-uri>@taglib-uri@</taglib-uri>
          + </renderer-extension>
          +</renderer>
          Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml
          ===================================================================
          — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml (revision 0)
          +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml (revision 0)
          @@ -0,0 +1,55 @@
          +<?xml version="1.0" encoding="UTF-8"?>
          +
          +<!--
          + ~ Version: MPL 1.1/GPL 2.0/LGPL 2.1
          + ~
          + ~ "The contents of this file are subject to the Mozilla Public License
          + ~ Version 1.1 (the "License"); you may not use this file except in
          + ~ compliance with the License. You may obtain a copy of the License at
          + ~ http://www.mozilla.org/MPL/
          + ~
          + ~ Software distributed under the License is distributed on an "AS IS"
          + ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
          + ~ License for the specific language governing rights and limitations under
          + ~ the License.
          + ~
          + ~ The Original Code is ICEfaces 1.5 open source software code, released
          + ~ November 5, 2006. The Initial Developer of the Original Code is ICEsoft
          + ~ Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C)
          + ~ 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved.
          + ~
          + ~ Contributor(s): _____________________.
          + ~
          + ~ Alternatively, the contents of this file may be used under the terms of
          + ~ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"
          + ~ License), in which case the provisions of the LGPL License are
          + ~ applicable instead of those above. If you wish to allow use of your
          + ~ version of this file only under the terms of the LGPL License and not to
          + ~ allow others to use your version of this file under the MPL, indicate
          + ~ your decision by deleting the provisions above and replace them with
          + ~ the notice and other provisions required by the LGPL License. If you do
          + ~ not delete the provisions above, a recipient may use your version of
          + ~ this file under either the MPL or the LGPL License."
          + ~
          + -->
          +
          +<component>
          + <description>
          + <![CDATA[
          +
          +
          +
          + ]]>
          + </description>
          + <display-name>Output NoScript</display-name>
          + <component-type>com.icesoft.faces.OutputNoScriptComp</component-type>
          +
          + &ice-cust-style-props;
          + <component-extension>
          + <base-component-type>com.sun.faces.Component</base-component-type>
          + <component-family>com.icesoft.faces.OutputNoScript</component-family>
          + <renderer-type>
          + com.icesoft.faces.noscript.OutputNoScriptRenderer
          + </renderer-type>
          + </component-extension>
          +</component>

          Show
          Philip Breau added a comment - suggested impl: Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java =================================================================== — D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java (revision 0) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScript.java (revision 0) @@ -0,0 +1,55 @@ +package com.icesoft.faces.component.noscript; + +import javax.faces.component.UIComponentBase; +import javax.faces.el.ValueBinding; + +public class OutputNoScript extends UIComponentBase { + + public static final String COMPONENT_TYPE = "com.icesoft.faces.OutputNoScriptComp"; + public static final String COMPONENT_FAMILY = "com.icesoft.faces.OutputNoScript"; + public static final String DEFAULT_RENDERER_TYPE = "com.icesoft.faces.noscript.OutputNoScriptRenderer"; + + private String href; + + public OutputNoScript() { + super(); + } + + public String getFamily() { + return COMPONENT_FAMILY; + } + + public String getRendererType() { + return DEFAULT_RENDERER_TYPE; + } + + /** + * Returns the href value of the link element that is rendered. + */ + public String getHref() { + if (href != null) { + return href; + } + ValueBinding vb = getValueBinding("href"); + if (vb != null) { + return (String) vb.getValue(getFacesContext()); + } + return null; + } + + + /** + * Sets the href value of the link element that is rendered. <p/> The href + * value of the link element that is rendered. An additional link element is + * rendered for internet explorer and Safari browsers. An additional style + * sheet is specifed when in design time in Studio Creator. The IE style + * sheet must end with '_ie.css', and the Safari style sheet must end with + * '_safari.css'. Design Time is '_dt.css' For example if the href value is + * 'style.css' then the IE style sheet needs to be named 'style_ie.css' + * </p> + */ + public void setHref(String href) { + this.href = href; + } + +} Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java =================================================================== — D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java (revision 0) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component/src/com/icesoft/faces/component/noscript/OutputNoScriptRenderer.java (revision 0) @@ -0,0 +1,43 @@ +package com.icesoft.faces.component.noscript; + +import java.io.IOException; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Element; + +import com.icesoft.faces.context.DOMContext; +import com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer; + +public class OutputNoScriptRenderer extends DomBasicRenderer { + + private static Log log = LogFactory.getLog(OutputNoScriptRenderer.class); + + public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) + throws IOException { + validateParameters(facesContext, uiComponent, OutputNoScript.class); + try { + DOMContext domContext = + DOMContext.attachDOMContext(facesContext, uiComponent); + if (!domContext.isInitialized()) { + OutputNoScript outputNoScript = (OutputNoScript) uiComponent; + Element noScriptEle = domContext.createElement("noscript"); + Element metaEle = domContext.createElement("meta"); + noScriptEle.appendChild(metaEle); + String href = outputNoScript.getHref(); + metaEle.setAttribute("content", "0;url=" + getResourceURL(facesContext,href)); + metaEle.setAttribute("http-equiv", "refresh"); + + domContext.setRootNode(noScriptEle); + } + domContext.stepOver(); + domContext.streamWrite(facesContext, uiComponent); + } catch (Exception e) { + log.error("Error in OutputNoScriptRenderer", e); + } + } + +} Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml =================================================================== — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml (revision 14627) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/extended-faces-config.xml (working copy) @@ -354,7 +354,10 @@ <!ENTITY outputDeclaration-component SYSTEM "custom/outputDeclaration-component.xml"> <!ENTITY outputDeclaration-renderer SYSTEM "custom/outputDeclaration-renderer.xml"> + + <!ENTITY outputnoscript-component SYSTEM "custom/outputnoscript-component.xml"> + <!ENTITY outputnoscript-renderer SYSTEM "custom/outputnoscript-renderer.xml"> + <!ENTITY outputstyle-component SYSTEM "custom/outputstyle-component.xml"> <!ENTITY outputstyle-renderer SYSTEM "custom/outputstyle-renderer.xml"> @@ -440,6 +443,7 @@ &selectinputtext-component; &panelSeries-component; &outputDeclaration-component; + &outputnoscript-component; &outputstyle-component; &panelPositioned-component; &rowselector-component; @@ -502,6 +506,7 @@ &selectinputtext-renderer; &panelSeries-renderer; &outputDeclaration-renderer; + &outputnoscript-renderer; &outputstyle-renderer; &panelPositioned-renderer; &rowselector-renderer; Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml =================================================================== — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml (revision 0) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-renderer.xml (revision 0) @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ Version: MPL 1.1/GPL 2.0/LGPL 2.1 + ~ + ~ "The contents of this file are subject to the Mozilla Public License + ~ Version 1.1 (the "License"); you may not use this file except in + ~ compliance with the License. You may obtain a copy of the License at + ~ http://www.mozilla.org/MPL/ + ~ + ~ Software distributed under the License is distributed on an "AS IS" + ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + ~ License for the specific language governing rights and limitations under + ~ the License. + ~ + ~ The Original Code is ICEfaces 1.5 open source software code, released + ~ November 5, 2006. The Initial Developer of the Original Code is ICEsoft + ~ Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C) + ~ 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved. + ~ + ~ Contributor(s): _____________________. + ~ + ~ Alternatively, the contents of this file may be used under the terms of + ~ the GNU Lesser General Public License Version 2.1 or later (the "LGPL" + ~ License), in which case the provisions of the LGPL License are + ~ applicable instead of those above. If you wish to allow use of your + ~ version of this file only under the terms of the LGPL License and not to + ~ allow others to use your version of this file under the MPL, indicate + ~ your decision by deleting the provisions above and replace them with + ~ the notice and other provisions required by the LGPL License. If you do + ~ not delete the provisions above, a recipient may use your version of + ~ this file under either the MPL or the LGPL License." + ~ + --> + +<renderer> + <description> + <![CDATA[ + + ]]> + </description> + <component-family>com.icesoft.faces.OutputNoScript</component-family> + <renderer-type>com.icesoft.faces.noscript.OutputNoScriptRenderer</renderer-type> + + <renderer-extension> + <instance-name>outputNoScript</instance-name> + <is-container>false</is-container> + <renders-children>false</renders-children> + <tag-name>outputNoScript</tag-name> + <taglib-prefix>@taglib-prefix@</taglib-prefix> + <taglib-uri>@taglib-uri@</taglib-uri> + </renderer-extension> +</renderer> Index: D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml =================================================================== — D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml (revision 0) +++ D:/Documents and Settings/pbreau/workspace/ICEfaces/component-metadata/src/main/resources/conf/custom/outputnoscript-component.xml (revision 0) @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ Version: MPL 1.1/GPL 2.0/LGPL 2.1 + ~ + ~ "The contents of this file are subject to the Mozilla Public License + ~ Version 1.1 (the "License"); you may not use this file except in + ~ compliance with the License. You may obtain a copy of the License at + ~ http://www.mozilla.org/MPL/ + ~ + ~ Software distributed under the License is distributed on an "AS IS" + ~ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the + ~ License for the specific language governing rights and limitations under + ~ the License. + ~ + ~ The Original Code is ICEfaces 1.5 open source software code, released + ~ November 5, 2006. The Initial Developer of the Original Code is ICEsoft + ~ Technologies Canada, Corp. Portions created by ICEsoft are Copyright (C) + ~ 2004-2006 ICEsoft Technologies Canada, Corp. All Rights Reserved. + ~ + ~ Contributor(s): _____________________. + ~ + ~ Alternatively, the contents of this file may be used under the terms of + ~ the GNU Lesser General Public License Version 2.1 or later (the "LGPL" + ~ License), in which case the provisions of the LGPL License are + ~ applicable instead of those above. If you wish to allow use of your + ~ version of this file only under the terms of the LGPL License and not to + ~ allow others to use your version of this file under the MPL, indicate + ~ your decision by deleting the provisions above and replace them with + ~ the notice and other provisions required by the LGPL License. If you do + ~ not delete the provisions above, a recipient may use your version of + ~ this file under either the MPL or the LGPL License." + ~ + --> + +<component> + <description> + <![CDATA[ + + + + ]]> + </description> + <display-name>Output NoScript</display-name> + <component-type>com.icesoft.faces.OutputNoScriptComp</component-type> + + &ice-cust-style-props; + <component-extension> + <base-component-type>com.sun.faces.Component</base-component-type> + <component-family>com.icesoft.faces.OutputNoScript</component-family> + <renderer-type> + com.icesoft.faces.noscript.OutputNoScriptRenderer + </renderer-type> + </component-extension> +</component>
          Hide
          Ken Fyten added a comment -

          Marking as Closed / Invalid as part of legacy ICEfaces ICE / Compat component JIRA cleanup.

          Note: This issue may be resolved in a newer ICEfaces release, available here: http://www.icesoft.org/java/downloads/icefaces-downloads.jsf

          If the issue persists with the current ICEfaces release, please create a new JIRA for it.

          Show
          Ken Fyten added a comment - Marking as Closed / Invalid as part of legacy ICEfaces ICE / Compat component JIRA cleanup. Note: This issue may be resolved in a newer ICEfaces release, available here: http://www.icesoft.org/java/downloads/icefaces-downloads.jsf If the issue persists with the current ICEfaces release, please create a new JIRA for it.

            People

            • Assignee:
              Unassigned
              Reporter:
              Philip Breau
            • Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: