You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mol...@us...> - 2011-05-06 15:21:22
|
Revision: 3452 http://openutils.svn.sourceforge.net/openutils/?rev=3452&view=rev Author: molaschi Date: 2011-05-06 15:21:16 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-227 Modified Paths: -------------- trunk/openutils-mgnlmedia/pom.xml Modified: trunk/openutils-mgnlmedia/pom.xml =================================================================== --- trunk/openutils-mgnlmedia/pom.xml 2011-05-06 15:20:46 UTC (rev 3451) +++ trunk/openutils-mgnlmedia/pom.xml 2011-05-06 15:21:16 UTC (rev 3452) @@ -205,6 +205,11 @@ <artifactId>ICOReader</artifactId> <version>1.04</version> </dependency> + <dependency> + <groupId>com.googlecode.mp4parser</groupId> + <artifactId>isoparser</artifactId> + <version>1.0-beta-2</version> + </dependency> </dependencies> <properties> <magnolia.version>4.4.1</magnolia.version> 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:20:52
|
Revision: 3451 http://openutils.svn.sourceforge.net/openutils/?rev=3451&view=rev Author: molaschi Date: 2011-05-06 15:20:46 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-226 Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcImageProcessor.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcServlet.java Added: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcImageProcessor.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcImageProcessor.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcImageProcessor.java 2011-05-06 15:20:46 UTC (rev 3451) @@ -0,0 +1,78 @@ +/** + * + * SimpleMedia Module for Magnolia CMS (http://www.openmindlab.com/lab/products/media.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlmedia.media.crop; + +import java.awt.image.BufferedImage; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; + +import net.sourceforge.openutils.mgnlmedia.media.processors.ResizeCropCenteredImageResolutionProcessor; +import net.sourceforge.openutils.mgnlmedia.media.utils.ImageUtils; + + +/** + * @author molaschi + * @version $Id: $ + */ +public class PzcImageProcessor extends ResizeCropCenteredImageResolutionProcessor +{ + + /** + * {@inheritDoc} + */ + @Override + public BufferedImage getImageForResolution(BufferedImage original, int x, int y, Map<String, String> parameters) + { + int oWidth = original.getWidth(); + int oHeight = original.getHeight(); + + if (x == oWidth && y == oHeight) + { + // same size + return original; + } + + String pzcParametersString = parameters.get("pzc"); + + if (StringUtils.isBlank(pzcParametersString)) + { + return super.getImageForResolution(original, x, y, parameters); + } + + String params[] = StringUtils.split(pzcParametersString, '|'); + + float zoom = Float.parseFloat(params[0]) / 100.0f; + float panX = Float.parseFloat(params[1]); + float panY = Float.parseFloat(params[2]); + float factor = 1.0f; + if (params.length > 3) + { + factor = Float.parseFloat(params[3]); + } + + float oX = oWidth * zoom * factor; + float oY = oX * oHeight / oWidth; + + BufferedImage filled = ImageUtils.resizeImage(original, (int) oX, (int) oY); + return ImageUtils.cropImage(filled, (int) (panX * factor), (int) (panY * factor), x, y); + } + +} Added: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcServlet.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcServlet.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/crop/PzcServlet.java 2011-05-06 15:20:46 UTC (rev 3451) @@ -0,0 +1,134 @@ +/** + * + * SimpleMedia Module for Magnolia CMS (http://www.openmindlab.com/lab/products/media.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlmedia.media.crop; + +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.NodeData; +import info.magnolia.cms.util.NodeDataUtil; +import info.magnolia.context.MgnlContext; + +import java.io.IOException; + +import javax.jcr.RepositoryException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.math.NumberUtils; + + +/** + * @author molaschi + * @version $Id: $ + */ +public class PzcServlet extends HttpServlet +{ + + /** + * + */ + private static final long serialVersionUID = -1763781795315878360L; + + /** + * {@inheritDoc} + */ + @Override + protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException + { + resp.setContentType("text/plain"); + String command = req.getParameter("command"); + final int zoom = NumberUtils.toInt(req.getParameter("zoom")); + final int x = NumberUtils.toInt(req.getParameter("x")); + final int y = NumberUtils.toInt(req.getParameter("y")); + final String id = req.getParameter("id"); + String handle = req.getParameter("handle"); + String repository = req.getParameter("repository"); + if (StringUtils.isBlank(repository)) + { + repository = ContentRepository.WEBSITE; + } + + HierarchyManager hm = MgnlContext.getHierarchyManager(repository); + + try + { + final Content node = hm.getContent(handle); + if ("delete".equals(command)) + { + NodeData nd = node.getNodeData(id); + if (nd != null) + { + nd.delete(); + node.save(); + } + resp.getWriter().println("true"); + } + else + { + final String systemRepository = repository; + MgnlContext.doInSystemContext(new MgnlContext.Op<Void, RepositoryException>() + { + + public Void exec() throws RepositoryException + { + HierarchyManager hm = MgnlContext.getHierarchyManager(systemRepository); + try + { + Content systemNode = hm.getContent(node.getHandle()); + NodeDataUtil.getOrCreateAndSet(systemNode, id, new StringBuffer() + .append(zoom) + .append("|") + .append(x) + .append("|") + .append(y) + .toString()); + systemNode.save(); + } + catch (RepositoryException ex) + { + } + return null; + } + }, true); + resp.getWriter().println("true"); + } + } + catch (RepositoryException ex) + { + resp.getWriter().println("false"); + } + + resp.flushBuffer(); + } + + /** + * {@inheritDoc} + */ + @Override + protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException + { + doGet(req, resp); + } + +} 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:19:54
|
Revision: 3450 http://openutils.svn.sourceforge.net/openutils/?rev=3450&view=rev Author: molaschi Date: 2011-05-06 15:19:48 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-226 Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.processors.image-resolution.p.xml trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.server.filters.servlets.pzc.xml Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.processors.image-resolution.p.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.processors.image-resolution.p.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media/config.modules.media.processors.image-resolution.p.xml 2011-05-06 15:19:48 UTC (rev 3450) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="p" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>c10d7b60-efc1-4078-9039-4f432f2792bf</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlmedia.media.crop.PzcImageProcessor</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2009-09-03T18:28:30.446+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-10-28T18:51:53.752+02:00</sv:value> + </sv:property> + </sv:node> +</sv:node> Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.server.filters.servlets.pzc.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.server.filters.servlets.pzc.xml (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.server.filters.servlets.pzc.xml 2011-05-06 15:19:48 UTC (rev 3450) @@ -0,0 +1,128 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="pzc" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>4bf6ead3-fc09-4959-8a14-0870e2ff6052</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>info.magnolia.cms.filters.ServletDispatchingFilter</sv:value> + </sv:property> + <sv:property sv:name="comment" sv:type="String"> + <sv:value>A servlet used by the media module for crop opertations</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="Boolean"> + <sv:value>true</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="servletClass" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlmedia.media.crop.PzcServlet</sv:value> + </sv:property> + <sv:property sv:name="servletName" sv:type="String"> + <sv:value>pzc</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-12-08T22:24:37.042+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-12-08T22:24:37.043+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:title" sv:type="String"> + <sv:value/> + </sv:property> + </sv:node> + <sv:node sv:name="mappings"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>063da876-c5b4-44a7-88bb-e95e71425cda</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-12-08T22:24:37.043+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="-media-pzc"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>fd91d24d-141b-48dd-83d9-21a1a81fdeff</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="pattern" sv:type="String"> + <sv:value>/media/pzc</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-12-08T22:24:37.044+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="parameters"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>118f9a2b-4d78-46c7-b739-886e1ab9d69e</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-12-08T22:24:37.044+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> +</sv:node> 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:18:15
|
Revision: 3449 http://openutils.svn.sourceforge.net/openutils/?rev=3449&view=rev Author: molaschi Date: 2011-05-06 15:18:08 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-227 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/BaseVideoTypeHandler.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/ExternalVideoTypeHandler.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/VideoTypeHandler.java trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/RtmpMedatadaFetcher.java trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.modules.media.dialogs.mediaVideoDlg.xml trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/multibox/multibox.js Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/VideoMedataUtils.java Removed Paths: ------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/FLVMedataUtils.java Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/BaseVideoTypeHandler.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/BaseVideoTypeHandler.java 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/BaseVideoTypeHandler.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -25,7 +25,7 @@ import java.util.Map; import net.sourceforge.openutils.mgnlmedia.media.utils.MediaMetadataFormatUtils; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils.FLVMetaData; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils.VideoMetaData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,14 +42,14 @@ */ private Logger log = LoggerFactory.getLogger(BaseVideoTypeHandler.class); - protected abstract FLVMetaData parseFLVMetaData(Content media) throws Exception; + protected abstract VideoMetaData parseFLVMetaData(Content media) throws Exception; @Override public boolean onPostSave(Content media) { try { - FLVMetaData flvMetaData = null; + VideoMetaData flvMetaData = null; try { flvMetaData = parseFLVMetaData(media); Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/ExternalVideoTypeHandler.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/ExternalVideoTypeHandler.java 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/ExternalVideoTypeHandler.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -41,8 +41,8 @@ import javax.servlet.http.HttpServletRequest; import net.sourceforge.openutils.mgnlmedia.media.types.externals.ExternalVideoSupport; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils.FLVMetaData; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils.VideoMetaData; import net.sourceforge.openutils.mgnlmedia.media.utils.RtmpMedatadaFetcher; import org.apache.commons.io.IOUtils; @@ -220,7 +220,7 @@ } @Override - protected FLVMetaData parseFLVMetaData(Content media) throws Exception + protected VideoMetaData parseFLVMetaData(Content media) throws Exception { if (!parseremotefiles) { @@ -244,7 +244,7 @@ // handle spaces: note we can't encode the full url here downloadUrl = StringUtils.replace(downloadUrl, " ", "%20"); URL url = new URL(downloadUrl); - return FLVMedataUtils.parseFLVfromUrl(url); + return VideoMedataUtils.parseFLVfromUrl(url); } else if (StringUtils.startsWith(downloadUrl, "rtmp")) { Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/VideoTypeHandler.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/VideoTypeHandler.java 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/types/impl/VideoTypeHandler.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -19,12 +19,13 @@ package net.sourceforge.openutils.mgnlmedia.media.types.impl; +import info.magnolia.cms.beans.runtime.FileProperties; import info.magnolia.cms.core.Content; import java.io.InputStream; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils.FLVMetaData; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils.VideoMetaData; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; @@ -47,12 +48,19 @@ protected final String DURATION_ATTRIBUTE = "duration"; @Override - protected FLVMetaData parseFLVMetaData(Content media) throws Exception + protected VideoMetaData parseFLVMetaData(Content media) throws Exception { InputStream stream = getOriginalFileNodeData(media).getStream(); try { - return FLVMedataUtils.parseFLVfromStream(stream); + VideoMetaData metaData = VideoMedataUtils.parsefromStream(getOriginalFileNodeData(media).getAttribute( + FileProperties.PROPERTY_EXTENSION), stream); + if (metaData.getFileSize() == 0) + { + metaData.setFileSize(Long.parseLong(getOriginalFileNodeData(media).getAttribute( + FileProperties.PROPERTY_SIZE))); + } + return metaData; } finally { Deleted: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/FLVMedataUtils.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/FLVMedataUtils.java 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/FLVMedataUtils.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -1,330 +0,0 @@ -/** - * - * SimpleMedia Module for Magnolia CMS (http://www.openmindlab.com/lab/products/media.html) - * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlmedia.media.utils; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.net.URLConnection; -import java.nio.ByteBuffer; - -import org.apache.commons.io.IOUtils; - - -/** - * <p> - * Parses FLV metadata in order to extract size and duration. - * </p> - * <p> - * Code based on FLVMetaData class by SANTHOSH REDDY MANDADI - * http://java-servlet-jsp-web.blogspot.com/2009/06/java-program-to-fetch-flv-metadata.html - * </p> - * @author fgiust - * @version $Id$ - */ -public final class FLVMedataUtils -{ - - /** - * Contains informations about a FLV file. - */ - public static class FLVMetaData - { - - private long duration; - - private long width; - - private long height; - - private double audioDataRate; - - private double videoDataRate; - - private long fileSize; - - private String createdDate; - - private String mimeType; - - private double frameRate; - - public void setCreatedDate(String createdDate) - { - this.createdDate = createdDate; - } - - public String getCreatedDate() - { - return createdDate; - } - - public void setMimeType(String mimeType) - { - this.mimeType = mimeType; - } - - public String getMimeType() - { - return mimeType; - } - - public void setWidth(long width) - { - this.width = width; - } - - public double getWidth() - { - return width; - } - - public void setHeight(long height) - { - this.height = height; - } - - public long getHeight() - { - return height; - } - - public void setAudioDataRate(double audioDataRate) - { - this.audioDataRate = audioDataRate; - } - - public double getAudioDataRate() - { - return audioDataRate; - } - - public void setVideoDataRate(double videoDataRate) - { - this.videoDataRate = videoDataRate; - } - - public double getVideoDataRate() - { - return videoDataRate; - } - - public void setFileSize(long fileSize) - { - this.fileSize = fileSize; - } - - public long getFileSize() - { - return fileSize; - } - - public void setFrameRate(double frameRate) - { - this.frameRate = frameRate; - } - - public double getFrameRate() - { - return frameRate; - } - - public void setDuration(long duration) - { - this.duration = duration; - } - - public long getDuration() - { - return duration; - } - - } - - public static FLVMetaData parseFLVfromStream(InputStream stream) throws IOException - { - return getMetaData(stream); - } - - public static FLVMetaData parseFLVfromUrl(URL url) throws IOException - { - URLConnection connection = url.openConnection(); - connection.setConnectTimeout(5000); - - // Getting the remote input stream - InputStream fis = connection.getInputStream(); - try - { - return parseFLVfromStream(fis); - } - finally - { - IOUtils.closeQuietly(fis); - } - - } - - /** - * Extract the metadata for the flv and sets them in the properties. If the property has 0.0 or null, then the - * information is not available on the target FLV. - * @throws IOException - * @throws Exception if something goes wrong. - */ - private static FLVMetaData getMetaData(InputStream fis) throws IOException - { - FLVMetaData meta = new FLVMetaData(); - try - { - // Creating the bytes array to read the first 400 bytes data from input stream - byte[] bytes = new byte[400]; - // Reading the data from the input stream - fis.read(bytes); - - meta = getMetaData(bytes); - - } - finally - { - IOUtils.closeQuietly(fis); - } - - return meta; - } - - /** - * @param meta - * @param bytes - */ - protected static FLVMetaData getMetaData(byte[] bytes) - { - - FLVMetaData meta = new FLVMetaData(); - - // Fetching the properties. If the output shows -1 or null then consider that the FLV doesn't have that - // info on metadata - meta.setDuration(getLong(bytes, "duration")); - meta.setWidth(getLong(bytes, "width")); - meta.setHeight(getLong(bytes, "height")); - meta.setAudioDataRate(getDouble(bytes, "audiodatarate")); - meta.setVideoDataRate(getDouble(bytes, "videodatarate")); - meta.setFileSize(getLong(bytes, "filesize")); - meta.setCreatedDate(getString(bytes, "creationdate")); - meta.setMimeType(getString(bytes, "mimetype")); - meta.setFrameRate(getDouble(bytes, "framerate")); - - return meta; - } - - private static double getDouble(byte[] bytes, String property) - { - // Checking whether the property exists on the metadata - int offset = indexOf(bytes, property.getBytes()); - if (offset != -1) - { - // Calculating the value from the bytes received from getBytes method - return ByteBuffer.wrap(getBytes(bytes, offset + property.length() + 1, 8)).getDouble(); - } - else - { - // Returning -1 to notify the info not available - return -1; - } - } - - private static long getLong(byte[] bytes, String property) - { - // Checking whether the property exists on the metadata - int offset = indexOf(bytes, property.getBytes()); - if (offset != -1) - { - // Calculating the value from the bytes received from getBytes method - return (long) ByteBuffer.wrap(getBytes(bytes, offset + property.length() + 1, 8)).getDouble(); - } - else - { - // Returning -1 to notify the info not available - return -1; - } - } - - private static String getString(byte[] bytes, String property) - { - // Checking whether the property exists on the metadata - int offset = indexOf(bytes, property.getBytes()); - if (offset != -1) - { - // Constructing the string from the bytes received from getBytes method - return new String(getBytes(bytes, offset + property.length() + 3, 24)); - } - else - { - // Returning null to notify the info not available - return null; - } - } - - private static byte[] getBytes(byte[] bytes, int offset, int length) - { - // Fetching the required number of bytes from the source and returning - byte[] requiredBytes = new byte[length]; - for (int i = offset, j = 0; j < length; i++, j++) - { - requiredBytes[j] = bytes[i]; - } - return requiredBytes; - } - - static int indexOf(byte[] source, byte[] target) - { - byte first = target[0]; - int max = source.length - target.length; - - for (int i = 0; i <= max; i++) - { - /* Look for first character. */ - if (source[i] != first) - { - while (++i <= max && source[i] != first) - { - ; - } - } - - /* Found first character, now look at the rest of v2 */ - if (i <= max) - { - int j = i + 1; - int end = j + target.length - 1; - for (int k = 1; j < end && source[j] == target[k]; j++, k++) - { - ; - } - - if (j == end) - { - /* Found whole string. */ - return i; - } - } - } - return -1; - } - -} Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/RtmpMedatadaFetcher.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/RtmpMedatadaFetcher.java 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/RtmpMedatadaFetcher.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -25,7 +25,7 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import net.sourceforge.openutils.mgnlmedia.media.utils.FLVMedataUtils.FLVMetaData; +import net.sourceforge.openutils.mgnlmedia.media.utils.VideoMedataUtils.VideoMetaData; import org.apache.commons.lang.StringUtils; import org.jboss.netty.bootstrap.ClientBootstrap; @@ -67,7 +67,7 @@ * @return parsed FLVMetadata * @throws IOException */ - public static FLVMetaData fetchMetadata(String url, long timeoutInMs) throws IOException + public static VideoMetaData fetchMetadata(String url, long timeoutInMs) throws IOException { String validUrl = StringUtils.substringBeforeLast(url, ".flv"); @@ -96,7 +96,7 @@ bootstrap.getFactory().releaseExternalResources(); - return FLVMedataUtils.getMetaData(writer.getByteArray().toByteArray()); + return VideoMedataUtils.getMetaData(writer.getByteArray().toByteArray()); } private static ClientBootstrap getBootstrap(final Executor executor, final ClientOptions options) Copied: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/VideoMedataUtils.java (from rev 3445, trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/FLVMedataUtils.java) =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/VideoMedataUtils.java (rev 0) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/utils/VideoMedataUtils.java 2011-05-06 15:18:08 UTC (rev 3449) @@ -0,0 +1,381 @@ +/** + * + * SimpleMedia Module for Magnolia CMS (http://www.openmindlab.com/lab/products/media.html) + * Copyright(C) 2008-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package net.sourceforge.openutils.mgnlmedia.media.utils; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.nio.ByteBuffer; + +import org.apache.commons.io.IOUtils; + +import com.coremedia.iso.IsoBufferWrapper; +import com.coremedia.iso.IsoFile; +import com.coremedia.iso.IsoFileConvenienceHelper; +import com.coremedia.iso.boxes.MovieBox; +import com.coremedia.iso.boxes.TrackHeaderBox; + + +/** + * <p> + * Parses Video metadata in order to extract size and duration. + * </p> + * <p> + * Code based on FLVMetaData class by SANTHOSH REDDY MANDADI + * http://java-servlet-jsp-web.blogspot.com/2009/06/java-program-to-fetch-flv-metadata.html + * </p> + * @author fgiust + * @version $Id$ + */ +public final class VideoMedataUtils +{ + + /** + * Contains informations about a FLV file. + */ + public static class VideoMetaData + { + + private long duration; + + private long width; + + private long height; + + private double audioDataRate; + + private double videoDataRate; + + private long fileSize; + + private String createdDate; + + private String mimeType; + + private double frameRate; + + public void setCreatedDate(String createdDate) + { + this.createdDate = createdDate; + } + + public String getCreatedDate() + { + return createdDate; + } + + public void setMimeType(String mimeType) + { + this.mimeType = mimeType; + } + + public String getMimeType() + { + return mimeType; + } + + public void setWidth(long width) + { + this.width = width; + } + + public double getWidth() + { + return width; + } + + public void setHeight(long height) + { + this.height = height; + } + + public long getHeight() + { + return height; + } + + public void setAudioDataRate(double audioDataRate) + { + this.audioDataRate = audioDataRate; + } + + public double getAudioDataRate() + { + return audioDataRate; + } + + public void setVideoDataRate(double videoDataRate) + { + this.videoDataRate = videoDataRate; + } + + public double getVideoDataRate() + { + return videoDataRate; + } + + public void setFileSize(long fileSize) + { + this.fileSize = fileSize; + } + + public long getFileSize() + { + return fileSize; + } + + public void setFrameRate(double frameRate) + { + this.frameRate = frameRate; + } + + public double getFrameRate() + { + return frameRate; + } + + public void setDuration(long duration) + { + this.duration = duration; + } + + public long getDuration() + { + return duration; + } + + } + + public static VideoMetaData parsefromStream(String extension, InputStream stream) throws IOException + { + if ("flv".equals(extension)) + { + return parseFLVfromStream(stream); + } + if ("mp4".equals(extension) || "m4v".equals(extension)) + { + return parseMP4fromStream(stream); + } + return null; + } + + public static VideoMetaData parseFLVfromStream(InputStream stream) throws IOException + { + return getMetaData(stream); + } + + public static VideoMetaData parseMP4fromStream(InputStream stream) throws IOException + { + VideoMetaData meta = new VideoMetaData(); + + InputStream is = stream; + ByteBuffer bb = ByteBuffer.wrap(IOUtils.toByteArray(is)); + IsoBufferWrapper buf = new IsoBufferWrapper(bb); + // Properties properties = new Properties(); + // properties.setProperty(MovieBox.TYPE, "com.coremedia.iso.boxes.MovieBox()"); + // PropertyBoxParserImpl boxParser = new PropertyBoxParserImpl(properties); + IsoFile isoFile = new IsoFile(buf); // , boxParser); + isoFile.parse(); + + MovieBox box = (MovieBox) IsoFileConvenienceHelper.get(isoFile, MovieBox.TYPE); + meta.setDuration(box.getMovieHeaderBox().getDuration() / box.getMovieHeaderBox().getTimescale()); + meta.setFrameRate(box.getMovieHeaderBox().getRate()); + // meta.setCreatedDate(box.getMovieHeaderBox().getCreationTime()); + + for (long trackid : box.getTrackNumbers()) + { + TrackHeaderBox thb = box.getTrackMetaData(trackid).getTrackBox().getTrackHeaderBox(); + if (thb.getWidth() > 0) + { + meta.setWidth((long) thb.getWidth()); + meta.setHeight((long) thb.getHeight()); + break; + } + } + + return meta; + } + + public static VideoMetaData parseFLVfromUrl(URL url) throws IOException + { + URLConnection connection = url.openConnection(); + connection.setConnectTimeout(5000); + + // Getting the remote input stream + InputStream fis = connection.getInputStream(); + try + { + return parseFLVfromStream(fis); + } + finally + { + IOUtils.closeQuietly(fis); + } + + } + + /** + * Extract the metadata for the flv and sets them in the properties. If the property has 0.0 or null, then the + * information is not available on the target FLV. + * @throws IOException + * @throws Exception if something goes wrong. + */ + private static VideoMetaData getMetaData(InputStream fis) throws IOException + { + VideoMetaData meta = new VideoMetaData(); + try + { + // Creating the bytes array to read the first 400 bytes data from input stream + byte[] bytes = new byte[400]; + // Reading the data from the input stream + fis.read(bytes); + + meta = getMetaData(bytes); + + } + finally + { + IOUtils.closeQuietly(fis); + } + + return meta; + } + + /** + * @param meta + * @param bytes + */ + protected static VideoMetaData getMetaData(byte[] bytes) + { + + VideoMetaData meta = new VideoMetaData(); + + // Fetching the properties. If the output shows -1 or null then consider that the FLV doesn't have that + // info on metadata + meta.setDuration(getLong(bytes, "duration")); + meta.setWidth(getLong(bytes, "width")); + meta.setHeight(getLong(bytes, "height")); + meta.setAudioDataRate(getDouble(bytes, "audiodatarate")); + meta.setVideoDataRate(getDouble(bytes, "videodatarate")); + meta.setFileSize(getLong(bytes, "filesize")); + meta.setCreatedDate(getString(bytes, "creationdate")); + meta.setMimeType(getString(bytes, "mimetype")); + meta.setFrameRate(getDouble(bytes, "framerate")); + + return meta; + } + + private static double getDouble(byte[] bytes, String property) + { + // Checking whether the property exists on the metadata + int offset = indexOf(bytes, property.getBytes()); + if (offset != -1) + { + // Calculating the value from the bytes received from getBytes method + return ByteBuffer.wrap(getBytes(bytes, offset + property.length() + 1, 8)).getDouble(); + } + else + { + // Returning -1 to notify the info not available + return -1; + } + } + + private static long getLong(byte[] bytes, String property) + { + // Checking whether the property exists on the metadata + int offset = indexOf(bytes, property.getBytes()); + if (offset != -1) + { + // Calculating the value from the bytes received from getBytes method + return (long) ByteBuffer.wrap(getBytes(bytes, offset + property.length() + 1, 8)).getDouble(); + } + else + { + // Returning -1 to notify the info not available + return -1; + } + } + + private static String getString(byte[] bytes, String property) + { + // Checking whether the property exists on the metadata + int offset = indexOf(bytes, property.getBytes()); + if (offset != -1) + { + // Constructing the string from the bytes received from getBytes method + return new String(getBytes(bytes, offset + property.length() + 3, 24)); + } + else + { + // Returning null to notify the info not available + return null; + } + } + + private static byte[] getBytes(byte[] bytes, int offset, int length) + { + // Fetching the required number of bytes from the source and returning + byte[] requiredBytes = new byte[length]; + for (int i = offset, j = 0; j < length; i++, j++) + { + requiredBytes[j] = bytes[i]; + } + return requiredBytes; + } + + static int indexOf(byte[] source, byte[] target) + { + byte first = target[0]; + int max = source.length - target.length; + + for (int i = 0; i <= max; i++) + { + /* Look for first character. */ + if (source[i] != first) + { + while (++i <= max && source[i] != first) + { + ; + } + } + + /* Found first character, now look at the rest of v2 */ + if (i <= max) + { + int j = i + 1; + int end = j + target.length - 1; + for (int k = 1; j < end && source[j] == target[k]; j++, k++) + { + ; + } + + if (j == end) + { + /* Found whole string. */ + return i; + } + } + } + return -1; + } + +} Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.modules.media.dialogs.mediaVideoDlg.xml =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.modules.media.dialogs.mediaVideoDlg.xml 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-bootstrap/media-nooverwrite/config.modules.media.dialogs.mediaVideoDlg.xml 2011-05-06 15:18:08 UTC (rev 3449) @@ -100,7 +100,7 @@ <sv:value>mediaFile</sv:value> </sv:property> <sv:property sv:name="extensions" sv:type="String"> - <sv:value>flv,swf</sv:value> + <sv:value>flv,swf,mp4,m4v</sv:value> </sv:property> <sv:property sv:name="label" sv:type="String"> <sv:value>media.dialogs.tabVideo.video.label</sv:value> Modified: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/multibox/multibox.js =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/multibox/multibox.js 2011-05-06 15:16:56 UTC (rev 3448) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/multibox/multibox.js 2011-05-06 15:18:08 UTC (rev 3449) @@ -175,6 +175,8 @@ this.type = 'flash'; break; case 'flv': + case 'mp4': + case 'm4v': this.type = 'flashVideo'; this.contentObj.xH = 20; break; 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: <mol...@us...> - 2011-05-06 15:16:35
|
Revision: 3447 http://openutils.svn.sourceforge.net/openutils/?rev=3447&view=rev Author: molaschi Date: 2011-05-06 15:16:24 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-226 Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/jquery-ui-1.8.12.custom.css trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/pzc.css trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/delete.png trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/edit.png trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/exit.png trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/save.png Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/jquery-ui-1.8.12.custom.css =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/jquery-ui-1.8.12.custom.css (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/jquery-ui-1.8.12.custom.css 2011-05-06 15:16:24 UTC (rev 3447) @@ -0,0 +1,572 @@ +/* + * jQuery UI CSS Framework 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; }/* + * jQuery UI Autocomplete 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.6 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/pzc.css =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/pzc.css (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/css/crop/pzc.css 2011-05-06 15:16:24 UTC (rev 3447) @@ -0,0 +1,30 @@ +div.pzc,div.pzc div { + padding: 0; + margin: 0; + border: 0; + position: relative; +} + +div.pzc div.pzcMask { + overflow: hidden; + width: 100%; + height: 100%; +} + +div.pzc div.pzcMedia { + position: absolute; +} + +div.pzc div.pzcMedia img { + width: 100%; + height: 100%; +} + +div.pzc div.pzcSlider { + position: absolute; + bottom: 0; + width: 100%; + height: 5px; + border: solid 1px #666; + margin-bottom: 5px; +} \ No newline at end of file Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/delete.png =================================================================== (Binary files differ) Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/delete.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/edit.png =================================================================== (Binary files differ) Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/edit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/exit.png =================================================================== (Binary files differ) Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/exit.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/save.png =================================================================== (Binary files differ) Property changes on: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/icons/crop/save.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream 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:15:05
|
Revision: 3446 http://openutils.svn.sourceforge.net/openutils/?rev=3446&view=rev Author: molaschi Date: 2011-05-06 15:14:56 +0000 (Fri, 06 May 2011) Log Message: ----------- MEDIA-226 Modified Paths: -------------- trunk/openutils-mgnlmedia/src/main/resources/META-INF/media.tld trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag Added Paths: ----------- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/crop.tag trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/crop/ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/crop/crop.js Modified: trunk/openutils-mgnlmedia/src/main/resources/META-INF/media.tld =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/media.tld 2011-05-03 12:35:16 UTC (rev 3445) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/media.tld 2011-05-06 15:14:56 UTC (rev 3446) @@ -35,6 +35,12 @@ ]]> </example> </tag-file> + <tag-file> + <description>Allow editors to crop (zoom and pan) an image</description> + <display-name>Crop Tag</display-name> + <name>crop</name> + <path>/META-INF/tags/media/crop.tag</path> + </tag-file> <function> <description>Get the media module instance.</description> <display-name>module</display-name> @@ -327,4 +333,11 @@ <function-class>net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl</function-class> <function-signature>java.util.Iterator mediaNodesInPlaylist(java.lang.Object)</function-signature> </function> + <function> + <description></description> + <display-name>replaceParam</display-name> + <name>replaceParam</name> + <function-class>net.sourceforge.openutils.mgnlmedia.media.tags.el.MediaEl</function-class> + <function-signature>java.lang.String replaceParam(java.lang.String, java.lang.String)</function-signature> + </function> </taglib> \ No newline at end of file Added: trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/crop.tag =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/crop.tag (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/crop.tag 2011-05-06 15:14:56 UTC (rev 3446) @@ -0,0 +1,132 @@ +<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:cms="urn:jsptld:cms-taglib" + xmlns:c="urn:jsptld:http://java.sun.com/jsp/jstl/core" xmlns:media="http://net.sourceforge.openutils/mgnlMedia" + xmlns:cmsfn="http://www.magnolia.info/tlds/cmsfn-taglib.tld" xmlns:fn="http://java.sun.com/jsp/jstl/functions"> + <jsp:directive.attribute name="property" required="true" rtexprvalue="true" type="java.lang.String" /> + <jsp:directive.attribute name="width" required="true" rtexprvalue="true" type="java.lang.Integer" /> + <jsp:directive.attribute name="height" required="true" rtexprvalue="true" type="java.lang.Integer" /> + <jsp:directive.attribute name="item" required="false" rtexprvalue="true" type="java.lang.Object" /> + <jsp:directive.attribute name="node" required="false" rtexprvalue="true" type="java.lang.String" /> + <jsp:directive.attribute name="jqueryui" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <jsp:directive.attribute name="jquery" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <jsp:directive.attribute name="loadjs" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <jsp:directive.attribute name="isEditMode" required="false" rtexprvalue="true" type="java.lang.Boolean" /> + <c:set var="isEditMode" value="${empty isEditMode ? mgnl.editMode and cmsfn:canEdit() : isEditMode}" /> + <c:if test="${isEditMode}"> + <c:set var="uuidBrandLink" value="uuid=${param.uuid}&" /> + </c:if> + <c:if test="${empty node}"> + <c:set var="node" value="${content.handle}" /> + </c:if> + <cms:setNode path="${node}" var="pzcNode" /> + <c:if test="${empty item}"> + <c:set var="item" value="${pzcNode[property]}" /> + </c:if> + <c:set var="loadjs" value="${empty loadjs ? true : loadjs}" /> + <c:set var="itemNode" value="${media:node(item)}" /> + <c:choose> + <c:when test="${(media:width(itemNode) ge width) and (media:height(itemNode) ge height)}"> + <c:set var="property" value="${property}_pzc" /> + <c:set var="pzcId" value="${node}.${property}" /> + <c:set var="pzcProperties" value="${pzcNode[property]}" /> + <c:if test="${isEditMode and (empty pzcJsIncluded or not pzcJsIncluded)}"> + <script type="text/javascript"> var crop_app_ctx = '${pageContext.request.contextPath}';</script> + <c:if test="${loadjs}"> + <c:if test="${empty jquery or jquery}"> + <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"><!-- --> + </script> + </c:if> + <c:if test="${empty jqueryui or jqueryui}"> + <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"><!-- --> + </script> + </c:if> + <script type="text/javascript" src="${pageContext.request.contextPath}/.resources/media/js/crop/crop.js"><!-- --> + </script> + </c:if> + <c:set var="pzcJsIncluded" value="${true}" scope="request" /> + </c:if> + <c:choose> + <c:when + test="${((mgnl.editMode and cmsfn:canEdit()) or (not empty isEditMode and isEditMode)) and param.pzcId eq pzcId}"> + <c:set var="cropScriptRequired" value="${true}" scope="request" /> + <c:set var="size" value="${media:size(media:node(item), 'original')}" /> + <c:if test="${empty pzcProperties}"> + <c:set var="pzcProperties" value="100|0|0" /> + </c:if> + <c:set var="pzcParams" value="${fn:split(pzcProperties, '|')}" /> + <c:set var="zoom" value="${(0 + pzcParams[0]) / 100}" /> + <c:set var="zoomW" value="${zoom * size[0]}" /> + <c:set var="zoomH" value="${zoom * size[1]}" /> + <c:set var="marginX" value="${size[0] - zoomW}" /> + <c:set var="marginY" value="${size[1] - zoomH}" /> + <c:set var="panX" value="${size[0] - width - pzcParams[1] - marginX}" /><!-- zoomW - width}" /> --> + <c:set var="panY" value="${size[1] - height - pzcParams[2] - marginY}" /> + <div id="${pzcId}" class="pzc" + style="width:${width}px;height:${height}px;padding:0;margin:0;border:0;position:relative" data-width="${size[0]}" + data-height="${size[1]}" data-property="${property}" data-node="${node}"> + <div class="pzcMask" style="overflow:hidden;width:100%;height:100%;padding:0;margin:0;border:0;position:relative"> + <div class="pzcContainment" + style="width:${2 * size[0] - width}px;height:${2 * size[1] - height}px;left:${width - size[0]}px;top:${height - size[1]}px;padding:0;margin:0;border:0;position:relative"> + <div class="pzcMedia" + style="left:${panX}px;top:${panY}px;width:${zoomW}px;height:${zoomH}px;padding: ${marginY}px ${marginX}px;margin:0;border:0;position:absolute"> + <img src="${appCtx}${media:url(media:node(item))}" style="width:100%;height:100%" /> + </div> + </div> + </div> + <a class="pzcEdit pzcExit" href="${media:replaceParam('pzcId', '')}" title="exit" + style="position:absolute;right:5px;top:5px;background:#000 url(${appCtx}/.resources/media/icons/crop/exit.png) center center no-repeat;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;width:24px;height:24px;"> + <!-- --> + </a> + <a class="pzcEdit pzcSave" href="${media:replaceParam('pzcId', '')}" title="save" + style="position:absolute;right:5px;top:34px;background:#000 url(${appCtx}/.resources/media/icons/crop/save.png) center center no-repeat;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;width:24px;height:24px;"> + <!-- --> + </a> + <div class="pzcZoomPanel" + style="display:none;position:absolute;border:none;padding:10px;bottom:20px;left:50%;margin-left:-20px;width:40px;text-align:center;background:#000;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;color:#fff;font-size:16px;font-family:Verdana;line-height:20px;height:20px;"><!-- --> + </div> + <div class="pzcSlider" + style="position:absolute;padding:0;margin:5px;width:100px;height:7px;bottom:0px;left:50%;margin-left:-50px;border:solid 1px #999"><!-- --> + </div> + </div> + </c:when> + <c:otherwise> + <c:set var="res" value="p${width}x${height}" /> + <c:if test="${not empty pzcProperties}"> + <c:set var="res" value="${res};pzc=${pzcProperties},quality=1" /> + </c:if> + <c:choose> + <c:when test="${((mgnl.editMode and cmsfn:canEdit()) or (not empty isEditMode and isEditMode))}"> + <div id="${pzcId}" + style="overflow:hidden;width:${width}px;height:${height}px;border:0;margin:0;padding:0;position:relative"> + <img src="${appCtx}${media:urlres(media:node(item), res)}" /> + <!-- <media:media item="${item}" width="${width}" height="${height}" resize="crop" />--> + <a class="pzcEdit" href="${media:replaceParam('pzcId', pzcId)}" title="edit" + style="position:absolute;right:5px;top:5px;background:#000 url(${appCtx}/.resources/media/icons/crop/edit.png) center center no-repeat;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;width:24px;height:24px;"> + <!-- --> + </a> + <c:if test="${not empty pzcProperties}"> + <a class="pzcEdit pzcDelete" href="${media:replaceParam('pzcId', '')}" title="reset" id="${node}.${property}" + style="position:absolute;right:5px;top:34px;background:#000 url(${appCtx}/.resources/media/icons/crop/delete.png) center center no-repeat;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;width:24px;height:24px;"> + <!-- --> + </a> + </c:if> + </div> + </c:when> + <c:otherwise> + <c:set var="res" value="${res}" /> + <img src="${appCtx}${media:urlres(media:node(item), res)}" /> + </c:otherwise> + </c:choose> + </c:otherwise> + </c:choose> + </c:when> + <c:otherwise> + <span + style="width:${width - 30}px;height:${height - 30}px;position:relative;border:none;display:block;padding:15px;margin:0;font-size:12px;color:#fff;font-family:Arial;background-color:#C0C0C0;"> + Selected media is too small. + <br /> + Choose media with minimum size of + <b>${width}x${height}</b> + </span> + </c:otherwise> + </c:choose> +</jsp:root> \ No newline at end of file Modified: trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2011-05-03 12:35:16 UTC (rev 3445) +++ trunk/openutils-mgnlmedia/src/main/resources/META-INF/tags/media/media.tag 2011-05-06 15:14:56 UTC (rev 3446) @@ -19,7 +19,9 @@ fit: makes the new image to fit into required resolution. nocrop: makes the new image to contain the required resolution. crop: makes the new image to contain the required res and the crop the simmetric bands that outfit resolution. -fitbands: makes the new image to fit into required res and fills empty areas with background color you pass to in 'parameter' attribute as hex value of 'background' parameter"/> +fitbands: makes the new image to fit into required res and fills empty areas with background color you pass to in 'parameter' attribute as hex value of 'background' parameter. +pzc: apply zoom and crop to image as specified by the pzc parameter (value must be built with the pattern zoom|pan x|pan y, i.e pzc:80|220|125). If no pzc parameter is found the crop mode is applied to image."/> + <jsp:directive.attribute name="parameters" required="false" rtexprvalue="true" description="parameters to pass to image processor as couples key=value joined by commas "/> <jsp:directive.attribute name="ignoreDim" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true the img element will be rendered without width and height attributes "/> <jsp:directive.attribute name="autoPlay" required="false" rtexprvalue="true" type="java.lang.Boolean" description="auto starts the player without waiting for user play command"/> @@ -30,6 +32,11 @@ <jsp:directive.attribute name="videoImagePreview" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if set to true, the tag will not insert the player for videos but only a preview image. For videos or mp3s it needs the following scripts loaded in page: <ul><li>.resources/media/js/mootools-1.2-core.js</li><li>.resources/media/js/mootools-1.2-more.js</li><li>.resources/media/js/mootools-1.2-swfobject.js</li></ul>"/> <jsp:directive.attribute name="controlbar" required="false" rtexprvalue="true" type="java.lang.String" description="defines controlbar position. Possible values are: 'none' (for hiding), 'over', 'bottom', 'top'. If not set, this value will be 'bottom' by default." /> <jsp:directive.attribute name="share" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if set to true the pluging share-1 is show"/> + <jsp:directive.attribute name="crop" required="false" rtexprvalue="true" type="java.lang.Boolean" description="if true, the zoom and crop mode is enabled on the media. The cropProperty attribute is mandatory"/> + <jsp:directive.attribute name="cropProperty" required="false" rtexprvalue="true" type="java.lang.String" description="the name of the property where (with '_pzc' suffix) zoom and crop informations are saved "/> + <jsp:directive.attribute name="cropJs" required="false" rtexprvalue="true" type="java.lang.Boolean" description="whether to load crop js files. Defaults to true. If false you have to manually include jquery, jquery ui and (before closing body tag) /.resources/media/js/crop/crop.js" /> + <jsp:directive.attribute name="cropJquery" required="false" rtexprvalue="true" type="java.lang.Boolean" description="whether to load jquery library or not. Defaults to true; if cropJs is false jquery is not loaded" /> + <jsp:directive.attribute name="cropJqueryUI" required="false" rtexprvalue="true" type="java.lang.Boolean" description="whether to load jquery UI library or not. Defaults to true; if cropJs is false jquery ui is not loaded" /> <c:if test="${empty item}"> <c:if test="${empty node}"> @@ -60,11 +67,15 @@ <c:set var="mediamodule" value="${media:module()}"/> <c:set var="player" value="${mediamodule.player}" /> </c:if> + <c:set var="crop" value="${empty crop ? false : crop}" /> <c:set value="${media:node(item)}" var="mediaNode" /> <c:choose> <c:when test="${!empty mediaNode}"> <cms:setNode var="media" content="${mediaNode}" /> <c:choose> + <c:when test="${crop and (media.type eq 'image' or media.type eq 'wallpaper' or videoImagePreview)}"> + <media:crop item="${media}" width="${width}" height="${height}" property="${cropProperty}" jquery="${cropJquery}" jqueryui="${cropJqueryUI}" loadjs="${cropJs}" /> + </c:when> <c:when test="${media.type eq 'image' or media.type eq 'wallpaper' or videoImagePreview}"> <c:choose> <c:when test="${width eq 0 and height eq 0}"> @@ -83,6 +94,9 @@ <c:when test="${resize eq 'fit'}"> <c:set var="controlChar" value="l" /> </c:when> + <c:when test="${resize eq 'pzc'}"> + <c:set var="controlChar" value="p" /> + </c:when> </c:choose> <c:if test="${width eq 0}"> <c:set var="controlChar" value="l" /> Added: trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/crop/crop.js =================================================================== --- trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/crop/crop.js (rev 0) +++ trunk/openutils-mgnlmedia/src/main/resources/mgnl-resources/media/js/crop/crop.js 2011-05-06 15:14:56 UTC (rev 3446) @@ -0,0 +1,173 @@ +(function($) { + function init(container, params) { + var media = container.find(".pzcMedia"); + var mediaImg = container.find(".pzcMedia img"); + var pczZoomPanel = container.find(".pzcZoomPanel"); + var pzcSlider = container.find(".pzcSlider"); + + var modified = false; + + $(media).draggable( { + containment : 'parent', + cursor : 'move', + refreshPositions : true, + start : function() { + modified = true; + } + }); + + var width = container.width(); + var height = container.height(); + + var imgW = parseInt(container.attr('data-width')); + var imgH = parseInt(container.attr('data-height')); + var property = container.attr('data-property'); + var node = container.attr('data-node'); + + var actZoom = Math.min( + parseInt(100 * $(".pzcMedia img").width() / imgW), 100); + var minZoom = Math.max(parseInt(100 * width / imgW), parseInt(100 + * height / imgH)); + + if (width < 100) { + pzcSlider.css( { + width : '' + (width - 10) + 'px', + 'margin-left' : '-' + ((width - 10) / 2) + 'px' + }); + } + + pczZoomPanel.html('' + actZoom + '%'); + + container.find(".pzcExit").click( + function() { + return !modified + || confirm("Are you sure to exit without saving?"); + }); + + container.find(".pzcSave").click( + function() { + var href = $(this).attr('href'); + $.ajax( { + url : crop_app_ctx + '/media/pzc', + data : { + zoom : actZoom, + x : Math.floor(container.offset().left + - mediaImg.offset().left), + y : Math.floor(container.offset().top + - mediaImg.offset().top), + id : property, + handle : node + }, + // type : 'HEAD', + error : function(err) { + alert(err); + }, + success : function(msg) { + location.href = href; + } + }); + return false; + }); + + var zoomFn = function(zoom) { + actZoom = zoom; + pczZoomPanel.html('' + actZoom + '%'); + var w = parseInt(actZoom * imgW / 100); + var h = parseInt(w * imgH / imgW); + if (w >= width && h >= height) { + var newLeft = width - w; + var newTop = height - h; + var left = parseInt(media.css('left')); + var top = parseInt(media.css('top')); + left = (left > w - width) ? w - width : left; + top = (top > h - height) ? h - height : top; + $(".pzcMedia").css( { + width : '' + w + 'px', + height : '' + h + 'px', + left : '' + left + 'px', + top : '' + top + 'px', + padding : '' + (imgH - h) + 'px ' + (imgW - w) + 'px' + }); + } + } + + pzcSlider.slider( { + min : minZoom, + max : 100, + value : actZoom, + slide : function(event, ui) { + modified = true; + zoomFn(ui.value); + } + }); + pzcSlider.fadeTo('slow', 0.4); + pzcSlider.mouseenter(function() { + pzcSlider.fadeTo('slow', 1.0); + pczZoomPanel.fadeTo('slow', 0.7); + }); + pzcSlider.mouseleave(function() { + pzcSlider.fadeTo('slow', 0.4); + pczZoomPanel.fadeTo('slow', 0); + }); + + // zoomFn(actZoom); + } + ; + + $.fn.mgnlMediaPZC = function(params) { + var params = $.extend( { + /* + * defaultOpened : 1, tabLinks : '.tablinks a[href^=#]', tabContents : + * '.tab section' + */ + }, params); + this.each(function(i, el) { + init($(el), params); + }); + return this; + }; + +})($); + +$('head') + .append( + '<link type="text/css" rel="stylesheet" href="'+ crop_app_ctx +'/.resources/media/css/crop/pzc.css" />'); +$('head') + .append( + '<link type="text/css" rel="stylesheet" href="'+ crop_app_ctx +'/.resources/media/css/crop/jquery-ui-1.8.12.custom.css" />'); + +var refreshMediaPZC = function() { + $(".pzc").mgnlMediaPZC(); + $(".pzcEdit").fadeTo('slow', 0.4); + $(".pzcEdit").mouseenter(function() { + $(this).fadeTo('slow', 1.0); + }); + $(".pzcEdit").mouseleave(function() { + $(this).fadeTo('slow', 0.4); + }); + $(".pzcDelete").click(function() { + var href = $(this).attr('href'); + var aId = $(this).attr('id'); + var node = aId.split('.')[0]; + var property = aId.split('.')[1]; + $.ajax( { + url : crop_app_ctx +'/media/pzc', + data : { + command : 'delete', + id : property, + handle : node + }, + // type : 'HEAD', + error : function(err) { + alert(err); + }, + success : function(msg) { + location.href = href; + } + }); + return false; + }); +} + +$(document).ready(refreshMediaPZC); +$(document).ajaxSuccess(refreshMediaPZC); \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2011-05-03 12:47:55
|
See <https://hudson.openmindonline.it/job/openutils-mgnlmessages/44/changes> |
From: <fg...@us...> - 2011-05-03 12:35:24
|
Revision: 3445 http://openutils.svn.sourceforge.net/openutils/?rev=3445&view=rev Author: fgiust Date: 2011-05-03 12:35:16 +0000 (Tue, 03 May 2011) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlmessages/pom.xml Modified: trunk/openutils-mgnlmessages/pom.xml =================================================================== --- trunk/openutils-mgnlmessages/pom.xml 2011-05-03 12:35:08 UTC (rev 3444) +++ trunk/openutils-mgnlmessages/pom.xml 2011-05-03 12:35:16 UTC (rev 3445) @@ -10,7 +10,7 @@ <artifactId>openutils-mgnlmessages</artifactId> <name>Messages Module for Magnolia CMS</name> <description>Manage your translations from the Magnolia admin interface</description> - <version>4.2.1</version> + <version>4.2.2-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -24,9 +24,9 @@ </issueManagement> <inceptionYear>2008</inceptionYear> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmessages-4.2.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmessages-4.2.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmessages-4.2.1</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlmessages</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlmessages</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlmessages</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-05-03 12:35:14
|
Revision: 3444 http://openutils.svn.sourceforge.net/openutils/?rev=3444&view=rev Author: fgiust Date: 2011-05-03 12:35:08 +0000 (Tue, 03 May 2011) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlmessages-4.2.1 Added Paths: ----------- tags/openutils-mgnlmessages-4.2.1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-05-03 12:34:53
|
Revision: 3443 http://openutils.svn.sourceforge.net/openutils/?rev=3443&view=rev Author: fgiust Date: 2011-05-03 12:34:46 +0000 (Tue, 03 May 2011) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlmessages-4.2.1 Modified Paths: -------------- trunk/openutils-mgnlmessages/pom.xml Modified: trunk/openutils-mgnlmessages/pom.xml =================================================================== --- trunk/openutils-mgnlmessages/pom.xml 2011-05-03 12:31:22 UTC (rev 3442) +++ trunk/openutils-mgnlmessages/pom.xml 2011-05-03 12:34:46 UTC (rev 3443) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -11,7 +10,7 @@ <artifactId>openutils-mgnlmessages</artifactId> <name>Messages Module for Magnolia CMS</name> <description>Manage your translations from the Magnolia admin interface</description> - <version>4.2.1-SNAPSHOT</version> + <version>4.2.1</version> <licenses> <license> <name>GPLv3</name> @@ -25,9 +24,9 @@ </issueManagement> <inceptionYear>2008</inceptionYear> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlmessages</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlmessages</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlmessages</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmessages-4.2.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlmessages-4.2.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlmessages-4.2.1</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-05-03 12:31:28
|
Revision: 3442 http://openutils.svn.sourceforge.net/openutils/?rev=3442&view=rev Author: fgiust Date: 2011-05-03 12:31:22 +0000 (Tue, 03 May 2011) Log Message: ----------- MESSAGES-11 Improve speed/memory usage when extracting all the messages Modified Paths: -------------- trunk/openutils-mgnlmessages/pom.xml trunk/openutils-mgnlmessages/src/main/java/net/sourceforge/openutils/mgnlmessages/i18n/RepositoryMessagesImpl.java Modified: trunk/openutils-mgnlmessages/pom.xml =================================================================== --- trunk/openutils-mgnlmessages/pom.xml 2011-04-27 13:42:04 UTC (rev 3441) +++ trunk/openutils-mgnlmessages/pom.xml 2011-05-03 12:31:22 UTC (rev 3442) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd "> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -87,6 +88,11 @@ <version>2.1</version> </dependency> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlcriteria</artifactId> + <version>3.3.1</version> + </dependency> + <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.6</version> Modified: trunk/openutils-mgnlmessages/src/main/java/net/sourceforge/openutils/mgnlmessages/i18n/RepositoryMessagesImpl.java =================================================================== --- trunk/openutils-mgnlmessages/src/main/java/net/sourceforge/openutils/mgnlmessages/i18n/RepositoryMessagesImpl.java 2011-04-27 13:42:04 UTC (rev 3441) +++ trunk/openutils-mgnlmessages/src/main/java/net/sourceforge/openutils/mgnlmessages/i18n/RepositoryMessagesImpl.java 2011-05-03 12:31:22 UTC (rev 3442) @@ -21,10 +21,6 @@ import info.magnolia.cms.core.Content; import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.cms.core.search.Query; -import info.magnolia.cms.core.search.QueryManager; -import info.magnolia.cms.core.search.QueryResult; import info.magnolia.cms.i18n.AbstractMessagesImpl; import info.magnolia.cms.util.NodeDataUtil; import info.magnolia.cms.util.ObservationUtil; @@ -40,6 +36,11 @@ import javax.jcr.observation.EventIterator; import javax.jcr.observation.EventListener; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.AdvancedResult; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.Criteria; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Order; +import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions; import net.sourceforge.openutils.mgnlmessages.configuration.MessagesConfigurationManager; import org.apache.commons.lang.StringUtils; @@ -124,8 +125,7 @@ /** * {@inheritDoc} */ - @SuppressWarnings("unchecked") - public Iterator keys() + public Iterator<String> keys() { long ms = System.currentTimeMillis(); @@ -135,29 +135,31 @@ keys = new ArrayList<String>(); - try + Criteria criteria = JCRCriteriaFactory + .createCriteria() + .setWorkspace(MessagesConfigurationManager.MESSAGES_REPO) + .setBasePath("//*") + .add(Restrictions.eq("jcr:primaryType", "mgnl:contentNode")) + .addOrder(Order.desc("@jcr:score")); + + AdvancedResult result = criteria.execute(); + + log.debug( + "Number of messages loaded: {} with query {}", + result.getTotalSize(), + criteria.toXpathExpression()); + + for (Content c : result.getItems()) { - QueryManager qm = MgnlContext.getSystemContext().getQueryManager( - MessagesConfigurationManager.MESSAGES_REPO); - Query q = qm.createQuery("//*", Query.XPATH); - QueryResult qr = q.execute(); - for (Content c : qr.getContent(ItemType.CONTENTNODE.getSystemName())) + if (c.getNodeDataCollection().size() > 0) { - if (c.getNodeDataCollection().size() > 0) - { - keys.add(StringUtils.replace(c.getHandle(), "/", ".").substring(1)); - } + keys.add(StringUtils.replace(c.getHandle(), "/", ".").substring(1)); } } - catch (RepositoryException e) - { - log.error("Error get keys : " + e.getMessage()); - } } log.debug("Messages loaded in {} ms", System.currentTimeMillis() - ms); return keys.iterator(); } - } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2011-04-27 14:00:14
|
See <https://hudson.openmindonline.it/job/openutils-elfunctions/changes> |
From: <hu...@op...> - 2011-04-27 14:00:11
|
See <https://hudson.openmindonline.it/job/openutils-elfunctions/net.sourceforge.openutils$openutils-elfunctions/changes> |
From: <fg...@us...> - 2011-04-27 13:42:14
|
Revision: 3441 http://openutils.svn.sourceforge.net/openutils/?rev=3441&view=rev Author: fgiust Date: 2011-04-27 13:42:04 +0000 (Wed, 27 Apr 2011) Log Message: ----------- added log Modified Paths: -------------- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filesystem/FSCacheManager.java Modified: trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filesystem/FSCacheManager.java =================================================================== --- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filesystem/FSCacheManager.java 2011-04-27 13:05:15 UTC (rev 3440) +++ trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filesystem/FSCacheManager.java 2011-04-27 13:42:04 UTC (rev 3441) @@ -448,6 +448,7 @@ */ public void flush() { + log.info("Flushing cache"); active = false; try @@ -478,6 +479,7 @@ finally { active = true; + log.info("Cache restarted"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 13:05:25
|
Revision: 3440 http://openutils.svn.sourceforge.net/openutils/?rev=3440&view=rev Author: fgiust Date: 2011-04-27 13:05:15 +0000 (Wed, 27 Apr 2011) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2011-04-27 13:04:59 UTC (rev 3439) +++ trunk/openutils-elfunctions/pom.xml 2011-04-27 13:05:15 UTC (rev 3440) @@ -9,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-elfunctions</artifactId> <name>openutils-elfunctions</name> - <version>1.1.2</version> + <version>1.1.3-SNAPSHOT</version> <inceptionYear>2008</inceptionYear> <description>A useful set of EL functions that can be used in jsps.</description> <licenses> @@ -24,10 +24,10 @@ <url>http://jira.openmindlab.com/browse/ELFUNCTIONS</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-elfunctions-1.1.2</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-elfunctions-1.1.2 + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions </developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-elfunctions-1.1.2</url> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-elfunctions</url> </scm> <build> <plugins> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 13:05:05
|
Revision: 3439 http://openutils.svn.sourceforge.net/openutils/?rev=3439&view=rev Author: fgiust Date: 2011-04-27 13:04:59 +0000 (Wed, 27 Apr 2011) Log Message: ----------- [maven-release-plugin] copy for tag openutils-elfunctions-1.1.2 Added Paths: ----------- tags/openutils-elfunctions-1.1.2/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 13:04:09
|
Revision: 3438 http://openutils.svn.sourceforge.net/openutils/?rev=3438&view=rev Author: fgiust Date: 2011-04-27 13:03:59 +0000 (Wed, 27 Apr 2011) Log Message: ----------- [maven-release-plugin] prepare release openutils-elfunctions-1.1.2 Modified Paths: -------------- trunk/openutils-elfunctions/pom.xml Modified: trunk/openutils-elfunctions/pom.xml =================================================================== --- trunk/openutils-elfunctions/pom.xml 2011-04-27 13:03:02 UTC (rev 3437) +++ trunk/openutils-elfunctions/pom.xml 2011-04-27 13:03:59 UTC (rev 3438) @@ -1,5 +1,4 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -10,7 +9,7 @@ <packaging>jar</packaging> <artifactId>openutils-elfunctions</artifactId> <name>openutils-elfunctions</name> - <version>1.1.2-SNAPSHOT</version> + <version>1.1.2</version> <inceptionYear>2008</inceptionYear> <description>A useful set of EL functions that can be used in jsps.</description> <licenses> @@ -25,10 +24,10 @@ <url>http://jira.openmindlab.com/browse/ELFUNCTIONS</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-elfunctions + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-elfunctions-1.1.2</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-elfunctions-1.1.2 </developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-elfunctions</url> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-elfunctions-1.1.2</url> </scm> <build> <plugins> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 13:03:08
|
Revision: 3437 http://openutils.svn.sourceforge.net/openutils/?rev=3437&view=rev Author: fgiust Date: 2011-04-27 13:03:02 +0000 (Wed, 27 Apr 2011) Log Message: ----------- fix tld formatting Modified Paths: -------------- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld Modified: trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld =================================================================== --- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 12:57:20 UTC (rev 3436) +++ trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 13:03:02 UTC (rev 3437) @@ -10,8 +10,7 @@ <description>Capitalizes all the whitespace separated words in a String. Only the first letter of each word is changed.</description> <name>capitaliseAllWords</name> <function-class>org.apache.commons.lang.StringUtils</function-class> - <function-signature>java.lang.String - capitaliseAllWords(java.lang.String)</function-signature> + <function-signature>java.lang.String capitaliseAllWords(java.lang.String)</function-signature> </function> <function> <description>Gets the substring after the last occurrence of a separator. The separator is not returned. The function takes 2 parameters:<![CDATA[ @@ -21,8 +20,7 @@ ]]></description> <name>substringAfterLast</name> <function-class>org.apache.commons.lang.StringUtils</function-class> - <function-signature>java.lang.String - substringAfterLast(java.lang.String, java.lang.String)</function-signature> + <function-signature>java.lang.String substringAfterLast(java.lang.String, java.lang.String)</function-signature> </function> <function> <description>Gets the substring before the last occurrence of a separator. The separator is not returned. The function takes 2 parameters:<![CDATA[ @@ -32,8 +30,7 @@ ]]></description> <name>substringBeforeLast</name> <function-class>org.apache.commons.lang.StringUtils</function-class> - <function-signature>java.lang.String - substringBeforeLast(java.lang.String, java.lang.String)</function-signature> + <function-signature>java.lang.String substringBeforeLast(java.lang.String, java.lang.String)</function-signature> </function> <function> <description>Checks if a String is whitespace, empty ("") or null.</description> @@ -108,8 +105,7 @@ ]]></description> <name>adaptStringLength</name> <function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class> - <function-signature>java.lang.String - adaptStringLength(java.lang.String, int, java.lang.String)</function-signature> + <function-signature>java.lang.String adaptStringLength(java.lang.String, int, java.lang.String)</function-signature> <example> <![CDATA[ adaptStringLength("pre",2,"post") : prpost This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hu...@op...> - 2011-04-27 13:00:01
|
See <https://hudson.openmindonline.it/job/openutils-elfunctions/changes> |
From: <hu...@op...> - 2011-04-27 12:59:58
|
See <https://hudson.openmindonline.it/job/openutils-elfunctions/net.sourceforge.openutils$openutils-elfunctions/changes> |
From: <fg...@us...> - 2011-04-27 12:57:27
|
Revision: 3436 http://openutils.svn.sourceforge.net/openutils/?rev=3436&view=rev Author: fgiust Date: 2011-04-27 12:57:20 +0000 (Wed, 27 Apr 2011) Log Message: ----------- ELFUNCTIONS-9 new function for javascript escaping Modified Paths: -------------- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:50:45 UTC (rev 3435) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:57:20 UTC (rev 3436) @@ -67,11 +67,23 @@ /** * Escapes a javascript string. If "true" is passed as parameter, the string is between ", if false is between ' * @param text the string to be escaped - * @param dbl deprecated - no effect + * @param dbl If "true" the escaped string is returned between ", if false is returned between ' * @return the escaped string between either ' or " */ public static String escapeJsText(String text, boolean dbl) { + String repl = dbl ? "\"" : "'"; + String with = "\\" + repl; + return repl + (text != null ? StringUtils.replace(text, repl, with) : "") + repl; + } + + /** + * Escapes a javascript string. + * @param text the string to be escaped + * @return the escaped string + */ + public static String escapeJavascript(String text) + { return StringEscapeUtils.escapeJavaScript(text); } Modified: trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld =================================================================== --- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 12:50:45 UTC (rev 3435) +++ trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 12:57:20 UTC (rev 3436) @@ -89,6 +89,17 @@ ]]> </example> </function> + <function> + <description>Escapes a javascript string.</description> + <name>escapeJavascript</name> + <function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class> + <function-signature>java.lang.String escapeJavascript(java.lang.String)</function-signature> + <example> + <![CDATA[ + escapeJavascript("xyz\\2'3",true) : xyz\\2\'3 + ]]> + </example> + </function> <function> <description>Crops a String to a given length, adding a suffix (for example "...") if needed. The function takes 3 parameters: <![CDATA[<br/><strong>java.lang.String:</strong> the string to be adapted<br/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 12:50:51
|
Revision: 3435 http://openutils.svn.sourceforge.net/openutils/?rev=3435&view=rev Author: fgiust Date: 2011-04-27 12:50:45 +0000 (Wed, 27 Apr 2011) Log Message: ----------- ELFUNCTIONS-9 Use StringEscapeUtils for escaping javascript texts Modified Paths: -------------- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:48:39 UTC (rev 3434) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:50:45 UTC (rev 3435) @@ -22,6 +22,7 @@ import java.net.URLDecoder; import java.net.URLEncoder; +import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; import org.apache.commons.lang.WordUtils; @@ -66,14 +67,12 @@ /** * Escapes a javascript string. If "true" is passed as parameter, the string is between ", if false is between ' * @param text the string to be escaped - * @param dbl If "true" the escaped string is returned between ", if false is returned between ' + * @param dbl deprecated - no effect * @return the escaped string between either ' or " */ public static String escapeJsText(String text, boolean dbl) { - String repl = dbl ? "\"" : "'"; - String with = "\\" + repl; - return repl + (text != null ? StringUtils.replace(text, repl, with) : "") + repl; + return StringEscapeUtils.escapeJavaScript(text); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 12:48:45
|
Revision: 3434 http://openutils.svn.sourceforge.net/openutils/?rev=3434&view=rev Author: fgiust Date: 2011-04-27 12:48:39 +0000 (Wed, 27 Apr 2011) Log Message: ----------- remove a duplicate function Modified Paths: -------------- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld Modified: trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java =================================================================== --- trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:43:28 UTC (rev 3433) +++ trunk/openutils-elfunctions/src/main/java/net/sourceforge/openutils/elfunctions/ElStringUtils.java 2011-04-27 12:48:39 UTC (rev 3434) @@ -305,27 +305,4 @@ return hyphened; } - /** - * Cut the #value string based on the #maxLength number characters, being careful to not truncate the last word, - * adding #ellipses to the end - * @param value - * @param maxLength - * @param ellipses - * @return - */ - public static String adaptStringLengthWholeWord(String value, int maxLength, String ellipses) - { - if (value != null && value.length() > maxLength) - { - String result = value.substring(0, maxLength + 1); - int p = result.length() - 1; - while (p > 0 && result.charAt(p) >= 'A') - { - p--; - } - return result.substring(0, p) + ellipses; - } - return value; - } - } Modified: trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld =================================================================== --- trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 12:43:28 UTC (rev 3433) +++ trunk/openutils-elfunctions/src/main/resources/META-INF/stringutils.tld 2011-04-27 12:48:39 UTC (rev 3434) @@ -214,11 +214,4 @@ <function-signature>java.lang.String simpleHyphenation(java.lang.String, int)</function-signature> </function> - <function> - <name>adaptStringLengthWholeWord</name> - <description>Cut the #value string based on the #maxLength number characters, being careful to not truncate the last word, adding #ellipses to the end</description> - <function-class>net.sourceforge.openutils.elfunctions.ElStringUtils</function-class> - <function-signature>java.lang.String - adaptStringLengthWholeWord(java.lang.String, int, java.lang.String)</function-signature> - </function> </taglib> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 12:43:38
|
Revision: 3433 http://openutils.svn.sourceforge.net/openutils/?rev=3433&view=rev Author: fgiust Date: 2011-04-27 12:43:28 +0000 (Wed, 27 Apr 2011) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlcache/pom.xml Modified: trunk/openutils-mgnlcache/pom.xml =================================================================== --- trunk/openutils-mgnlcache/pom.xml 2011-04-27 12:43:16 UTC (rev 3432) +++ trunk/openutils-mgnlcache/pom.xml 2011-04-27 12:43:28 UTC (rev 3433) @@ -10,7 +10,7 @@ <artifactId>openutils-mgnlcache</artifactId> <name>Simplecache module for Magnolia CMS</name> <description>An alternative "simple is beautiful" cache module for Magnolia CMS</description> - <version>1.0.1</version> + <version>1.0.2-SNAPSHOT</version> <inceptionYear>2010</inceptionYear> <licenses> <license> @@ -24,9 +24,9 @@ <url>http://jira.openmindlab.com/browse/CACHE</url> </issueManagement> <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlcache-1.0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlcache-1.0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlcache-1.0.1</url> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlcache</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/trunk/openutils-mgnlcache</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/trunk/openutils-mgnlcache</url> </scm> <build> <resources> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |