From: <me...@us...> - 2010-01-19 10:04:17
|
Revision: 1681 http://openutils.svn.sourceforge.net/openutils/?rev=1681&view=rev Author: memila Date: 2010-01-19 10:04:11 +0000 (Tue, 19 Jan 2010) Log Message: ----------- added examples Modified Paths: -------------- trunk/magnolia-test-webapp/src/main/webapp/template_magnoliautils/magnoliaUtils.jsp trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld Modified: trunk/magnolia-test-webapp/src/main/webapp/template_magnoliautils/magnoliaUtils.jsp =================================================================== --- trunk/magnolia-test-webapp/src/main/webapp/template_magnoliautils/magnoliaUtils.jsp 2010-01-19 10:03:18 UTC (rev 1680) +++ trunk/magnolia-test-webapp/src/main/webapp/template_magnoliautils/magnoliaUtils.jsp 2010-01-19 10:04:11 UTC (rev 1681) @@ -58,6 +58,12 @@ <div class="sampletext">isPage(actpage)</div> <div class="sampleresult">${mu:isPage(actpage)}</div> </div> + <div class="function"> + <h2>getPage</h2> + <p>Return the object passed or the first parent page that has content type = mgnl:content</p> + <div class="sampletext">getPage(actpage))</div> + <div class="sampleresult">${mu:getPage(actpage)}</div> + </div> <div class="function"> <h2>requestAttributeMap</h2> <p>Return a map key=value of all magnolia request attributes</p> Modified: trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld =================================================================== --- trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2010-01-19 10:03:18 UTC (rev 1680) +++ trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2010-01-19 10:04:11 UTC (rev 1681) @@ -11,36 +11,68 @@ <description>Test if exists a parent page with content in the collectionName given as parameter, if exist set the parent page a sactpage</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.Boolean firstPageWithCollection(java.lang.String)</function-signature> + <example> + <![CDATA[ + <cms:newBar contentNodeCollectionName="newcontent" paragraph="xyz" /> + ${mu:firstPageWithCollection("newcontent")}} + ]]> + </example> </function> <function> <name>isPage</name> <description>Evaluete if primary node type of the associated Node of an object is a mgnl:contentNode</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.Boolean isPage(info.magnolia.cms.core.Content)</function-signature> + <example> + <![CDATA[ + ${mu:isPage(actpage)} + ]]> + </example> </function> <function> <name>getPage</name> <description>Return the object passed or the first parent page that has content type = mgnl:content</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>info.magnolia.cms.core.Content getPage(info.magnolia.cms.core.Content)</function-signature> + <example> + <![CDATA[ + ${mu:getPage(actpage)} + ]]> + </example> </function> <function> <name>requestAttributeMap</name> <description>Return a map key=value of all magnolia request attributes</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.util.Map getRequestAttributeMap()</function-signature> + <example> + <![CDATA[ + ${mu:requestAttributeMap()["javax.servlet.forward.request_uri"]} + ]]> + </example> </function> <function> <name>countNodesInCollection</name> <description>Count the nodes in a collection with a given content and the name of the collection</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.Integer countNodesInCollection(info.magnolia.cms.core.Content, java.lang.String)</function-signature> + <example> + <![CDATA[ + <cms:newBar contentNodeCollectionName="newcontent" paragraph="xyz" /> + ${mu:countNodesInCollection(actpage,"newcontent")} + ]]> + </example> </function> <function> <name>countSubpages</name> <description>Count subpages with a given content</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.Integer countSubpages(info.magnolia.cms.core.Content)</function-signature> + <example> + <![CDATA[ + ${mu:countSubpages(actpage)} + ]]> + </example> </function> <function> <name>subpages</name> @@ -53,6 +85,11 @@ <description>Return the current user logged</description> <function-class>info.magnolia.context.MgnlContext</function-class> <function-signature>info.magnolia.cms.security.User getUser()</function-signature> + <example> + <![CDATA[ + ${mu:user()} + ]]> + </example> </function> <function> <name>ctx</name> @@ -65,6 +102,11 @@ <description>Return the content of a given path and repository</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>info.magnolia.cms.core.Content contentByPath(java.lang.String, java.lang.String)</function-signature> + <example> + <![CDATA[ + ${mu:contentByPath('Magnolia-Utils','website')} + ]]> + </example> </function> <function> <name>message</name> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |