From: <fg...@us...> - 2009-04-29 14:51:17
|
Revision: 1167 http://openutils.svn.sourceforge.net/openutils/?rev=1167&view=rev Author: fgiust Date: 2009-04-29 14:51:15 +0000 (Wed, 29 Apr 2009) Log Message: ----------- fix NPE Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-04-23 17:13:28 UTC (rev 1166) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-04-29 14:51:15 UTC (rev 1167) @@ -147,7 +147,11 @@ } MgnlContext.setLocale(locale); MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); - return mtc.getHandler().getTitle(media); + if (mtc != null) + { + return mtc.getHandler().getTitle(media); + } + return null; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-08-25 16:16:36
|
Revision: 1312 http://openutils.svn.sourceforge.net/openutils/?rev=1312&view=rev Author: molaschi Date: 2009-08-25 16:16:27 +0000 (Tue, 25 Aug 2009) Log Message: ----------- add trim to uuid when finding a node and add url encoding for resolutions Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-08-25 16:15:20 UTC (rev 1311) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-08-25 16:16:27 UTC (rev 1312) @@ -25,6 +25,10 @@ import info.magnolia.context.MgnlContext; import java.awt.Point; +import java.io.UnsupportedEncodingException; +import java.net.URL; +import java.net.URLEncoder; +import java.nio.charset.CharacterCodingException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -82,7 +86,7 @@ HierarchyManager hm = MgnlContext.getHierarchyManager(MediaModule.REPO); try { - return hm.getContentByUUID(uuid); + return hm.getContentByUUID(StringUtils.trim(uuid)); } catch (RepositoryException e) { @@ -125,7 +129,10 @@ { return null; } - MgnlContext.setLocale(locale); + if (locale != null) + { + MgnlContext.setLocale(locale); + } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); if (mtc == null) { @@ -290,9 +297,9 @@ Content resolutions = media.getChildByName("resolutions"); - String resString = "res-" + resolution; try { + String resString = "res-" + URLEncoder.encode(resolution, "utf-8"); if (resolutions != null && resolutions.hasNodeData(resString)) { String resPath = new FileProperties(resolutions, resString).getProperty(FileProperties.PATH); @@ -305,6 +312,10 @@ { log.debug(e.getMessage(), e); } + catch (UnsupportedEncodingException e) + { + log.debug(e.getMessage(), e); + } return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-10-08 14:31:07
|
Revision: 1470 http://openutils.svn.sourceforge.net/openutils/?rev=1470&view=rev Author: molaschi Date: 2009-10-08 14:30:56 +0000 (Thu, 08 Oct 2009) Log Message: ----------- MEDIA-24 fix repositoryexception propagation Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-08 14:24:52 UTC (rev 1469) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-08 14:30:56 UTC (rev 1470) @@ -79,7 +79,7 @@ * @param uuid media uuid * @return content node */ - public static Content getNode(Object obj) + public static Content getNode(Object obj) throws RepositoryException { if (obj == null) { @@ -95,7 +95,8 @@ } catch (RepositoryException e) { - return null; + log.error("Exception getting node {}", uuid, e); + throw e; } } else if (obj instanceof Content) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-10-08 14:48:20
|
Revision: 1471 http://openutils.svn.sourceforge.net/openutils/?rev=1471&view=rev Author: molaschi Date: 2009-10-08 14:48:05 +0000 (Thu, 08 Oct 2009) Log Message: ----------- MEDIA-24 fix repositoryexception propagation Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-08 14:30:56 UTC (rev 1470) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-08 14:48:05 UTC (rev 1471) @@ -42,6 +42,7 @@ import javax.jcr.RepositoryException; import javax.jcr.query.InvalidQueryException; +import javax.servlet.jsp.JspTagException; import net.sourceforge.openutils.mgnlmedia.media.configuration.MediaConfigurationManager; import net.sourceforge.openutils.mgnlmedia.media.configuration.MediaTypeConfiguration; @@ -79,7 +80,7 @@ * @param uuid media uuid * @return content node */ - public static Content getNode(Object obj) throws RepositoryException + public static Content getNode(Object obj) throws JspTagException { if (obj == null) { @@ -96,7 +97,7 @@ catch (RepositoryException e) { log.error("Exception getting node {}", uuid, e); - throw e; + throw new JspTagException(e); } } else if (obj instanceof Content) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2009-10-14 14:14:07
|
Revision: 1483 http://openutils.svn.sourceforge.net/openutils/?rev=1483&view=rev Author: molaschi Date: 2009-10-14 14:13:48 +0000 (Wed, 14 Oct 2009) Log Message: ----------- MEDIA-24 log exception but doesn't throw it up Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-14 13:58:46 UTC (rev 1482) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2009-10-14 14:13:48 UTC (rev 1483) @@ -80,7 +80,7 @@ * @param uuid media uuid * @return content node */ - public static Content getNode(Object obj) throws JspTagException + public static Content getNode(Object obj) { if (obj == null) { @@ -96,8 +96,7 @@ } catch (RepositoryException e) { - log.error("Exception getting node {}", uuid, e); - throw new JspTagException(e); + log.error("Exception getting node with UUID \"{}\"", uuid, e); } } else if (obj instanceof Content) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-08 19:08:16
|
Revision: 1604 http://openutils.svn.sourceforge.net/openutils/?rev=1604&view=rev Author: fgiust Date: 2010-01-08 19:08:09 +0000 (Fri, 08 Jan 2010) Log Message: ----------- MEDIA-49 Don't log missing nodes with error level Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-01-08 12:25:53 UTC (rev 1603) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-01-08 19:08:09 UTC (rev 1604) @@ -39,6 +39,7 @@ import java.util.Locale; import java.util.Map; +import javax.jcr.ItemNotFoundException; import javax.jcr.RepositoryException; import javax.jcr.query.InvalidQueryException; @@ -92,9 +93,13 @@ { return hm.getContentByUUID(StringUtils.trim(uuid)); } + catch (ItemNotFoundException e) + { + log.debug("Node with UUID \"" + uuid + "\" not found"); + } catch (RepositoryException e) { - log.error("Exception getting node with UUID \"{}\"", uuid, e); + log.error(e.getClass().getName() + " getting node with UUID \"" + uuid + "\"", e); } } else if (obj instanceof Content) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-01-09 14:09:26
|
Revision: 1620 http://openutils.svn.sourceforge.net/openutils/?rev=1620&view=rev Author: fgiust Date: 2010-01-09 14:09:19 +0000 (Sat, 09 Jan 2010) Log Message: ----------- avoid lookup of empty uuids Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-01-09 14:09:02 UTC (rev 1619) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-01-09 14:09:19 UTC (rev 1620) @@ -88,6 +88,12 @@ if (obj instanceof String) { String uuid = (String) obj; + + if (StringUtils.isBlank(uuid)) + { + return null; + } + HierarchyManager hm = MgnlContext.getHierarchyManager(MediaModule.REPO); try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2010-02-01 10:39:31
|
Revision: 1729 http://openutils.svn.sourceforge.net/openutils/?rev=1729&view=rev Author: diego_schivo Date: 2010-02-01 10:39:24 +0000 (Mon, 01 Feb 2010) Log Message: ----------- MEDIA-62 possibile NPE in MediaEl.getUrl2() Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-01 10:29:11 UTC (rev 1728) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-01 10:39:24 UTC (rev 1729) @@ -240,6 +240,10 @@ return null; } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); + if (mtc == null || mtc.getHandler() == null) + { + return null; + } return mtc.getHandler().getUrl(media, options); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-09 15:44:54
|
Revision: 1868 http://openutils.svn.sourceforge.net/openutils/?rev=1868&view=rev Author: fgiust Date: 2010-02-09 15:44:45 +0000 (Tue, 09 Feb 2010) Log Message: ----------- NPE check in getSize() Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-09 11:54:10 UTC (rev 1867) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-09 15:44:45 UTC (rev 1868) @@ -378,21 +378,20 @@ else { Content resolutions = media.getChildByName("resolutions"); - try + if (resolutions != null) { - if (resolutions.hasNodeData(ImageUtils.getResolutionPath("res-" + resolution))) + try { - res = resolutions.getNodeData(ImageUtils.getResolutionPath("res-" + resolution)); + if (resolutions.hasNodeData(ImageUtils.getResolutionPath("res-" + resolution))) + { + res = resolutions.getNodeData(ImageUtils.getResolutionPath("res-" + resolution)); + } } - else + catch (RepositoryException e) { res = null; } } - catch (RepositoryException e) - { - res = null; - } } if (res != null) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-13 18:32:20
|
Revision: 1912 http://openutils.svn.sourceforge.net/openutils/?rev=1912&view=rev Author: fgiust Date: 2010-02-13 18:32:14 +0000 (Sat, 13 Feb 2010) Log Message: ----------- MEDIA-90 nodedata.getAttribute() called for non-binary nodedata, will be a problem with magnolia 4.3 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-13 14:14:38 UTC (rev 1911) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-13 18:32:14 UTC (rev 1912) @@ -35,6 +35,7 @@ import java.util.Map; import javax.jcr.ItemNotFoundException; +import javax.jcr.PropertyType; import javax.jcr.RepositoryException; import javax.jcr.query.InvalidQueryException; @@ -325,13 +326,18 @@ */ public static String getResolutionUrl(Content media, String resolution) { - FileProperties prop = new FileProperties(media, BaseTypeHandler.ORGINAL_NODEDATA_NAME); - Integer width = NumberUtils.toInt(prop.getProperty(FileProperties.PROPERTY_WIDTH)); - Integer height = NumberUtils.toInt(prop.getProperty(FileProperties.PROPERTY_HEIGHT)); - Point size = ImageUtils.parseForSize(resolution); - if (width == size.x && height == size.y) + + // MEDIA-90 may be simply a url + if (media.getNodeData(BaseTypeHandler.ORGINAL_NODEDATA_NAME).getType() == PropertyType.BINARY) { - return mcm.getURIMappingPrefix() + prop.getProperty(FileProperties.PATH); + FileProperties prop = new FileProperties(media, BaseTypeHandler.ORGINAL_NODEDATA_NAME); + Integer width = NumberUtils.toInt(prop.getProperty(FileProperties.PROPERTY_WIDTH)); + Integer height = NumberUtils.toInt(prop.getProperty(FileProperties.PROPERTY_HEIGHT)); + Point size = ImageUtils.parseForSize(resolution); + if (width == size.x && height == size.y) + { + return mcm.getURIMappingPrefix() + prop.getProperty(FileProperties.PATH); + } } if (media == null || !ImageUtils.checkOrCreateResolution(media, resolution, null)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-13 21:07:37
|
Revision: 1919 http://openutils.svn.sourceforge.net/openutils/?rev=1919&view=rev Author: fgiust Date: 2010-02-13 21:07:29 +0000 (Sat, 13 Feb 2010) Log Message: ----------- MEDIA-94 allow both Long and Double for size Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-13 20:59:55 UTC (rev 1918) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-13 21:07:29 UTC (rev 1919) @@ -488,7 +488,7 @@ */ public static Integer width(Content media) { - Long longproperty = (Long) property(media, MediaTypeHandler.METADATA_WIDTH); + Number longproperty = (Number) property(media, MediaTypeHandler.METADATA_WIDTH); if (longproperty != null) { return longproperty.intValue(); @@ -503,7 +503,7 @@ */ public static Integer height(Content media) { - Long longproperty = (Long) property(media, MediaTypeHandler.METADATA_HEIGHT); + Number longproperty = (Number) property(media, MediaTypeHandler.METADATA_HEIGHT); if (longproperty != null) { return longproperty.intValue(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-14 22:05:37
|
Revision: 1935 http://openutils.svn.sourceforge.net/openutils/?rev=1935&view=rev Author: fgiust Date: 2010-02-14 22:05:31 +0000 (Sun, 14 Feb 2010) Log Message: ----------- Compilation working with magnolia 4.0 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-14 22:01:53 UTC (rev 1934) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-14 22:05:31 UTC (rev 1935) @@ -300,7 +300,9 @@ Content resolutions = media.getChildByName("resolutions"); - for (NodeData item : resolutions.getNodeDataCollection()) + Collection<NodeData> nodeDataCollection = resolutions.getNodeDataCollection(); + + for (NodeData item : nodeDataCollection) { if (item.getName().startsWith("res-")) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-02-18 11:28:27
|
Revision: 1982 http://openutils.svn.sourceforge.net/openutils/?rev=1982&view=rev Author: fgiust Date: 2010-02-18 11:28:21 +0000 (Thu, 18 Feb 2010) Log Message: ----------- MEDIA-110 null check Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-18 10:43:42 UTC (rev 1981) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-18 11:28:21 UTC (rev 1982) @@ -331,6 +331,11 @@ public static String urlres(Content media, String resolution) { + if (media == null) + { + return null; + } + // MEDIA-90 may be simply a url if (media.getNodeData(BaseTypeHandler.ORGINAL_NODEDATA_NAME).getType() == PropertyType.BINARY) { @@ -344,7 +349,7 @@ } } - if (media == null || !ImageUtils.checkOrCreateResolution(media, resolution, null)) + if (!ImageUtils.checkOrCreateResolution(media, resolution, null)) { return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2010-02-23 15:31:34
|
Revision: 2042 http://openutils.svn.sourceforge.net/openutils/?rev=2042&view=rev Author: diego_schivo Date: 2010-02-23 15:31:28 +0000 (Tue, 23 Feb 2010) Log Message: ----------- MEDIA-114 MediaEl throws NullPointerException when MediaTypeConfiguration is not found Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-23 10:10:32 UTC (rev 2041) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-02-23 15:31:28 UTC (rev 2042) @@ -142,7 +142,7 @@ MgnlContext.setLocale(locale); } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); - if (mtc == null) + if (mtc == null || mtc.getHandler() == null) { return null; } @@ -177,11 +177,11 @@ MgnlContext.setLocale(locale); } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); - if (mtc != null) + if (mtc == null || mtc.getHandler() == null) { - return mtc.getHandler().getTitle(media); + return null; } - return null; + return mtc.getHandler().getTitle(media); } /** @@ -212,12 +212,17 @@ MgnlContext.setLocale(locale); } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); + if (mtc == null || mtc.getHandler() == null) + { + return null; + } String tags = mtc.getHandler().getTags(media); - if (tags != null) + if (tags == null) { - return StringUtils.split(tags, ","); + return null; + } - return null; + return StringUtils.split(tags, ","); } /** @@ -272,6 +277,10 @@ return null; } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); + if (mtc == null || mtc.getHandler() == null) + { + return null; + } return mtc.getHandler().getThumbnailUrl(media); } @@ -432,6 +441,10 @@ return null; } MediaTypeConfiguration mtc = mcm.getMediaTypeConfigurationFromMedia(media); + if (mtc == null || mtc.getHandler() == null) + { + return null; + } return mtc.getHandler().getPreviewUrl(media); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2010-04-23 14:04:39
|
Revision: 2294 http://openutils.svn.sourceforge.net/openutils/?rev=2294&view=rev Author: carlocolombo Date: 2010-04-23 14:04:33 +0000 (Fri, 23 Apr 2010) Log Message: ----------- [MEDIA-127]Check if parameter passed starts with / and exist in jcr media repostitory, if exist return the rappresented content. Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-23 08:09:17 UTC (rev 2293) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-23 14:04:33 UTC (rev 2294) @@ -96,9 +96,9 @@ } if (obj instanceof String) { - String uuid = (String) obj; + String mediaIdentifier = (String) obj; - if (StringUtils.isBlank(uuid)) + if (StringUtils.isBlank(mediaIdentifier)) { return null; } @@ -106,15 +106,25 @@ HierarchyManager hm = MgnlContext.getHierarchyManager(MediaModule.REPO); try { - return hm.getContentByUUID(StringUtils.trim(uuid)); + if (mediaIdentifier.startsWith("/")) + { + if (hm.isExist(mediaIdentifier)) + { + return hm.getContent(mediaIdentifier); + } + } + else + { + return hm.getContentByUUID(StringUtils.trim(mediaIdentifier)); + } } catch (ItemNotFoundException e) { - log.debug("Node with UUID \"" + uuid + "\" not found"); + log.debug("Node \"" + mediaIdentifier + "\" not found"); } catch (RepositoryException e) { - log.error(e.getClass().getName() + " getting node with UUID \"" + uuid + "\"", e); + log.error(e.getClass().getName() + " getting node \"" + mediaIdentifier + "\"", e); } } else if (obj instanceof Content) @@ -220,7 +230,7 @@ if (tags == null) { return null; - + } return StringUtils.split(tags, ","); } @@ -344,7 +354,7 @@ { return null; } - + // MEDIA-90 may be simply a url if (media.getNodeData(BaseTypeHandler.ORGINAL_NODEDATA_NAME).getType() == PropertyType.BINARY) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2010-04-23 14:07:11
|
Revision: 2295 http://openutils.svn.sourceforge.net/openutils/?rev=2295&view=rev Author: carlocolombo Date: 2010-04-23 14:07:05 +0000 (Fri, 23 Apr 2010) Log Message: ----------- [MEDIA-127]Updated javadoc for method node Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-23 14:04:33 UTC (rev 2294) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-23 14:07:05 UTC (rev 2295) @@ -85,7 +85,7 @@ /** * Get content node for media - * @param obj content node or node UUID + * @param obj content node or node UUID or jcr absolute path in media repository * @return content node */ public static Content node(Object obj) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2010-04-26 16:44:01
|
Revision: 2310 http://openutils.svn.sourceforge.net/openutils/?rev=2310&view=rev Author: fgiust Date: 2010-04-26 16:43:55 +0000 (Mon, 26 Apr 2010) Log Message: ----------- don't wrap null nodes Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-26 16:43:40 UTC (rev 2309) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2010-04-26 16:43:55 UTC (rev 2310) @@ -137,7 +137,7 @@ content = (Content) obj; } - if (!(content instanceof NodeMapWrapper)) + if (content != null && !(content instanceof NodeMapWrapper)) { content = new NodeMapWrapper(new I18nContentWrapper(content), MgnlContext .getAggregationState() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <die...@us...> - 2011-02-09 13:53:24
|
Revision: 3328 http://openutils.svn.sourceforge.net/openutils/?rev=3328&view=rev Author: diego_schivo Date: 2011-02-09 13:53:17 +0000 (Wed, 09 Feb 2011) Log Message: ----------- MEDIA-216 exclude null items from iterator Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-02-09 10:14:51 UTC (rev 3327) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-02-09 13:53:17 UTC (rev 3328) @@ -63,6 +63,7 @@ import org.slf4j.LoggerFactory; import com.google.common.base.Function; +import com.google.common.base.Predicates; import com.google.common.collect.Iterators; @@ -856,16 +857,19 @@ playlistNode = (Content) obj; } - return Iterators.transform(PlaylistIterateUtils.iterate(playlistNode), new Function<MediaNodeAndEntryPath, Content>() - { + Iterator<Content> iter = Iterators.transform( + PlaylistIterateUtils.iterate(playlistNode), + new Function<MediaNodeAndEntryPath, Content>() + { - /** - * {@inheritDoc} - */ - public Content apply(MediaNodeAndEntryPath from) - { - return from.getMediaNode(); - } - }); + /** + * {@inheritDoc} + */ + public Content apply(MediaNodeAndEntryPath from) + { + return from.getMediaNode(); + } + }); + return Iterators.filter(iter, Predicates.notNull()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2011-05-06 15:17:02
|
Revision: 3448 http://openutils.svn.sourceforge.net/openutils/?rev=3448&view=rev Author: molaschi Date: 2011-05-06 15:16:56 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-226 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-05-06 15:16:24 UTC (rev 3447) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-05-06 15:16:56 UTC (rev 3448) @@ -44,6 +44,7 @@ import javax.jcr.RepositoryException; import javax.jcr.Value; import javax.jcr.query.InvalidQueryException; +import javax.servlet.http.HttpServletRequest; import net.sourceforge.openutils.mgnlmedia.media.configuration.MediaConfigurationManager; import net.sourceforge.openutils.mgnlmedia.media.configuration.MediaTypeConfiguration; @@ -872,4 +873,28 @@ }); return Iterators.filter(iter, Predicates.notNull()); } + + public static String replaceParam(String param, String newValue) + { + HttpServletRequest req = MgnlContext.getWebContext().getRequest(); + String url = "?" + + (StringUtils.isNotBlank(req.getQueryString()) + ? MgnlContext.getWebContext().getRequest().getQueryString() + : StringUtils.EMPTY); + if (url.indexOf("?" + param + "=") >= 0 || url.indexOf("&" + param + "=") >= 0) + { + int index = 1; + if (url.indexOf("&" + param + "=") >= 0) + { + index = url.indexOf("&" + param + "="); + } + url = StringUtils.substring(url, 0, index) + + StringUtils.substringAfter(StringUtils.substring(url, index + 1), "&"); + } + if (StringUtils.isNotBlank(newValue)) + { + url += (url.endsWith("?") ? StringUtils.EMPTY : "&") + param + "=" + newValue; + } + return url; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2011-06-13 08:28:40
|
Revision: 3526 http://openutils.svn.sourceforge.net/openutils/?rev=3526&view=rev Author: carlocolombo Date: 2011-06-13 08:28:31 +0000 (Mon, 13 Jun 2011) Log Message: ----------- [MEDIA-231]fix getting resolution if requested resolution is equal to original media resolution Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-06-12 16:41:28 UTC (rev 3525) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-06-13 08:28:31 UTC (rev 3526) @@ -494,6 +494,17 @@ NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_WIDTH)), NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_HEIGHT)) }; } + else + { + // MEDIA-231 + Point size = ImageUtils.parseForSize(resolution); + if (NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_WIDTH)) == size.x + && NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_HEIGHT)) == size.y) + { + return new int[]{size.x, size.y }; + } + + } } return new int[]{-1, -1 }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <car...@us...> - 2011-06-20 12:22:51
|
Revision: 3544 http://openutils.svn.sourceforge.net/openutils/?rev=3544&view=rev Author: carlocolombo Date: 2011-06-20 12:22:45 +0000 (Mon, 20 Jun 2011) Log Message: ----------- fix npe Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-06-16 16:58:33 UTC (rev 3543) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-06-20 12:22:45 UTC (rev 3544) @@ -497,6 +497,7 @@ else { // MEDIA-231 + res = media.getNodeData("original"); Point size = ImageUtils.parseForSize(resolution); if (NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_WIDTH)) == size.x && NumberUtils.toInt(res.getAttribute(FileProperties.PROPERTY_HEIGHT)) == size.y) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-08-21 17:01:50
|
Revision: 3621 http://openutils.svn.sourceforge.net/openutils/?rev=3621&view=rev Author: fgiust Date: 2011-08-21 17:01:44 +0000 (Sun, 21 Aug 2011) Log Message: ----------- MEDIA-251 MediaEL.node() should not require a webcontext Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-08-20 15:50:25 UTC (rev 3620) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/tags/el/MediaEl.java 2011-08-21 17:01:44 UTC (rev 3621) @@ -154,11 +154,18 @@ if (content != null && !(content instanceof NodeMapWrapper)) { - Content currentpage = MgnlContext.getAggregationState().getMainContent(); + Content currentpage = null; + + if (MgnlContext.isWebContext()) + { + currentpage = MgnlContext.getAggregationState().getMainContent(); + } + if (currentpage == null) { currentpage = content; } + content = new NodeMapWrapper(new I18nContentWrapper(content), currentpage.getHandle()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |