myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r698804 - in /myfaces/trinidad/trunk_1.2.x/trinidad-sandbox: sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/ sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/ sandbox-demo/s...
Date Thu, 25 Sep 2008 03:14:46 GMT
Author: arobinson74
Date: Wed Sep 24 20:14:46 2008
New Revision: 698804

URL: http://svn.apache.org/viewvc?rev=698804&view=rev
Log:
TRINIDAD-664
Add PartialRendered to the 1.2 sandbox

Added:
    myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
  (with props)
    myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
  (with props)
    myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/components/partialRendered.jspx
Modified:
    myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/componentDemos.jspx

Added: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java?rev=698804&view=auto
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
(added)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
Wed Sep 24 20:14:46 2008
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+ * 
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.myfaces.trinidad.sandbox.component;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.trinidad.component.UIXComponentBase;
+import org.apache.myfaces.trinidad.context.RequestContext;
+import org.apache.myfaces.trinidad.util.ComponentUtils;
+
+public abstract class UIXPartialRenderedTemplate extends UIXComponentBase
+{
+/**/  public abstract String[] getPartialTriggers();
+/**/  public abstract String getFor();
+/**/  public abstract boolean isAlwaysRendered();
+
+  /**
+   * @see org.apache.myfaces.trinidad.component.UIXComponentBase#decode(
+   * javax.faces.context.FacesContext)
+   */
+  @Override
+  public void decode(FacesContext context)
+  {
+    UIComponent comp;
+    
+    String forVal = getFor();
+    if (forVal == null)
+    {
+      comp = getParent();
+    }
+    else
+    {
+      comp = ComponentUtils.findRelativeComponent(this, forVal);
+    }
+
+    if (comp != null)
+    {
+      RequestContext adfContext = RequestContext.getCurrentInstance();
+      if (adfContext != null)
+      {
+        if (isAlwaysRendered())
+        {
+          adfContext.addPartialTarget(comp);
+        }
+        else
+        {
+          String[] partialTriggers = getPartialTriggers();
+          if (partialTriggers != null)
+          {
+            adfContext.addPartialTriggerListeners(comp, partialTriggers);
+          }
+        }
+      }
+    }
+  }
+}

Propchange: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-api/src/main/java-templates/org/apache/myfaces/trinidad/sandbox/component/UIXPartialRenderedTemplate.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml?rev=698804&view=auto
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
(added)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
Wed Sep 24 20:14:46 2008
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  
+-->
+<faces-config
+  version="1.2"
+  xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:trs="http://myfaces.apache.org/trinidad/sandbox"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  xmlns:mfp="http://myfaces.apache.org/maven-faces-plugin"
+  xmlns:mafp="http://myfaces.apache.org/maven-trinidad-plugin"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml">
+  <component>
+    <description><![CDATA[Component that provides partialTriggers support for 
+    a non-Trinidad component. Also supports "always" rendering.]]></description>
+    <component-type>org.apache.myfaces.trinidad.sandbox.PartialRendered</component-type>
+    <component-class>
+      org.apache.myfaces.trinidad.sandbox.component.UIXPartialRendered
+    </component-class>
+    <property>
+      <description><![CDATA[mark the target component to always render during a
partial update.]]>
+      </description>
+      <property-name>alwaysRendered</property-name>
+      <property-class>boolean</property-class>
+    </property>
+    <property>
+      <description><![CDATA[the IDs of the components that should trigger a partial
update.
+        The component this component is for will listen on the trigger components. If one
of the
+        trigger components receives an event that will cause it to update
+        in some way, this component will request to be updated too.
+        Identifiers are relative to the source component, and must account for
+        NamingContainers.  If your component is already inside of a naming
+        container, you can use a single colon to start the search from the root,
+        or multiple colons to move up through the NamingContainers - "::" will
+        search from the parent naming container, ":::" will search
+        from the grandparent naming container, etc. ]]>
+      </description>
+      <property-name>partialTriggers</property-name>
+      <property-class>java.lang.String[]</property-class>
+      <property-extension>
+        <mfp:property-metadata>
+          <mfp:preferred>true</mfp:preferred>
+        </mfp:property-metadata>
+      </property-extension>
+    </property>
+    <property>
+      <description><![CDATA[the relative ID from this component to the component
+      that should be updated]]></description>
+      <property-name>for</property-name>
+      <property-class>java.lang.String</property-class>
+    </property>
+    <component-extension>
+      <mfp:component-family>org.apache.myfaces.trinidad.sandbox.PartialRendered</mfp:component-family>
+      <mfp:component-supertype>org.apache.myfaces.trinidad.ComponentBase</mfp:component-supertype>
+      <mfp:component-superclass>
+        org.apache.myfaces.trinidad.component.UIXComponentBase
+      </mfp:component-superclass>
+      <mfp:tag-name>trs:partialRendered</mfp:tag-name>
+      <mfp:tag-class>
+        org.apache.myfaces.trinidadinternal.sandbox.taglib.UIXPartialRenderedTag
+      </mfp:tag-class>
+      <mfp:long-description><![CDATA[<html><p>UIXPartialRendered is
a component that provides integration
+with the PPR functionality of Trinidad. It adds support of the partialTriggers functionality
for
+components that do not normally support it.</p>
+<p>This component can either be a child of the component to have support triggering
(it must be rendered)
+or have it's for attribute point to the component to support.</p></html>
+]]>
+      </mfp:long-description>
+      <mfp:author>Andrew Robinson</mfp:author>
+    </component-extension>
+  </component>
+</faces-config>
\ No newline at end of file

