From: <die...@us...> - 2011-02-09 08:02:11
|
Revision: 3326 http://openutils.svn.sourceforge.net/openutils/?rev=3326&view=rev Author: diego_schivo Date: 2011-02-09 08:02:05 +0000 (Wed, 09 Feb 2011) Log Message: ----------- MGNLUTILS-25 EL function returning a content given a UUID/path/content Modified Paths: -------------- trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 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 2011-02-09 07:55:26 UTC (rev 3325) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2011-02-09 08:02:05 UTC (rev 3326) @@ -787,9 +787,9 @@ if (obj instanceof String) { - String mediaIdentifier = (String) obj; + String identifier = (String) obj; - if (StringUtils.isBlank(mediaIdentifier)) + if (StringUtils.isBlank(identifier)) { return null; } @@ -797,25 +797,25 @@ HierarchyManager hm = MgnlContext.getHierarchyManager(repo); try { - if (mediaIdentifier.startsWith("/")) + if (identifier.startsWith("/")) { - if (hm.isExist(mediaIdentifier)) + if (hm.isExist(identifier)) { - content = hm.getContent(mediaIdentifier); + content = hm.getContent(identifier); } } else { - content = hm.getContentByUUID(StringUtils.trim(mediaIdentifier)); + content = hm.getContentByUUID(StringUtils.trim(identifier)); } } catch (ItemNotFoundException e) { - log.debug("Node \"" + mediaIdentifier + "\" not found"); + log.debug("Node \"" + identifier + "\" not found"); } catch (RepositoryException e) { - log.error(e.getClass().getName() + " getting node \"" + mediaIdentifier + "\"", e); + log.error(e.getClass().getName() + " getting node \"" + identifier + "\"", e); } } else if (obj instanceof Content) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |