You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2014/02/06 02:32:07 UTC
svn commit: r1565034 [1/2] - in /myfaces/site/cms-site/trunk/content/wiki:
./ core/ core/committer-and-pmc-guide/
core/committer-and-pmc-guide/myfaces-project-management/ core/user-guide/
core/user-guide/configuration-of-special-features/ core/user-gui...
Author: lu4242
Date: Thu Feb 6 01:32:06 2014
New Revision: 1565034
URL: http://svn.apache.org/r1565034
Log:
port documentation from cwiki to apache cms
Added:
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext (with props)
Modified:
myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-developer-notes.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/deploying-project-website.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/voting-on-a-myfaces-project-release.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/new-committers.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/faq.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/elresolver-ordering.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/update-all-form-javax.faces.viewstate-hidden-fields-between-ajax-requests.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started/using-myfaces-in-a-project-built-with-maven.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/how-the-immediate-attribute-works.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/studying-how-myfaces-core-works.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/access-facescontext-from-servlet.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/accessing-one-managed-bean-from-another.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/clear-input-components.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/resulting-nested-facescontext.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components/create-a-non-namingcontainer-composite-component.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings/displaying-errors---infos---warnings-in-jsf-pages.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings/handling-server-errors.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/working-with-tables.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/working-with-tables/executing-methods-from-link-or-button-inside-a-table.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/working-with-tables/get-row-data-from-an-actionlistener.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/migration-guide.mdtext
myfaces/site/cms-site/trunk/content/wiki/core/user-guide/working-with-myfaces-core-integration-tests.mdtext
myfaces/site/cms-site/trunk/content/wiki/gsoc-and-myfaces.mdtext
myfaces/site/cms-site/trunk/content/wiki/index.mdtext
Modified: myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide.mdtext Thu Feb 6 01:32:06 2014
@@ -3,5 +3,6 @@ Title: MyFaces Committer and PMC Guide
<p>Here you can find information about how to work with MyFaces Core code,
and other administrative information of MyFaces project.</p>
-<ac:macro ac:name="children" />
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
Modified: myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-developer-notes.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-developer-notes.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-developer-notes.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-developer-notes.mdtext Thu Feb 6 01:32:06 2014
@@ -101,41 +101,37 @@ list.</li>
<h5>Copyright</h5>
<p>Every file should start with the following copyright notice:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-/*
- * 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.
- */
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ /*
+ * 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.
+ */
<h5>Class and Interface comment</h5>
<p>Every class and interface should have a javadoc similar to this:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-/**
- * Very detailed description goes here... ;-)
- *
- * @author Bug Rogers
- */
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ /**
+ * Very detailed description goes here... ;-)
+ *
+ * @author Bug Rogers
+ */
<h5>SVN Settings</h5>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/deploying-project-website.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/deploying-project-website.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/deploying-project-website.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/deploying-project-website.mdtext Thu Feb 6 01:32:06 2014
@@ -3,11 +3,9 @@ Title: Deploying project website
<p>MyFaces uses maven to deploy its website. To build and deploy a site for
a project just run.</p>
-<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
-mvn site
-mvn site:deploy
-]
-]></ac:plain-text-body></ac:macro>
+ :::bash
+ mvn site
+ mvn site:deploy
<p>The site is initially deployed to minotaur.apache.org (aka
people.apache.org). From there a periodic task transfers it to the main
@@ -34,9 +32,9 @@ submodule are placed into the target dir
result, none of the inter-module links work.</p>
<p>To test a multi-module site, use this instead:</p>
-<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
- mvn site:stage -DstagingDirectory=/tmp/stage
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ mvn site:stage -DstagingDirectory=/tmp/stage
+
<p>which will assemble a complete site from the partial pieces present in
the different modules.</p>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/voting-on-a-myfaces-project-release.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/voting-on-a-myfaces-project-release.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/voting-on-a-myfaces-project-release.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/myfaces-project-management/voting-on-a-myfaces-project-release.mdtext Thu Feb 6 01:32:06 2014
@@ -36,51 +36,46 @@ href="http://www.apache.org/dev/release-
linux.</h3>
<h4>verify checksums on released files.</h4>
-<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
-find . -name '*.md5' -exec cat {} \; -printf ' %f\n' | sed 's|\.md5$||' |
-md5sum -c
-find . -name '*.sha1' -exec cat {} \; -printf ' %f\n' | sed 's|\.sha1$||'
-| sha1sum -c
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ find . -name '*.md5' -exec cat {} \; -printf ' %f\n' | sed 's|\.md5$||' |
+ md5sum -c
+ find . -name '*.sha1' -exec cat {} \; -printf ' %f\n' | sed 's|\.sha1$||'
+ | sha1sum -c
<h4>Validate signatures on released files.</h4>
-<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
-wget http://www.apache.org/dist/myfaces/KEYS
-gpg --import KEYS
-find . -name '*.asc' -exec gpg --verify {} \;
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ wget http://www.apache.org/dist/myfaces/KEYS
+ gpg --import KEYS
+ find . -name '*.asc' -exec gpg --verify {} \;
<h4>Verify tar.gz and zip sources are identical</h4>
-<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
-mkdir src
-cd src
-tar xvf ../myfaces-core-assembly-2.0.15-src.tar.gz
-ls -l
-mv myfaces-core-2.0.15-src/ myfaces-core-2.0.15-src-tar-gz
-unzip ../myfaces-core-assembly-2.0.15-src.zip
-1. should be no output
-diff -rq myfaces-core-2.0.15-src*
-1. should be "are identical" output
-diff -srq myfaces-core-2.0.15-src*
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ mkdir src
+ cd src
+ tar xvf ../myfaces-core-assembly-2.0.15-src.tar.gz
+ ls -l
+ mv myfaces-core-2.0.15-src/ myfaces-core-2.0.15-src-tar-gz
+ unzip ../myfaces-core-assembly-2.0.15-src.zip
+ 1. should be no output
+ diff -rq myfaces-core-2.0.15-src*
+ 1. should be "are identical" output
+ diff -srq myfaces-core-2.0.15-src*
<h4>Verify that the release source code builds.</h4>
-<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
-cd myfaces-core-2.0.15-src/src
-find \( -name '*.jar' -o -name '*.zip' \) -exec unzip -n {} \;
-cd myfaces-core-module-2.0.15/
-mvn install
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ cd myfaces-core-2.0.15-src/src
+ find \( -name '*.jar' -o -name '*.zip' \) -exec unzip -n {} \;
+ cd myfaces-core-module-2.0.15/
+ mvn install
<h4>Verify that all source files have appropriate and compatible
licensing.</h4>
-<ac:macro ac:name="noformat"><ac:plain-text-body><![CDATA[
-mvn apache-rat:check
-1. To check for all errors, if more than one project is affected
-1. mvn -e -X apache-rat:check -Drat.numUnapprovedLicenses=9999
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::bash
+ mvn apache-rat:check
+ 1. To check for all errors, if more than one project is affected
+ 1. mvn -e -X apache-rat:check -Drat.numUnapprovedLicenses=9999
Modified: myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/new-committers.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/new-committers.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/new-committers.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/committer-and-pmc-guide/new-committers.mdtext Thu Feb 6 01:32:06 2014
@@ -8,53 +8,51 @@ you to get up and started.</p>
<p>Once the Apache Software foundation has granted you committer status,
you should have gotten a mail similar to following message:</p>
-<ac:macro ac:name="code"><ac:plain-text-body><![CDATA[
-Dear Max Committer,
+ :::plain
+ Dear Max Committer,
-We're glad to tell you that your account has been created and is now
-available for use. Your login details are:
+ We're glad to tell you that your account has been created and is now
+ available for use. Your login details are:
- username: maxcom
- password: reuhgw342434
+ username: maxcom
+ password: reuhgw342434
-This will grant you access to cvs.apache.org.
+ This will grant you access to cvs.apache.org.
-Obviously, we'd request that you change the password as soon as you
-login the first time! Even better would be to change your password and
-then upload your SSH keys to the server so that you then won't need a
-password at all.
+ Obviously, we'd request that you change the password as soon as you
+ login the first time! Even better would be to change your password and
+ then upload your SSH keys to the server so that you then won't need a
+ password at all.
-Please note that until the Project Management Committee responsible
-for the project to which you were given group membership actually grants
-you access to the relevant source code modules, you won't be able to
-commit anything. If you have problems committing, you need to email
-pmc@myfaces.apache.org.
+ Please note that until the Project Management Committee responsible
+ for the project to which you were given group membership actually grants
+ you access to the relevant source code modules, you won't be able to
+ commit anything. If you have problems committing, you need to email
+ pmc@myfaces.apache.org.
-The ASF is a large community spread over a number of different
-technologies and programming languages, with access to a number of
-servers. The project that has requested your account is part of
-the ASF and your account is managed by the ASF infrastructure team.
-In the unlikely case of problems please send an email to
-infrastructure@apache.org outlining your problem.
+ The ASF is a large community spread over a number of different
+ technologies and programming languages, with access to a number of
+ servers. The project that has requested your account is part of
+ the ASF and your account is managed by the ASF infrastructure team.
+ In the unlikely case of problems please send an email to
+ infrastructure@apache.org outlining your problem.
-More information on the ASF can be found at <http://www.apache.org/>
-and information of interest to developers can be found at
-<http://www.apache.org/dev/>.
+ More information on the ASF can be found at <http://www.apache.org/>
+ and information of interest to developers can be found at
+ <http://www.apache.org/dev/>.
-There exist several ASF wide mailing lists that may be of interest to
-you, in particular community@apache.org which is aimed at improving
-relations between the various projects and people within the ASF.
+ There exist several ASF wide mailing lists that may be of interest to
+ you, in particular community@apache.org which is aimed at improving
+ relations between the various projects and people within the ASF.
-Should you have any questions of a more general nature then please
-direct them initially to your project.
+ Should you have any questions of a more general nature then please
+ direct them initially to your project.
-We hope your time spent as a committer will be enjoyable,
+ We hope your time spent as a committer will be enjoyable,
-The Apache Software Foundation
-]
-]></ac:plain-text-body></ac:macro>
+ The Apache Software Foundation
<p>This means that you have access to the apache infrastructure and to the
apache SVN and ssh servers. You now can login<br />
Modified: myfaces/site/cms-site/trunk/content/wiki/core/faq.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/faq.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/faq.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/faq.mdtext Thu Feb 6 01:32:06 2014
@@ -387,23 +387,19 @@ is a member of type DataModel then just
<p>If you want to serialize the list within the !DataModel along with the
managed bean, then do this:</p>
-<ac:macro ac:name="code"><ac:parameter
-ac:name="borderStyle">solid</ac:parameter><ac:parameter
-ac:name="title">SomeManagedBean.java</ac:parameter><ac:plain-text-body><![CDATA[
-public class SomeManagedBean implements Serializable {
- private List myData;
-
- private transient DataModel myDataModel;
-
- public DataModel getDataModel() {
- if (myDataModel == null) {
- myDataModel = new ListDataModel(myData);
+ :::java SomeManagedBean.java
+ public class SomeManagedBean implements Serializable {
+ private List myData;
+
+ private transient DataModel myDataModel;
+
+ public DataModel getDataModel() {
+ if (myDataModel == null) {
+ myDataModel = new ListDataModel(myData);
+ }
+ return myDataModel;
+ }
}
- return myDataModel;
- }
-}
-]
-]></ac:plain-text-body></ac:macro>
<h3>Why are my dates displaying the wrong day/time?</h3>
@@ -417,19 +413,13 @@ timezone of the server.</p>
<p>You can control the timezone used by the conversion by attaching an
explicit converter:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<f:convertDateTime timeZone="Antarctica/South_Pole" .../>
-]
-]></ac:plain-text-body></ac:macro>
<p>or</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<f:convertDateTime timeZone="#{bean.timeZone}" .../>
-]
-]></ac:plain-text-body></ac:macro>
<p>where #{bean.timeZone} returns either a string id, or a TimeZone
instance.</p>
@@ -439,11 +429,8 @@ commons converters project</a> contains
like f:convertDateTime, but defaults to using the timezone of the
server:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<mcc:convertDateTime/>
-]
-]></ac:plain-text-body></ac:macro>
<p>Alternatively you register your own converter to override the standard
converter, causing your custom code to be applied by default to all
@@ -466,15 +453,10 @@ component. This is fine when the referen
than the one it refers to. But when the components are in the wrong order,
an error is reported.</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-
- <t:dataScroller for="someTable" .../>
-
- <t:dataTable id="someTable" .../>
+ :::xml
+ <t:dataScroller for="someTable" .../>
-]
-]></ac:plain-text-body></ac:macro>
+ <t:dataTable id="someTable" .../>
<p>When using JSP, creating and rendering of components is done in a single
pass through the JSP page. This means that when the dataScroller is
@@ -487,14 +469,11 @@ attribute or similar mechanism will have
that "renders its children". Such components cause their nested
components to be processed in two passes (create then render):</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <h:panelGroup>
- <t:dataScroller for="someTable" .../>
- <t:dataTable id="someTable" .../>
- </h:panelGroup>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <h:panelGroup>
+ <t:dataScroller for="someTable" .../>
+ <t:dataTable id="someTable" .../>
+ </h:panelGroup>
<p>This does have a few minor drawbacks. In JSF 1.1, components that render
their children interact badly with nested "template text" and
@@ -523,18 +502,14 @@ setInitialized(boolean state)"</li>
<li>defining this as the last managed property for the bean:</li>
</ul>
-
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <managed-bean>
- ....
- <managed-property>
- <property-name>initialized</property-name>
- <value>true</value>
- </managed-property>
- </managed-bean>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <managed-bean>
+ ....
+ <managed-property>
+ <property-name>initialized</property-name>
+ <value>true</value>
+ </managed-property>
+ </managed-bean>
<p>The JSF spec requires that managed properties are initialised in the
order they are declared, so the setInitialized method will be called only
@@ -557,14 +532,11 @@ rel="nofollow">https://javaserverfaces-s
load /WEB-INF/faces-config.xml at startup. There is consequently no need
for the following context parameter:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config.xml</param-value>
-</context-param>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
<p>Putting this context parameter in your deployment descriptor will force
any JSF implementation to load the configuration twice, therefore
@@ -582,16 +554,13 @@ are on a dataTable, and the value attri
request scoped data source, the action source just isn't rendered on a
subsequent request.</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<h:dataTable value="#{requestScopedBean.dataModel.wrappedData}" />
- <h:column>
- <h:commandLink value="click here"
-action="#{backingBean.willNotFire}" />
- </h:column>
-</h:dataTable>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <h:dataTable value="#{requestScopedBean.dataModel.wrappedData}" />
+ <h:column>
+ <h:commandLink value="click here"
+ action="#{backingBean.willNotFire}" />
+ </h:column>
+ </h:dataTable>
<p>The action source ( h:commandLink, h:commandButton ), is not rendered
because the data source does not exist during a subsequent request ( it was
@@ -600,11 +569,8 @@ garbage collected after the first respon
<p>To solve this problem, use t:saveState or put the request scoped backing
bean in session scope.</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<t:saveState value="#{myRequestScopedBean.dataModel.wrappedData}" />
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <t:saveState value="#{myRequestScopedBean.dataModel.wrappedData}" />
<p>t:saveState is preffered over a session scoped solution.</p>
@@ -789,12 +755,9 @@ components. Although the behavior was ni
supposed to convert the values from the UISelectItems. For example, in
1.1.4 this would have worked:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<f:selectOneMenu value="#{bean.intValue}"><f:selectItem itemValue="1"
-/></selectOneMenu>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <h:selectOneMenu value="#{bean.intValue}"><f:selectItem itemValue="1"/>
+ </h:selectOneMenu>
<p>The reason this used to work is that the code in the past used the
converter on the select one menu component to convert the value from the
@@ -808,107 +771,103 @@ itemValue must be an integer value, not
component that converts the value using the converter from the input
control. Here is the code:</p>
-<ac:macro ac:name="code"><ac:parameter
-ac:name="borderStyle">solid</ac:parameter><ac:parameter
-ac:name="title">UISelectItem.java</ac:parameter><ac:plain-text-body><![CDATA[
-public class UISelectItem
- extends javax.faces.component.UISelectItem
-{
- public final static String COMPONENT_TYPE =
-"org.apache.myfaces.wiki.SelectItem";
- private Boolean convertValue;
-
- /**
- * @return the convertValue
- */
- public boolean getConvertValue()
- {
- if (this.convertValue != null) return this.convertValue;
- ValueBinding vb = getValueBinding("convertValue");
- return (vb == null) ? true : (Boolean) vb.getValue(getFacesContext());
- }
-
- /**
- * @param convertValue the convertValue to set
- */
- public void setConvertValue(boolean convertValue)
- {
- this.convertValue = convertValue;
- }
-
- /**
- * @see javax.faces.component.UISelectItem#getItemValue()
- */
- @Override
- public Object getItemValue()
- {
- Object value = super.getItemValue();
-
- if (getConvertValue())
+ :::java UISelectItem.java
+ public class UISelectItem
+ extends javax.faces.component.UISelectItem
{
- UIInput parent = null;
- for (UIComponent comp = getParent(); comp != null; comp =
-comp.getParent())
+ public final static String COMPONENT_TYPE =
+ "org.apache.myfaces.wiki.SelectItem";
+ private Boolean convertValue;
+
+ /**
+ * @return the convertValue
+ */
+ public boolean getConvertValue()
{
- if (comp instanceof UIInput)
- {
- parent = (UIInput)comp;
- break;
- }
+ if (this.convertValue != null) return this.convertValue;
+ ValueBinding vb = getValueBinding("convertValue");
+ return (vb == null) ? true : (Boolean) vb.getValue(getFacesContext());
}
- if (parent != null)
- value = getConvertedValue(getFacesContext(), parent, value);
- }
- return value;
- }
- /**
- * @see
-javax.faces.component.UISelectItem#saveState(javax.faces.context.FacesContext)
- */
- @Override
- public Object saveState(FacesContext context)
- {
- return new Object[](.html)
- {
- super.saveState(context), convertValue, };
- }
-
- /**
- * @see
-javax.faces.component.UISelectItem#restoreState(javax.faces.context.FacesContext,
-java.lang.Object)
- */
- @Override
- public void restoreState(FacesContext context, Object state)
- {
- Object[](.html)
- arr = (Object[]) state;
- int index = -1;
- super.restoreState(context, arr[++index](++index.html)
-);
- this.convertValue = (Boolean) arr[++index](++index.html)
-;
- }
-
- private Object getConvertedValue(FacesContext context, UIInput input,
-Object value)
- throws ConverterException
- {
- Renderer renderer = getRenderer(context);
- if (renderer != null)
- return renderer.getConvertedValue(context, this, value);
- else if (value instanceof String)
- {
- Converter converter = RendererUtils.findUIOutputConverter(
- context, input);
- if (converter != null)
- return converter.getAsObject(context, this, (String)value);
+ /**
+ * @param convertValue the convertValue to set
+ */
+ public void setConvertValue(boolean convertValue)
+ {
+ this.convertValue = convertValue;
+ }
+
+ /**
+ * @see javax.faces.component.UISelectItem#getItemValue()
+ */
+ @Override
+ public Object getItemValue()
+ {
+ Object value = super.getItemValue();
+
+ if (getConvertValue())
+ {
+ UIInput parent = null;
+ for (UIComponent comp = getParent(); comp != null; comp =
+ comp.getParent())
+ {
+ if (comp instanceof UIInput)
+ {
+ parent = (UIInput)comp;
+ break;
+ }
+ }
+ if (parent != null)
+ value = getConvertedValue(getFacesContext(), parent, value);
+ }
+ return value;
+ }
+
+ /**
+ * @see
+ javax.faces.component.UISelectItem#saveState(javax.faces.context.FacesContext)
+ */
+ @Override
+ public Object saveState(FacesContext context)
+ {
+ return new Object[](.html)
+ {
+ super.saveState(context), convertValue, };
+ }
+
+ /**
+ * @see
+ javax.faces.component.UISelectItem#restoreState(javax.faces.context.FacesContext,
+ java.lang.Object)
+ */
+ @Override
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object[](.html)
+ arr = (Object[]) state;
+ int index = -1;
+ super.restoreState(context, arr[++index](++index.html)
+ );
+ this.convertValue = (Boolean) arr[++index](++index.html)
+ ;
+ }
+
+ private Object getConvertedValue(FacesContext context, UIInput input,
+ Object value)
+ throws ConverterException
+ {
+ Renderer renderer = getRenderer(context);
+ if (renderer != null)
+ return renderer.getConvertedValue(context, this, value);
+ else if (value instanceof String)
+ {
+ Converter converter = RendererUtils.findUIOutputConverter(
+ context, input);
+ if (converter != null)
+ return converter.getAsObject(context, this, (String)value);
+ }
+ return value;
+ }
}
- return value;
- }
-}
-]
-]></ac:plain-text-body></ac:macro>
<p>Then just register this new component in the standard JSF way.</p>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide.mdtext Thu Feb 6 01:32:06 2014
@@ -42,5 +42,7 @@ the well-known Struts framework, but has
<p>Here you can find additional information about how to setup and work
with MyFaces Core JSF implementation.</p>
-<ac:macro ac:name="children" />
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
+
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features.mdtext Thu Feb 6 01:32:06 2014
@@ -3,8 +3,8 @@ Title: Configuration of special features
<p>Here you can find additional information about how to configure special
features available on MyFaces core project.</p>
-<ac:macro ac:name="children"><ac:parameter
-ac:name="all">true</ac:parameter></ac:macro>
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
<p>Remember you can find an updated and documented list of web config
params on these links:</p>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/elresolver-ordering.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/elresolver-ordering.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/elresolver-ordering.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/elresolver-ordering.mdtext Thu Feb 6 01:32:06 2014
@@ -36,14 +36,11 @@ will be applied to the List of ELResolve
<p>To install the comparator you simply have to set a web.xml config
parameter:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<context-param>
- <param-name>org.apache.myfaces.EL_RESOLVER_COMPARATOR</param-name>
- <param-value>com.acme.el.MyELResolverComparator</param-value>
-</context-param>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <context-param>
+ <param-name>org.apache.myfaces.EL_RESOLVER_COMPARATOR</param-name>
+ <param-value>com.acme.el.MyELResolverComparator</param-value>
+ </context-param>
<h3>Default implementations shipping with MyFaces core</h3>
@@ -68,15 +65,11 @@ ac:name="code"><ac:default-parameter>xml
<p>To optimize the marriage of MyFaces and OpenWebBeans, you simply have to
set the following config parameter:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<context-param>
- <param-name>org.apache.myfaces.EL_RESOLVER_COMPARATOR</param-name>
-
-<param-value>org.apache.myfaces.el.unified.OpenWebBeansELResolverComparator</param-value>
-</context-param>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <context-param>
+ <param-name>org.apache.myfaces.EL_RESOLVER_COMPARATOR</param-name>
+ <param-value>org.apache.myfaces.el.unified.OpenWebBeansELResolverComparator</param-value>
+ </context-param>
<p>This moves the WebBeansELResolver almost to the last place in the
ELResolver chain, thus improving the overall performance of ELExpression
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/update-all-form-javax.faces.viewstate-hidden-fields-between-ajax-requests.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/update-all-form-javax.faces.viewstate-hidden-fields-between-ajax-requests.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/update-all-form-javax.faces.viewstate-hidden-fields-between-ajax-requests.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/configuration-of-special-features/update-all-form-javax.faces.viewstate-hidden-fields-between-ajax-requests.mdtext Thu Feb 6 01:32:06 2014
@@ -2,22 +2,19 @@ Title: Update all form javax.faces.ViewS
<p>Suppose the following example:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<!-- ... -->
-<h:form id="form1">
+ :::xml
<!-- ... -->
- <h:commandButton value="Partial">
- <f:ajax execute="@this" render="@this" />
- </h:commandButton>
-</h:fom>
-<!-- ... -->
-<h:form id="form2">
+ <h:form id="form1">
+ <!-- ... -->
+ <h:commandButton value="Partial">
+ <f:ajax execute="@this" render="@this" />
+ </h:commandButton>
+ </h:fom>
<!-- ... -->
- <h:commandButton value="Normal Submit" />
-</h:form>
-]
-]></ac:plain-text-body></ac:macro>
+ <h:form id="form2">
+ <!-- ... -->
+ <h:commandButton value="Normal Submit" />
+ </h:form>
<p>Note each form has its own javax.faces.ViewState hidden field. When a
partial ajax request is triggered, the hidden field of "form1" is
@@ -46,17 +43,14 @@ form</li>
<p>In MyFaces Core there is a fix for this one. Just try add this after
your jsf.js include</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <script type="text/javascript">
+ :::xml
+ <script type="text/javascript">
//fixup for an issue of the jsf2.0 and 2.1 ajax spec to deal with
-multiple forms per page
+ multiple forms per page
window.myfaces = window.myfaces || {};
myfaces.config = myfaces.config || {};
myfaces.config.no_portlet_env = true;
- </script>
-]
-]></ac:plain-text-body></ac:macro>
+ </script>
<p>This enable and special mode that find and update javax.faces.ViewState
per ajax request, solving the problem.</p>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started.mdtext Thu Feb 6 01:32:06 2014
@@ -26,5 +26,6 @@ Started in 30 Minutes</a></li>
<h3>Contents</h3>
-<ac:macro ac:name="children" />
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started/using-myfaces-in-a-project-built-with-maven.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started/using-myfaces-in-a-project-built-with-maven.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started/using-myfaces-in-a-project-built-with-maven.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/getting-started/using-myfaces-in-a-project-built-with-maven.mdtext Thu Feb 6 01:32:06 2014
@@ -17,27 +17,24 @@ included.</li>
</ul>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <dependencies>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-api</artifactId>
- <version>1.1.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.core</groupId>
- <artifactId>myfaces-impl</artifactId>
- <version>1.1.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.myfaces.tomahawk</groupId>
- <artifactId>tomahawk</artifactId>
- <version>1.1.4</version>
- </dependency>
- </dependencies>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk</artifactId>
+ <version>1.1.4</version>
+ </dependency>
+ </dependencies>
<h3>Using SNAPSHOT versions</h3>
@@ -45,22 +42,18 @@ ac:name="code"><ac:default-parameter>xml
edge that is not yet an official release, then add the following repository
to your project's pom or your settings.xml file.</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<repository>
- <releases>
- <enabled>false</enabled>
- </releases>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>apache.snapshots</id>
- <name>Apache Snapshot Repository</name>
-
-<url>https://repository.apache.org/content/repositories/snapshots</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <id>apache.snapshots</id>
+ <name>Apache Snapshot Repository</name>
+ <url>https://repository.apache.org/content/repositories/snapshots</url>
</repository>
-]
-]></ac:plain-text-body></ac:macro>
<h3>Some useful Maven commands </h3>
<ul>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts.mdtext Thu Feb 6 01:32:06 2014
@@ -3,5 +3,6 @@ Title: JSF and MyFaces Core Concepts
<p>Below you can find some useful concepts in JSF and MyFaces that are
important to understand.</p>
-<ac:macro ac:name="children" />
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/how-the-immediate-attribute-works.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/how-the-immediate-attribute-works.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/how-the-immediate-attribute-works.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/how-the-immediate-attribute-works.mdtext Thu Feb 6 01:32:06 2014
@@ -214,12 +214,12 @@ In the page:
In the bean:
:::java
- public boolean isCancelling() {
- // assumes cancelButton is a component binding
- FacesContext fc = FacesContext.getCurrentInstance();
- Map reqParams = fc.getExternalContext().getRequestParameterMap();
- return reqParams.containsKey(cancelButton.getClientId());
- }
+ public boolean isCancelling() {
+ // assumes cancelButton is a component binding
+ FacesContext fc = FacesContext.getCurrentInstance();
+ Map reqParams = fc.getExternalContext().getRequestParameterMap();
+ return reqParams.containsKey(cancelButton.getClientId());
+ }
<h4>Solution 4</h4>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/studying-how-myfaces-core-works.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/studying-how-myfaces-core-works.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/studying-how-myfaces-core-works.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-core-concepts/studying-how-myfaces-core-works.mdtext Thu Feb 6 01:32:06 2014
@@ -94,18 +94,16 @@ specific renderkit via:</li>
</ul>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <render-kit>
+ :::xml
+ <render-kit>
<render-kit-id>some-id</render-kit-id>
<renderer>
- <component-family>javax.faces.Input</component-family>
- <renderer-type>org.apache.myfaces.InputSuggest</renderer-type>
-
-<renderer-class>org.apache.myfaces.custom.suggest.InputSuggestRenderer</renderer-class>
+ <component-family>javax.faces.Input</component-family>
+ <renderer-type>org.apache.myfaces.InputSuggest</renderer-type>
+ <renderer-class>org.apache.myfaces.custom.suggest.InputSuggestRenderer</renderer-class>
</renderer>
-]
-]></ac:plain-text-body></ac:macro>
+ <!-- ... -->
+ </render-kit>
<h5>javax.faces.webapp.UIComponentTag:</h5>
<ul>
@@ -128,12 +126,9 @@ entries to this via:</li>
</ul>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<component-type>...
<component-class>...
-]
-]></ac:plain-text-body></ac:macro>
<ul>
<li>The other methods of this class are worth studying for more
Added: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext?rev=1565034&view=auto
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext (added)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext Thu Feb 6 01:32:06 2014
@@ -0,0 +1,7 @@
+Title: JSF and MyFaces Howtos
+
+Below you can find solutions to common problems in JSF and MyFaces
+
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
+
Propchange: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos.mdtext
------------------------------------------------------------------------------
svn:eol-style = native
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend.mdtext Thu Feb 6 01:32:06 2014
@@ -1,5 +1,4 @@
Title: Backend
-<ac:macro ac:name="children"><ac:parameter
-ac:name="all">true</ac:parameter></ac:macro>
-
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/access-facescontext-from-servlet.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/access-facescontext-from-servlet.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/access-facescontext-from-servlet.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/access-facescontext-from-servlet.mdtext Thu Feb 6 01:32:06 2014
@@ -32,91 +32,87 @@ JSF apps. In particular we use this appr
JFreeChart images and generate PDFs on the fly using iText. The same code
is also used in a filter to manage sessions.</p>
-<ac:macro ac:name="code"><ac:parameter
-ac:name="title">AbstractFacesServlet.java</ac:parameter><ac:plain-text-body><![CDATA[
-public abstract class AbstractFacesServlet extends HttpServlet {
-
- public AbstractFacesServlet() {
- super();
- }
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
- }
- protected abstract void processRequest(HttpServletRequest request,
-HttpServletResponse response) throws ServletException, IOException;
-
- /** Handles the HTTP <code>GET</code> method.
- * @param request servlet request
- * @param response servlet response
- */
- protected void doGet(HttpServletRequest request, HttpServletResponse
-response) throws ServletException, IOException {
- processRequest(request, response);
- }
- protected void log(FacesContext facesContext, String message) {
- facesContext.getExternalContext().log(message);
- }
- /** Handles the HTTP <code>POST</code> method.
- * @param request servlet request
- * @param response servlet response
- */
- protected void doPost(HttpServletRequest request, HttpServletResponse
-response) throws ServletException, IOException {
- processRequest(request, response);
- }
- protected FacesContext getFacesContext(HttpServletRequest request,
-HttpServletResponse response) {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (facesContext == null) {
-
- FacesContextFactory contextFactory =
-(FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
- LifecycleFactory lifecycleFactory =
-(LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
- Lifecycle lifecycle =
-lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
-
- facesContext =
-contextFactory.getFacesContext(request.getSession().getServletContext(),
-request, response, lifecycle);
-
- // Set using our inner class
-
-InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
-
- // set a new viewRoot, otherwise context.getViewRoot returns
-null
- UIViewRoot view =
-facesContext.getApplication().getViewHandler().createView(facesContext,
-"");
- facesContext.setViewRoot(view);
- }
- return facesContext;
- }
- public void removeFacesContext() {
- InnerFacesContext.setFacesContextAsCurrentInstance(null);
- }
- protected Application getApplication(FacesContext facesContext) {
- return facesContext.getApplication();
- }
- protected Object getManagedBean(String beanName, FacesContext
-facesContext) {
- return
-getApplication(facesContext).getVariableResolver().resolveVariable(facesContext,
-beanName);
+AbstractFacesServlet.java
+
+ :::java
+ public abstract class AbstractFacesServlet extends HttpServlet {
+
+ public AbstractFacesServlet() {
+ super();
+ }
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ }
+ protected abstract void processRequest(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException;
+
+ /** Handles the HTTP <code>GET</code> method.
+ * @param request servlet request
+ * @param response servlet response
+ */
+ protected void doGet(HttpServletRequest request, HttpServletResponse
+ response) throws ServletException, IOException {
+ processRequest(request, response);
+ }
+ protected void log(FacesContext facesContext, String message) {
+ facesContext.getExternalContext().log(message);
+ }
+ /** Handles the HTTP <code>POST</code> method.
+ * @param request servlet request
+ * @param response servlet response
+ */
+ protected void doPost(HttpServletRequest request, HttpServletResponse
+ response) throws ServletException, IOException {
+ processRequest(request, response);
+ }
+ protected FacesContext getFacesContext(HttpServletRequest request,
+ HttpServletResponse response) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ if (facesContext == null) {
+
+ FacesContextFactory contextFactory =
+ (FacesContextFactory)FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ LifecycleFactory lifecycleFactory =
+ (LifecycleFactory)FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ Lifecycle lifecycle =
+ lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
+
+ facesContext =
+ contextFactory.getFacesContext(request.getSession().getServletContext(),
+ request, response, lifecycle);
+
+ // Set using our inner class
+
+ InnerFacesContext.setFacesContextAsCurrentInstance(facesContext);
+
+ // set a new viewRoot, otherwise context.getViewRoot returns null
+ UIViewRoot view =
+ facesContext.getApplication().getViewHandler().createView(facesContext, "");
+ facesContext.setViewRoot(view);
+ }
+ return facesContext;
+ }
+ public void removeFacesContext() {
+ InnerFacesContext.setFacesContextAsCurrentInstance(null);
+ }
+ protected Application getApplication(FacesContext facesContext) {
+ return facesContext.getApplication();
+ }
+ protected Object getManagedBean(String beanName, FacesContext
+ facesContext) {
+ return
+ getApplication(facesContext).getVariableResolver().resolveVariable(facesContext,
+ beanName);
+ }
+ // You need an inner class to be able to call FacesContext.setCurrentInstance
+ // since it's a protected method
+ private abstract static class InnerFacesContext extends FacesContext {
+ protected static void setFacesContextAsCurrentInstance(FacesContext
+ facesContext) {
+ FacesContext.setCurrentInstance(facesContext);
+ }
+ }
}
- // You need an inner class to be able to call
-FacesContext.setCurrentInstance
- // since it's a protected method
- private abstract static class InnerFacesContext extends FacesContext {
- protected static void setFacesContextAsCurrentInstance(FacesContext
-facesContext) {
- FacesContext.setCurrentInstance(facesContext);
- }
- }
-}
-]
-]></ac:plain-text-body></ac:macro>
<p>This is simple to use and extend and, as I stated earlier, has been
handed around several lists. We provide convienience methods for access to
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/accessing-one-managed-bean-from-another.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/accessing-one-managed-bean-from-another.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/accessing-one-managed-bean-from-another.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/accessing-one-managed-bean-from-another.mdtext Thu Feb 6 01:32:06 2014
@@ -12,33 +12,29 @@ in the same webapp:</p>
<p>In your managed bean add a @ManagedProperty annotation to the related
property and don't forget to add getter and setter methods. </p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-
-@ManagedBean(name="usingBean")
-@RequestScoped
-public class UsingBean
-{
-
- @ManagedProperty(value="#{neededBean}")
- private NeededBean neededBean;
-
- public NeededBean getNeededBean()
+ :::java
+ @ManagedBean(name="usingBean")
+ @RequestScoped
+ public class UsingBean
{
- return neededBean;
- }
- public void setNeededBean(NeededBean neededBean)
- {
- this.neededBean = neededBean;
- }
+ @ManagedProperty(value="#{neededBean}")
+ private NeededBean neededBean;
- // ....
+ public NeededBean getNeededBean()
+ {
+ return neededBean;
+ }
+
+ public void setNeededBean(NeededBean neededBean)
+ {
+ this.neededBean = neededBean;
+ }
+ // ....
-}
-]
-]></ac:plain-text-body></ac:macro>
+
+ }
<h4>Binding through faces-config.xml</h4>
@@ -46,25 +42,22 @@ public class UsingBean
beans, a managed bean property can be declared as initialised with a
reference to another managed bean:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
- <managed-bean>
- <managed-bean-name>neededBean</managed-bean-name>
- <managed-bean-class>fqn.to.NeededBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- </managed-bean>
-
- <managed-bean>
- <managed-bean-name>usingBean</managed-bean-name>
- <managed-bean-class>fqn.to.UsingBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property>
- <property-name>neededBean</property-name>
- <value>#{neededBean}</value>
- </managed-property>
- </managed-bean>
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <managed-bean>
+ <managed-bean-name>neededBean</managed-bean-name>
+ <managed-bean-class>fqn.to.NeededBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>usingBean</managed-bean-name>
+ <managed-bean-class>fqn.to.UsingBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>neededBean</property-name>
+ <value>#{neededBean}</value>
+ </managed-property>
+ </managed-bean>
<p>The constraints are that:</p>
<ul>
@@ -80,30 +73,26 @@ the needed bean as a parameter</li>
<p>The following java code can be used in MyFaces 1.1 to explicitly look up
an arbitrary managed bean by name:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-FacesContext facesContext = FacesContext.getCurrentInstance();
-NeededBean neededBean
- = (NeededBean) facesContext.getApplication()
- .getVariableResolver().resolveVariable(facesContext, "neededBean");
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ NeededBean neededBean
+ = (NeededBean) facesContext.getApplication()
+ .getVariableResolver().resolveVariable(facesContext, "neededBean");
+
<p>In MyFaces 1.2, that code is deprecated, and preffered version is:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-ELContext elContext = FacesContext.getCurrentInstance().getELContext();
-NeededBean neededBean
- = (NeededBean) FacesContext.getCurrentInstance().getApplication()
- .getELResolver().getValue(elContext, null, "neededBean");
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ ELContext elContext = FacesContext.getCurrentInstance().getELContext();
+ NeededBean neededBean
+ = (NeededBean) FacesContext.getCurrentInstance().getApplication()
+ .getELResolver().getValue(elContext, null, "neededBean");
+
<p>Alternately, you can use this code to evaluate any JSF EL
expression.</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
-FacesContext facesContext = FacesContext.getCurrentInstance();
-NeededBean neededBean
- = (NeededBean)facesContext.getApplication()
- .createValueBinding("#{neededBean}").getValue(facesContext);
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ NeededBean neededBean
+ = (NeededBean)facesContext.getApplication()
+ .createValueBinding("#{neededBean}").getValue(facesContext);
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/clear-input-components.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/clear-input-components.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/clear-input-components.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/clear-input-components.mdtext Thu Feb 6 01:32:06 2014
@@ -43,19 +43,18 @@ backing bean.</p>
<h2>Force a new View</h2>
<p>Call this method from the action method of the immediate command
component:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
- public void refresh() {
- FacesContext context = FacesContext.getCurrentInstance();
- Application application = context.getApplication();
- ViewHandler viewHandler = application.getViewHandler();
- UIViewRoot viewRoot = viewHandler.createView(context, context
- .getViewRoot().getViewId());
- context.setViewRoot(viewRoot);
- context.renderResponse(); //Optional
- }
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ public void refresh() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ Application application = context.getApplication();
+ ViewHandler viewHandler = application.getViewHandler();
+ UIViewRoot viewRoot = viewHandler.createView(context, context
+ .getViewRoot().getViewId());
+ context.setViewRoot(viewRoot);
+ context.renderResponse(); //Optional
+ }
+
<p>This causes the current View tree to be discarded and a fresh one
created. The new components of course then have no submitted values,<br />
and so fetch their displayed values via their value-bindings.</p>
@@ -80,11 +79,10 @@ other life-cycle phases.</p>
<h2>Delete Components Holding Unwanted State</h2>
<p>Find the parent component of the problem inputs, and call </p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
- parentComponent.getChildren().clear();
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ parentComponent.getChildren().clear();
+
<p>During the render phase, new instances of these child components will
then be created, while other components will not be affected.</p>
@@ -103,15 +101,13 @@ component by id, or other similar soluti
<p>For each component that you want to reset, specify a binding attribute
so that the backing bean can access them. From the immediate component's
action method, call:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
- component.setSubmittedValue(null);
- // The following is only needed for immediate input components
- // but it won't do any harm in other situations..
- component.setValue(null);
- component.setLocalValueSet(false);
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ component.setSubmittedValue(null);
+ // The following is only needed for immediate input components
+ // but it won't do any harm in other situations..
+ component.setValue(null);
+ component.setLocalValueSet(false);
<p>This will cause that component to refetch its value via its
value-binding when rendered. In JSF 1.2, a resetValue() convenience
@@ -130,15 +126,13 @@ single set of UIComponent objects to rep
and stores the state of each row separately from the components themselves.
It is probably therefore necessary to do something like this to reset
editable components within table rows:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>java</ac:default-parameter><ac:plain-text-body><![CDATA[
- for(int i=0; i<uiDataComponent.rows(); ++i) {
- uiDataComponent.setRowIndex(i);
- // walk the child components, resetting any submitted value
- }
- uiDataComponent.setRowIndex(-1);
-]
-]></ac:plain-text-body></ac:macro>
+
+ :::java
+ for(int i=0; i<uiDataComponent.rows(); ++i) {
+ uiDataComponent.setRowIndex(i);
+ // walk the child components, resetting any submitted value
+ }
+ uiDataComponent.setRowIndex(-1);
<p>MyFaces Trinidad includes a <code><tr:resetActionListener></code>
tag that automates this strategy of walking the tree, including tables.</p>
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/resulting-nested-facescontext.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/resulting-nested-facescontext.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/resulting-nested-facescontext.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/backend/resulting-nested-facescontext.mdtext Thu Feb 6 01:32:06 2014
@@ -43,100 +43,89 @@ to the custom FacesContext.</p>
as needed):</p>
<p>Configuration in faces-config.xml:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+
+ :::xml
<factory>
-
-<faces-context-factory>org.apache....StateCopyFacesContextFactory</faces-context-factory>
+ <faces-context-factory>org.apache....StateCopyFacesContextFactory</faces-context-factory>
</factory>
-]
-]></ac:plain-text-body></ac:macro>
<p>Source:</p>
-<ac:macro ac:name="code"><ac:parameter
-ac:name="title">StateCopyFacesContextFactory.java</ac:parameter><ac:plain-text-body><![CDATA[
-/*
- * 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.....;
-
-import javax.faces.context.FacesContextFactory;
-import javax.faces.context.FacesContext;
-import javax.faces.lifecycle.Lifecycle;
-import javax.faces.FacesException;
-import javax.faces.application.FacesMessage;
-import java.util.Iterator;
-
-/**
- * FacesContextFactory which first checks if a FacesContext is already
-there
- */
-public class StateCopyFacesContextFactory extends FacesContextFactory
-{
- private final FacesContextFactory original;
-
- public StateCopyFacesContextFactory(FacesContextFactory original)
- {
- this.original = original;
- }
-
- @Override
- public FacesContext getFacesContext(Object context, Object request,
-Object response, Lifecycle lifecycle) throws FacesException
- {
- FacesContext previousContext =
-FacesContext.getCurrentInstance();
-
- FacesContext newContext = original.getFacesContext(context,
-request, response, lifecycle);
-
- if (previousContext != null)
- {
- // transfer the default locale (might have been
-changed)
-
-newContext.getApplication().setDefaultLocale(previousContext.getApplication().getDefaultLocale());
-
- // transfer all already collected messages
- Iterator iterClientIds =
-previousContext.getClientIdsWithMessages();
- while (iterClientIds.hasNext())
- {
- String clientId = (String)
-iterClientIds.next();
- Iterator iterMessages =
-previousContext.getMessages(clientId);
- while (iterMessages.hasNext())
- {
- FacesMessage message =
-(FacesMessage) iterMessages.next();
-
- newContext.addMessage(clientId,
-message);
- }
- }
- }
-
- return newContext;
- }
-}
-]
-]></ac:plain-text-body></ac:macro>
+
+StateCopyFacesContextFactory.java
+
+ :::java
+ /*
+ * 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.....;
+
+ import javax.faces.context.FacesContextFactory;
+ import javax.faces.context.FacesContext;
+ import javax.faces.lifecycle.Lifecycle;
+ import javax.faces.FacesException;
+ import javax.faces.application.FacesMessage;
+ import java.util.Iterator;
+
+ /**
+ * FacesContextFactory which first checks if a FacesContext is already
+ there
+ */
+ public class StateCopyFacesContextFactory extends FacesContextFactory
+ {
+ private final FacesContextFactory original;
+
+ public StateCopyFacesContextFactory(FacesContextFactory original)
+ {
+ this.original = original;
+ }
+
+ @Override
+ public FacesContext getFacesContext(Object context, Object request,
+ Object response, Lifecycle lifecycle) throws FacesException
+ {
+ FacesContext previousContext =
+ FacesContext.getCurrentInstance();
+
+ FacesContext newContext = original.getFacesContext(context, request, response, lifecycle);
+
+ if (previousContext != null)
+ {
+ // transfer the default locale (might have been changed)
+
+ newContext.getApplication().setDefaultLocale(previousContext.getApplication().getDefaultLocale());
+
+ // transfer all already collected messages
+ Iterator iterClientIds = previousContext.getClientIdsWithMessages();
+ while (iterClientIds.hasNext())
+ {
+ String clientId = (String) iterClientIds.next();
+ Iterator iterMessages = previousContext.getMessages(clientId);
+ while (iterMessages.hasNext())
+ {
+ FacesMessage message = (FacesMessage) iterMessages.next();
+ newContext.addMessage(clientId, message);
+ }
+ }
+ }
+
+ return newContext;
+ }
+ }
<p>Notice: This solution do not deal with resetting to the previousContext
on newContext.release(). One can enhance it. For me it was sufficient that
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components.mdtext Thu Feb 6 01:32:06 2014
@@ -1,5 +1,4 @@
Title: Composite Components
-<ac:macro ac:name="children"><ac:parameter
-ac:name="all">true</ac:parameter></ac:macro>
-
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components/create-a-non-namingcontainer-composite-component.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components/create-a-non-namingcontainer-composite-component.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components/create-a-non-namingcontainer-composite-component.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/composite-components/create-a-non-namingcontainer-composite-component.mdtext Thu Feb 6 01:32:06 2014
@@ -7,23 +7,19 @@ said "non explicit", because i
<p>Let's take a look at this simple example:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<h:form id="frmTst">
+ :::xml
+ <h:form id="frmTst">
<ui:include src="demoui1.xhtml"/>
<ui:include src="demoui1.xhtml"/>
<ui:include src="demoui1.xhtml"/>
-</h:form>
-]
-]></ac:plain-text-body></ac:macro>
-
-<ac:macro ac:name="code"><ac:parameter
-ac:name="title">demoui1.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
-<ui:composition>
- <p><h:commandButton value="Hello World!"/></p>
-</ui:composition>
-]
-]></ac:plain-text-body></ac:macro>
+ </h:form>
+
+demoui1.xhtml
+
+ :::xml
+ <ui:composition>
+ <p><h:commandButton value="Hello World!"/></p>
+ </ui:composition>
<p>The previous code works in both MyFaces and Mojarra. This is valid from
facelets 1.1.x. The idea is as long as there is no component with
@@ -38,43 +34,38 @@ but this time let's create a normal comp
NamingContainer, because after all the previous snippet followed the rule
that no components with id set were added:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<h:form id="frmTst">
- <test:ccc value="Hello World!"></test:ccc>
- <test:ccc value="Hello World!"></test:ccc>
- <test:ccc value="Hello World!"></test:ccc>
-</h:form>
-]
-]></ac:plain-text-body></ac:macro>
-
-<ac:macro ac:name="code"><ac:parameter
-ac:name="title">ccc.xhtml</ac:parameter><ac:plain-text-body><![CDATA[
-<cc:interface componentType="test.ComponentCCC">
- <cc:attribute name="value" type="java.lang.String" />
-</cc:interface>
-<cc:implementation>
- <p><h:commandButton value="#{cc.attrs.value}"/></p>
-</cc:implementation>
-]
-]></ac:plain-text-body></ac:macro>
-
-<ac:macro ac:name="code"><ac:parameter
-ac:name="title">ComponentCCC.java</ac:parameter><ac:plain-text-body><![CDATA[
-@FacesComponent("test.ComponentCCC")
-public class ComponentCCC extends UIOutput
-{
- public final static String COMPONENT_TYPE = "test.ComponentCCC";
-
-
- @Override
- public String getFamily()
- {
- return UINamingContainer.COMPONENT_FAMILY;
- }
-}
-]
-]></ac:plain-text-body></ac:macro>
+ :::xml
+ <h:form id="frmTst">
+ <test:ccc value="Hello World!"></test:ccc>
+ <test:ccc value="Hello World!"></test:ccc>
+ <test:ccc value="Hello World!"></test:ccc>
+ </h:form>
+
+ccc.xhtml
+
+ :::xml
+ <cc:interface componentType="test.ComponentCCC">
+ <cc:attribute name="value" type="java.lang.String" />
+ </cc:interface>
+ <cc:implementation>
+ <p><h:commandButton value="#{cc.attrs.value}"/></p>
+ </cc:implementation>
+
+ComponentCCC.java
+
+ :::java
+ @FacesComponent("test.ComponentCCC")
+ public class ComponentCCC extends UIOutput
+ {
+ public final static String COMPONENT_TYPE = "test.ComponentCCC";
+
+
+ @Override
+ public String getFamily()
+ {
+ return UINamingContainer.COMPONENT_FAMILY;
+ }
+ }
<p>In theory, since all ids are generated, everything should work like in
ui:include case. In practice, the previous code works on MyFaces but does
@@ -85,24 +76,22 @@ its effects, specially with UIComponent.
create a component that works as a panel. You can imagine something like
this:</p>
-<ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
-<h:form prependId="true">
- <y:myPanel>
- <h:inputText id="field1" ... />
- <!-- more components -->
- </y:myPanel>
-</h:form>
+ :::xml
+ <h:form prependId="true">
+ <y:myPanel>
+ <h:inputText id="field1" ... />
+ <!-- more components -->
+ </y:myPanel>
+ </h:form>
-
- {code:title=y.xhtml}
+y.xhtml
+
+ :::xml
<cc:implementation>
<!-- some javascript markup with html and css -->
<cc:insertChildren />
<!-- some javascript markup with html and css -->
<cc:implementation>
- ]
-]></ac:plain-text-body></ac:macro>
<p>The user wants that the final clientId be "field1", but
instead he/she has "<ac:link><ri:page ri:content-title="generated id"
@@ -115,8 +104,7 @@ the component instance.</p>
idea is just wrap everything inside cc:implementation with f:subview, which
creates a NamingContainer component:</p>
- <ac:macro
-ac:name="code"><ac:default-parameter>xml</ac:default-parameter><ac:plain-text-body><![CDATA[
+ :::xml
<cc:interface componentType="test.ComponentCCC">
<cc:attribute name="value" type="java.lang.String" />
</cc:interface>
@@ -126,8 +114,6 @@ ac:name="code"><ac:default-parameter>xml
<!-- more markup here -->
</f:subview>
</cc:implementation>
- ]
-]></ac:plain-text-body></ac:macro>
<p>Works great, because the internal markup uses the naming container, but
the composite component base is not a naming container, so its children or
Modified: myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings.mdtext
URL: http://svn.apache.org/viewvc/myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings.mdtext?rev=1565034&r1=1565033&r2=1565034&view=diff
==============================================================================
--- myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings.mdtext (original)
+++ myfaces/site/cms-site/trunk/content/wiki/core/user-guide/jsf-and-myfaces-howtos/managing-errors---infos---warnings.mdtext Thu Feb 6 01:32:06 2014
@@ -1,5 +1,4 @@
Title: Managing Errors - Infos - Warnings
-<ac:macro ac:name="children"><ac:parameter
-ac:name="all">true</ac:parameter></ac:macro>
-
+{% for label, page in children %}* [{{ page.headers.title }}]({{ page.path }})
+{% endfor %}