Propchange: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-build/src/main/resources/META-INF/maven-faces-plugin/components/trinidad/PartialRendered.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/componentDemos.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/componentDemos.jspx?rev=698804&r1=698803&r2=698804&view=diff
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/componentDemos.jspx
(original)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/componentDemos.jspx
Wed Sep 24 20:14:46 2008
@@ -39,6 +39,9 @@
           <tr:panelHeader text="Sandbox Component Demos">
             <tr:panelGroupLayout layout="vertical">
               <tr:goLink
+                text="partialRendered"
+                destination="components/partialRendered.jspx"/>
+              <tr:goLink
                 text="partialTrigger"
                 destination="components/partialTrigger.jspx"/>
               <tr:commandLink text="tableFormLayout" action="guide.tableFormLayout"/>

Added: myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/components/partialRendered.jspx
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/components/partialRendered.jspx?rev=698804&view=auto
==============================================================================
--- myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/components/partialRendered.jspx
(added)
+++ myfaces/trinidad/trunk_1.2.x/trinidad-sandbox/sandbox-demo/src/main/webapp/components/partialRendered.jspx
Wed Sep 24 20:14:46 2008
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+	   
+-->
+<jsp:root
+  xmlns:jsp="http://java.sun.com/JSP/Page"
+  version="2.0"
+  xmlns:f="http://java.sun.com/jsf/core"
+  xmlns:h="http://java.sun.com/jsf/html"
+  xmlns:trh="http://myfaces.apache.org/trinidad/html"
+  xmlns:tr="http://myfaces.apache.org/trinidad"
+  xmlns:trs="http://myfaces.apache.org/trinidad/sandbox">
+  <jsp:directive.page contentType="text/html;charset=utf-8" />
+  <f:view>
+    <tr:document title="Partial Rendered Demo">
+      <tr:form>
+        <tr:panelPage>
+          <f:facet name="navigationGlobal">
+            <tr:panelGroupLayout
+              layout="vertical">
+              <tr:commandLink immediate="true" text="Sandbox Component Guide"
+                action="guide"/>
+            </tr:panelGroupLayout>
+          </f:facet>
+
+          <tr:panelHeader
+            text="Partial Rendered Demo">
+            <tr:panelGroupLayout layout="vertical">
+              <tr:panelHeader text="Status Indicator">
+                <tr:statusIndicator />
+              </tr:panelHeader>
+              <tr:subform>
+                <tr:panelGroupLayout
+                  layout="vertical">
+                  <tr:group>
+                    <h:outputText
+                      id="partialRendered1"
+                      value="#{partialDemoUtil.status.linkUpdate}">
+                      <f:convertDateTime pattern="HH:mm:ss"/>
+                    </h:outputText>
+                    <trs:partialRendered
+                      for="partialRendered1"
+                      alwaysRendered="true" />
+                  </tr:group>
+                  <tr:group>
+                    <h:outputText
+                      id="partialRendered2"
+                      value="#{partialDemoUtil.status.linkUpdate}">
+                      <f:convertDateTime pattern="HH:mm:ss"/>
+                    </h:outputText>
+                    <trs:partialRendered
+                      for="partialRendered2"
+                      partialTriggers="partialRenderedTrigger2" />
+                  </tr:group>
+                  <tr:group>
+                    <h:outputText
+                      id="partialRendered3"
+                      value="#{partialDemoUtil.status.linkUpdate}">
+                      <f:convertDateTime pattern="HH:mm:ss"/>
+                      <trs:partialRendered
+                        partialTriggers="partialRenderedTrigger2" />
+                    </h:outputText>
+                  </tr:group>
+                  <tr:commandLink
+                    id="partialRenderedTrigger1"
+                    partialSubmit="true"
+                    text="No one listens to this link -- test always rendered"
+                    actionListener="#{partialDemoUtil.action}" />
+                  <tr:commandLink
+                    id="partialRenderedTrigger2"
+                    partialSubmit="true"
+                    text="Trigger"
+                    actionListener="#{partialDemoUtil.action}" />
+                </tr:panelGroupLayout>
+              </tr:subform>
+            </tr:panelGroupLayout>
+          </tr:panelHeader>
+        </tr:panelPage>
+      </tr:form>
+    </tr:document>
+  </f:view>
+</jsp:root>



Mime
View raw message