From: <me...@us...> - 2010-01-15 15:12:25
|
Revision: 1651 http://openutils.svn.sourceforge.net/openutils/?rev=1651&view=rev Author: memila Date: 2010-01-15 15:12:14 +0000 (Fri, 15 Jan 2010) Log Message: ----------- descriptions added Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld Modified: trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java =================================================================== --- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2010-01-15 14:51:23 UTC (rev 1650) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2010-01-15 15:12:14 UTC (rev 1651) @@ -44,9 +44,9 @@ } /** - * return true if exists content + * Test if exists a parent page with content in the collectionName given as parameter, if exist set the parent page a sactpage * @param collectionName (column) of magnolia contentNode - * @return boolean value + * @return true if exists a parent page with content in the collectionName given as parameter, if exist set the parent page a sactpage */ public static boolean firstPageWithCollection(String collectionName) { @@ -72,7 +72,11 @@ return false; } - + /** + * Return the content of a given path and repository + * @param String path, String repository + * @return the content of a given path and repository + */ public static Content contentByPath(String path, String repository) { try @@ -84,7 +88,10 @@ return null; } } - + /** + * Return a map key=value of all magnolia request attributes + * @return a map key=value of all magnolia request attributes + */ @SuppressWarnings("unchecked") public static Map<String, Object> getRequestAttributeMap() { @@ -102,22 +109,38 @@ return attrs; } - + /** + * Return the message of a given message key + * @param String key + * @return return the message string of a given message key + */ public static String message(String key) { return MgnlContext.getMessages().get(key); } - + /** + * Test the system property 'magnolia.develop' + * @return true if the system property = 'magnolia.develop' + */ public static boolean develop() { return SystemProperty.getBooleanProperty("magnolia.develop"); } - + + /** + * @param String uuidOrPath + * @return a link from given a path or a uuid + */ public static String link(String uuidOrPath) { return uuidLink(uuidOrPath); } + + /** + * @param String uuid + * @return a link the ContextPath o '.html' when needed + */ public static String uuidLink(String uuid) { if (StringUtils.isEmpty(uuid)) @@ -220,7 +243,13 @@ return splitted[0]; } } - + + /** + * Count the nodes in a collection with a given content and the name of the collection + * @param Content content, String subnode + * @return the number of nodes in a collection + */ + public static int countNodesInCollection(Content content, String subnode) { int count = 0; @@ -246,6 +275,11 @@ return count; } + /** + * Count subpages with a given content + * @param Content content + * @return the number of subpages + */ public static int countSubpages(Content content) { int count = 0; @@ -258,6 +292,11 @@ return count; } + /** + * Return the collection of subpages of a given page + * @param Content content + * @return a Collection<Content> of subpages of a given page + */ public static Collection<Content> subpages(Content content) { @@ -273,12 +312,21 @@ { return MgnlContext.getUser().hasRole(role); } - + /** + * Evaluete if primary node type of the associated Node of an object is a mgnl:contentNode + * @param content + * @return boolean value + */ public static boolean isPage(Content content) { return content != null && !content.isNodeType(ItemType.CONTENTNODE.getSystemName()); } - + + /** + * Return the Content of the object passed or of the first parent page that has content type = mgnl:content + * @param Content content + * @return the Content of the object passed or of the first parent page that has content type = mgnl:content + */ public static Content getPage(Content content) { 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-15 14:51:23 UTC (rev 1650) +++ trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2010-01-15 15:12:14 UTC (rev 1651) @@ -74,16 +74,19 @@ </function> <function> <name>develop</name> + <description>Test the system property 'magnolia.develop'</description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.Boolean develop()</function-signature> </function> <function> <name>uuidlink</name> + <description></description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.String uuidLink(java.lang.String)</function-signature> </function> <function> <name>link</name> + <description></description> <function-class>it.openutils.mgnlutils.el.MgnlUtilsElFunctions</function-class> <function-signature>java.lang.String link(java.lang.String)</function-signature> </function> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |