From: <fg...@us...> - 2010-01-14 21:15:33
|
Revision: 1642 http://openutils.svn.sourceforge.net/openutils/?rev=1642&view=rev Author: fgiust Date: 2010-01-14 21:15:23 +0000 (Thu, 14 Jan 2010) Log Message: ----------- remove duplicate function (getLink() -> link()) 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-14 17:45:36 UTC (rev 1641) +++ trunk/openutils-mgnlutils/src/main/java/it/openutils/mgnlutils/el/MgnlUtilsElFunctions.java 2010-01-14 21:15:23 UTC (rev 1642) @@ -6,7 +6,6 @@ import info.magnolia.cms.core.Path; import info.magnolia.cms.core.SystemProperty; import info.magnolia.context.MgnlContext; -import info.magnolia.context.WebContext; import info.magnolia.link.LinkException; import info.magnolia.link.LinkUtil; @@ -170,57 +169,6 @@ return cleanedurl; } - /** - * Parse the string (path or uuid) and return a link. - * @param uuidOrPath url (http:// or internal link or an UUID) - * @return cleaned url (external or internal) - */ - public static String getLink(String uuidOrPath) - { - - String cleanedurl = StringUtils.replace(StringUtils.trim(uuidOrPath), "&", "&"); - String contextPath = ((WebContext) MgnlContext.getInstance()).getContextPath(); - - if (StringUtils.isBlank(cleanedurl)) - { - return contextPath; - } - - if (cleanedurl.startsWith("http") || cleanedurl.startsWith("#")) - { - return cleanedurl; - } - - // Check if there is already an extensions, else add default one - if (cleanedurl.startsWith("/")) - { - cleanedurl = contextPath + cleanedurl; - if (!cleanedurl.endsWith(".html")) - { - return cleanedurl + ".html"; - } - - return cleanedurl; - } - - // uuidOrPath is an UUID, mabye... - try - { - cleanedurl = MgnlContext.getContextPath() - + LinkUtil.convertUUIDtoURI(cleanedurl, ContentRepository.WEBSITE); - } - catch (LinkException e) - { - log.debug("Failed to parse links with from " - + MgnlContext.getAggregationState().getCurrentURI() - + e.getMessage()); - } - - // If got an error return the cleaned string - return cleanedurl; - - } - public static String tolinkOrText(String tabseparatedstring) { 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-14 17:45:36 UTC (rev 1641) +++ trunk/openutils-mgnlutils/src/main/resources/META-INF/tld/mgnlutils.tld 2010-01-14 21:15:23 UTC (rev 1642) @@ -92,11 +92,6 @@ <function-signature>java.lang.String encodeISO9075(java.lang.String)</function-signature> </function> <function> - <name>getLink</name> - <function-class>--to be set --</function-class> - <function-signature>java.lang.String getLink(java.lang.String)</function-signature> - </function> - <function> <name>formatDateTime</name> <description> Format a date and time based on a given pattern, or a builtin style (short, medium, long or full). Also supports This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |